/* 10:10. Layout (same as live): hero time + sentence beside the slot panel, the day strip as one
   card, then the city tiles. C4E tools language (SG, 15 Oct): the C4E homepage's paper, ink and
   dot grid, C4E red as the one accent, and the timer's habit of turning red when time is short.
   Red tokens: --accent = C4E red for shapes (slot band, grips, dots); --accent-solid behind white
   text (5.6:1); --accent-deep = red text on the page (4.6:1 or more in both themes). */
:root {
  --ground: #EFE9DF;
  --paper: #FAF8F4;
  --well: #EFE9DF;
  --ink: #1A1916;
  --ink-2: #5C574E;
  --hair: #DCD5C8;
  --sq-mid: #8A857C;
  --sq-off: #86817A;
  --accent: #FF0032;
  --accent-deep: #D1002B;
  --accent-solid: #D1002B;
  --dot: rgba(26, 25, 22, 0.11);
  --warm: #E6DDCB;
  --dusk: #24231F;
  --on-dark: #F2F0E9;
  --on-dark-2: #BAB6AA;
  --bar: #1A1916;
  --card: 0 1px 2px rgba(19, 19, 19, 0.05), 0 16px 36px -22px rgba(19, 19, 19, 0.3);
  --key-gloss: rgba(255, 255, 255, 0.9);
  --gutter: clamp(16px, 4vw, 40px);
  --sans: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --ground: #111110;
    --paper: #1C1C1A;
    --well: #262623;
    --ink: #F1EFEA;
    --ink-2: #A9A69D;
    --hair: #34332F;
    --sq-mid: #7A776F;
    --sq-off: #6E6B64;
    --accent: #FF0032;
    --accent-deep: #FF5C77;
    --accent-solid: #D1002B;
    --dot: rgba(241, 239, 234, 0.07);
    --warm: #3A342A;
    --dusk: #090908;
    --bar: #000000;
    --card: 0 0 0 1px #2A2926, 0 16px 36px -22px rgba(0, 0, 0, 0.8);
    --key-gloss: rgba(255, 255, 255, 0.06);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --ground: #111110;
  --paper: #1C1C1A;
  --well: #262623;
  --ink: #F1EFEA;
  --ink-2: #A9A69D;
  --hair: #34332F;
  --sq-mid: #7A776F;
  --sq-off: #6E6B64;
  --accent: #FF0032;
  --accent-deep: #FF5C77;
  --accent-solid: #D1002B;
  --dot: rgba(241, 239, 234, 0.07);
  --warm: #3A342A;
  --dusk: #090908;
  --bar: #000000;
  --card: 0 0 0 1px #2A2926, 0 16px 36px -22px rgba(0, 0, 0, 0.8);
  --key-gloss: rgba(255, 255, 255, 0.06);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font: 500 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased;
  background: radial-gradient(circle, var(--dot) 1.2px, transparent 1.6px) 0 0 / 22px 22px, var(--ground);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-underline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
::selection { background: var(--accent-solid); color: #FFFFFF; }
.mono { font-family: var(--mono); font-feature-settings: 'zero' 1; font-variant-numeric: tabular-nums; }
.eyebrow { font: 500 12px/1.45 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }
.hint { color: var(--ink-2); font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: var(--ground); padding: 10px 14px; border-radius: 10px; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2.5px solid var(--ink); outline-offset: 3px; }

/* ---------- header and footer: the black bars from the live site ---------- */
.top { background: var(--bar); color: var(--on-dark); }
.top-in, .foot-in { display: flex; align-items: center; gap: clamp(8px, 2vw, 24px); max-width: 1200px; margin: 0 auto; padding: 10px var(--gutter); }
.top :focus-visible, .foot :focus-visible, .tile.night :focus-visible { outline-color: var(--on-dark); }
.brand { font-weight: 700; font-size: 15px; text-decoration: none; padding: 6px 9px; border: 1.5px solid currentColor; border-radius: 8px; }
.tools { display: flex; gap: 2px; }
.tool {
  display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px;
  background: transparent; font: 500 12px var(--mono); letter-spacing: 0.1em; text-transform: uppercase;
}
.tool:hover { background: rgba(255, 255, 255, 0.1); }
.clock { margin-left: auto; display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.clock .eyebrow { color: var(--on-dark-2); }
.clock time { font-weight: 700; font-size: 15px; }
.clock .sec { color: var(--on-dark-2); }
.foot { background: var(--bar); color: var(--on-dark-2); font-size: 13px; }
.foot-in { flex-wrap: wrap; justify-content: space-between; padding-block: 18px; }
.foot .eyebrow { color: var(--on-dark-2); }
.foot nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0 18px; }
.foot nav a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- page ---------- */
.main { display: flex; flex-direction: column; gap: 24px; max-width: 1200px; margin: 0 auto; padding: 36px var(--gutter) 64px; }

/* hero: the time, one context line, the sentence; the slot panel beside it */
.hero { display: grid; gap: 28px; align-items: start; scroll-margin-top: 16px; }
@media (min-width: 880px) { .hero { grid-template-columns: minmax(0, 1fr) minmax(340px, 400px); gap: 48px; } }
.readout { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding-top: 4px; }
.big {
  font: 800 clamp(76px, 11vw, 148px)/0.9 var(--sans); letter-spacing: -0.045em; margin-left: -0.04em;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.big small { font-size: 0.3em; letter-spacing: 0; margin-left: 0.12em; }
.big .to { font-size: 0.26em; font-weight: 700; letter-spacing: -0.01em; color: var(--ink-2); margin-left: 0.2em; }
.who { font: 700 clamp(20px, 2.1vw, 26px)/1.3 var(--sans); max-width: 32ch; text-wrap: balance; min-height: 2.6em; }

.panel { display: flex; flex-direction: column; gap: 14px; padding: 20px; background: var(--paper); border-radius: 22px; box-shadow: var(--card); }
.prow { display: grid; grid-template-columns: 78px minmax(0, 1fr); align-items: center; gap: 12px; }
.prow.slim { margin-top: -8px; }
.rule { border-top: 1px solid var(--hair); padding-top: 14px; }
.daynav { display: flex; align-items: center; gap: 6px; }
.step {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 13px;
  border: 1px solid var(--hair); background: var(--paper); box-shadow: 0 1px 0 var(--key-gloss) inset, 0 2px 0 var(--hair);
}
.step:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--key-gloss) inset; }
.date {
  position: relative; flex: 1; display: grid; place-items: center; height: 44px; padding: 0 10px;
  border-radius: 13px; background: var(--well); font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.date input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.date input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.date:focus-within { outline: 2.5px solid var(--ink); outline-offset: 3px; }
.seg { display: flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--well); }
.seg button {
  flex: 1; height: 38px; min-width: 0; padding: 0 8px; border: 0; border-radius: 999px; background: transparent;
  font: 600 13px var(--mono); font-feature-settings: 'zero' 1;
}
.seg button[aria-pressed='true'] { background: var(--ink); color: var(--paper); box-shadow: 0 2px 6px -2px rgba(0, 0, 0, 0.35); }
.pactions { display: flex; flex-wrap: wrap; gap: 8px; }
.pactions .btn { flex: 1 1 auto; }
.pmore { display: flex; flex-wrap: wrap; gap: 0 16px; margin-top: -4px; }
.pmore a, .linkbtn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0; border: 0; background: none;
  font-size: 13px; font-weight: 600; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px;
}
.pmore a:hover, .linkbtn:hover { color: var(--ink); }
.count { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.count.past { font: 600 15px var(--sans); color: var(--ink-2); }
/* the Event Timer's language: red when time is short, red and blinking when it arrives */
.count-row { display: inline-flex; align-items: center; gap: 6px; }
.count.soon { color: var(--accent-deep); }
.count.now { font: 800 18px var(--sans); color: var(--accent-deep); animation: count-now 1s steps(2, jump-none) infinite; }
@keyframes count-now { 50% { opacity: 0.35; } }
.count-row .icon-btn[aria-pressed='false'] { color: var(--ink-2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px;
  border-radius: 14px; border: 1px solid var(--hair); background: var(--paper); color: var(--ink);
  box-shadow: 0 1px 0 var(--key-gloss) inset, 0 2px 0 var(--hair);
  font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap; transition: transform 0.08s, box-shadow 0.08s;
}
.btn:active { transform: translateY(1.5px); box-shadow: 0 1px 0 var(--key-gloss) inset, 0 0.5px 0 var(--hair); }
.btn.primary {
  color: #FFFFFF; border-color: #A30022;
  background: linear-gradient(180deg, #E0002E, var(--accent-solid));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 2px 0 #A30022;
}
.btn.primary:active { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 0.5px 0 #A30022; }
.flag-chip {
  display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px;
  background: var(--ink); color: var(--paper); font: 700 12px var(--mono);
}
.btn.primary .flag-chip { background: #FFFFFF; color: var(--accent-solid); }

/* ---------- the day strip ---------- */
.day { display: flex; flex-direction: column; gap: 12px; padding: 20px 20px 16px; background: var(--paper); border-radius: 22px; box-shadow: var(--card); }
.day-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; list-style: none; margin: 0; padding: 0; font-size: 13px; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.legend .sq { width: 13px; height: 13px; }
.legend .flag-chip { width: 19px; height: 19px; font-size: 11px; }
.day-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding-top: 12px; border-top: 1px solid var(--hair); }
.day-help { flex: 1 1 320px; display: flex; flex-direction: column; gap: 4px; }
.day-help .hint { font-size: 13px; }
.day-foot .search { flex: 0 1 320px; margin: 0; }

.strip { --lab: 128px; --val: 76px; display: flex; flex-direction: column; }
.srow { display: grid; grid-template-columns: var(--lab) minmax(0, 1fr) var(--val); align-items: center; column-gap: 14px; }
.rows { touch-action: pan-y; user-select: none; -webkit-user-select: none; border-radius: 10px; }
.rows .srow { height: 32px; }
.rows:focus-visible { outline-offset: 6px; }
.lab { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.val { text-align: right; font-weight: 700; font-size: 13.5px; white-space: nowrap; }
.track { position: relative; isolation: isolate; height: 100%; display: grid; grid-template-columns: repeat(var(--n, 48), minmax(0, 1fr)); gap: 3px; align-items: center; cursor: pointer; }
.sq { display: block; height: 18px; border-radius: 4px; }
.sq.on { background: var(--ink); }
.sq.half { background: var(--sq-mid); }
.sq.off { box-shadow: inset 0 0 0 1.5px var(--sq-off); }
.band {
  position: absolute; z-index: -1; top: 0; bottom: 0; margin-left: -2px; padding-right: 4px; box-sizing: content-box; pointer-events: none;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border-inline: 2.5px solid var(--accent);
  transition: left 0.18s ease-out, width 0.18s ease-out;
}
.band.first { border-top: 2.5px solid var(--accent); border-radius: 10px 10px 0 0; }
.band.last { border-bottom: 2.5px solid var(--accent); border-radius: 0 0 10px 10px; }
.band.first.last { border-radius: 10px; }
.now { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--ink); pointer-events: none; }
.flags-row { height: 32px; }
/* a bracket under each flag: the whole window it stands for */
.win {
  position: absolute; bottom: 0; height: 5px; pointer-events: none;
  border: 1.5px solid color-mix(in srgb, var(--ink) 45%, transparent); border-top: 0; border-radius: 0 0 3px 3px;
}
.lane { position: relative; height: 100%; }
.flag {
  position: absolute; top: 2px; transform: translateX(-50%); width: 24px; height: 24px; padding: 0;
  display: grid; place-items: center; border: 0; border-radius: 7px;
  background: var(--ink); color: var(--paper); font: 700 12px var(--mono);
}
.flag::before { content: ''; position: absolute; inset: -10px; }
.flag:hover { background: var(--accent-solid); color: #FFFFFF; }
.axis { height: 24px; margin-top: 4px; }
.axis .tick { position: absolute; top: 4px; transform: translateX(-50%); font: 500 12px var(--mono); font-feature-settings: 'zero' 1; color: var(--ink-2); white-space: nowrap; }
.axis .tick:first-child { transform: none; }
.axis-city { font: 500 12px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); align-self: start; padding-top: 4px; }

/* ---------- strip interactions ---------- */
/* scrub: a column follows the pointer, its time floats above the strip */
.peek { position: absolute; z-index: -1; top: 0; bottom: 0; background: color-mix(in srgb, var(--ink) 12%, transparent); pointer-events: none; }
.peek-tip {
  position: absolute; top: 2px; transform: translateX(-50%); z-index: 2; pointer-events: none;
  padding: 3px 8px; border-radius: 7px; background: var(--ink); color: var(--paper); font: 700 12px var(--mono); white-space: nowrap;
}
/* direct manipulation: grips on the band's edges, cursors that say what a drag will do */
.grip {
  position: absolute; z-index: 2; top: 50%; width: 8px; height: 22px; border-radius: 4px; transform: translate(-50%, -50%); pointer-events: none;
  background: var(--accent); box-shadow: 0 0 0 2px var(--paper), 0 2px 6px rgba(0, 0, 0, 0.3);
}
.strip.hover-l .rows, .strip.hover-r .rows, .strip.drag-l .rows, .strip.drag-r .rows { cursor: ew-resize; }
.strip.hover-move .rows { cursor: grab; }
.strip.drag-move .rows { cursor: grabbing; }
.strip.hover-l .grip.l, .strip.hover-r .grip.r, .strip.drag-l .grip.l, .strip.drag-r .grip.r { height: 28px; }
.strip[class*='drag-'] .band { transition: none; }
/* magnet: the flag the band snapped to pulses */
.flag.snap { background: var(--accent-solid); color: #FFFFFF; animation: snap 0.35s ease-out; }
@keyframes snap { 40% { transform: translateX(-50%) scale(1.25); } }
/* the slot's own label under the strip */
.slot-pill {
  position: absolute; top: 0; transform: translateX(-50%); z-index: 1; padding: 3px 9px; border-radius: 8px; white-space: nowrap;
  background: var(--accent-solid); color: #FFFFFF; font: 700 12px var(--mono); font-feature-settings: 'zero' 1;
}
.pill-row { height: 26px; }
.slot-pill.l { transform: none; }
.slot-pill.r { transform: translateX(-100%); }
/* linked focus: hovering a city dims the other rows */
.has-hot .rows .srow:not(.hot) .track, .has-hot .rows .srow:not(.hot) .lab, .has-hot .rows .srow:not(.hot) .val { opacity: 0.35; }
.rows .track, .rows .lab, .rows .val { transition: opacity 0.15s; }
.rows .lab { cursor: default; }
.srow.hot .lab { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
/* preview before you add: the ghost row */
.srow.ghost { opacity: 0.55; animation: row-in 0.25s ease-out; }
.srow.ghost .lab { font-style: italic; }
.srow.ghost .track { background: repeating-linear-gradient(90deg, transparent 0 6px, color-mix(in srgb, var(--ink) 4%, transparent) 6px 7px); border-radius: 6px; }
.rows .srow { animation: row-in 0.35s ease-out both; }
@keyframes row-in { from { opacity: 0; transform: translateY(-4px); } }
/* a preview is not a commitment: the big time softens while you scrub */
.readout .big, .readout .who { transition: color 0.15s; }
.readout.is-peek .big, .readout.is-peek .who { color: var(--ink-2); }
.readout.is-peek .eyebrow { color: var(--accent-deep); }

/* rolling digits */
.roll { display: inline-flex; }
.rd { display: inline-block; height: 1em; line-height: 1; overflow: hidden; vertical-align: top; }
.rs { display: flex; flex-direction: column; transition: transform 0.38s cubic-bezier(0.2, 0.9, 0.25, 1.05); }
.rs > span { height: 1em; line-height: 1; }
.big .roll, .tile-time .roll { line-height: 1; }

/* in-place feedback */
.btn.is-done { border-color: var(--ink); }
.btn.primary.is-done { background: var(--ink); color: var(--paper); border-color: var(--ink); box-shadow: 0 2px 0 #000; }
.toast { display: flex; align-items: center; gap: 14px; }
.toast button { border: 0; background: none; padding: 6px 4px; color: inherit; font-weight: 800; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.keys-help summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); width: fit-content; min-height: 32px; display: flex; align-items: center; }
.keys-help ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); }
kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; margin-right: 2px; border-radius: 6px; border: 1px solid var(--hair); border-bottom-width: 2px; background: var(--paper); color: var(--ink); font: 600 11px var(--mono); }
@media (hover: none) { .on-hover { display: none; } }
@media (hover: hover) { .on-touch { display: none; } }
@media (hover: none) and (pointer: coarse) { .keys-help { display: none; } }

/* ---------- page heading, visitor bar, clock changes ---------- */
.page-title { font: 700 clamp(19px, 2vw, 24px)/1.3 var(--sans); text-wrap: balance; margin-bottom: -8px; }
.me-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 12px 12px 16px;
  border-radius: 16px; background: var(--paper); box-shadow: var(--card); border-left: 4px solid var(--ink);
}
.me-bar > svg { flex: none; }
.me-bar p { flex: 1 1 260px; font-size: 15px; }
.me-status { display: inline-block; margin-left: 4px; padding: 0 8px; border-radius: 999px; border: 1.5px solid var(--hair); font-size: 12px; font-weight: 700; }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: 13px; }
.shifts { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-width: 46ch; }
.shifts li { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.shifts svg { flex: none; margin-top: 2px; color: var(--accent-deep); }

/* ---------- breadcrumb and answer card (city-pair pages) ---------- */
.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 8px; list-style: none; margin: 0 0 -10px; padding: 0; font-size: 13px; color: var(--ink-2); }
.crumbs li + li::before { content: '/'; margin-right: 8px; color: var(--sq-off); }
.crumbs li { display: flex; align-items: center; min-height: 32px; }
.crumbs a { display: inline-flex; min-height: 32px; align-items: center; font-weight: 600; }
.facts { background: var(--paper); border-radius: 22px; box-shadow: var(--card); overflow: hidden; }
.facts-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }
.fact { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px 20px; min-width: 0; }
.fact + .fact { border-left: 1px solid var(--hair); }
.fact dd { margin: 0; }
.fact dt { margin-bottom: 4px; }
.fact-big { font: 800 clamp(22px, 2.3vw, 28px)/1.1 var(--sans); letter-spacing: -0.02em; }
.fact-big.mono { font-family: var(--mono); font-weight: 700; letter-spacing: -0.03em; font-size: clamp(20px, 2vw, 25px); }
.fact-big small { display: block; margin-top: 4px; font: 600 12px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.fact-sub { font-size: 14px; color: var(--ink-2); line-height: 1.4; }
.fact .linkbtn { min-height: 36px; margin-top: auto; color: var(--ink); }
.level { display: inline-block; margin-right: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; color: var(--paper); background: var(--ink); }
.level.easy { background: var(--ink); }
.level.workable, .level.tight { background: var(--sq-mid); color: #131313; }
.level.hard, .level.none { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.facts-note { padding: 12px 20px; border-top: 1px solid var(--hair); background: var(--well); font-size: 14px; }
@media (max-width: 900px) {
  .facts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact:nth-child(3) { border-left: 0; }
  .fact:nth-child(n + 3) { border-top: 1px solid var(--hair); }
}

/* ---------- guide modules under the tool ---------- */
.guide { display: grid; gap: 18px; }
.module { padding: clamp(20px, 3.2vw, 36px); background: var(--paper); border-radius: 22px; box-shadow: var(--card); min-width: 0; }
.module > .eyebrow { margin-bottom: 6px; }
.module h2 { font: 800 clamp(21px, 2.3vw, 27px)/1.2 var(--sans); letter-spacing: -0.01em; margin-bottom: 12px; text-wrap: balance; max-width: 34ch; }
.module h3 { font: 700 16px/1.35 var(--sans); }
.module p { font-size: 16px; line-height: 1.6; max-width: 68ch; }
.module a { font-weight: 600; }

/* the gap through the year */
.yearbar { display: flex; gap: 3px; height: 44px; margin-top: 18px; }
.yb-seg { display: flex; align-items: center; min-width: 4px; padding: 0 10px; border-radius: 8px; font: 700 13px var(--mono); white-space: nowrap; overflow: hidden; }
.yb-seg.t0 { background: var(--ink); color: var(--paper); }
.yb-seg.t1 { background: var(--well); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--sq-off); }
.yb-seg.t2, .yb-key i.t2 { background: repeating-linear-gradient(135deg, var(--well) 0 5px, var(--hair) 5px 10px); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--sq-off); }
.yb-axis { position: relative; height: 22px; margin-top: 6px; font: 500 12px var(--mono); color: var(--ink-2); }
.yb-axis span { position: absolute; top: 2px; padding-left: 4px; border-left: 1px solid var(--hair); }
.yb-key { display: flex; flex-wrap: wrap; gap: 6px 20px; list-style: none; margin: 10px 0 0; padding: 0; font-size: 14px; }
.yb-key li { display: inline-flex; align-items: center; gap: 8px; }
.yb-key i { width: 22px; height: 12px; border-radius: 4px; }
.yb-key i.t0 { background: var(--ink); }
.yb-key i.t1 { background: var(--well); box-shadow: inset 0 0 0 1.5px var(--sq-off); }
.yb-changes { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.yb-changes li { padding: 10px 14px; border-radius: 12px; background: var(--well); font-size: 15px; line-height: 1.45; }
.yb-changes b { display: block; font: 700 12px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 2px; }

.yb-axis span.today { border-left-color: var(--accent); color: var(--ink); font-weight: 700; }
/* hour by hour, folded away as reference */
.moments { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; list-style: none; margin: 16px 0 0; padding: 0; }
.moments li { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 14px; background: var(--well); }
.km-when { font-size: 13px; color: var(--ink-2); }
.km-when b { color: var(--ink); font-size: 13px; }
.km-then { font-size: 15px; }
.km-then > b { font: 700 22px var(--mono); letter-spacing: -0.02em; margin-right: 2px; }
.moments .st { margin-left: 0; }
details.hours { margin-top: 14px; }
details.hours > summary, .qa > summary, .city-group > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; cursor: pointer; list-style: none;
}
details > summary::-webkit-details-marker { display: none; }
details.hours > summary { width: fit-content; padding: 0 16px; border-radius: 12px; border: 1px solid var(--hair); background: var(--paper); font-weight: 700; font-size: 14px; box-shadow: 0 2px 0 var(--hair); }
details > summary::after { content: ''; flex: none; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform 0.2s; }
details[open] > summary::after { transform: rotate(-135deg) translate(-2px, 0); }
.table-wrap { max-width: 100%; overflow-x: auto; margin-top: 12px; }
.hours-table { border-collapse: collapse; width: 100%; max-width: 560px; font-size: 14px; }
.hours-table th, .hours-table td { text-align: left; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--hair); width: 50%; }
.hours-table th { font: 500 12px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.hours-table .mono { font-weight: 700; }
.hours-table tr.best td { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.hours-table tr.best td:first-child { box-shadow: inset 3px 0 0 var(--accent); padding-left: 8px; }
.st { display: inline-flex; align-items: center; gap: 6px; margin-left: 4px; color: var(--ink-2); font-size: 13px; }
.st .sq { width: 10px; height: 10px; border-radius: 3px; }
.wd { font: 600 11px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; padding: 1px 5px; border-radius: 5px; background: var(--well); }

/* questions: an accordion, the first one open */
.faq .qa { border-top: 1px solid var(--hair); }
.faq .qa:last-child { border-bottom: 1px solid var(--hair); }
.qa > summary h3 { font: 700 16px/1.35 var(--sans); padding-block: 12px; }
.qa > p { padding-bottom: 16px; color: var(--ink-2); }

/* more cities: chips */
.chip-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px 32px; }
.chip-groups h3 { margin-bottom: 10px; }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.chip-list a {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--hair); background: var(--paper); text-decoration: none; font-size: 14px; color: var(--ink);
  transition: border-color 0.15s, background 0.15s;
}
.chip-list a:hover { border-color: var(--ink); background: var(--well); }
.all-pairs { margin-top: 16px; }

