/* Daysleeper · glass over a living field. Panes are translucent so the slow zone-colored
   fields (js/ambient.js) show through. Chrome stays near-monochrome; color comes from the
   field and from the thin edge line on each block. Light and dark share every name below.
   Real backdrop blur only on a few big surfaces (header, Now card, sheets, tab bar, bubble);
   everything else is "fake glass": a translucent fill over the already-soft field.
   Mobile first, 390-430 px. */
/* UI font: Familjen Grotesk (SIL OFL 1.1, app/fonts/OFL.txt), the variable weight axis
   400-700, Latin subset, served from the app itself so it works offline and nothing calls
   Google. One font for text and times: its figures are tabular by default (and it has tnum),
   so --num is the same face with tabular-nums. Glyphs it lacks (left/right arrows, the
   plane) fall back to the system. */
@font-face {
  font-family: 'Familjen Grotesk'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('../fonts/familjen-grotesk-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root, [data-theme='light'] {
  --base: #f4f4f2;
  --ink: #14161b;
  --ink-2: #43474f;
  --ink-3: #50555d;
  --halo: rgba(255, 255, 255, .75);
  --line: rgba(20, 22, 27, .08);
  --line-2: rgba(20, 22, 27, .15);
  --pane: rgba(255, 255, 255, .36);
  --pane-2: rgba(255, 255, 255, .44);
  --pane-3: rgba(255, 255, 255, .7);
  --pane-hi: rgba(255, 255, 255, .78);
  --glass-live: rgba(255, 255, 255, .4);
  --chrome: rgba(246, 246, 244, .62);
  --chrome-0: rgba(246, 246, 244, 0);
  --sheet: rgba(248, 248, 247, .8);
  --shadow-c: rgba(34, 32, 70, .2);
  --seg-bg: rgba(20, 22, 27, .07);
  --seg-on: rgba(255, 255, 255, .9);
  --primary-bg: #14161b;
  --primary-ink: #fff;
  --switch-on: #14161b;
  --sleep: #4247b5;
  --nap: #7579d4;
  --sleep-ink: #343898;
  --seek: #e09c12;
  --seek-ink: #8a5600;
  --seek-glow: rgba(255, 190, 70, .30);
  --avoid: #8f62d1;
  --avoid-ink: #6a3fb0;
  --caf: #8b5a36;
  --mela: #11887d;
  --fixed: rgba(20, 22, 27, .4);
  --flight: #262b36;
  --warn: #8a3f0c;
  --warn-bg: rgba(255, 236, 222, .72);
  --amber-ink: #8a5300;
  --amber-bg: rgba(255, 196, 92, .22);
  --amber-line: rgba(214, 140, 20, .62);
  --amber-wash: rgba(255, 190, 90, .08);
  --ok: #2b7549;
  --danger: #a12d18;
  --tint-l: .95;
  --tint-c: .05;
  --tint-a: .5;
  --globe-0: #fff;
  --globe-1: #e7e8ec;
  --land: #d4d6db;
  color-scheme: light;
}
[data-theme='dark'] {
  --base: #0b0c11;
  --ink: #eceef3;
  --ink-2: #b3b8c3;
  --ink-3: #9ca1ad;
  --halo: rgba(0, 0, 0, .6);
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .16);
  --pane: rgba(20, 22, 32, .34);
  --pane-2: rgba(22, 24, 34, .46);
  --pane-3: rgba(30, 32, 44, .72);
  --pane-hi: rgba(255, 255, 255, .1);
  --glass-live: rgba(24, 26, 36, .5);
  --chrome: rgba(12, 13, 18, .6);
  --chrome-0: rgba(12, 13, 18, 0);
  --sheet: rgba(22, 24, 33, .82);
  --shadow-c: rgba(0, 0, 0, .55);
  --seg-bg: rgba(255, 255, 255, .08);
  --seg-on: rgba(255, 255, 255, .16);
  --primary-bg: #eceef3;
  --primary-ink: #111318;
  --switch-on: #6d72e6;
  --sleep: #9093ff;
  --nap: #b7b9ff;
  --sleep-ink: #c4c6ff;
  --seek: #ffc247;
  --seek-ink: #ffd47e;
  --seek-glow: rgba(255, 186, 60, .16);
  --avoid: #be98ff;
  --avoid-ink: #d3b9ff;
  --caf: #d49b6c;
  --mela: #4bcfc1;
  --fixed: rgba(255, 255, 255, .42);
  --flight: #e3e7ef;
  --warn: #ffb27e;
  --warn-bg: rgba(90, 44, 14, .45);
  --amber-ink: #ffcf7a;
  --amber-bg: rgba(255, 180, 60, .14);
  --amber-line: rgba(255, 190, 90, .55);
  --amber-wash: rgba(255, 180, 60, .05);
  --ok: #6fd39a;
  --danger: #ff8a73;
  --tint-l: .3;
  --tint-c: .05;
  --tint-a: .45;
  --globe-0: #2a2e3c;
  --globe-1: #151821;
  --land: #3a3f4e;
  color-scheme: dark;
}
:root {
  --radius: 20px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  /* Home-screen app on iPhone: iOS blurs and fades a band over the status bar, a bit
     taller than the inset, so the header starts this far below it. 0 in a browser tab. */
  --top-extra: 0px;
  --top: calc(var(--safe-t) + var(--top-extra));
  --live-blur: blur(24px) saturate(165%);
  --ui: 'Familjen Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --num: var(--ui);
}
html.standalone { --top-extra: 22px; }
/* iPad home-screen apps keep a solid status bar (status-bar-style default, set in
   index.html), so the page already starts below it. Not verified on a device yet. */
html.standalone.ipad { --top-extra: 0px; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--field, var(--base)); }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; color: var(--ink); background: var(--field, var(--base));
  font: 16px/1.35 var(--ui);
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; letter-spacing: 0;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
input, select { font: inherit; color: inherit; }
h1, h2 { margin: 0; letter-spacing: -0.02em; }
p { margin: .35em 0; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.center { text-align: center; }
.pad { padding: 0 20px; }
.ic { width: 20px; height: 20px; flex: none; }
.boot { padding: 40vh 0 0; text-align: center; color: var(--ink-3); }

/* The field behind everything. A 64 x 40 canvas scaled up smoothly: that is the blur. */
.ambient { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100lvh; z-index: 0; display: block; pointer-events: none; image-rendering: auto; }
#app { position: relative; z-index: 1; }

/* Fake glass: translucent fill, a light hairline and a soft shadow. No backdrop blur, so
   cards, lists and blocks stay cheap to scroll; the field under them is soft already. */
.glass {
  background: var(--pane-2);
  box-shadow: inset 0 1px 0 var(--pane-hi), inset 0 0 0 .5px var(--pane-hi), 0 0 0 .5px var(--line), 0 12px 32px -16px var(--shadow-c);
}
/* Real glass, for the few big surfaces that things scroll under. */
.live-glass, .next, .tabs, .bubble {
  background: var(--glass-live);
  -webkit-backdrop-filter: var(--live-blur); backdrop-filter: var(--live-blur);
  box-shadow: inset 0 1px 0 var(--pane-hi), inset 0 0 0 .5px var(--pane-hi), 0 0 0 .5px var(--line-2), 0 14px 36px -14px var(--shadow-c);
}

.screen { max-width: 480px; margin: 0 auto; padding: 0 0 calc(var(--safe-b) + 120px); min-height: 100vh; min-height: 100dvh; }

/* App bar: sticky, starts below the status bar band. Content scrolls under a soft glass
   that fades out at the bottom edge, so whatever runs under the status bar looks meant. */
.appbar { position: sticky; top: 0; z-index: 20; padding-top: calc(var(--top) + 4px); }
/* Frosted band behind the header, full strength on every screen (scenes included), easing out
   over its last 28 px: a heavy blur under the title, then a lighter one (::after) that carries
   the fade, so what scrolls under softens progressively instead of meeting a hard line. */
.appbar::before, .appbar::after { content: ""; position: absolute; left: 0; right: 0; top: 0; z-index: -1; pointer-events: none; }
.appbar::before { bottom: 0;
  background: var(--chrome);
  -webkit-backdrop-filter: var(--live-blur); backdrop-filter: var(--live-blur);
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 12px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 12px), transparent); }
.appbar::after { bottom: -28px;
  background: linear-gradient(to bottom, var(--chrome), var(--chrome-0));
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 40px), transparent); }
.appbar .seg { margin-bottom: 8px; position: relative; }
/* Timeline's Now/Day/Week switch is its own piece of glass: it blurs whatever scrolls under it
   rather than relying on the app bar's fading band, which a scene turns down. */
