/* Outdoor Window, under the template's house system (ART.md; Template/HOUSE.md) and its pane-app register
   (HOUSE 11): sections on plates on the gray page, the Shutters and the title on the page itself (their lit
   windows are --sheet, and on a plate would vanish), one face, gray chrome, no shadows, no glass. The one data
   color is --used, the share of a rule's allowance an hour uses; the register adds none (HOUSE 11.3). The one
   bold thing is the Shutters' ink. Staleness and failure are words, never a hue. */

@font-face {
  font-family: 'Ysabeau Office';
  src: url(fonts/ysabeau-office-gw.woff2) format('woff2');
  font-weight: 400 650;
  font-display: block;
}

:root {
  --page: #e8eef0;
  --sheet: #f6f9fa;
  --ink: #0f1c23;
  --ink-2: #45555d;
  --ink-3: #5b6a72;
  --line: #c9d4d8;
  --line-strong: #74858c;
  --used: #0c8c68;
  --draw: cubic-bezier(0.2, 0, 0, 1);
  --sheet-in: cubic-bezier(0.32, 0.72, 0, 1);
  --face: 'Ysabeau Office', system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #141d21;
    --sheet: #1c272c;
    --ink: #e6edee;
    --ink-2: #a3b1b6;
    --ink-3: #8b9a9f;
    --line: #2a373c;
    --line-strong: #64757b;
    --used: #209670;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--page);
  color: var(--ink);
  font: 400 13.5px/1.35 var(--face);
  font-variant-numeric: tabular-nums lining-nums;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}
body { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
h1, h2, h3, p, dl, dd, ol { margin: 0; }
a, button, [role="slider"] { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; margin: -1px; }

/* ── the header: the name, the stamp, the panes as tabs ── */
/* the header's sides follow the pane's 760 px column, so on a wide screen the name starts where the plates do */
.head { flex: 0 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); padding: calc(6px + env(safe-area-inset-top)) calc(max(16px, 50% - 364px) + env(safe-area-inset-right)) 0 calc(max(16px, 50% - 364px) + env(safe-area-inset-left)); }
.head h1 { font-size: 15px; font-weight: 650; line-height: 22px; }
.stamp-home { min-width: 0; padding-bottom: 6px; }
.stamp { position: relative; display: block; max-width: 100%; font-size: 11.5px; line-height: 16px; color: var(--ink-2); }
.stamp .lead { color: var(--ink); }
/* the hit runs up over the name (not a control) and down into the gap: 22 + 16 + 6 = 44 px */
.stamp::before { content: ''; position: absolute; inset: -22px 0 -6px; }

