/* What's My Tide? — app styles.
   Dark by default because this gets used at dawn, at dusk and on a dock,
   with a full light theme for bright days. All colour comes from tokens. */

:root {
  /* dark is the base palette */
  --ground: #0E1A21;
  --ground-2: #12222B;
  --surface: #16262F;
  --surface-2: #1C303A;
  --ink: #E4EDF1;
  --ink-2: #B9C8D0;
  --muted: #8598A3;
  --line: #263A45;
  --line-soft: #1D2E38;

  --accent: #5FB8C6;
  --accent-deep: #1C7C8A;
  --accent-soft: #14323A;
  --accent-ink: #8FD3DE;

  --sand: #D2AC6E;
  --sand-soft: #33291A;
  --sand-ink: #E5C68E;

  --ok: #6CC49A;
  --ok-soft: #14301F;
  --warn: #E2A33C;
  --warn-soft: #33260F;
  --bad: #E5715C;
  --bad-soft: #35191A;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35);
  --maxw: 720px;

  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --ground: #F2F6F7;
    --ground-2: #E8EFF1;
    --surface: #FFFFFF;
    --surface-2: #F4F8F9;
    --ink: #14232E;
    --ink-2: #3B4C57;
    --muted: #63757F;
    --line: #D5DFE3;
    --line-soft: #E7EEF0;

    --accent: #14707E;
    --accent-deep: #1C7C8A;
    --accent-soft: #DDEFF2;
    --accent-ink: #0F5A66;

    --sand: #A8823F;
    --sand-soft: #F5EDDD;
    --sand-ink: #6F5426;

    --ok: #23795A;
    --ok-soft: #DDF0E7;
    --warn: #9A6B12;
    --warn-soft: #F7EBD5;
    --bad: #B84632;
    --bad-soft: #F9E3DF;

    --shadow: 0 1px 2px rgba(20, 35, 46, .08);
    color-scheme: light;
  }
}

:root[data-theme="light"] {
  --ground: #F2F6F7;
  --ground-2: #E8EFF1;
  --surface: #FFFFFF;
  --surface-2: #F4F8F9;
  --ink: #14232E;
  --ink-2: #3B4C57;
  --muted: #63757F;
  --line: #D5DFE3;
  --line-soft: #E7EEF0;

  --accent: #14707E;
  --accent-deep: #1C7C8A;
  --accent-soft: #DDEFF2;
  --accent-ink: #0F5A66;

  --sand: #A8823F;
  --sand-soft: #F5EDDD;
  --sand-ink: #6F5426;

  --ok: #23795A;
  --ok-soft: #DDF0E7;
  --warn: #9A6B12;
  --warn-soft: #F7EBD5;
  --bad: #B84632;
  --bad-soft: #F9E3DF;

  --shadow: 0 1px 2px rgba(20, 35, 46, .08);
  color-scheme: light;
}

/* ------------------------------------------------------------------ base */

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

h1, h2, h3 {
  font-family: "Familjen Grotesk", "IBM Plex Sans", system-ui, sans-serif;
  line-height: 1.18;
  text-wrap: balance;
  margin: 0;
}

p { margin: 0 0 10px; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent-ink); }