.appbar .seg { background: var(--glass-live); -webkit-backdrop-filter: var(--live-blur); backdrop-filter: var(--live-blur);
  box-shadow: inset 0 1px 0 var(--pane-hi), inset 0 0 0 .5px var(--pane-hi), 0 0 0 .5px var(--line-2), 0 8px 24px -12px var(--shadow-c); }
.appbar + * { margin-top: 12px; }
/* Preview only (?inset=47): a stand-in for the iPhone status bar and its blur band. */
.sim-status { position: fixed; z-index: 60; top: 0; left: 0; right: 0; height: calc(var(--safe-t) + 14px); pointer-events: none;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); background: linear-gradient(to bottom, rgba(255, 255, 255, .35), rgba(255, 255, 255, 0));
  -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent); mask-image: linear-gradient(to bottom, #000 60%, transparent); }
.sim-status b { position: absolute; left: 34px; top: calc(var(--safe-t) / 2 - 9px); font-size: 16px; font-weight: 600; }
.sim-status i { position: absolute; left: 50%; top: 11px; width: 124px; height: 36px; margin-left: -62px; border-radius: 20px; background: #000; }
.sim-status u { position: absolute; right: 30px; top: calc(var(--safe-t) / 2 - 6px); width: 26px; height: 12px; border-radius: 3px; border: 1.5px solid var(--ink); }

/* Headers */
.top { display: flex; align-items: flex-start; justify-content: space-between; padding: 10px 20px 8px; gap: 12px; }
.screen > .top:not(.appbar) { padding-top: calc(var(--top) + 14px); }
.top.appbar { padding-top: calc(var(--top) + 14px); }
.appbar > .top, .appbar > .bar > .top { padding-top: 10px; }
.top h1 { font-size: 32px; font-weight: 700; line-height: 1.1; }
.subtitle { color: var(--ink-2); font-size: 14px; margin-top: 2px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; position: relative; flex: none; }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn.sm .ic { width: 16px; height: 16px; }
.badge { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--ink); color: var(--base); font-size: 11px; font-weight: 600; display: grid; place-items: center; }
.nav-bar { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: calc(var(--top) + 10px) 16px 10px; background: var(--chrome); -webkit-backdrop-filter: var(--live-blur); backdrop-filter: var(--live-blur); border-bottom: .5px solid var(--line); }
.nav-bar b { font-size: 17px; }
.nav-bar > :last-child { justify-self: end; }
.link { color: var(--ink); font-size: 16px; display: inline-flex; align-items: center; gap: 2px; }
.link .ic { width: 18px; height: 18px; }
.link.strong { font-weight: 650; }
.link.danger, .danger { color: var(--danger); }

/* Segmented control */
.seg { position: relative; display: flex; margin: 4px 20px 10px; padding: 3px; border-radius: 12px; background: var(--seg-bg); box-shadow: inset 0 0 0 .5px var(--line); }
.seg > .ind { border-radius: 9px; background: var(--seg-on); box-shadow: 0 1px 3px rgba(0, 0, 0, .1), inset 0 0 0 .5px var(--pane-hi), 0 0 0 .5px var(--line); }
.seg > button { position: relative; z-index: 1; transition: color .2s ease; }
.seg.has-ind > button.on { background: none; box-shadow: none; }
.seg button { flex: 1; padding: 6px 0; border-radius: 9px; font-size: 14px; font-weight: 550; color: var(--ink-2); text-align: center; }
.seg button.on { background: var(--seg-on); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1), inset 0 0 0 .5px var(--pane-hi), 0 0 0 .5px var(--line); }
.seg.small { margin: 8px 0 4px; }

/* Toast and notes */
.toast { display: flex; gap: 10px; align-items: flex-start; margin: 0 16px 10px; padding: 12px 10px 12px 16px; border-radius: 16px; }
/* a new toast springs down into place (only the first time it's drawn, not on each minute) */
.toast.fresh { animation: toast-in .42s var(--spring-pop, cubic-bezier(.34, 1.4, .64, 1)) both; }
@keyframes toast-in { from { transform: translate3d(0, -18px, 0) scale(.96); opacity: 0; } }
.toast div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.toast b { font-size: 15px; }
.toast span { font-size: 14px; color: var(--ink-2); }
@keyframes drop { from { transform: translateY(-8px); opacity: 0; } }
.note { margin: 0 16px 12px; padding: 12px 16px; border-radius: 14px; font-size: 14px; }
.note.warn { background: var(--warn-bg); color: var(--warn); box-shadow: inset 0 0 0 .5px var(--line-2); }
.appbar + .note { margin-top: 12px; }

/* Now: the next step on real glass, pinned under the header (it rides in the sticky app bar).
   The header's glass covers only the title and the switch (--bar-h, set by fitNow), so the
   scene reads around the card. The timeline rests low (.now-spacer) and slides up under it;
   as it arrives, a blur band comes up behind the card (--now-cover) to soften the rows
   passing beside and under it. */
.appbar.has-card::before { bottom: auto; height: calc(var(--bar-h, 150px)); }
.appbar.has-card::after { bottom: auto; height: calc(var(--bar-h, 150px) + 28px); }
.now-head { position: relative; margin: 2px 16px 0; display: flex; }
.now-head::before { content: ""; position: absolute; left: -16px; right: -16px; top: -12px; bottom: -18px; z-index: -1; pointer-events: none; display: none;
  opacity: var(--now-cover, 0); background: linear-gradient(to bottom, var(--chrome), var(--chrome-0));
  -webkit-backdrop-filter: var(--live-blur); backdrop-filter: var(--live-blur);
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 18px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 18px), transparent); }
html.now-covered .now-head::before { display: block; }
.now-spacer { margin: 0 !important; height: 40vh; }
/* The past on Now (js/pull.js): the column carries the next earlier chunk above a clip
   (overflow, not a mask, so nothing loses its blur); a pull lifts .tl-wrap and slides
   .tl-slide with transforms only. The page keeps Safari's own bounce: a downward drag at the
   top is the pull (pull.js stops the bounce there), everywhere else scrolling is native. */
.tl-clip { position: relative; overflow: hidden; border-radius: 20px 20px 0 0; box-shadow: 0 16px 40px -22px var(--shadow-c); }
.tl-clip::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 7; box-shadow: inset 0 0 0 .5px var(--pane-hi), inset 0 0 0 1px var(--line); }
.tl-clip .tl { box-shadow: none; }
/* Now: the pane is a whole card, rounded at the bottom too, with room under the last hour. */
.tl-wrap[data-zoom='now'] .tl-clip, .tl-wrap[data-zoom='now'] .tl { border-radius: 20px; }
.tl-wrap[data-zoom='now'] .tl { padding-bottom: 20px; }
/* The pull label: tucked behind the pane's top edge (clipped just above it), it rises into
   view as she pulls and says what letting go loads. Moved by js (timeline.js showHint). */
.pull-hint { position: absolute; z-index: 8; left: 0; right: 0; bottom: 100%; height: 34px; overflow: hidden; display: flex; justify-content: center; align-items: flex-end; pointer-events: none; }
.ph-pill { display: block; margin-bottom: 5px; padding: 5px 13px; border-radius: 99px; font-size: 13px; font-weight: 600; line-height: 1.2; white-space: nowrap; color: var(--ink);
  background: var(--pane-3); -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
  box-shadow: inset 0 1px 0 var(--pane-hi), inset 0 0 0 .5px var(--line-2);
  opacity: 0; transform: translate3d(0, 135%, 0); will-change: transform, opacity; }