.tabs { display: flex; min-width: 0; overflow-x: auto; scrollbar-width: none; margin: 0 -8px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button:focus-visible { outline-offset: -2px; }
.tabs button { position: relative; flex: 0 0 auto; min-width: 44px; height: 44px; padding: 0 8px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; text-align: center; }
/* the chosen tab: 620 in ink, a tracer under it drawn from its tail to its head (HOUSE 4.3) */
.tabs [aria-selected="true"] { color: var(--ink); font-weight: 620; }
.tabs [aria-selected="true"]::after {
  content: '';
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 9px;
  height: 4px;
  background:
    radial-gradient(circle at calc(100% - 2px) 50%, var(--ink) 1.9px, transparent 2.1px),
    linear-gradient(90deg, transparent, var(--ink) calc(100% - 3px), transparent calc(100% - 3px)) 0 1px / 100% 2px no-repeat;
  animation: tracer-in 160ms var(--draw);
}
@keyframes tracer-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* ── the pane: it scrolls inside the frame, so the header and the footer's one line stay put; a 760 px column,
   centered with the header on a wide screen; the footer under it keeps the bottom inset (HOUSE 4.14) ── */
.pane { position: relative; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.panebody { max-width: 760px; margin: 0 auto; padding: 0 calc(16px + env(safe-area-inset-right)) 0 calc(16px + env(safe-area-inset-left)); padding-top: 4px; padding-bottom: 28px; }

/* statements: sentences on the page, the first words at 620, never a box or a colored edge */
.statement { padding: 8px 0 2px; line-height: 1.4; max-width: 62ch; }
.statement b { font-weight: 620; }
.title { padding-top: 10px; }
.title h2 { font-size: 15px; font-weight: 650; }
.title p { font-size: 11.5px; line-height: 16px; color: var(--ink-2); }
/* one short label under the title (HOUSE 11.1 rule 9) */
.zone { margin-top: 2px; font-size: 11.5px; line-height: 16px; color: var(--ink-2); }

/* ── the Shutters: ink blocks on the page, thin --used bars, every window lit (--sheet) and framed in ink. The
   drawing is the hours' slider; a vertical swipe on it scrolls the pane and a pinch zooms the page (app.js) ── */
.sh { position: relative; width: fit-content; max-width: 100%; margin: 10px 0 2px; touch-action: pan-y pinch-zoom; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: pointer; }
.sh svg { display: block; overflow: visible; }
.sh:focus-visible { outline-offset: 4px; }
.sh .lab { font-size: 10.5px; fill: var(--ink-2); }
.sh .nowl { fill: var(--ink-3); }
.sh .blk, .sh .br, .sh .jb, .sh .head rect, .sh .head circle { fill: var(--ink); }
.sh .lit { fill: var(--sheet); }
.sh .head .ring { fill: var(--page); }
.sh .ho { fill: none; stroke: var(--ink); stroke-width: 1; }
.sh .u { fill: var(--used); }
.sh .past { opacity: 0.4; }
.sh .col { fill: var(--ink); fill-opacity: 0.07; }
.sh .hair { stroke: var(--line); stroke-width: 1; }
.sh .base { fill: var(--line-strong); }
.sh .mid, .sh .now { fill: var(--ink-2); }
.sh .qt { fill: var(--ink-3); opacity: 0.5; }

/* the readout: three fixed lines under the Shutters (four below 360 px), always the chosen hour, updated in place */
.ro { padding-bottom: 10px; }
.ro-when { font-size: 12.5px; line-height: 17px; }
.ro-when b { font-weight: 620; }
.ro-vals { height: 32px; overflow: hidden; font-size: 11.5px; line-height: 16px; color: var(--ink-2); }

/* ── sections on plates (HOUSE 11.1 rule 4): --sheet, a 1 px --line edge, 12 px apart ── */
.sec { margin-top: 12px; padding: 12px 12px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--sheet); }
.sec > h2 { font-size: 15px; font-weight: 650; padding-bottom: 4px; }
/* the key number (HOUSE 11.1 rule 2): the label above, the figure at 34 px, the lead under it */
.headline { padding: 14px 12px 8px; }
.hl { display: grid; gap: 2px; padding-bottom: 8px; }
.hl-what { font-size: 12.5px; font-weight: inherit; color: var(--ink-2); }
.hl-fig { font-size: 34px; font-weight: 650; line-height: 1.05; }
.hl-lead { font-size: 13.5px; color: var(--ink-2); }
/* the window's facts as two-column tiles (HOUSE 11.1 rule 3) */
.tiles { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; }
.tile { padding: 8px 0 7px; border-top: 1px solid var(--line); }
.tile:nth-child(-n+2) { border-top: 0; padding-top: 2px; }
.tile dt { font-size: 11.5px; line-height: 15px; color: var(--ink-2); }
.tile dd { font-size: 19px; font-weight: 650; line-height: 1.25; }
/* the later windows as a table: a th over a --line-strong rule, rows parted by --line, the figures right-aligned */
.wins { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.wins th { padding: 4px 0; font-size: 11.5px; font-weight: 600; color: var(--ink-2); text-align: right; border-bottom: 1px solid var(--line-strong); }
.wins td { padding: 6px 0; text-align: right; font-weight: 560; border-bottom: 1px solid var(--line); }
.wins th:first-child, .wins td:first-child { text-align: left; }
.wins td:first-child { font-weight: 400; }
.wins tr:last-child td { border-bottom: 0; }
.sec > p { max-width: 62ch; padding-bottom: 6px; }
.sec .note { font-size: 11.5px; line-height: 16px; color: var(--ink-2); }
/* the Shutters' key (HOUSE 4.15, 11.1 rule 6): each mark drawn small, with its word */
.key { display: flex; flex-wrap: wrap; gap: 2px 12px; padding-bottom: 6px; font-size: 11.5px; line-height: 15px; color: var(--ink-2); }
.key .sw { display: inline-block; width: 10px; height: 10px; margin-right: 5px; border-radius: 2px; vertical-align: -1px; }
.sw-blk { background: var(--ink); }
.sw-used { width: 3px !important; background: var(--used); }
.sw-ho { border: 1px solid var(--ink); }
.sw-frame { border-radius: 0 !important; background: var(--sheet); border: solid var(--ink); border-width: 0 1px 2px; }
/* the key at the end of every pane (HOUSE 11.1 rule 1) */
.aboutlink { display: block; margin: 14px 0 0; min-height: 44px; font-size: 12.5px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.aboutlink:active { color: var(--ink); }

/* the Rules pane: a rule's name and limit, and under them its key and what it did to this file */
.rule { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.rule:first-child { border-top: 0; padding-top: 0; }
.rule dt { font-weight: 560; }
.rule dd:first-of-type { font-weight: 600; text-align: right; white-space: nowrap; }
.rule dd.note { grid-column: 1 / -1; margin-top: 2px; max-width: 62ch; font-size: 11.5px; line-height: 16px; color: var(--ink-2); }
.steps { padding: 0 0 6px 20px; max-width: 62ch; }
.steps li { padding: 3px 0; }

/* ── the Hours pane's table: an hour a row, a day a group ── */
.hours { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.hours th, .hours td { padding: 0 0 0 6px; text-align: right; font-weight: 400; vertical-align: baseline; }
.hours th:first-child, .hours td:first-child { padding-left: 6px; text-align: left; border-left: 2px solid transparent; }
.hours thead th { padding-bottom: 4px; font-size: 11px; line-height: 14px; color: var(--ink-3); vertical-align: bottom; }
.hours thead th:nth-child(2) { text-align: left; }
.hours .day th { padding: 12px 0 4px 8px; font-size: 13.5px; font-weight: 650; color: var(--ink); text-align: left; border-left: 0; }
.hours tbody tr.h td { padding-top: 6px; padding-bottom: 6px; border-top: 1px solid var(--line); }
.hours tbody tr.h.has-why td { padding-bottom: 0; }
.hours tr.why td { padding-top: 0; padding-bottom: 6px; font-size: 11px; line-height: 15px; color: var(--ink-2); text-align: left; }
.hours td.lt { text-align: left; color: var(--ink-2); }
.hours td.t { color: var(--ink-2); }
.hours tr.ok td.t { color: var(--ink); font-weight: 620; }
.hours tr.win td:first-child { border-left-color: var(--ink); }
.hours tr.on td { background: color-mix(in srgb, var(--ink) 7%, transparent); }

/* text keys: a 28 px frame on a 44 px hit */
.textkey { position: relative; height: 44px; padding: 0 10px; font-size: 12.5px; }
.textkey::before { content: ''; position: absolute; inset: 8px 0; border: 1px solid var(--line-strong); border-radius: 6px; }
.textkey:active::before { background: color-mix(in srgb, currentColor 22%, transparent); }

/* a problem with the forecast is a sentence on a plate, never a blank pane */
.notice { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 5; width: max-content; max-width: min(300px, calc(100% - 32px)); padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--sheet); line-height: 1.4; text-align: center; }
.notice.kept { position: fixed; }
.notice p + p { margin-top: 6px; }
.notice-lines { font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; text-align: left; }

/* ── the footer: Open-Meteo's link and nothing else (HOUSE 4.15 exception 1), one 10.5 px line, its sides on the
   pane's column, the bottom safe-area inset under it. The anchor's 44 px hit lies inside the band, never under the
   screen's edge and never over the pane (and so never over its About key): the anchor is a block 6 + 15 + 23 px
   tall, and the band adds only what the inset needs beyond the 19 px of hit under the line, so with an inset it
   is as tall as before (6 + 15 + 4 px + the inset) and without one it grows to the hit's 44 px ── */
.band { flex: 0 0 auto; padding: 0 calc(max(16px, 50% - 364px) + env(safe-area-inset-right)) max(0px, calc(env(safe-area-inset-bottom) - 19px)) calc(max(16px, 50% - 364px) + env(safe-area-inset-left)); border-top: 1px solid var(--line); font-size: 10.5px; line-height: 15px; color: var(--ink-2); }
/* the credit anchor: ink, underlined, a 44 px hit by padding that moves no text: 6 px above the line, 23 px below */
.credits a { display: block; width: fit-content; max-width: calc(100% + 8px); color: var(--ink); text-decoration: underline; text-underline-offset: 2px; padding: 6px 4px 23px; margin: 0 -4px; }
.about-body a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

/* ── About: a full-height sheet ── */
.about { position: fixed; inset: 0; z-index: 20; }
.about-sheet { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--sheet); animation: sheet-in 220ms var(--sheet-in); }
@keyframes sheet-in { from { transform: translateY(100%); } }
.about-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: env(safe-area-inset-top) calc(8px + env(safe-area-inset-right)) 0 calc(16px + env(safe-area-inset-left)); border-bottom: 1px solid var(--line); }
.about-head h2 { font-size: 15px; font-weight: 650; }
.about .textkey::before { border: 0; }
.about-body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 0 calc(16px + env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left)); }
.about-body section { max-width: 62ch; padding: 12px 0; border-bottom: 1px solid var(--line); }
.about-body h3 { margin-bottom: 6px; font-size: 13.5px; font-weight: 650; }
.about-body p { line-height: 1.5; }
.about-body p + p { margin-top: 8px; }
.about-body dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; line-height: 1.45; }
.about-body dt { color: var(--ink-2); }
.about-body dd { overflow-wrap: anywhere; }
.about-foot { margin-top: 8px; }

@media (hover: hover) {
  .tabs button:hover, .stamp:hover, .aboutlink:hover { color: var(--ink); }
  .textkey:hover::before { background: color-mix(in srgb, currentColor 7%, transparent); }
}
@media (max-width: 359px) { .ro-vals { height: 48px; } }
/* a phone on its side: the header is one row */
@media (orientation: landscape) and (max-height: 500px) {
  .head { grid-template-columns: max-content minmax(0, 1fr); grid-template-rows: 22px 24px; column-gap: 16px; padding-top: env(safe-area-inset-top); }
  .stamp-home { grid-area: 2 / 1; padding-bottom: 0; }
  .stamp { white-space: nowrap; }
  .tabs { grid-area: 1 / 2 / 3 / 3; align-self: center; margin: 0; }
  .band { padding-bottom: max(0px, calc(env(safe-area-inset-bottom) - 21px)); }
  .credits a { padding-top: 4px; padding-bottom: 25px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; transition-duration: 0s !important; scroll-behavior: auto !important; }
}