.mono, .num { font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.quiet { color: var(--ink-2); font-size: 14px; margin: 4px 0 0; }
.small { font-size: 13px; }
.plain { color: var(--ink-2); margin: 6px 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --------------------------------------------------------------- layout */

.main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
  padding-block: 12px calc(72px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; }
.row.gap { gap: 10px; }
.row.gap-sm { gap: 6px; }
.row.wrap { flex-wrap: wrap; }

/* --------------------------------------------------------------- header */

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  /* viewport-fit=cover + a translucent status bar put the page under the
     notch, so the header pads itself clear of it. */
  padding: calc(10px + env(safe-area-inset-top, 0px))
           calc(16px + env(safe-area-inset-right, 0px))
           10px
           calc(16px + env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}

.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); }
.brand img { border-radius: 7px; display: block; }
.brand-name { font-family: "Familjen Grotesk", sans-serif; font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.header-mid { min-width: 0; }
.header-title { font-family: "Familjen Grotesk", sans-serif; font-weight: 600; font-size: 16px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  padding: 0;
}
.icon-btn:hover { color: var(--ink); border-color: var(--accent); }
.icon-btn svg { width: 18px; height: 18px; }

.place-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 9px 16px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-2);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
}
.place-bar svg { width: 15px; height: 15px; color: var(--accent); flex: none; }
.place-name { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-change { margin-left: auto; color: var(--accent-ink); font-size: 13px; flex: none; }

/* ----------------------------------------------------------------- card */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.card-head { margin-bottom: 12px; }
.card-title { font-size: 17px; font-weight: 600; }
.card-sub { color: var(--muted); font-size: 13.5px; margin: 3px 0 0; }
.sub-title { font-size: 14px; font-weight: 600; color: var(--ink-2); margin: 2px 0 8px; }

/* ------------------------------------------------------------- now card */

.now {
  background: linear-gradient(160deg, var(--accent-soft), var(--surface) 70%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px 16px;
}
.now-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.now-height { display: flex; align-items: baseline; gap: 6px; }
.now-value {
  font-family: "Familjen Grotesk", sans-serif;
  font-size: clamp(46px, 15vw, 64px);
  font-weight: 700;
  line-height: .95;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.now-unit { font-size: 18px; color: var(--muted); font-weight: 500; }
.now-character { margin: 8px 0 0; color: var(--ink-2); font-size: 14.5px; }
.now-arrow { font-size: 12px; }
.now-arrow.up { color: var(--accent); }
.now-arrow.down { color: var(--sand); }
.now-moon { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; }
.moon-emoji { font-size: 26px; line-height: 1; }
.now-next { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line-soft); font-size: 14.5px; color: var(--ink-2); }
.now-next strong { color: var(--ink); }

/* ---------------------------------------------------------------- curve */

.curve { display: block; width: 100%; height: 210px; touch-action: pan-y; }
.curve-card { padding: 12px 10px 8px; }
.scrub-readout {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  text-align: center;
  margin: 6px 0 2px;
  color: var(--ink-2);
  min-height: 18px;
}

/* ---------------------------------------------------------------- turns */

.turns { display: flex; flex-direction: column; gap: 2px; }
.turn {
  display: grid;
  grid-template-columns: 48px minmax(76px, auto) 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14.5px;
}
.turn:last-child { border-bottom: none; }
.turn-kind {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  padding: 2px 6px; border-radius: 4px; text-align: center;
}
.turn-kind.high { background: var(--accent-soft); color: var(--accent-ink); }
.turn-kind.low { background: var(--sand-soft); color: var(--sand-ink); }
.turn-time { font-family: "IBM Plex Mono", monospace; font-variant-numeric: tabular-nums; white-space: nowrap; }
.turn-h { font-family: "IBM Plex Mono", monospace; font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.turn-rel { font-size: 12.5px; text-align: right; }

.glance {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}
.glance-item { display: flex; flex-direction: column; gap: 1px; }
.glance-k { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.glance-v { font-size: 14.5px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- chips */

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.chip {
  flex: none;
  display: flex; flex-direction: column; gap: 1px;
  padding: 9px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
}
.chip:hover { border-color: var(--accent); }
.chip-title { font-weight: 600; font-size: 14px; }
.chip-tag { font-size: 11px; color: var(--muted); }

/* ------------------------------------------------------------ tool grid */

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tool-grid.wide { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.tool {
  display: flex; flex-direction: column; gap: 4px;
  padding: 13px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--ink);
  transition: border-color .12s, transform .12s;
}
.tool:hover { border-color: var(--accent); transform: translateY(-1px); }
.tool-icon { color: var(--accent); }
.tool-icon svg { width: 20px; height: 20px; }
.tool-title { font-weight: 600; font-size: 14.5px; }
.tool-blurb { font-size: 12.5px; color: var(--muted); line-height: 1.35; }

/* -------------------------------------------------------------- feature */

.feature-head { padding: 4px 2px 0; }
.feature-title { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.feature-blurb { color: var(--muted); font-size: 14.5px; margin: 4px 0 0; }
.hub-intro { padding: 4px 2px; }
.hub-title { font-size: 26px; font-weight: 700; }
.hub-blurb { color: var(--muted); margin: 5px 0 0; }

/* --------------------------------------------------------------- inputs */

.input {
  width: 100%;
  padding: 9px 11px;
  background: var(--ground-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}
.input:focus { border-color: var(--accent); outline: none; }
select.input { appearance: none; background-image: none; cursor: pointer; }
textarea.input { resize: vertical; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; }
.field-label { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 500; }
.field-hint { font-size: 12.5px; color: var(--muted); margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 12px; }

.btn {
  padding: 9px 15px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font: inherit;
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { background: none; border-color: transparent; color: var(--muted); padding: 6px 10px; font-size: 13px; }
.btn-ghost:hover { color: var(--bad); border-color: var(--line); }
.btn-active { background: var(--sand); border-color: var(--sand); color: #1b1408; }

.switch { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.switch input { width: 17px; height: 17px; accent-color: var(--accent-deep); }
.range { width: 100%; accent-color: var(--accent-deep); }

/* ---------------------------------------------------------------- lists */

.list { display: flex; flex-direction: column; }
.list-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14.5px;
}
.list-row:last-child { border-bottom: none; }
.list-row strong { font-weight: 600; }

.search-results { display: flex; flex-direction: column; max-height: 320px; overflow-y: auto; }
.search-results.big { max-height: 55vh; }
.search-item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
  font: inherit;
  font-size: 14.5px;
  text-align: left;
  cursor: pointer;
}
.search-item:hover { background: var(--surface-2); }

/* --------------------------------------------------------------- badges */

.badge {
  display: inline-block;
  padding: 1px 7px;
  margin-left: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  white-space: nowrap;
  vertical-align: middle;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }

/* ----------------------------------------------------------- stats/table */

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; margin: 12px 0 0; }
.stat { display: flex; flex-direction: column; gap: 1px; }
.stat-k { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.stat-v { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }

.table-wrap { overflow-x: auto; margin: 10px 0 0; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 360px; }
table.data th {
  text-align: left; padding: 7px 9px;
  font-family: "IBM Plex Mono", monospace; font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td { padding: 8px 9px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data td.num { font-family: "IBM Plex Mono", monospace; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data td.num.bad { color: var(--bad); }
table.data tr.row-active td { background: var(--accent-soft); }

/* --------------------------------------------------------------- notices */

.notice {
  margin: 10px 0 0;
  padding: 9px 12px;
  background: var(--sand-soft);
  border-left: 3px solid var(--sand);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink-2);
  font-size: 13.5px;
}

.source-note {
  display: flex; align-items: flex-start; gap: 7px;
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}
.conf {
  flex: none;
  padding: 1px 6px;
  border-radius: 3px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.conf-live { background: var(--ok-soft); color: var(--ok); }
.conf-source { background: var(--accent-soft); color: var(--accent-ink); }
.conf-derived { background: var(--accent-soft); color: var(--accent-ink); }
.conf-estimate { background: var(--warn-soft); color: var(--warn); }
.conf-illustrative { background: var(--bad-soft); color: var(--bad); }
.conf-private { background: var(--surface-2); color: var(--muted); }

.alert { padding: 11px 13px; border-radius: var(--radius-sm); margin-bottom: 12px; font-size: 14px; }
.alert p { margin: 3px 0 0; font-size: 13.5px; }
.alert-ok { background: var(--ok-soft); border: 1px solid var(--ok); color: var(--ok); }
.alert-warn { background: var(--warn-soft); border: 1px solid var(--warn); color: var(--warn); }
.alert-bad { background: var(--bad-soft); border: 1px solid var(--bad); color: var(--bad); }
.alert p { color: var(--ink-2); }

.empty { padding: 18px 0; text-align: center; color: var(--muted); }
.empty p { margin: 0; }
.empty-hint { font-size: 13px; margin-top: 5px !important; }

.fatal { padding: 32px 16px; text-align: center; }
.fatal h2 { font-size: 19px; margin-bottom: 6px; }

.splash { display: grid; place-items: center; gap: 14px; padding: 80px 16px; color: var(--muted); }
.splash img { border-radius: 14px; opacity: .85; }

/* ---------------------------------------------------------------- toast */

.toast {
  position: fixed;
  left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 20px);
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s, transform .18s;
  z-index: 60;
  max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.warn { border-color: var(--warn); color: var(--warn); }
.toast.ok { border-color: var(--ok); color: var(--ok); }

/* --------------------------------------------------------------- sensory */

.pulse-stage { display: grid; place-items: center; padding: 18px 0 10px; }
.pulse-ring {
  width: 132px; height: 132px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  display: grid; place-items: center;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
}
.pulse-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); }
@keyframes beat {
  0% { transform: scale(1); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); }
  60% { transform: scale(1.12); box-shadow: 0 0 0 26px transparent; }
  100% { transform: scale(1); box-shadow: 0 0 0 0 transparent; }
}
.pulse-ring.beat { animation: beat var(--beat-ms, 600ms) ease-out; }
.pulse-readout { text-align: center; font-size: 13.5px; color: var(--ink-2); font-family: "IBM Plex Mono", monospace; }

.breath-stage { display: grid; place-items: center; padding: 26px 0; min-height: 200px; }
.breath-orb {
  width: 160px; height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, var(--accent), var(--accent-deep) 70%);
  transform: scale(.55);
  transition: transform .1s linear;
  opacity: .9;
}
.breath-phase { text-align: center; font-size: 19px; font-weight: 600; font-family: "Familjen Grotesk", sans-serif; margin: 0; }
.breath-count { text-align: center; color: var(--muted); font-size: 13px; margin: 2px 0 12px; }

.organism-canvas { display: block; width: 100%; height: 300px; }

/* --------------------------------------------------------------- ecology */

.gauge-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 12px; }
.gauge { display: flex; flex-direction: column; gap: 4px; }
.gauge-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.gauge-band { font-size: 17px; font-weight: 600; font-family: "Familjen Grotesk", sans-serif; }
.gauge-band.ok { color: var(--ok); }
.gauge-band.warn { color: var(--warn); }
.gauge-band.bad { color: var(--bad); }
.gauge-track { height: 5px; background: var(--line-soft); border-radius: 3px; overflow: hidden; }
.gauge-fill { height: 100%; border-radius: 3px; background: var(--accent); }
.gauge-fill.ok { background: var(--ok); }
.gauge-fill.warn { background: var(--warn); }
.gauge-fill.bad { background: var(--bad); }

.creature { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.creature:last-child { border-bottom: none; }
.creature-emoji { font-size: 24px; line-height: 1.2; flex: none; }
.creature-body { min-width: 0; flex: 1; }
.creature-head { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.creature-window { margin: 5px 0 0; font-size: 13px; }
.creature-window .mono { color: var(--accent-ink); }

.meter { height: 5px; background: var(--line-soft); border-radius: 3px; overflow: hidden; min-width: 54px; }
.meter-fill { height: 100%; background: var(--accent); border-radius: 3px; }

.oracle-line { font-size: 15px; line-height: 1.55; color: var(--ink-2); }

/* ----------------------------------------------------------- speculative */

.twin { padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.twin:last-child { border-bottom: none; }
.twin-head { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; margin-bottom: 3px; }
.twin .meter { margin-top: 7px; }

.legend-line { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.swatch { display: inline-block; width: 16px; height: 3px; border-radius: 2px; vertical-align: middle; }
.swatch-teal { background: var(--accent); }
.swatch-ghost { background: repeating-linear-gradient(90deg, var(--bad) 0 5px, transparent 5px 9px); }

.music-bar { height: 4px; background: var(--line-soft); border-radius: 2px; overflow: hidden; margin: 10px 0 6px; }
.music-fill { height: 100%; width: 0; background: var(--accent); transition: width .25s linear; }
.music-now { text-align: center; font-family: "IBM Plex Mono", monospace; font-size: 13px; color: var(--ink-2); margin: 0 0 12px; min-height: 19px; }
.score-row { border-bottom: 1px solid var(--line-soft); }

/* ------------------------------------------------------------- practical */

.route { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.route:last-child { border-bottom: none; }
.route-head { display: flex; align-items: center; flex-wrap: wrap; gap: 3px; margin-bottom: 7px; }
.windows { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }
.window {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px;
  background: var(--ok-soft);
  color: var(--ok);
  border: 1px solid var(--ok);
  border-radius: var(--radius-sm);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12.5px;
}
.window-dark { background: var(--surface-2); color: var(--muted); border-color: var(--line); }
.window-tag { font-size: 10px; opacity: .75; text-transform: uppercase; letter-spacing: .04em; }

.timeline-wrap { margin-top: 4px; }
.timeline { position: relative; height: 9px; background: var(--line-soft); border-radius: 5px; overflow: hidden; }
.timeline-block { position: absolute; top: 0; bottom: 0; background: var(--ok); border-radius: 3px; }
.timeline-block.dark { background: var(--muted); opacity: .55; }
.timeline-axis { display: flex; justify-content: space-between; font-family: "IBM Plex Mono", monospace; font-size: 10px; color: var(--muted); margin-top: 3px; }

/* ------------------------------------------------------------- narrative */

.myth-text { font-size: 16.5px; line-height: 1.62; color: var(--ink); margin-bottom: 12px; }
.mood-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px; margin-bottom: 12px; }
.mood {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 11px 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.mood:hover { border-color: var(--accent); }
.mood-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.mood-emoji { font-size: 21px; line-height: 1; }
.insight { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.insight:last-child { border-bottom: none; }
.insight p { margin: 3px 0 0; color: var(--ink-2); font-size: 14px; }

/* -------------------------------------------------------------------- ar */

.ar-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 62vh;
  background: var(--ground-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.ar-stage::after {
  content: "Camera off";
  color: var(--muted);
  font-size: 13px;
}
.ar-stage.ar-live::after, .ar-stage.ar-fallback::after { content: none; }
.ar-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ar-overlay { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------------------------------------------------------------- onboard */

.onboard { max-width: 520px; padding-block: 40px 60px; text-align: left; }
.onboard-mark { border-radius: 16px; align-self: flex-start; }
.onboard-title { font-size: 30px; font-weight: 700; margin-top: 6px; }
.onboard-sub { color: var(--ink-2); font-size: 15.5px; margin: 6px 0 6px; }
.onboard-note { font-size: 13px; color: var(--muted); margin-top: 10px; }

/* ---------------------------------------------------------------- footer */

.app-footer {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  font-size: 12.5px;
  color: var(--muted);
}
.app-footer p { margin: 0 0 5px; }

/* ---------------------------------------------------------------- motion */

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .breath-orb { transition: none; }
}

@media (max-width: 420px) {
  .gauge-pair { grid-template-columns: 1fr; }
  .turn { grid-template-columns: 44px minmax(74px, auto) 1fr; }
  .turn-rel { display: none; }
}