.ph-pill.armed { box-shadow: inset 0 1px 0 var(--pane-hi), inset 0 0 0 1.5px var(--ink); }
.next { position: relative; z-index: 2; width: 100%; display: flex; gap: 12px; padding: 14px 16px; border-radius: 18px; cursor: pointer; }
.next-icon { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--pane-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.next.t-sleep .next-icon, .next.t-nap .next-icon { color: var(--sleep-ink); box-shadow: inset 0 0 0 1.5px var(--sleep); background: color-mix(in oklab, var(--sleep) 12%, transparent); }
.next.t-seek-light .next-icon { color: var(--seek-ink); box-shadow: inset 0 0 0 1.5px var(--seek), inset 0 0 14px var(--seek-glow); background: color-mix(in oklab, var(--seek) 14%, transparent); }
.next.t-avoid-light .next-icon { color: var(--avoid-ink); box-shadow: inset 0 0 0 1.5px var(--avoid); background: color-mix(in oklab, var(--avoid) 12%, transparent); }
.next.t-coffee-helps .next-icon, .next.t-caffeine-cutoff .next-icon { color: var(--caf); box-shadow: inset 0 0 0 1.5px var(--caf); }
.next.t-melatonin .next-icon { color: var(--mela); box-shadow: inset 0 0 0 1.5px var(--mela); }
.next-body { min-width: 0; flex: 1; }
.eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.next-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin: 1px 0 3px; }
.next-clocks { font-size: 14px; font-weight: 550; }
.next-clocks { display: flex; flex-direction: column; }
.next-clocks .sec { color: var(--ink-2); font-weight: 500; }
.next p { font-size: 14px; color: var(--ink-2); margin: 4px 0 0; }
.late-note { display: flex; gap: 6px; align-items: flex-start; margin-top: 8px; font-size: 13px; color: var(--warn); }
.late-note .ic { width: 16px; height: 16px; margin-top: 1px; }
.next-meal { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: .5px solid var(--line-2); font-size: 13px; color: var(--ink-2); }
.next-meal .ic { width: 16px; height: 16px; flex: none; }
.next-meal span { flex: 1; }
.next-meal .chip { color: var(--ink); font-weight: 600; flex: none; }
.btn .ic { width: 18px; height: 18px; vertical-align: -3px; margin-right: 4px; }
.then { margin-top: 8px; padding-top: 8px; border-top: .5px solid var(--line-2); font-size: 13px; color: var(--ink-2); }

/* Now scene (js/scene.js): one canvas, full-bleed behind everything, above the field.
   Only at Now; it fades as she scrolls away from now. */
@media (prefers-reduced-motion: reduce) { .toast { animation: none !important; } .scene-canvas { transition: none; } }
/* With a scene behind (all of Now, even as the scene fades, so nothing jumps): thinner
   glass with a stronger blur, and a soft halo of the base color behind the type, so the
   scene reads through while the ink keeps AA. Over a deep scene in light appearance (or a
   bright one in dark) the glass thickens a step; work/scene-contrast.js checks every shot. */
[data-theme='light'].scene-on { --ink-2: #3d4149; --ink-3: #464a52; --live-blur: blur(34px) saturate(180%); --glass-live: rgba(255, 255, 255, .26); --pane: rgba(255, 255, 255, .22); --pane-2: rgba(255, 255, 255, .3); }
[data-theme='dark'].scene-on { --ink-2: #bec3cd; --ink-3: #b1b6c0; --live-blur: blur(34px) saturate(170%); --glass-live: rgba(22, 24, 34, .34); --pane: rgba(20, 22, 32, .24); --pane-2: rgba(22, 24, 34, .34); }

[data-theme='light'].scene-on[data-scene='deep'] { --glass-live: rgba(255, 255, 255, .48); --pane: rgba(255, 255, 255, .44); --pane-2: rgba(255, 255, 255, .44); --chrome: rgba(246, 246, 244, .74); }
[data-theme='light'].scene-on[data-scene='deeper'] { --glass-live: rgba(255, 255, 255, .58); --pane: rgba(255, 255, 255, .54); --pane-2: rgba(255, 255, 255, .5); --chrome: rgba(246, 246, 244, .8); }
[data-theme='light'].scene-on[data-scene='deeper'] .appbar::before { opacity: .82; }
[data-theme='dark'].scene-on[data-scene='bright'] { --glass-live: rgba(16, 18, 26, .5); --pane: rgba(16, 18, 26, .44); --pane-2: rgba(22, 24, 34, .4); --chrome: rgba(12, 13, 18, .7); }
[data-theme='dark'].scene-on[data-scene='bright'] .appbar::before { opacity: .7; }
[data-theme='dark'].scene-on[data-scene='brighter'] { --glass-live: rgba(14, 16, 24, .62); --pane: rgba(16, 18, 26, .54); --pane-2: rgba(22, 24, 34, .46); --chrome: rgba(12, 13, 18, .78); }
[data-theme='dark'].scene-on[data-scene='brighter'] .appbar::before { opacity: .82; }
html.scene-on .appbar .top h1, html.scene-on .next-body, html.scene-on .tl .gl, html.scene-on .tab span { text-shadow: 0 0 12px var(--halo), 0 0 3px var(--halo); }
.scene-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100lvh; z-index: 0; display: block; pointer-events: none; opacity: 0; transition: opacity .6s ease; }

/* Timeline column: a glass sheet over the field, edge to edge, the zone tint faint inside it */
.tl-wrap { margin: 0; position: relative; -webkit-user-select: none; user-select: none; } /* a drag here is a pull or a swipe, never a text selection */
.tl { position: relative; margin-left: 0; overflow: hidden; border-radius: 20px 20px 0 0; background: var(--pane);
  box-shadow: inset 0 0 0 .5px var(--pane-hi), 0 0 0 .5px var(--line), 0 16px 40px -22px var(--shadow-c); }
.tl-bg { position: absolute; inset: 0 0 0 0; border-radius: 20px 20px 0 0; opacity: var(--tint-a); }
/* Calm field: the page is already the zone's tone, so the column keeps only a hint of the
   zone run (it still shifts across a flight). The neutral prototype keeps the full tint. */
[data-ambient='calm'] .tl-bg { opacity: calc(var(--tint-a) * .5); }
/* while dimmed the field turns warm; a zone-colored column beside it would be a second hue */
[data-ambient='calm'] body.dim .tl-bg { opacity: 0; }
/* neutral prototype: no zone color in Now / Day at all; the header pill carries it */
[data-ambient='neutral'] .tl-bg { display: none; }
.hl { position: absolute; left: 66px; right: 0; height: 0; border-top: .5px solid var(--line); }
.gutter { position: absolute; left: 0; top: 0; bottom: 0; width: 66px; pointer-events: none; }
.gl { position: absolute; left: 10px; right: 8px; transform: translateY(-7px); display: flex; flex-direction: column; line-height: 1.1; }
.gl b { font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.gl span { font-size: 10.5px; color: var(--ink-3); margin-top: 1px; white-space: nowrap; }
.tl-col { position: absolute; left: 70px; right: 6px; top: 0; bottom: 0; cursor: copy; }
.now-line { position: absolute; left: 58px; right: 0; height: 0; border-top: 1.5px solid var(--ink); z-index: 6; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -5px; top: -5px; width: 9px; height: 9px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 3px var(--pane-hi); }
/* in flight the plane on the rail is the now marker */
.now-line.on-rail::before { display: none; }
.now-line span { position: absolute; left: -54px; top: -9px; font-size: 11px; font-weight: 700; background: var(--ink); color: var(--base); border-radius: 6px; padding: 1px 4px; display: none; }
/* Flight: a solid rail with a plane on it */
/* Guessed travel on a draft trip: a plain soft hatched "Travel" block behind the blocks */
.travel { position: absolute; left: 0; right: 0; z-index: 1; border-radius: 12px; pointer-events: none;
  background: repeating-linear-gradient(135deg, color-mix(in oklab, var(--flight) 6%, transparent) 0 8px, transparent 8px 16px);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--flight) 22%, transparent); }