/* the C4E card: the business reason the tool exists */
.module.c4e { background: var(--bar); color: var(--on-dark); box-shadow: none; }
.module.c4e .eyebrow, .module.c4e p { color: var(--on-dark-2); }
.module.c4e h2 { color: var(--on-dark); }
.module.c4e .btn { margin-top: 8px; }
.module.c4e :focus-visible { outline-color: var(--on-dark); }

/* hub: steps, the city directory, clock-change rules */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; list-style: none; margin: 4px 0 0; padding: 0; counter-reset: step; }
.steps li { counter-increment: step; display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: 16px; background: var(--well); }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--paper); font: 700 13px var(--mono); }
.steps b { font-size: 16px; }
.steps span { color: var(--ink-2); font-size: 14px; line-height: 1.45; }
.city-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0 28px; }
.city-group { border-top: 1px solid var(--hair); }
.city-group > summary { font-weight: 700; font-size: 16px; }
.city-group > summary span { margin-left: auto; font: 500 12px var(--mono); color: var(--ink-2); }
.city-group .chip-list { padding: 4px 0 16px; }
.rules { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.rules li { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 14px; background: var(--well); font-size: 14px; line-height: 1.5; }
.rules b { font-size: 15px; }
.rules span { color: var(--ink-2); }

/* ---------- city tiles: colour = state, like the strip ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; list-style: none; margin: 0; padding: 0; }
.tile {
  display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 232px; padding: 16px 12px 16px 18px; container-type: inline-size;
  border-radius: 22px; background: var(--paper); color: var(--ink); box-shadow: var(--card);
}
.tile.edge { background: var(--warm); }
.tile { transition: transform 0.18s ease-out, box-shadow 0.18s, background-color 0.3s, color 0.3s; }
.tiles .tile.hot { transform: translateY(-3px); box-shadow: 0 0 0 2px var(--ink), var(--card); }
.tile.night { background: var(--dusk); color: var(--on-dark); --ink-2: var(--on-dark-2); box-shadow: none; }
.tile-top { display: flex; justify-content: space-between; gap: 6px; }
.tile-id { min-width: 0; padding-top: 2px; }
.tile h3 { font: 700 20px/1.2 var(--sans); overflow-wrap: anywhere; margin-top: 2px; }
.tile-acts { display: flex; flex-direction: column; align-items: flex-end; flex: none; margin-top: -6px; }
.tile-acts button {
  position: relative; min-height: 30px; padding: 0 6px; border: 0; border-radius: 8px; background: none;
  font: 500 11px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2);
}
.tile-acts button::after { content: ''; position: absolute; inset: -7px -4px; }
.tile-acts button:hover { color: inherit; background: color-mix(in srgb, currentColor 10%, transparent); }
.tile-time { margin-top: auto; font: 800 min(62px, 27cqi)/1 var(--sans); letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.tile-time small { font-size: 0.32em; letter-spacing: 0; margin-left: 0.1em; }
.tile-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; white-space: nowrap;
  border: 1.5px solid color-mix(in srgb, currentColor 35%, transparent); font-weight: 700; font-size: 12px;
}
.search { position: relative; }
.search-field { position: relative; }
.search-field svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-2); }
.search input { width: 100%; height: 46px; padding: 0 12px 0 38px; border-radius: 13px; border: 1px solid var(--hair); background: var(--well); font-size: 15px; }
.results {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none;
  background: var(--paper); border-radius: 16px; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.35), 0 0 0 1px var(--hair);
  max-height: 300px; overflow: auto; min-width: min(300px, 80vw);
}
.results li { padding: 10px 12px; border-radius: 10px; cursor: pointer; line-height: 1.3; }
.results li span { color: var(--ink-2); font-size: 13px; }
.results li.active { background: var(--well); }
.results .empty { color: var(--ink-2); cursor: default; font-size: 14px; }
.skeleton-line { height: 38px; margin: 4px 0; background: var(--well); }

/* ---------- sheets ---------- */
.sheet {
  margin: 0 0 0 auto; padding: 0; border: 0; width: min(440px, 100vw); height: 100dvh; max-height: none; max-width: 100vw;
  background: var(--paper); color: var(--ink); box-shadow: -30px 0 60px -30px rgba(0, 0, 0, 0.4);
}
.sheet[open] { animation: sheet-in 0.28s cubic-bezier(0.2, 0.9, 0.2, 1); }
@keyframes sheet-in { from { transform: translateX(40px); opacity: 0; } }
.sheet::backdrop { background: rgba(10, 10, 9, 0.4); }
.sheet-in { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px 28px; min-height: 100%; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.sheet h2 { font: 800 24px var(--sans); }
.sheet h3 { font: 500 11.5px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); margin-top: 14px; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: inherit; }
.icon-btn:hover { background: var(--well); }
.copyrow { display: flex; gap: 8px; }
.copyrow input, .fields select {
  flex: 1; min-width: 0; height: 48px; padding: 0 12px; border-radius: 13px; border: 1px solid var(--hair); background: var(--ground); font-size: 15px;
}
.lists { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.lists li { display: flex; align-items: center; gap: 4px; border-radius: 14px; background: var(--ground); padding-right: 4px; }
.list-load { flex: 1; text-align: left; border: 0; background: none; padding: 12px 14px; display: flex; flex-direction: column; }
.list-load span { color: var(--ink-2); font-size: 13px; }
.fields { display: grid; gap: 6px; }
.fields label { font-weight: 700; margin-top: 8px; }
.clip { width: 100%; padding: 12px; border-radius: 13px; border: 1px solid var(--hair); background: var(--ground); color: var(--ink); font: 13px/1.5 var(--mono); resize: vertical; }

/* ---------- toast, skeleton ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60;
  max-width: calc(100vw - 32px); background: var(--ink); color: var(--ground); padding: 12px 18px; border-radius: 999px;
  font-weight: 700; font-size: 14px; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.5); animation: toast-in 0.22s ease-out;
}
@keyframes toast-in { from { transform: translate(-50%, 10px); opacity: 0; } }
.skel { background: color-mix(in srgb, var(--ink) 6%, transparent); border-radius: 22px; }
.hero-skel { height: 260px; }
.strip-skel { height: 240px; }

/* ---------- phones: label above each strip row, 24 hours always visible ---------- */
@media (max-width: 640px) {
  .tool svg, .clock .eyebrow, .clock .sec { display: none; }
  .tool { padding: 0 9px; letter-spacing: 0.06em; }
  .top-in { gap: 4px; }
  .main { padding-top: 24px; gap: 18px; }
  .who { min-height: 3.9em; }
  .panel, .day { padding: 16px; }
  .prow { grid-template-columns: 1fr; gap: 8px; }
  .prow.slim { margin-top: -4px; }
  .rows .srow { height: auto; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'lab val' 'track track'; row-gap: 4px; padding-block: 4px; }
  .rows .lab { grid-area: lab; }
  .rows .val { grid-area: val; }
  .rows .track { grid-area: track; height: 18px; gap: 0; }
  .rows .sq { height: 14px; }
  .sq.off { box-shadow: inset 0 0 0 1px var(--sq-off); }
  .flags-row, .axis, .pill-row { grid-template-columns: minmax(0, 1fr); }
  .flags-row .lab, .flags-row .val, .axis .lab, .axis .val, .pill-row .lab, .pill-row .val { display: none; }
  .band { border-radius: 4px; border-block: 2px solid var(--accent); border-inline-width: 2px; }
  .axis .minor { display: none; }
  .tiles { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .tile { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'top top' 'foot time'; min-height: 0; padding: 14px 10px 14px 16px; gap: 8px 12px; border-radius: 18px; }
  .tile-top { grid-area: top; }
  .tile-acts { flex-direction: row; gap: 2px; margin-top: -4px; }
  .tile-time { grid-area: time; align-self: end; margin: 0 6px 0 0; font-size: 44px; }
  .tile-foot { grid-area: foot; flex-direction: column; align-items: flex-start; gap: 8px; }
  .flag { width: 22px; height: 22px; font-size: 11px; }
  .day-foot .search { flex-basis: 100%; }
  .me-bar .btn.sm { flex: 1 1 auto; }
}

/* Narrow phones: tighter header buttons keep the clock on one line (12-hour time is the widest).
   The smallest (320px) drop the header clock; the hero already shows home time. */
@media (max-width: 400px) { .tool { padding: 0 6px; letter-spacing: 0.02em; } }
@media (max-width: 359px) { .top .clock { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- "How to read the strip": the planner's strip as an explainer, with numbered pins ---------- */
.ex-h { font: 800 18px/1.3 var(--sans); margin: 26px 0 8px; }
.explain { margin: 12px 0 0; }
.ex { display: flex; flex-direction: column; gap: 22px; padding: 14px 18px 12px; border-radius: 16px; background: var(--well); }
.ex-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; column-gap: 12px; }
.ex-lab { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-track { position: relative; isolation: isolate; display: grid; grid-template-columns: repeat(var(--n, 48), minmax(0, 1fr)); gap: 2px; align-items: center; height: 24px; }
.ex-track .sq { height: 20px; border-radius: 3px; }
.ex-flags .ex-track, .ex-axis .ex-track { display: block; }
.ex-flags { margin-bottom: -12px; }
.ex-axis { margin-top: -10px; }
.ex-axis + .ex-axis { margin-top: -16px; }
.ex-win { position: absolute; top: 25px; height: 5px; border: 1.5px solid color-mix(in srgb, var(--ink) 45%, transparent); border-top: 0; border-radius: 0 0 3px 3px; }
.ex-flag { position: absolute; top: 0; transform: translateX(-50%); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--ink); color: var(--paper); font: 700 11px var(--mono); }
.ex-band { position: absolute; z-index: -1; top: -4px; bottom: -4px; margin-left: -2px; padding-right: 2px; box-sizing: content-box; background: color-mix(in srgb, var(--accent) 16%, transparent); border-inline: 2.5px solid var(--accent); }
.ex-band.first { border-top: 2.5px solid var(--accent); border-radius: 8px 8px 0 0; }
.ex-band.last { border-bottom: 2.5px solid var(--accent); border-radius: 0 0 8px 8px; }
.ex-band.first.last { border-radius: 8px; }
.ex-axis .ex-lab { font: 500 11px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.ex-axis .ex-track span { position: absolute; top: 2px; font: 500 11.5px var(--mono); font-feature-settings: 'zero' 1; color: var(--ink-2); padding-left: 3px; border-left: 1px solid var(--hair); }
.pin {
  position: absolute; z-index: 3; top: -22px; transform: translateX(-50%); display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent-solid); color: #FFFFFF; font: 700 11px var(--mono); box-shadow: 0 0 0 2px var(--well);
}
.ex-key { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 22px; font-size: 14px; }
.ex-key li { display: flex; gap: 10px; align-items: baseline; }
.ex-flags .pin { top: 2px; }
.ex-key .pin { position: static; flex: none; transform: translateY(4px); box-shadow: none; }
.ex-note { margin-top: 10px; font-size: 14px; color: var(--ink-2); }
@media (max-width: 640px) {
  .ex { padding: 22px 12px 10px; }
  .ex-row { grid-template-columns: 64px minmax(0, 1fr); column-gap: 8px; }
  .ex-lab { font-size: 11.5px; line-height: 1.1; white-space: normal; overflow-wrap: anywhere; }
  .ex-track { gap: 1px; }
  .ex-track .sq { height: 12px; border-radius: 2px; }
  .ex-axis .ex-track span:nth-child(even) { display: none; }
  .ex-lab-t { display: none; }
  .c4e-tools-in { mask-image: linear-gradient(90deg, #000 85%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); }
}

/* ---------- C4E tools submenu: one bar shared by every C4E tool ---------- */
.c4e-tools { background: var(--paper); border-bottom: 1px solid var(--hair); }
.c4e-tools-in {
  display: flex; align-items: center; gap: 2px; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter);
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.c4e-tools-in::-webkit-scrollbar { display: none; }
.c4e-tools a {
  flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; border-block: 2px solid transparent;
  color: var(--ink-2); font: 600 13px var(--sans); text-decoration: none; white-space: nowrap;
}
.c4e-tools a:hover { color: var(--ink); }
.c4e-tools a.is-here { color: var(--ink); border-bottom-color: var(--accent); }
.c4e-tools .c4e-mark { padding: 0 6px 0 0; }
.c4e-mark img { display: block; border-radius: 6px; }
.c4e-tools .c4e-all { position: relative; font: 500 11.5px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; padding-right: 14px; margin-right: 4px; }
.c4e-all::after { content: ''; position: absolute; right: 0; top: 12px; bottom: 12px; width: 1px; background: var(--hair); }

/* Phones: 48 half hours in ~300px make 5px slivers, and an outline on a sliver reads as hatching.
   So the squares join into hour blocks (no gap inside an hour, a small one between hours) and an
   asleep hour is one empty box. Half hours still show as a change of tone inside a block. */
@media (max-width: 640px) {
  .rows .track .sq, .ex-track .sq { border-radius: 0; }
  .ex-track { gap: 0; }
  .rows .track .sq:nth-of-type(odd), .ex-track .sq:nth-of-type(odd) { border-radius: 2px 0 0 2px; }
  .rows .track .sq:nth-of-type(even), .ex-track .sq:nth-of-type(even) { border-radius: 0 2px 2px 0; margin-right: 2px; }
  .rows .track .sq.off, .ex-track .sq.off { box-shadow: inset 0 1px 0 var(--sq-off), inset 0 -1px 0 var(--sq-off); }
  .rows .track .sq.off:nth-of-type(odd), .ex-track .sq.off:nth-of-type(odd) { box-shadow: inset 1px 0 0 var(--sq-off), inset 0 1px 0 var(--sq-off), inset 0 -1px 0 var(--sq-off); }
  .rows .track .sq.off:nth-of-type(even), .ex-track .sq.off:nth-of-type(even) { box-shadow: inset -1px 0 0 var(--sq-off), inset 0 1px 0 var(--sq-off), inset 0 -1px 0 var(--sq-off); }
}