.travel-label { position: absolute; top: 6px; right: 6px; z-index: 5; pointer-events: auto; display: flex; gap: 6px; align-items: center; padding: 5px 11px 5px 9px; border-radius: 99px; font-size: 13px; line-height: 1.2; color: var(--ink); background: var(--pane-3); box-shadow: 0 0 0 1px color-mix(in oklab, var(--flight) 26%, transparent), 0 4px 12px -6px var(--shadow-c); }
.travel-label .ic { width: 14px; height: 14px; flex: none; color: var(--flight); }
.travel-label b { font-weight: 650; }
.wb.travel { left: 2px; right: 2px; border-radius: 6px; z-index: 1; cursor: pointer; pointer-events: auto; background: repeating-linear-gradient(135deg, color-mix(in oklab, var(--flight) 11%, transparent) 0 5px, transparent 5px 10px); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--flight) 30%, transparent); }
.lg.lg-travel { border-radius: 3px; background: repeating-linear-gradient(135deg, color-mix(in oklab, var(--flight) 22%, transparent) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--flight) 40%, transparent); }
.rail { position: absolute; left: -4px; width: 3px; border-radius: 2px; background: var(--flight); opacity: .8; z-index: 4; }
.rail-plane { position: absolute; left: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; display: grid; place-items: center; color: var(--flight); background: var(--pane-3); box-shadow: 0 0 0 1.5px var(--flight), 0 3px 8px -2px var(--shadow-c); }
.rail-plane .ic { width: 13px; height: 13px; transform: rotate(90deg); }

/* Blocks: glass panes. Type is the thin colored line on the leading edge plus the icon. */
.blk { position: absolute; border-radius: 11px; padding: 4px 8px 4px 15px; overflow: hidden; font-size: 13px; cursor: pointer; display: flex; flex-direction: column; justify-content: flex-start; z-index: 2;
  --edge: transparent; --wash: transparent;
  background: linear-gradient(var(--wash), var(--wash)), var(--pane-2);
  box-shadow: inset 0 1px 0 var(--pane-hi), inset 0 0 0 .5px var(--pane-hi), 0 0 0 .5px var(--line-2), 0 8px 20px -14px var(--shadow-c); }
.blk::before { content: ""; position: absolute; left: 5px; top: 5px; bottom: 5px; width: 3.5px; border-radius: 2px; background: var(--edge); }
.blk-row { display: flex; align-items: center; gap: 5px; min-width: 0; white-space: nowrap; height: 18px; }
.blk-row .ic { width: 15px; height: 15px; color: var(--edge-ink, var(--ink-2)); }
.blk-row b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; }
.blk-time { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; flex: 0 10 auto; }
.blk-sub { font-size: 12px; color: var(--ink-2); margin-top: 3px; line-height: 1.25; white-space: normal; }
.blk .ok { width: 14px; height: 14px; color: var(--ok); }
.blk.point { justify-content: center; border-radius: 13px; padding: 0 9px; z-index: 3; background: var(--pane-3); }
.blk.point::before { display: none; }
.blk.t-sleep { --edge: var(--sleep); --edge-ink: var(--sleep-ink); --wash: color-mix(in oklab, var(--sleep) 9%, transparent); }
.blk.t-nap { --edge: var(--nap); --edge-ink: var(--sleep-ink); --wash: color-mix(in oklab, var(--nap) 8%, transparent); }
.blk.t-sleep.usual { --edge: color-mix(in oklab, var(--sleep) 45%, transparent); --wash: transparent; }
.blk.t-seek-light, .blk.t-log-light { --edge: var(--seek); --edge-ink: var(--seek-ink); --wash: color-mix(in oklab, var(--seek) 10%, transparent);
  box-shadow: inset 0 1px 0 var(--pane-hi), inset 0 0 0 .5px var(--pane-hi), inset 0 0 26px var(--seek-glow), 0 0 0 .5px color-mix(in oklab, var(--seek) 40%, transparent), 0 8px 22px -12px var(--seek-glow); }
.blk.t-avoid-light { --edge: var(--avoid); --edge-ink: var(--avoid-ink); --wash: color-mix(in oklab, var(--avoid) 7%, transparent); }
.blk.t-caffeine-cutoff, .blk.t-coffee-helps, .blk.t-log-caffeine { --edge-ink: var(--caf); box-shadow: inset 0 0 0 1.4px var(--caf), 0 6px 16px -10px var(--shadow-c); }
.blk.t-melatonin, .blk.t-log-melatonin { --edge-ink: var(--mela); box-shadow: inset 0 0 0 1.4px var(--mela), 0 6px 16px -10px var(--shadow-c); }
.blk.t-meal, .blk.t-fixed, .blk.t-boarding { padding-left: 9px; background: var(--pane); box-shadow: inset 0 0 0 1px transparent, 0 6px 16px -12px var(--shadow-c); outline: 1.2px dashed var(--fixed); outline-offset: -1.2px; }
.blk.t-meal::before, .blk.t-fixed::before, .blk.t-boarding::before { display: none; }
.blk.t-takeoff, .blk.t-landing { --edge-ink: var(--flight); background: var(--pane-3); box-shadow: inset 0 0 0 1.5px var(--flight), 0 6px 16px -10px var(--shadow-c); }
.blk.logged::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--edge-ink, var(--ink)) 60%, transparent); }
.blk.moved { outline: 1.5px dashed var(--fixed); outline-offset: -3px; }
.blk.st-skipped { opacity: .5; }
.blk.st-skipped b { text-decoration: line-through; }
.blk.st-done { opacity: .8; }

.clash { position: absolute; left: 14px; right: 0; z-index: 7; padding: 10px 12px; border-radius: 14px; background: var(--pane-3); box-shadow: inset 0 0 0 .5px var(--pane-hi), 0 0 0 1.5px var(--ink), 0 8px 24px var(--shadow-c); display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.clash b { font-size: 14px; }
.clash span { color: var(--ink-2); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chip { padding: 6px 12px; border-radius: 99px; font-size: 13px; font-weight: 550; box-shadow: inset 0 0 0 1px var(--line-2), inset 0 1px 0 var(--pane-hi); background: var(--pane-2); }
.chip.on { box-shadow: inset 0 0 0 1.5px var(--ink); }
.chips.big { gap: 8px; margin: 14px 0 6px; }
.chips.big .chip { padding: 10px 16px; font-size: 15px; }

/* Text that sits straight on the field gets a soft halo of the base color, so it stays
   readable over the darker patches (and while dimmed). */
.section-label, .pad.muted, .small.muted.pad, .screen > .top h1, .screen > .top .subtitle, .appbar .subtitle, .wgut span, .legend, .day-label, .wh, .inbox-sub { text-shadow: 0 0 10px var(--halo), 0 0 2px var(--halo); }

/* Day and week */
.day-nav { display: flex; align-items: center; justify-content: space-between; margin: 0 12px 8px; }
.day-label { text-align: center; display: flex; flex-direction: column; }
.day-label b { font-size: 17px; }
.day-label span { font-size: 13px; color: var(--ink-2); }
.pill-btn { padding: 5px 14px; border-radius: 99px; font-size: 13px; font-weight: 600; background: var(--pane-2); box-shadow: inset 0 1px 0 var(--pane-hi), 0 0 0 .5px var(--line-2); margin-bottom: 8px; }
.week { display: flex; margin: 0 8px 0 0; }
.wgut { position: relative; width: 34px; flex: none; margin-top: 38px; }
.wgut span { position: absolute; right: 6px; transform: translateY(-6px); font-size: 10px; color: var(--ink-2); }
.wcols { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.wcol { display: flex; flex-direction: column; align-items: stretch; cursor: pointer; min-width: 0; }
.wh { height: 38px; text-align: center; display: flex; flex-direction: column; justify-content: center; line-height: 1.15; }
.wh b { font-size: 12px; font-weight: 650; white-space: nowrap; }
.wh span { font-size: 10.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wcol.today .wh b { background: var(--ink); color: var(--base); border-radius: 6px; padding: 0 3px; align-self: center; }
.wbody { position: relative; border-radius: 10px; overflow: hidden; background: var(--pane); box-shadow: inset 0 1px 0 var(--pane-hi), inset 0 0 0 .5px var(--pane-hi), 0 0 0 .5px var(--line), 0 10px 24px -16px var(--shadow-c); }
.wcol.today .wbody { box-shadow: inset 0 1px 0 var(--pane-hi), inset 0 0 0 .5px var(--pane-hi), 0 0 0 1px var(--line-2), 0 10px 24px -14px var(--shadow-c); }
.wtint { position: absolute; inset: 0; opacity: var(--tint-a); }
.wb { position: absolute; left: 4px; right: 4px; border-radius: 5px; pointer-events: none; }
.wb.t-sleep, .wb.t-nap { background: color-mix(in oklab, var(--sleep) 16%, transparent); box-shadow: inset 0 0 0 1.5px var(--sleep); }
.wb.t-nap { box-shadow: inset 0 0 0 1.5px var(--nap); }
.wb.t-sleep.usual { background: transparent; box-shadow: inset 0 0 0 1.2px color-mix(in oklab, var(--sleep) 50%, transparent); }
.wb.t-seek-light { left: auto; right: 3px; width: 3px; border-radius: 2px; background: var(--seek); box-shadow: 0 0 8px 1px var(--seek-glow); }
.wb.t-avoid-light { left: auto; right: 3px; width: 3px; border-radius: 2px; background: var(--avoid); opacity: .75; }
.wb.t-meal, .wb.t-fixed { left: 30%; right: 30%; border-radius: 3px; outline: 1px dashed var(--fixed); outline-offset: -1px; }
.wb.rail { left: 5px; right: auto; width: 3px; border-radius: 2px; background: var(--flight); opacity: .85; z-index: 1; }
.wplane { position: absolute; left: 6.5px; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; display: grid; place-items: center; color: var(--flight); background: var(--pane-3); box-shadow: 0 0 0 1.2px var(--flight); z-index: 2; }
.wplane .ic { width: 10px; height: 10px; transform: rotate(90deg); }
.wnow { position: absolute; left: 0; right: 0; height: 2px; background: var(--ink); z-index: 3; }
.wtag { height: 30px; display: grid; place-items: center; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2); background: var(--pane-2); white-space: nowrap; }
.wtag .tag { padding: 1px 5px; font-size: 10px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 6px 20px 0; font-size: 12px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.lg { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.lg.t-sleep { background: color-mix(in oklab, var(--sleep) 16%, transparent); box-shadow: inset 0 0 0 1.5px var(--sleep); }
.lg.t-seek-light { width: 3px; border-radius: 2px; background: var(--seek); }
.lg.t-avoid-light { width: 3px; border-radius: 2px; background: var(--avoid); }
.lg.t-fixed { outline: 1px dashed var(--fixed); outline-offset: -1px; }
.lg.lg-flight { width: 3px; border-radius: 2px; background: var(--flight); }

/* Empty states */
.empty { margin: 12px 16px; padding: 28px 22px 22px; border-radius: 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty h2 { font-size: 22px; }
.empty p { color: var(--ink-2); max-width: 300px; }
.empty-art { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; color: var(--sleep-ink); background: color-mix(in oklab, var(--sleep) 10%, transparent); box-shadow: inset 0 0 0 1.5px var(--sleep); margin-bottom: 4px; }
.empty-art .ic { width: 30px; height: 30px; }

/* Buttons */
.btn { display: block; width: 100%; padding: 13px 16px; border-radius: 14px; text-align: center; font-weight: 600; font-size: 16px; background: var(--pane-2); box-shadow: inset 0 1px 0 var(--pane-hi), inset 0 0 0 1px var(--line-2); }
.btn.primary { background: var(--primary-bg); color: var(--primary-ink); box-shadow: 0 8px 20px -12px var(--shadow-c); }
.btn.danger { color: var(--danger); }
.btn.full { margin-top: 18px; }
.empty .btn { max-width: 300px; }
.btns { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.dashed { display: block; width: 100%; padding: 13px; border-radius: 14px; text-align: center; color: var(--ink-2); border: 1.5px dashed var(--line-2); margin: 10px 0 0; font-weight: 550; }

/* Cards (You, Trips) */
.stack { display: flex; flex-direction: column; gap: 12px; padding: 0 16px; }
.card { display: block; width: 100%; padding: 14px 16px; border-radius: var(--radius); text-align: left; }
.card-title { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.card p { font-size: 14px; color: var(--ink-2); margin-bottom: 0; }
.card p b { color: var(--ink); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row-between .chev { color: var(--ink-3); }
.big { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.huge { font-size: 52px; font-weight: 750; letter-spacing: -0.03em; line-height: 1.05; margin: 2px 0; }
.lead { font-size: 17px !important; color: var(--ink) !important; margin-top: 10px !important; line-height: 1.35; }
.two-up { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.strip { height: 8px; border-radius: 4px; margin: 10px 0 2px; }
.strip.big { height: 10px; margin: 6px 0 6px; }
.section-label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); padding: 18px 20px 8px; }
.stack + .section-label { padding-top: 22px; }
.globe { display: block; margin: 6px auto 2px; max-width: 100%; height: auto; }
.globe .g0 { stop-color: var(--globe-0); } .globe .g1 { stop-color: var(--globe-1); }
.globe .ocean { stroke: var(--line-2); stroke-width: 1; }
.globe .grat { fill: none; stroke: var(--line); stroke-width: .7; }
.globe .land path { fill: var(--land); }
.globe .done { fill: none; stroke: var(--ink); stroke-width: 3.5; stroke-linecap: round; }
.globe .todo { fill: none; stroke: var(--ink-3); stroke-width: 2.2; stroke-dasharray: 4 5; stroke-linecap: round; }
.globe .end { fill: var(--globe-0); stroke: var(--ink-2); stroke-width: 2; }
.globe .lbl { font-size: 11px; fill: var(--ink-2); }
.globe .dot { fill: var(--ink); stroke: var(--globe-0); stroke-width: 3; }
.globe .pill { fill: var(--ink); }
.globe .pill-t { font-size: 11.5px; font-weight: 650; fill: var(--base); }

.nights { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 120px; margin: 12px 0 4px; padding-bottom: 32px; }
.nb { display: flex; flex-direction: column; align-items: center; height: 100%; position: relative; }
.nb-col { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.nb-col i { display: block; width: 100%; border-radius: 6px; background: color-mix(in oklab, var(--sleep) 16%, transparent); box-shadow: inset 0 0 0 1.5px var(--sleep); }
.nb-col i.none { background: var(--seg-bg); box-shadow: none; }
.nb-v { position: absolute; bottom: -30px; font-size: 10.5px; color: var(--ink-2); white-space: nowrap; }
.nb-d { position: absolute; bottom: -16px; font-size: 11px; font-weight: 600; color: var(--ink-3); }
.nb-v { bottom: -32px; }
.nb-d { bottom: -16px; }
.usual-line { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--fixed); z-index: 1; margin-bottom: 32px; }
.usual-line span { position: absolute; right: 0; top: -16px; font-size: 10.5px; color: var(--ink-2); background: var(--pane-3); padding: 0 3px; border-radius: 3px; }

.stats { margin: 0 16px; border-radius: var(--radius); display: grid; grid-template-columns: repeat(2, 1fr); overflow: hidden; }
.stat { padding: 14px 16px; display: flex; flex-direction: column; border-bottom: .5px solid var(--line); }
.stat:nth-child(odd) { border-right: .5px solid var(--line); }
.stat:last-child { grid-column: 1 / -1; border-right: 0; border-bottom: 0; }
.stat b { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.stat span { font-size: 13px; color: var(--ink-2); }

/* Trips */
.trip { display: block; width: 100%; padding: 14px 16px; border-radius: var(--radius); text-align: left; }
.trip-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.trip-top b { font-size: 19px; display: block; letter-spacing: -0.015em; }
.trip-top span:not(.tag) { font-size: 14px; color: var(--ink-2); }
.trip-foot { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.trip.past { opacity: .7; }
.trip-note { margin: 8px 0 0; padding-top: 8px; border-top: .5px solid var(--line); font-size: 13px; line-height: 1.35; color: var(--ink); }

/* Forms */
.form { padding: 12px 16px 0; }
.strip-text { margin-bottom: 8px; }
.form-group { margin-top: 6px; }
.group-head { display: flex; align-items: center; justify-content: space-between; }
.form .group-head .section-label { padding-left: 4px; }
.card-fields { border-radius: var(--radius); padding: 6px 14px 10px; margin-bottom: 6px; }
.field { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-bottom: .5px solid var(--line); min-width: 0; }
.field:last-child { border-bottom: 0; }
.field > span { font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.field input, .field select { border: 0; background: transparent; padding: 4px 0; font-size: 16px; width: 100%; min-width: 0; outline: none; }
.field select { -webkit-appearance: none; appearance: none; background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%238b9099" stroke-width="2"><path d="M7 10l5 5 5-5"/></svg>') right center / 18px no-repeat; padding-right: 22px; }
.field.solo { border-radius: 14px; padding: 10px 14px; border: 0; margin: 8px 0 4px; }
.fields.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fields.two .field { border-bottom: .5px solid var(--line); }
.card-fields .fields.two .field { border-bottom: .5px solid var(--line); }
.card-fields .small { margin-top: 6px; }
/* Time fields: the clock, then the zone it's typed in. */
.time-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.time-row input { flex: 1 1 0; width: 0; }
.tz { position: relative; flex: none; }
.tz-pill { display: inline-flex; justify-content: center; min-width: 96px; align-items: baseline; gap: 5px; padding: 5px 10px; border-radius: 99px; font-size: 13px; line-height: 1.2; white-space: nowrap; color: var(--ink); background: var(--pane-3); box-shadow: inset 0 0 0 .5px var(--line-2); }
.tz-pill b { font-weight: 650; }
.tz-pill span { color: var(--ink-2); }
.tz-pill.open { box-shadow: inset 0 0 0 1.5px var(--ink); }
.tz-pill:disabled { opacity: .55; }
.tz-scrim { position: fixed; inset: 0; z-index: 30; }
.tz-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 31; width: max-content; min-width: 220px; max-width: calc(100vw - 48px); padding: 5px; border-radius: 14px; background: var(--base); box-shadow: 0 0 0 .5px var(--line-2), 0 14px 36px -10px var(--shadow-c); display: flex; flex-direction: column; animation: drop .14s ease-out; }
.tz-opt { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left; padding: 8px 10px; border-radius: 9px; font-size: 15px; color: var(--ink); }
.tz-opt span { font-weight: 550; }
.tz-opt small { grid-column: 1; font-size: 12.5px; color: var(--ink-2); }
.tz-opt .tz-tick { grid-column: 2; grid-row: 1 / span 2; width: 18px; height: 18px; }
.tz-opt.on { background: var(--pane-2); box-shadow: inset 0 0 0 .5px var(--line); }
.tz-opt + .tz-opt { margin-top: 2px; }
.tz-check { margin: 2px 0 4px; font-size: 13px; line-height: 1.35; color: var(--ink-2); }
.tz-check:empty { display: none; }
.tz-check span { white-space: nowrap; }
.tz-check.warn { color: var(--warn); font-weight: 550; }
input.bare { border: 0; background: transparent; font-size: 17px; font-weight: 650; padding: 8px 0; outline: none; flex: 1; min-width: 0; }
.form .card-fields + .section-label, .form .dashed + .section-label { padding-left: 4px; }

/* Settings */
.settings { padding: 4px 0; }
.list { margin: 0 16px; border-radius: 16px; overflow: hidden; }
.li { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: .5px solid var(--line); min-height: 50px; font-size: 16px; }
.li:last-child { border-bottom: 0; }
.li span { display: flex; flex-direction: column; }
.li small { font-size: 13px; color: var(--ink-2); margin-top: 1px; }
.li.col { flex-direction: column; align-items: stretch; gap: 0; }
.li.col.home-city { gap: 6px; }
.li.col .seg { margin-left: 0; margin-right: 0; }
.li-r { flex-direction: row !important; align-items: center; gap: 4px; color: var(--ink-2); white-space: nowrap; }
.li-r input, .li-r select { border: 0; background: var(--seg-bg); border-radius: 8px; padding: 5px 7px; font-size: 15px; color: var(--ink); }
.li .chev { color: var(--ink-3); width: 18px; }
.li.danger { color: var(--danger); }
.switch { width: 51px; height: 31px; border-radius: 16px; background: var(--line-2); position: relative; flex: none; transition: background .2s; }
.switch i { position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch.on { background: var(--switch-on); }
.switch.on i { transform: translateX(20px); }

/* Inbox */
.inbox-sub { margin: 14px 4px 10px; }
.ib { align-items: flex-start; }
.ib span { flex: 1; min-width: 0; }
.ib b { font-size: 15px; }
.ib time { font-size: 13px; color: var(--ink-3); white-space: nowrap; padding-top: 1px; }
.ib.new b::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--sleep); margin-right: 6px; vertical-align: 1px; }

/* Tab bar: left pill + right bubble */
.tabbar { position: fixed; z-index: 30; left: 0; right: 0; bottom: max(18px, calc(var(--safe-b) + 4px)); display: flex; justify-content: space-between; align-items: center; gap: 12px; max-width: 480px; margin: 0 auto; padding: 0 16px; pointer-events: none; }
.tabbar > * { pointer-events: auto; }
.tabs { position: relative; display: flex; padding: 4px; border-radius: 32px; gap: 2px; }
/* the sliding pill behind the active tab (and the switch's active button): js/transitions.js */
.ind { position: absolute; left: 0; top: 0; z-index: 0; pointer-events: none; border-radius: 26px; background: var(--seg-bg); box-shadow: inset 0 0 0 .5px var(--line); }
.tabs > .tab { position: relative; z-index: 1; transition: color .2s ease, transform .18s var(--spring-soft, cubic-bezier(.32, .72, 0, 1)); }
.tabs.has-ind > .tab.on { background: none; box-shadow: none; }
.tab { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 16px 6px; border-radius: 26px; color: var(--ink-2); font-size: 10.5px; font-weight: 600; min-width: 78px; }
.tab .ic { width: 23px; height: 23px; }
.tab.on { color: var(--ink); background: var(--seg-bg); box-shadow: inset 0 0 0 .5px var(--line); }
.bubble { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; transition: transform .18s var(--spring-soft, cubic-bezier(.32, .72, 0, 1)); }
.bubble > * { grid-area: 1 / 1; }
.bubble-old { display: grid; place-items: center; pointer-events: none; }
.bubble .ic { width: 24px; height: 24px; }

/* Sheets */
#sheet-host { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
#sheet-host.open { pointer-events: auto; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(15, 17, 22, .3); opacity: 0; transition: opacity .3s ease; }
[data-theme='dark'] .sheet-backdrop { background: rgba(0, 0, 0, .45); }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-width: 480px; margin: 0 auto; max-height: 88vh; max-height: 88dvh; overflow: auto; background: var(--sheet); -webkit-backdrop-filter: blur(30px) saturate(170%); backdrop-filter: blur(30px) saturate(170%); border-radius: 26px 26px 0 0; padding: 10px 20px calc(var(--safe-b) + 22px); transform: translateY(100%); transition: transform .34s cubic-bezier(.32, .72, 0, 1); overscroll-behavior-y: contain; box-shadow: inset 0 1px 0 var(--pane-hi), 0 0 0 .5px var(--line-2), 0 -10px 40px var(--shadow-c); }
#sheet-host.in .sheet { transform: none; }
#sheet-host.in .sheet-backdrop { opacity: 1; }
.grabber { width: 38px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 0 auto 14px; }
.sheet h2 { font-size: 22px; margin: 3px 0 4px; }
.sheet h2.with-icon { display: flex; gap: 10px; align-items: flex-start; }
.sheet h2.with-icon .ic { width: 26px; height: 26px; margin-top: 2px; }
.h-time { font-weight: 500; color: var(--ink-2); font-size: 18px; white-space: nowrap; }
.rows { margin-top: 10px; }
.row { display: flex; width: 100%; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: .5px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row span { flex: 1; display: flex; flex-direction: column; }
.row small { color: var(--ink-2); font-size: 13px; }
.row .chev { color: var(--ink-3); width: 16px; }
.sheet .field { border-bottom: .5px solid var(--line-2); }
.sheet .field input { font-size: 20px; font-weight: 600; }
.ok-text { color: var(--ok); }

/* Editing something she logged: steppers in 5-minute steps, drag the time to scrub */
.steppers { margin: 14px 0 4px; display: flex; flex-direction: column; gap: 10px; }
.stepper { display: grid; grid-template-columns: 54px 48px 1fr 48px; align-items: center; gap: 8px; }
.st-name { font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.st-btn { display: grid; place-items: center; padding: 0; height: 48px; border-radius: 14px; font-size: 24px; font-weight: 500; line-height: 1; background: var(--pane-2); box-shadow: inset 0 1px 0 var(--pane-hi), inset 0 0 0 1px var(--line-2); touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.st-btn:active { background: var(--pane-3); }
.st-val { display: block; text-align: center; font-size: 24px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; padding: 8px 0; border-radius: 12px; cursor: ew-resize; touch-action: none; user-select: none; -webkit-user-select: none; }
.st-val small { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-left: 2px; }
.st-val.drag { background: var(--pane-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.st-len { min-height: 18px; margin: 6px 0 0; text-align: center; }
.btn:disabled { opacity: .45; }
.toast .toast-undo { flex: none; align-self: center; font-weight: 650; color: var(--ink); }

/* Check-in */
.ci { margin: 22px 4px 6px; }
.ci-track { position: relative; height: 44px; touch-action: none; cursor: ew-resize; }
.ci-track::before { content: ""; position: absolute; left: 0; right: 0; top: 21px; border-top: 1.5px solid var(--line-2); }
.ci-plan { position: absolute; top: 8px; height: 28px; border-radius: 8px; border: 1.5px dashed var(--fixed); }
.ci-bar { position: absolute; top: 12px; height: 20px; border-radius: 6px; background: color-mix(in oklab, var(--sleep) 22%, transparent); box-shadow: inset 0 0 0 1.5px var(--sleep); }
.ci-h { position: absolute; top: 4px; width: 22px; height: 36px; margin-left: -11px; border-radius: 11px; background: var(--pane-3); box-shadow: 0 0 0 1.5px var(--sleep), 0 2px 6px var(--shadow-c); touch-action: none; }
.ci-ticks { position: relative; height: 18px; margin-top: 6px; }
.ci-ticks span { position: absolute; transform: translateX(-50%); font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.ci-result { font-size: 26px; font-weight: 750; letter-spacing: -0.02em; margin-top: 8px; }

/* Dimming during avoid-light windows */
.dimmer { position: fixed; inset: 0; z-index: 45; pointer-events: none; background: rgba(60, 34, 8, .14); mix-blend-mode: multiply; opacity: 0; transition: opacity 1.5s; }
body.dim .dimmer { opacity: 1; }
/* the field itself warms and darkens too (ambient.js) */

.preview-flag { position: fixed; bottom: calc(max(18px, calc(var(--safe-b) + 4px)) + 68px); left: 50%; transform: translateX(-50%); z-index: 40; font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); background: var(--pane-3); padding: 2px 8px; border-radius: 99px; box-shadow: 0 0 0 .5px var(--line-2); pointer-events: none; }

/* Zone pill in the date header. Plain text on the calm field; with ?ambient=neutral (no zone
   color in the field) it is a small tinted pill, two tones across a flight. */
.zone-pill { white-space: nowrap; }
[data-ambient='neutral'] .zone-pill { display: inline-block; font-size: 13px; padding: 0 8px 0 18px; margin-left: -1px; border-radius: 99px; position: relative; font-weight: 600; line-height: 20px; text-shadow: none;
  color: oklch(0.36 0.07 var(--zh2));
  background: linear-gradient(90deg, oklch(0.92 0.05 var(--zh) / .9), oklch(0.92 0.05 var(--zh2) / .9));
  box-shadow: inset 0 0 0 .5px oklch(0.6 0.08 var(--zh2) / .35); }
[data-ambient='neutral'] .zone-pill::before { content: ""; position: absolute; left: 7px; top: 6.5px; width: 7px; height: 7px; border-radius: 50%; background: oklch(0.62 0.13 var(--zh2)); }
[data-theme='dark'][data-ambient='neutral'] .zone-pill { color: oklch(0.9 0.05 var(--zh2));
  background: linear-gradient(90deg, oklch(0.34 0.06 var(--zh) / .85), oklch(0.34 0.06 var(--zh2) / .85));
  box-shadow: inset 0 0 0 .5px oklch(0.7 0.08 var(--zh2) / .3); }
[data-theme='dark'][data-ambient='neutral'] .zone-pill::before { background: oklch(0.75 0.12 var(--zh2)); }

/* Draft trips: cities and dates, flight times still to come. The card is outlined in amber and asks for them. */
.trip.is-draft { background: linear-gradient(var(--amber-wash), var(--amber-wash)), var(--pane-2); box-shadow: inset 0 1px 0 var(--pane-hi), 0 12px 32px -16px var(--shadow-c); outline: 1.5px dashed var(--amber-line); outline-offset: -1.5px; }
.tag.tag-draft { color: var(--amber-ink); background: var(--amber-bg); box-shadow: inset 0 0 0 1px var(--amber-line); }
.trip-cta { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--amber-line); font-size: 15px; font-weight: 650; color: var(--amber-ink); }
.trip-cta .ic { width: 16px; height: 16px; flex: none; transform: rotate(45deg); }
.trip-cta span { flex: 1; text-align: left; }
.trip-cta .chev { transform: none; opacity: .8; }
.wplane.guess { left: 50%; pointer-events: none; box-shadow: 0 0 0 1.2px color-mix(in oklab, var(--flight) 45%, transparent); }
.section-label.sub { padding: 0; margin: 0; }

/* City picker: a typeahead over every city (and airport codes). */
.cpick { position: relative; display: block; width: 100%; }
.cpick-q { width: 100%; }
.li .cpick-q { border: 0; background: var(--seg-bg); border-radius: 8px; padding: 7px 9px; font-size: 16px; color: var(--ink); outline: none; }
.li.home-city { align-items: stretch; }
.form .adapt-row { margin: 16px 0 0; }
.cpick-list { position: absolute; left: -6px; right: -6px; top: calc(100% + 6px); z-index: 32; padding: 5px; border-radius: 14px; background: var(--base); box-shadow: 0 0 0 .5px var(--line-2), 0 14px 36px -10px var(--shadow-c); display: flex; flex-direction: column; animation: drop .14s ease-out; max-height: min(330px, 52vh); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.cpick-list[hidden] { display: none; }
.cpick-opt { display: flex; flex-direction: column; align-items: flex-start; text-align: left; padding: 8px 10px; border-radius: 9px; color: var(--ink); min-height: 44px; justify-content: center; }
.cpick-opt span { font-size: 16px; font-weight: 550; }
.cpick-opt small { font-size: 12.5px; color: var(--ink-2); }
.cpick-opt.on { background: var(--pane-2); box-shadow: inset 0 0 0 .5px var(--line); }
.cpick-opt + .cpick-opt { margin-top: 2px; }
.cpick-none { padding: 10px; font-size: 14px; color: var(--ink-2); }
.credits a { color: inherit; }
/* An open picker lifts its card above the ones after it and lets the list hang out of it. */
.glass:has(.cpick-list:not([hidden])), .form-group:has(.cpick-list:not([hidden])) { overflow: visible; position: relative; z-index: 6; }

/* Day: the pane runs on past the bottom of the screen with nothing in it. Its own padding
   takes over the screen's bottom padding, so 11 pm still stops above the tab bar. */
.tl.dayv { box-sizing: content-box; padding-bottom: calc(var(--safe-b) + 120px); }
.screen:has(.tl.dayv) { padding-bottom: 0; }

/* Week: a flight that runs on into the next column meets the column edge square, so the
   rail reads as one line across days (js/week.js tiles the columns in time). A day longer or
   shorter than 24 hours (flying across zones) says how long it was under its place. */
.wb.rail.cont-top, .wb.travel.cont-top { border-top-left-radius: 0; border-top-right-radius: 0; }
.wb.rail.cont-bot, .wb.travel.cont-bot { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.wh .wlen { font-style: normal; font-weight: 650; }

/* Dimmed (avoid-light windows), light appearance: the glass stays glass. White glass over the
   darkened warm scene read as muddy gray, so while dimmed the live glass (Now card, header,
   tab bar, bubble) is a warm cream with a soft amber rim and inner glow instead, and the
   backdrop keeps more of its color. Values checked for AA with work/v8/check_contrast.py. */
[data-theme='light'].dim, [data-theme='light'].dim.scene-on[data-scene] {
  --glass-live: rgba(255, 238, 214, .62);
  --pane-hi: rgba(255, 247, 234, .95);
  --chrome: rgba(252, 241, 226, .82);
  --pane: rgba(255, 243, 228, .6);
  --pane-2: rgba(255, 243, 228, .56);
  --ink-2: #363940;
  --ink-3: #3a3d44;
  --live-blur: blur(34px) saturate(140%) brightness(1.4);
}
[data-theme='light'].dim .next, [data-theme='light'].dim .tabs, [data-theme='light'].dim .bubble {
  box-shadow: inset 0 1px 0 var(--pane-hi), inset 0 0 0 .5px rgba(214, 150, 70, .35), inset 0 0 28px rgba(255, 196, 120, .22), 0 0 0 .5px rgba(120, 70, 20, .18), 0 14px 36px -14px rgba(80, 40, 10, .3);
}

/* Figures that line up or tick: tabular (Familjen's default, said outright). */
.gl, .blk-time, .next-clocks, .h-time, .big, .huge, .ci-result, .ci-ticks, .wgut span, .now-line span, .nb-v, .stat b, .tnum { font-family: var(--num); font-variant-numeric: tabular-nums; }

/* Landing screen (js/landing.js): what a browser tab shows instead of the app. Phone first,
   375-430 px; plain base color, no field. */
.landing { max-width: 440px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; text-align: center;
  padding: calc(var(--safe-t) + 56px) calc(max(24px, env(safe-area-inset-right, 0px))) calc(var(--safe-b) + 40px) calc(max(24px, env(safe-area-inset-left, 0px))); }
.landing .app-icon { display: block; width: 108px; height: 108px; margin: 0 auto 20px; border-radius: 24px;
  box-shadow: 0 0 0 .5px var(--line-2), 0 14px 30px -14px var(--shadow-c); }
.landing h1 { font-size: 34px; font-weight: 650; line-height: 1.1; display: inline-block; padding-bottom: 0.08em;
  background: linear-gradient(180deg, #d98500 30%, #c97a00 45%, #1f7fd6 70%); -webkit-background-clip: text; background-clip: text; color: transparent; }
@media (prefers-color-scheme: dark) { .landing h1 { background-image: linear-gradient(180deg, #ffc24a 30%, #5cc0ff 70%); } }
.landing .what { margin: 12px auto 0; max-width: 330px; text-wrap: balance; font-size: 19px; line-height: 1.35; color: var(--ink); }
.landing .what span { display: block; text-wrap: balance; }
.landing .private { margin: 10px auto 0; max-width: 330px; text-wrap: balance; font-size: 15px; color: var(--ink-2); }
.landing .install { margin: 32px 0 0; padding: 22px 20px 20px; border-radius: var(--radius); text-align: left;
  background: var(--pane-3); box-shadow: inset 0 1px 0 var(--pane-hi), 0 0 0 .5px var(--line-2), 0 12px 32px -18px var(--shadow-c); }
.landing h2 { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; margin: 0 0 14px; }
.landing .steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.landing .steps li { counter-increment: s; position: relative; padding: 0 0 0 40px; min-height: 28px; }
.landing .steps li + li { margin-top: 14px; }
.landing .steps li[hidden] { display: none; }
.landing .steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-size: 14px; font-weight: 650; background: var(--seg-bg); color: var(--ink); }
.landing .steps p { margin: 0; padding-top: 3px; font-size: 16px; line-height: 1.4; }
.landing .steps p.sub { padding-top: 0; margin-top: 4px; font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.landing .key { display: inline-grid; place-items: center; width: 28px; height: 28px; margin: -4px 2px; vertical-align: middle; position: relative; top: -1px;
  border-radius: 8px; background: var(--seg-on); box-shadow: 0 0 0 .5px var(--line-2); color: var(--ink); }
.landing .steps p.sub .key { width: 24px; height: 24px; margin: -3px 2px; border-radius: 7px; }
.landing .glyph { width: 20px; height: 20px; display: block; }
.landing .sub .glyph { width: 17px; height: 17px; }
.landing .hint { margin: 16px 0 0; font-size: 14px; color: var(--ink-2); }
.landing .prompt { margin: 0 0 16px; }
.landing .prompt[hidden], .landing .qr[hidden] { display: none; }
.landing .prompt .btn { margin: 0; }
.landing .then { margin: 14px 0 0; padding: 0; border: 0; font-size: 15px; color: var(--ink-2); text-align: center; }
.landing .steps[hidden], .landing .then[hidden] { display: none; }
.landing .done { margin: 0; font-weight: 600; color: var(--ok); }
.landing .desk { margin: 0; font-size: 16px; text-align: center; }
.landing .qr { width: 168px; margin: 18px auto 0; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 .5px var(--line-2); }
.landing .qr svg { display: block; width: 100%; height: auto; }
.landing .url { margin: 10px 0 0; font-size: 13px; text-align: center; color: var(--ink-2); overflow-wrap: anywhere; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html[data-mode='landing'] .boot { visibility: hidden; }

/* Press: things you tap give a little under the finger. Not while a pull or a swipe is on. */
.blk, .next, .btn, .chip, .row, .card, .trip, .li, .icon-btn, .pill-btn { transition: transform .18s var(--spring-soft, cubic-bezier(.32, .72, 0, 1)); }
.blk:active, .chip:active, .pill-btn:active, .icon-btn:active { transform: scale(.96); }
.next:active, .btn:active, .card:active, .trip:active, .row:active, .li:active { transform: scale(.98); }
.tabs > .tab:active, .bubble:active { transform: scale(.94); }
html.pulling .blk:active, html.pulling .next:active { transform: none; }

/* Reduce Motion: no slides, springs or presses. Things change in place. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; animation-delay: 0s !important; }
  .blk:active, .chip:active, .pill-btn:active, .icon-btn:active, .next:active, .btn:active, .card:active, .trip:active, .row:active, .li:active, .tabs > .tab:active, .bubble:active { transform: none; }
}
