/* AERO — Meridian (S129). The design system for the ONE Aero platform.
 *
 * Sir chose MERIDIAN on 14 Sep 2026 (docs/design/aero-platform-s128/README.md).
 * Loaded AFTER style.css and re-points the tokens every /exec page already
 * uses, so the Executive pages take the new look without being rewritten and
 * no page declares its own colours.
 *
 *   NIGHT (body.theme-dark) — the chosen design: atmospheric navy lit from
 *     above, faint grain, one champagne accent for "now", the countdown and
 *     the primary action.
 *   DAY (body.theme-light) — its OWN design, not an inversion: warm paper under
 *     morning light, navy ink, a bronze-champagne that still reads as text on
 *     cream. The Next panel stays a navy dial in both modes — the one
 *     instrument on the page.
 *
 * SILVER AND BLUE (S167, Sir 18 Oct: "make all the white logos and buttons etc
 * silver and blue txt. theme is silver and blue"). Marks and filled controls
 * that were white, cream or champagne are brushed silver (--sv-*), and the
 * words on them are navy (--sv-ink). Night ink is a cool silver-white, not
 * cream; day paper is a cool silver, not warm cream. One set of tokens below —
 * no control states its own white.
 *
 * Every text/background pair below is checked for 4.5:1 by
 * scripts/verify_meridian_personal.py, which reads THIS file — change a token
 * and the gate re-measures it.
 */

@font-face {
  font-family: "Manrope";
  src: url("/exec/static/fonts/manrope.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

/* ── Tokens · SILVER (both modes) ─────────────────────────────────── */
:root {
  --sv-hi:   #E4E5E6;
  --sv-mid:  #C3C4C5;
  --sv-lo:   #A5A6A5;
  --sv-fill: linear-gradient(180deg, #E4E5E6 0%, #C3C4C5 52%, #A5A6A5 100%);
  --sv-fill-hover: linear-gradient(180deg, #F0F1F2 0%, #D2D3D4 52%, #B4B5B4 100%);
  --sv-ink:  #0A1530;
  --sv-edge: rgba(10, 21, 48, 0.16);
  --sv-lift: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 4px 14px -6px rgba(2, 6, 20, 0.45);
}

/* ── Tokens · SILVER by day = COMPANY BLUE (Sir, 18 Oct) ─────────────
 * "on light mode everything that is silver in dark mode should be our
 * company blue". The Aeronaut's brand navy #0A1530 (brand tokens: silver
 * #A5A6A5 + navy #0A1530). By day every silver control is navy with silver
 * words; night keeps brushed silver with navy words. One override, here. */
body:not(.theme-dark) {
  --sv-hi:   #2A3B66;
  --sv-mid:  #1A2A4F;
  --sv-lo:   #0A1530;
  --sv-fill: linear-gradient(180deg, #1E2E57 0%, #0A1530 100%);
  --sv-fill-hover: linear-gradient(180deg, #2A3B6B 0%, #13214A 100%);
  --sv-ink:  #E4E5E6;
  --sv-edge: rgba(10, 21, 48, 0.55);
  --sv-lift: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 4px 14px -6px rgba(2, 6, 20, 0.40);
}

/* ── Tokens · DAY ─────────────────────────────────────────────────── */
:root,
body.theme-light {
  --canvas:    #ECEEF1;
  --surface-1: #F8F9FA;
  --surface-2: #E1E4E8;
  --surface-3: rgba(10, 21, 48, 0.10);

  --ink:       #0A1530;
  --ink-mid:   #465068;
  --ink-lo:    #5F6882;
  --ink-faint: rgba(10, 21, 48, 0.22);

  /* S167 silver and blue: the accent is Aero blue, not bronze */
  --accent:       #1E4FA6;
  --accent-hi:    #2A5FBD;
  --accent-lo:    #183F86;
  --accent-line:  #5F82C4;
  --accent-faint: rgba(30, 79, 166, 0.09);
  --accent-edge:  rgba(30, 79, 166, 0.30);

  --ok:   #1E7A52;  --ok-faint:   rgba(30, 122, 82, 0.10);
  --warn: #9A5B12;  --warn-faint: rgba(154, 91, 18, 0.10);
  --crit: #B3362B;  --crit-faint: rgba(179, 54, 43, 0.09);
  /* 21 Oct — cockpit priority markers (domains/web/priority.py): meaning only. Day: darker for 4.5:1 on paper. */
  --pri-green: #1E7A52; --pri-amber: #9A5B12; --pri-red: #B3362B;

  --card-fill:   rgba(248, 249, 250, 0.80);
  --card-edge:   rgba(10, 21, 48, 0.07);
  --card-lift:   inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 2px rgba(10, 21, 48, 0.04), 0 12px 32px -18px rgba(10, 21, 48, 0.18);
  --glass-fill:  rgba(248, 249, 250, 0.64);
  --glass-edge:  rgba(10, 21, 48, 0.08);
  --glass-lift:  inset 0 1px 0 rgba(255, 255, 255, 0.85);
  --nav-active:  rgba(10, 21, 48, 0.06);
  --seg-on-bg:   var(--sv-fill);
  --seg-on-ink:  var(--sv-ink);
  --atmos:       radial-gradient(90% 60% at 62% -12%, #F7F8F9 0%, rgba(247, 248, 249, 0) 60%),
                 radial-gradient(50% 40% at 0% 100%, rgba(165, 166, 165, 0.16) 0%, rgba(165, 166, 165, 0) 70%),
                 #ECEEF1;
  --grain-opacity: 0.035;
  --grain-blend:   multiply;

  --bg: var(--canvas); --chrome: transparent; --card-bg: var(--card-fill);
  --rule: var(--surface-3); --divider: var(--surface-3);
  --text-hi: var(--ink); --text-mid: var(--ink-mid); --text-lo: var(--ink-lo);
  --silver: var(--accent); --silver-dim: var(--accent-lo);
  --silver-faint: var(--surface-2); --silver-edge: var(--surface-3);
  --sans:    "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* S167 — the radius scale lives in style.css only (A7). */
  --shadow-1: 0 1px 2px rgba(10, 21, 48, 0.05);
  --shadow-2: 0 12px 32px -18px rgba(10, 21, 48, 0.22);
  --shadow-3: 0 30px 60px -20px rgba(10, 21, 48, 0.30);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ── Tokens · NIGHT ───────────────────────────────────────────────── */
body.theme-dark {
  --canvas:    #0A1530;
  --surface-1: #111E42;
  --surface-2: #17264F;
  --surface-3: rgba(245, 240, 234, 0.09);

  --ink:       #E8EAED;
  --ink-mid:   #A5A6A5;
  --ink-lo:    #8A93AC;
  --ink-faint: rgba(245, 240, 234, 0.22);

  /* S167 silver and blue: a light Aero blue, not champagne */
  --accent:       #A9C1EC;
  --accent-hi:    #C3D4F2;
  --accent-lo:    #93AEE0;
  --accent-line:  #A9C1EC;
  --accent-faint: rgba(169, 193, 236, 0.12);
  --accent-edge:  rgba(169, 193, 236, 0.34);

  --ok:   #86C9A6;  --ok-faint:   rgba(134, 201, 166, 0.12);
  --warn: #E7A764;  --warn-faint: rgba(231, 167, 100, 0.12);
  --crit: #EC8A80;  --crit-faint: rgba(236, 138, 128, 0.12);
  /* Night: brighter, as on a flight deck. */
  --pri-green: #4FD08A; --pri-amber: #F2B347; --pri-red: #FF7A6B;

  --card-fill:   rgba(17, 30, 66, 0.62);
  --card-edge:   rgba(245, 240, 234, 0.07);
  --card-lift:   inset 0 1px 0 rgba(245, 240, 234, 0.06);
  --glass-fill:  rgba(17, 30, 66, 0.55);
  --glass-edge:  rgba(245, 240, 234, 0.08);
  --glass-lift:  inset 0 1px 0 rgba(245, 240, 234, 0.07);
  --nav-active:  rgba(245, 240, 234, 0.07);
  --seg-on-bg:   var(--sv-fill);
  --seg-on-ink:  var(--sv-ink);
  --atmos:       radial-gradient(90% 60% at 62% -12%, #1D2E62 0%, rgba(29, 46, 98, 0) 60%),
                 radial-gradient(50% 40% at 0% 100%, #0E1B40 0%, rgba(14, 27, 64, 0) 70%),
                 #0A1530;
  --grain-opacity: 0.05;
  --grain-blend:   normal;

  --bg: var(--canvas); --chrome: transparent; --card-bg: var(--card-fill);
  --rule: var(--surface-3); --divider: var(--surface-3);
  --text-hi: var(--ink); --text-mid: var(--ink-mid); --text-lo: var(--ink-lo);

  --shadow-1: 0 1px 2px rgba(2, 6, 20, 0.40);
  --shadow-2: 0 18px 40px -18px rgba(2, 6, 20, 0.70);
  --shadow-3: 0 30px 60px -20px rgba(2, 6, 20, 0.70);
}

/* ── Material: atmosphere + grain ─────────────────────────────────── */
html { background: var(--canvas); }
/* --canvas is set on body.theme-dark, which html cannot see: at night the
   root painted day paper, seen as a cream band on rubber-band overscroll on
   the phone and below a tall page (S130 screenshots). */
html:has(body.theme-dark) { background: #0A1530; }
html, body { font-family: var(--sans); font-feature-settings: normal; }
body { background: transparent; color: var(--ink); }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2;
  background: var(--atmos);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: var(--grain-opacity); mix-blend-mode: var(--grain-blend);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23g)'/%3E%3C/svg%3E");
}
::selection { background: var(--accent); color: var(--canvas); }
a:hover { color: var(--ink); }
.num, .kpi-value, .clock-time { font-variant-numeric: tabular-nums; }

/* The old theme painted every region solid; Meridian lets the material show. */
.shell, .top, .topbar, .nav, .sidebar, .rail,
body.theme-dark .nav, body.theme-dark .sidebar, body.theme-dark .top,
body.theme-dark .topbar, body.theme-dark .rail { background: transparent; }
.shell { grid-template-columns: 232px 1fr; grid-template-rows: 72px 1fr; }
.shell.with-rail { grid-template-columns: 232px 1fr 320px; }
.top, .topbar { border-bottom: 0; min-height: 72px; gap: 14px; padding: 0 44px 0 24px; }
.nav, .sidebar { border-right: 0; padding: 12px 16px 24px; }
.rail { border-left: 1px solid var(--rule); }
/* min-width: 0 lets the grid column shrink below its widest child; without it
   one wide row pushed every Executive card past the phone's right edge. */
.main { padding: 8px 44px 48px 24px; min-width: 0; }

/* One logo per mode. style.css's `.top-brand .symbol img { display: block }`
   out-ranks its own `.logo-dark { display: none }`, so day mode showed both. */
.top-brand .symbol img.logo-dark { display: none; }
body.theme-dark .top-brand .symbol img.logo-light { display: none; }
body.theme-dark .top-brand .symbol img.logo-dark { display: block; }

/* ── Header: brand, switch, controls (glass lives ONLY here) ──────── */
.top-brand .divider { background: var(--rule); }
.top-brand .eyebrow-text .sub { color: var(--ink-lo); }
/* S144 — the name is Sir's wordmark, small; one per mode like the icon. */
.top-brand .eyebrow-text img.wordmark { display: block; height: 11px; width: auto; margin: 1px 0 3px; }
.top-brand .eyebrow-text img.wordmark.logo-dark { display: none; }
body.theme-dark .top-brand .eyebrow-text img.wordmark.logo-light { display: none; }
body.theme-dark .top-brand .eyebrow-text img.wordmark.logo-dark { display: block; }
.mer-glass {
  background: var(--glass-fill);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-lift);
}
@media (prefers-reduced-transparency: reduce) {
  .mer-glass { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--surface-1); }
}

.side-switch { display: flex; padding: 4px; border-radius: var(--r-pill); }
.side-switch a {
  padding: 7px 20px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 500; color: var(--ink-mid);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.side-switch a:hover { color: var(--ink); }
.side-switch a[aria-current="page"] { background: var(--seg-on-bg); color: var(--seg-on-ink); font-weight: 700; box-shadow: var(--sv-lift); }

.top-right { gap: 10px; }
.theme-toggle { width: 42px; height: 42px; background: var(--glass-fill); border: 1px solid var(--glass-edge); color: var(--ink-mid); }
.theme-toggle:hover { background: var(--surface-2); color: var(--ink); }
/* S167 silver and blue: by day the round is silver, not a white disc */
body.theme-light .theme-toggle { background: var(--sv-fill); border-color: var(--sv-edge); color: var(--sv-ink); box-shadow: var(--sv-lift); }
body.theme-light .theme-toggle:hover { background: var(--sv-fill-hover); color: var(--sv-ink); }
.avatar {
  width: 42px; height: 42px; font-size: 12px; font-weight: 700; color: var(--sv-ink);
  background: var(--sv-fill); border: 1px solid var(--sv-edge); box-shadow: var(--sv-lift);
}

/* S167 — the AP menu: Sign out, and Stop Aero for those who may halt. */
.aero-me { position: relative; display: flex; }
.aero-me-btn { padding: 0; cursor: pointer; font-family: inherit; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.aero-me-btn[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--accent-edge, rgba(227, 205, 164, .5)); }
.aero-me-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 90; min-width: 196px; padding: 6px;
  background: var(--surface-1); color: var(--ink); border-radius: var(--r-md);
  box-shadow: var(--shadow-3, 0 18px 40px -12px rgba(0,0,0,.45)), inset 0 0 0 1px var(--card-edge);
  transform-origin: top right; animation: aero-me-pop 150ms cubic-bezier(0.23, 1, 0.32, 1) both;
}
.aero-me-menu[hidden] { display: none; }
@keyframes aero-me-pop { from { opacity: 0; transform: scale(.96) translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .aero-me-menu { animation: none; } }
.aero-me-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; box-sizing: border-box;
  border: 0; border-radius: var(--r-sm); background: none; color: var(--ink); font: 500 14px var(--sans, inherit);
  text-decoration: none; text-align: left; cursor: pointer;
}
.aero-me-item:hover, .aero-me-item:focus-visible { background: var(--surface-2); outline: none; }
.aero-me-item.aero-stop { color: var(--crit, #C2453B); }
/* S167 — the confirmation sheet (Sign out, Stop Aero). */
.aero-confirm {
  /* margin:auto re-centres the modal: style.css's `* { margin: 0 }` had pinned every sheet to the top-left. */
  margin: auto; max-height: calc(100dvh - 32px); overflow-y: auto;
  width: min(360px, calc(100vw - 32px)); box-sizing: border-box; padding: 22px 22px 18px; border: 0; border-radius: var(--r-lg);
  background: var(--surface-1); color: var(--ink);
  box-shadow: var(--shadow-3, 0 24px 60px -18px rgba(0,0,0,.5)), inset 0 0 0 1px var(--card-edge);
}
.aero-confirm[open] { animation: aero-me-pop 170ms cubic-bezier(0.23, 1, 0.32, 1) both; }
.aero-confirm::backdrop { background: rgba(5, 10, 24, .48); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.aero-confirm-title { margin: 0 0 6px; font: 700 18px/1.3 var(--display, inherit); letter-spacing: -.01em; }
.aero-confirm-body { margin: 0 0 20px; color: var(--ink-mid); font: 500 14px/1.5 var(--sans, inherit); }
.aero-confirm-body:empty { display: none; }
.aero-confirm-acts { display: flex; gap: 10px; justify-content: flex-end; }
.aero-confirm-acts button {
  min-height: 44px; padding: 0 18px; border: 0; border-radius: var(--r-pill); cursor: pointer; font: 600 14px var(--sans, inherit);
}
.aero-confirm-no { background: var(--surface-2); color: var(--ink); }
.aero-confirm-no[hidden] { display: none; }
.aero-confirm-yes { background: var(--seg-on-bg); color: var(--seg-on-ink); box-shadow: var(--sv-lift); }
.aero-confirm-yes.is-danger { background: var(--crit, #C2453B); color: #fff; }
@media (prefers-reduced-motion: reduce) { .aero-confirm[open] { animation: none; } }

/* 19 Oct — the profile (docs/design/profile_avatars_2026-10-19.md). The AP
   circle wears the person's photo; the initials stay underneath as the
   fallback a failed image falls back to. */
.aero-me-btn { position: relative; overflow: hidden; }
.aero-me-btn .aero-me-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.aero-me-btn.has-photo { background: var(--surface-2); }
.aero-me-btn.has-photo .aero-me-initials { visibility: hidden; }
.aero-me-rule { height: 1px; margin: 4px 8px; background: var(--rule); }
.aero-profile { width: min(400px, calc(100vw - 32px)); }
.aero-profile-photo { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 14px 0 18px; }
.aero-profile-circle {
  width: 132px; height: 132px; border-radius: 50%; overflow: hidden; position: relative; display: grid; place-items: center;
  background: var(--sv-fill); border: 1px solid var(--sv-edge); box-shadow: var(--sv-lift);
}
.aero-profile-circle canvas { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.aero-profile-circle canvas:active { cursor: grabbing; }
.aero-profile-circle canvas[hidden] { display: none; }
.aero-profile-initials { font: 700 38px/1 var(--display, inherit); color: var(--sv-ink); letter-spacing: .02em; }
.aero-profile-initials[hidden] { display: none; }
.aero-profile-zoom { width: 160px; accent-color: var(--accent); }
.aero-profile-zoom[hidden], .aero-profile-hint[hidden] { display: none; }
.aero-profile-hint { margin: -4px 0 0; color: var(--ink-lo); font-size: 12px; }
.aero-profile-photo-acts { display: flex; gap: 8px; align-items: center; }
.aero-profile-pick input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.aero-profile-pick span, .aero-profile-link {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: var(--r-pill); cursor: pointer;
  font: 600 13px var(--sans, inherit); border: 1px solid var(--rule); background: var(--surface-2); color: var(--ink);
}
.aero-profile-pick:focus-within span { outline: 2px solid var(--accent); outline-offset: 2px; }
.aero-profile-link { color: var(--ink-mid); }
.aero-profile-link[hidden] { display: none; }
.aero-profile-fields { display: grid; gap: 12px; }
.aero-profile-field { display: grid; gap: 6px; font: 600 12px var(--sans, inherit); color: var(--ink-mid); letter-spacing: .02em; }
.aero-profile-field em { font-style: normal; font-weight: 500; color: var(--ink-lo); margin-left: 4px; }
.aero-profile-field input {
  height: 44px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--rule); background: var(--surface-2);
  color: var(--ink); font: 500 15px var(--sans, inherit); box-sizing: border-box; width: 100%;
}
.aero-profile-field input:focus { outline: none; border-color: var(--accent-edge, var(--accent)); box-shadow: 0 0 0 3px var(--accent-faint); }
.aero-profile-preview { margin: 14px 0 0; color: var(--ink-mid); font: 500 13.5px/1.5 var(--sans, inherit); }
.aero-profile-err { margin: 8px 0 0; color: var(--crit, #C2453B); font: 600 13px/1.45 var(--sans, inherit); }
.aero-profile-err:empty { display: none; }
.aero-profile .aero-confirm-acts { margin-top: 18px; }
.aero-profile .aero-confirm-yes:disabled { opacity: .6; cursor: progress; }

/* Chat avatars: Aero's emblem on his answers, the person's photo (or
   initials) on theirs — at the bubble's outer edge, everywhere a bubble is drawn. */
.bubble { position: relative; }
.bubble .bubble-av {
  position: absolute; top: 2px; width: 28px; height: 28px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; font: 700 10.5px/1 var(--sans, inherit); letter-spacing: .02em;
}
.bubble-user .bubble-av { right: -38px; color: var(--sv-ink); background: var(--sv-fill); border: 1px solid var(--sv-edge); }
.bubble-user .bubble-av img { width: 100%; height: 100%; object-fit: cover; }
/* Aero's disc: the silver emblem on company navy, day and night (Sir, 19 Oct:
   the navy-on-silver emblem read too light). A silver ring lifts it off the
   night canvas. */
.bubble-aero .bubble-av {
  left: -38px; border: 1px solid rgba(195, 196, 197, 0.55);
  background: url("/exec/static/emblem-clean-silver.png") center / 74% no-repeat,
              linear-gradient(180deg, #1E2E57 0%, #0A1530 100%);
}
.bubble .role-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#chat-stream .bubble-user { margin-right: 38px; }
#chat-stream .bubble-aero { margin-left: 38px; }

/* ── Nav: quiet, no icons, one lit row ────────────────────────────── */
.nav-section { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-lo); margin: 20px 0 8px; }
.nav-section:first-child { margin-top: 4px; }
.nav-item { height: 38px; padding: 0 12px; border-radius: var(--r-sm); font-size: 14px; font-weight: 500; color: var(--ink-mid); }
.nav-item svg { display: none; }
.nav-item:hover { background: var(--nav-active); color: var(--ink); }
.nav-item.active, .nav-item.is-active { background: var(--nav-active); color: var(--ink); font-weight: 600; box-shadow: var(--glass-lift); }
.nav-item.active::before, .nav-item.is-active::before { display: none; }
.nav-item[aria-disabled="true"] { color: var(--ink-lo); cursor: default; }
.nav-item[aria-disabled="true"]:hover { background: transparent; color: var(--ink-lo); }
.nav-item .nav-hint { font-size: 11px; color: var(--ink-lo); font-weight: 500; }
/* 31 Oct, Sir: "make all the buttons that are light blue into silver with navy writing" */
.nav-badge.alert { background: var(--sv-fill); color: var(--sv-ink); }

/* ── Surfaces: cards, KPIs, briefs (never glass) ──────────────────── */
.card, .kpi, .finance-card, .attention, .brief, .approval, .qj, .agent-card, .tool,
body.theme-dark .card, body.theme-dark .kpi, body.theme-dark .finance-card,
body.theme-dark .attention, body.theme-dark .brief {
  background: var(--card-fill);
  border: 1px solid var(--card-edge);
  box-shadow: var(--card-lift);
}
.card, .kpi, .finance-card, .attention, .brief, .approval { border-radius: var(--r-lg); }
.kpi:hover { transform: none; border-color: var(--card-edge); box-shadow: var(--card-lift); }
.kpi-value { font-weight: 300; letter-spacing: -0.02em; }
.greeting h1, h1 { font-weight: 500; letter-spacing: -0.025em; }
.eyebrow { color: var(--ink-lo); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
.eyebrow::before { display: none; }
.card-head, .finance-card-head { border-bottom-color: var(--rule); }
table.aero th, table.finance-table th,
body.theme-dark table.aero th, body.theme-dark table.finance-table th { background: transparent; color: var(--ink-lo); }

/* ── Buttons: champagne for the ONE primary action, ghost for the rest ─ */
.btn, body.theme-dark .btn {
  background: transparent; color: var(--ink);
  border: 1px solid var(--ink-faint); border-radius: var(--r-pill);
}
.btn:hover, body.theme-dark .btn:hover { background: var(--nav-active); transform: none; }
/* S167: the ONE primary action is brushed silver with navy words (was champagne). */
.btn.primary, .mer-primary, .aero-fab, .aero-send {
  background: var(--sv-fill); color: var(--sv-ink); border: 0; box-shadow: var(--sv-lift);
}
.btn.primary:hover, .mer-primary:hover, .aero-fab:hover, .aero-send:hover { background: var(--sv-fill-hover); color: var(--sv-ink); }
.chip.primary, .palette-row.is-focused .row-icon { background: var(--sv-fill); color: var(--sv-ink); border-color: var(--sv-lo); }
.palette, body.theme-dark .palette { background: var(--surface-1); border: 1px solid var(--card-edge); }
.aero-panel { background: var(--surface-1); }

/* ── Motion: one gentle arrival, nothing that loops ───────────────── */
@keyframes merRise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.mer-rise { animation: merRise .22s var(--ease) both; }
@media (prefers-reduced-motion: reduce) {
  .mer-rise { animation: none; }
  .side-switch a { transition: none; }
}

/* ── Personal side ────────────────────────────────────────────────── */
/* Executive-only machinery is not offered on Personal: the assistant and the
   palette both drive the Executive router, and Personal must not talk to it. */
/* S138 — Aero is talked to from the docked chat bar on EVERY side now; only the
   Executive command palette stays off Personal and Aviation. */

.mer-page { max-width: 1160px; }
.mer-lbl { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-lo); }

/* The Next panel — a navy dial in BOTH modes, so it carries its own palette. */
.mer-hero {
  --h-ink: #E8EAED; --h-mid: #A5A6A5; --h-lo: #8A93AC; --h-accent: #C3D4F2;
  position: relative; min-height: 212px; border-radius: var(--r-xl); overflow: hidden;
  color: var(--h-ink);
  background: linear-gradient(180deg, #17275A 0%, #101D45 100%);
  border: 1px solid rgba(245, 240, 234, 0.08);
  box-shadow: inset 0 1px 0 rgba(245, 240, 234, 0.09), var(--shadow-3);
}
.mer-hero .mer-lbl { color: var(--h-lo); }
.mer-hero-glow { position: absolute; inset: 0; background: radial-gradient(45% 90% at 12% 0%, rgba(245, 240, 234, 0.07) 0%, rgba(245, 240, 234, 0) 70%); pointer-events: none; }
.mer-hero-art { position: absolute; right: 0; top: 0; height: 100%; width: min(620px, 70%); pointer-events: none; }
.mer-hero-emblem { position: absolute; right: 40px; bottom: 26px; width: 110px; opacity: 0.08; pointer-events: none; }
.mer-hero-body { position: relative; min-height: 212px; box-sizing: border-box; padding: 30px 36px; display: flex; flex-direction: column; }
.mer-hero-when { color: var(--h-mid); }
.mer-hero-title { margin-top: 10px; font-size: 38px; font-weight: 500; letter-spacing: -0.025em; line-height: 1.12; color: var(--h-ink); }
.mer-hero-meta { margin-top: 6px; font-size: 13px; color: var(--h-mid); }
.mer-hero-figs { margin-top: auto; padding-top: 22px; display: flex; align-items: flex-end; flex-wrap: wrap; gap: 20px 44px; }
.mer-fig { display: flex; flex-direction: column; gap: 4px; }
.mer-fig .mer-lbl { color: var(--h-lo); }
.mer-fig-val { font-size: 26px; font-weight: 300; line-height: 40px; font-variant-numeric: tabular-nums; color: var(--h-ink); }
.mer-fig-val.is-count { font-size: 40px; letter-spacing: -0.03em; color: var(--h-accent); }
.mer-hero-action {
  height: 40px; padding: 0 18px; display: inline-flex; align-items: center; gap: 8px; border-radius: var(--r-pill);
  background: rgba(245, 240, 234, 0.08); border: 1px solid rgba(245, 240, 234, 0.14);
  color: var(--h-ink); font-size: 13px; font-weight: 600;
}
.mer-hero-action:hover { background: rgba(245, 240, 234, 0.14); color: var(--h-ink); }
.mer-hero-quiet { margin-top: auto; font-size: 15px; color: var(--h-mid); }

.mer-grid { margin-top: 22px; display: grid; grid-template-columns: 1.05fr 1fr; gap: 22px; align-items: start; }
.mer-card {
  border-radius: var(--r-lg); padding: 22px 26px;
  background: var(--card-fill); border: 1px solid var(--card-edge); box-shadow: var(--card-lift);
}
.mer-card + .mer-card { margin-top: 12px; }
.mer-card > .mer-lbl { display: block; margin-bottom: 10px; }

.mer-line { position: relative; display: flex; flex-direction: column; }
.mer-line::before { content: ""; position: absolute; left: 61px; top: 16px; bottom: 16px; width: 1px; background: var(--rule); }
.mer-row { position: relative; display: flex; align-items: center; gap: 18px; padding: 10px 0; }
.mer-row .t { width: 40px; flex: none; font-size: 13px; color: var(--ink-mid); font-variant-numeric: tabular-nums; }
.mer-row .dot { width: 7px; height: 7px; flex: none; border-radius: var(--r-sm); background: var(--ink); }
.mer-row .what { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.mer-row .what b { font-size: 15px; font-weight: 600; color: var(--ink); }
.mer-row .what span { font-size: 12px; color: var(--ink-mid); }
.mer-row.is-past { opacity: 0.5; }
.mer-row.is-past .dot { background: var(--canvas); border: 1px solid var(--ink-mid); box-sizing: border-box; }
.mer-row.is-past .what b { font-weight: 500; }
.mer-row.is-current .dot, .mer-row.is-next .dot { background: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-faint); }
.mer-now { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.mer-now .t { width: 46px; flex: none; font-size: 11px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
/* The only glow on the page. */
.mer-now .rule { flex: 1; height: 1px; background: linear-gradient(90deg, var(--accent-line), transparent); box-shadow: 0 0 8px var(--accent-faint); }
.mer-allday { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.mer-allday span { font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: var(--r-pill); background: var(--nav-active); color: var(--ink-mid); }

.mer-coming { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.mer-coming > div { padding: 10px 12px; border-radius: var(--r-md); background: var(--nav-active); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mer-coming .when { font-size: 11px; color: var(--ink-lo); }
.mer-coming .title { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.mer-empty { font-size: 14px; color: var(--ink-mid); padding: 6px 0 2px; }
.mer-warn { font-size: 13px; line-height: 1.55; color: var(--warn); }
.mer-note { margin: 12px 4px 0; font-size: 13px; line-height: 1.6; color: var(--ink-mid); }
.mer-note .src { color: var(--ink-lo); }
.mer-pending { display: flex; flex-direction: column; gap: 10px; }
.mer-pending .row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--ink-mid); padding: 4px 0; border-bottom: 1px solid var(--rule); }
.mer-pending .row:last-child { border-bottom: 0; }
.mer-pending .row b { font-weight: 600; color: var(--ink); }
.mer-skeleton { height: 212px; border-radius: var(--r-xl); background: var(--card-fill); border: 1px solid var(--card-edge); }

/* ── Phone ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Must restate the single column: the desktop columns above load after
     style.css's phone rules and would otherwise squeeze main into 232px. */
  .shell, .shell.with-rail { grid-template-columns: 1fr; grid-template-rows: 64px 1fr; }
  .shell.with-rail { grid-template-rows: 64px 1fr auto; }
  .top, .topbar { padding: 0 16px; gap: 10px; min-height: 64px; }
  .top-brand .divider, .top-brand .eyebrow-text { display: none; }
  .side-switch a { padding: 7px 14px; }
  .theme-toggle, .avatar { width: 38px; height: 38px; }
  .nav, .sidebar { top: 64px; background: var(--surface-1); }
  body.theme-dark .nav, body.theme-dark .sidebar { background: var(--surface-1); }
  body.nav-open .nav-backdrop { inset: 64px 0 0 0; }
  .main { padding: 8px 16px 32px; }
  .mer-hero, .mer-hero-body { min-height: 210px; }
  .mer-hero { border-radius: var(--r-xl); }
  .mer-hero-body { padding: 22px; }
  .mer-hero-title { font-size: 27px; margin-top: 6px; }
  .mer-hero-figs { gap: 14px 22px; }
  .mer-fig-val { font-size: 20px; line-height: 38px; }
  .mer-fig-val.is-count { font-size: 36px; }
  .mer-hero-emblem { display: none; }
  /* On a phone the route would cross the title and location; the arcs stay. */
  .mer-hero-art .route { display: none; }
  .mer-grid { grid-template-columns: 1fr; gap: 14px; margin-top: 14px; }
  .mer-card { border-radius: var(--r-xl); padding: 16px 18px; }
  .mer-coming { grid-template-columns: 1fr; }
}
/* An iPhone is ~390px wide. The day/night toggle and the switch stay; the
   initials go, and where the switch is shown it names the side, so the brand
   lock-up gives way too. */
@media (max-width: 480px) {   /* was 430 — an iPhone Pro Max is 440 (S138) */
  .top-right .avatar:not(.aero-me-btn) { display: none; }   /* S167: AP stays — it holds Sign out and Stop */
  .top:has(.side-switch) .top-brand { display: none; }
  .side-switch a { padding: 7px 13px; font-size: 13px; }
}

/* -- Personal ▸ Documents — the vault (S129) ------------------------------- */
.mer-ask { display: flex; gap: 10px; align-items: stretch; }
.mer-ask input { flex: 1; min-width: 0; font: inherit; font-size: 15px; padding: 11px 14px; border-radius: var(--r-md); border: 1px solid var(--card-edge); background: var(--canvas); color: var(--ink); }
.mer-ask input:focus { outline: 2px solid var(--accent-line); outline-offset: 1px; }
.mer-ask .mer-primary { padding: 0 18px; border-radius: var(--r-md); font-weight: 600; }
.mer-hits { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.mer-hit { padding: 12px 14px; border-radius: var(--r-md); background: var(--nav-active); }
.mer-hit .cite { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-lo); margin-bottom: 6px; }
.mer-hit p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink); }
@media (max-width: 720px) { .mer-ask { flex-direction: column; } }
.mer-card-wide { margin-top: 22px; }
.mer-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.mer-chip { font-size: 12px; font-weight: 600; padding: 6px 11px; border-radius: var(--r-pill); background: var(--nav-active); color: var(--ink-mid); text-decoration: none; }
.mer-chip.is-on { background: var(--sv-fill); color: var(--sv-ink); }
.mer-filter { margin-bottom: 8px; }
.mer-papers { display: flex; flex-direction: column; }
.mer-paper { display: flex; align-items: center; gap: 14px; padding: 10px 2px; border-bottom: 1px solid var(--rule); text-decoration: none; color: inherit; }
.mer-paper:last-child { border-bottom: 0; }
.mer-paper .ext { flex: none; width: 44px; font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-align: center; padding: 5px 0; border-radius: var(--r-sm); background: var(--nav-active); color: var(--ink-lo); }
.mer-paper .what { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.mer-paper .what b { font-size: 14px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.mer-paper .what span { font-size: 12px; color: var(--ink-mid); }
.mer-paper:hover .what b { color: var(--accent-text, var(--ink)); }

/* ── Personal ▸ Health (S130) — Whoop figures. Tier colours are Whoop's bands. */
.mer-tier-green { color: var(--ok); }
.mer-tier-amber { color: var(--warn); }
.mer-tier-red { color: #D9705F; }
.mer-fig-val small { font-size: 13px; font-weight: 500; color: var(--h-mid, var(--ink-mid)); }
.mer-card .mer-fig-val { color: var(--ink); }
.mer-sleep-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.mer-big { font-size: 34px; font-weight: 300; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--ink); }
.mer-sleep-sub { font-size: 13px; color: var(--ink-mid); }
.mer-stages { display: flex; height: 10px; border-radius: var(--r-pill); overflow: hidden; background: var(--nav-active); }
.mer-stage { display: block; height: 100%; }
.mer-stage.is-light, .mer-stage-key i.is-light { background: #4E6AA8; }
.mer-stage.is-rem,   .mer-stage-key i.is-rem   { background: #8FA5D6; }
.mer-stage.is-deep,  .mer-stage-key i.is-deep  { background: #D4B98C; }
.mer-stage.is-awake, .mer-stage-key i.is-awake { background: rgba(245, 240, 234, 0.22); }
.mer-stage-key { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 12px; color: var(--ink-mid); }
.mer-stage-key i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.mer-figs-row { display: flex; flex-wrap: wrap; gap: 14px 32px; margin-top: 16px; }
.mer-lbl-gap { display: block; margin-top: 18px; }
.mer-week { display: flex; flex-direction: column; gap: 14px; }
.mer-bars { display: flex; align-items: flex-end; gap: 10px; height: 120px; }
.mer-bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; min-width: 0; }
.mer-bar-fill { display: block; width: 100%; max-width: 44px; border-radius: var(--r-sm) var(--r-sm) var(--r-xs) var(--r-xs); background: linear-gradient(180deg, #E3CDA4, #B99A66); min-height: 3px; }
.mer-bar-val { font-size: 11px; color: var(--ink-mid); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mer-bar-day { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; color: var(--ink-lo); }
.mer-scores { display: flex; gap: 10px; flex-wrap: wrap; }
.mer-score { min-width: 44px; text-align: center; padding: 6px 0; border-radius: var(--r-sm); background: var(--nav-active); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .mer-bars { height: 96px; gap: 6px; } .mer-bar-val { display: none; } }

/* ── Personal ▸ Aeroflight (S133) — built for a flight deck ────────────────
 *
 * Own namespace: `.mer-row` already belongs to the Today timeline (.t/.dot/
 * .what) and reusing it would fight that cascade. Only the generic Meridian
 * pieces are reused — hero, card, grid, lbl, note, fig, big, tier.
 *
 * Sized for a knee-mounted iPad in turbulence, read at arm's length, in
 * sunlight or under red light. Every colour is an existing Meridian token, so
 * the 4.5:1 contrast proven by scripts/verify_meridian_personal.py still holds.
 */

/* ── Entry. Anything touched is at least 52px. ───────────────────────────── */
.af-form {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end;
  margin: 18px 0 12px;
}
.af-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; flex: 1 1 260px; }
.af-field .mer-lbl { margin: 0; }
.af-input {
  font-family: var(--sans); font-variant-numeric: tabular-nums;
  font-size: 19px; letter-spacing: 0.01em; color: var(--ink);
  background: var(--surface-1); border: 1.5px solid var(--card-edge);
  border-radius: var(--r-md); padding: 0 16px; min-height: 52px; width: 100%;
  font-variant-numeric: tabular-nums;
}
select.af-input { font-family: inherit; font-size: 17px; padding: 0 12px; }
.af-input::placeholder { color: var(--ink-faint); }
.af-input:focus-visible { outline: 3px solid var(--accent-line); outline-offset: 1px; border-color: var(--accent-line); }
.af-btn {
  font: inherit; font-size: 17px; font-weight: 650; cursor: pointer;
  color: var(--sv-ink); background: var(--sv-fill); box-shadow: var(--sv-lift);
  border: 1.5px solid var(--sv-lo); border-radius: var(--r-md);
  min-height: 52px; padding: 0 30px; flex: 0 0 auto;
}
.af-btn:hover { background: var(--sv-fill-hover); }
.af-btn:active { transform: translateY(1px); }
.af-btn:focus-visible { outline: 3px solid var(--accent-line); outline-offset: 2px; }
.af-form .htmx-indicator { opacity: 0; transition: opacity .15s ease; font-size: 14px; }
.af-form.htmx-request .htmx-indicator { opacity: 1; }

/* The accepted spellings, as tappable examples rather than prose. */
.af-formats { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.af-fmt {
  font-family: var(--sans); font-variant-numeric: tabular-nums; font-size: 13px;
  color: var(--ink-mid); background: var(--surface-2);
  border: 1px solid var(--card-edge); border-radius: var(--r-sm);
  padding: 7px 11px; min-height: 36px; display: inline-flex; align-items: center;
  cursor: pointer;
}
.af-fmt:hover { border-color: var(--accent-edge); color: var(--ink); }

/* ── The position line. ──────────────────────────────────────────────────── */
.af-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin: 22px 0 12px; }
.af-head .mer-big {
  font-family: var(--sans); font-variant-numeric: tabular-nums;
  font-size: 30px; font-weight: 500; letter-spacing: -0.01em;
}
.af-meta { font-size: 14px; color: var(--ink-mid); font-variant-numeric: tabular-nums; }
.af-num { font-variant-numeric: tabular-nums; }
.af-quiet { color: var(--ink-lo); }
.af-mono {
  font-family: var(--sans); font-variant-numeric: tabular-nums; font-size: 13px;
  color: var(--ink-mid); line-height: 1.55; margin-top: 6px;
  overflow-wrap: anywhere;
}

/* ── One aerodrome. ICAO dominates; bearing and distance sit right. ─────── */
.af-ad { padding: 18px 0; border-top: 1px solid var(--rule); }
.af-ad:first-of-type { border-top: 0; }
.af-ad-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.af-ad-name { font-size: 16px; color: var(--ink-mid); min-width: 0; }
.af-ad-name strong {
  font-family: var(--sans); font-variant-numeric: tabular-nums;
  font-size: 25px; font-weight: 600; color: var(--ink);
  letter-spacing: 0.01em; margin-right: 8px;
}
.af-ad-top .af-meta {
  margin-left: auto; font-size: 20px; font-weight: 600; color: var(--ink);
  white-space: nowrap;
}
.af-reasons { margin: 10px 0 0 18px; padding: 0; font-size: 13px; color: var(--ink-lo); line-height: 1.6; }
.af-reasons li { margin-bottom: 3px; }

/* ── Verdicts. Glyph AND colour. ─────────────────────────────────────────
 * Under red cockpit lighting red and amber converge, and about one man in
 * twelve does not separate them at all. The glyph carries the meaning when the
 * colour cannot. `unknown` is FILLED — it is the one that must never be
 * mistaken for a pass. */
.af-pill {
  font-size: 12px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  padding: 6px 12px; border-radius: var(--r-sm); white-space: nowrap;
  border: 1.5px solid transparent; display: inline-flex; align-items: center; gap: 6px;
}
.af-pill::before { font-weight: 800; font-size: 13px; line-height: 1; }
.af-v-suitable   { color: var(--ok); border-color: var(--ok); }
.af-v-suitable::before   { content: "\2713"; }
.af-v-marginal   { color: var(--warn); border-color: var(--warn); }
.af-v-marginal::before   { content: "\007E"; }
.af-v-unknown    { color: var(--surface-1); background: var(--warn); border-color: var(--warn); }
.af-v-unknown::before    { content: "\003F"; }
.af-v-unsuitable { color: #D9705F; border-color: #D9705F; }
.af-v-unsuitable::before { content: "\2715"; }
.af-pill.mer-tier-green { color: var(--ok); border-color: var(--ok); }
.af-pill.mer-tier-blue  { color: var(--accent); border-color: var(--accent-edge); }
.af-pill.mer-tier-green::before, .af-pill.mer-tier-blue::before { content: none; }

/* ── The shortlist. ──────────────────────────────────────────────────────── */
.af-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 15px; }
.af-table th {
  text-align: left; font-size: 11px; letter-spacing: 0.12em; font-weight: 600;
  color: var(--ink-lo); padding: 10px 12px 10px 0;
  border-bottom: 1.5px solid var(--rule); white-space: nowrap;
}
.af-table td {
  padding: 14px 12px 14px 0; border-bottom: 1px solid var(--rule);
  vertical-align: middle; color: var(--ink);
}
.af-table tr:last-child td { border-bottom: 0; }
.af-table td:first-child strong {
  font-family: var(--sans); font-variant-numeric: tabular-nums;
  font-size: 19px; font-weight: 600;
}
.af-table .af-meta { font-size: 12.5px; }
.af-table .af-num { font-size: 17px; font-weight: 600; }

/* ── iPad landscape: the shortlist beside the cards, not under them. ────── */
@media (min-width: 1100px) {
  .af-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 26px; align-items: start; }
}

/* ── Phone. ──────────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .af-form { flex-direction: column; align-items: stretch; }
  .af-field { flex: 1 1 auto; }
  .af-btn { width: 100%; }
  .af-head .mer-big { font-size: 24px; }
  .af-ad-name strong { font-size: 21px; }
  .af-ad-top .af-meta { margin-left: 0; width: 100%; font-size: 18px; }
  .af-table { display: block; overflow-x: auto; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  .af-btn:active { transform: none; }
  .af-form .htmx-indicator { transition: none; }
}

/* The shortlist heading sat hard against the below-screen note. A heading with
 * no air above it reads as part of the paragraph before it. */
.af-shortlist-lbl { display: block; margin-top: 30px; margin-bottom: 2px; }

/* Qualification states. Same glyph-and-colour rule as the diversion verdicts:
 * under red light the hues converge, so the mark carries the meaning too. */
.af-st-valid     { color: var(--ok); border-color: var(--ok); }
.af-st-valid::before     { content: "\2713"; }
.af-st-permanent { color: var(--accent); border-color: var(--accent-edge); }
.af-st-permanent::before { content: "\221E"; }
.af-st-soon      { color: var(--warn); border-color: var(--warn); }
.af-st-soon::before      { content: "\007E"; }
.af-st-due       { color: var(--surface-1); background: var(--warn); border-color: var(--warn); }
.af-st-due::before       { content: "\0021"; }
.af-st-expired   { color: var(--surface-1); background: #C25A4B; border-color: #C25A4B; }
.af-st-expired::before   { content: "\2715"; }
.af-st-pending   { color: var(--surface-1); background: var(--warn); border-color: var(--warn); }
.af-st-pending::before   { content: "\003F"; }
.af-st-undated   { color: var(--ink-lo); border-color: var(--rule); }
.af-st-undated::before   { content: "\2014"; }

/* How far a logbook layout can be trusted, shown beside it. */
.af-conf-confirmed    { color: var(--ok); border-color: var(--ok); }
.af-conf-conventional { color: var(--accent); border-color: var(--accent-edge); }
.af-conf-assumed      { color: var(--surface-1); background: var(--warn); border-color: var(--warn); }

/* The door to the offline app (S138). */
.af-app { position: relative; display: flex; flex-direction: column; gap: 4px; text-decoration: none;
  color: var(--ink); padding-right: 56px; min-height: 44px; }
.af-app-title { font-size: 1.2rem; font-weight: 600; }
.af-app-sub { font-size: .84rem; color: var(--ink-mid); line-height: 1.4; }
.af-app-go { position: absolute; right: 22px; top: 50%; transform: translateY(-50%); font-size: 1.4rem; color: var(--accent);
  transition: transform .2s var(--ease, ease); }
.af-app:hover .af-app-go { transform: translate(4px, -50%); }
@media (prefers-reduced-motion: reduce) { .af-app-go { transition: none; } }

/* The career strip and the year tabs (S138 — a real logbook is 1,100+ lines). */
.af-career { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; margin: 14px 0 6px; }
.af-career > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px;
  border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--accent-faint); }
.af-fig { font-variant-numeric: tabular-nums; font-size: 1.15rem; font-weight: 600; color: var(--ink); }
.af-cap { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-lo); }
.af-years { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 10px; scrollbar-width: none;
  -webkit-overflow-scrolling: touch; }
.af-years::-webkit-scrollbar { display: none; }
.af-year { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 1px;
  min-width: 62px; min-height: 44px; padding: 6px 10px; border-radius: var(--r-sm); cursor: pointer;
  border: 1px solid var(--rule); background: transparent; color: var(--ink-mid); font: inherit; }
.af-year-n { font-weight: 600; font-size: .82rem; }
.af-year-h { font-size: .68rem; font-variant-numeric: tabular-nums; opacity: .75; }
.af-year:hover { border-color: var(--accent-edge); }
.af-year.is-on { border-color: var(--sv-lo); color: var(--sv-ink); background: var(--sv-fill); }
.af-fmt.is-on { border-color: var(--sv-lo); color: var(--sv-ink); background: var(--sv-fill); }

/* A Part-FCL page is 22 columns wide. It scrolls in its own box rather than
 * pushing the page sideways. */
.af-book-scroll { overflow-x: auto; margin-top: 10px; }
.af-book { min-width: 1100px; font-size: 12.5px; }
.af-book th, .af-book td { padding: 7px 9px 7px 0; white-space: nowrap; }
.af-book .af-grp {
  font-size: 9.5px; letter-spacing: .1em; color: var(--ink-lo);
  border-bottom: 1px solid var(--rule); text-align: left;
}

.af-tools { margin-top: 26px; border-top: 1px solid var(--rule); padding-top: 14px; }
.af-tools > summary {
  cursor: pointer; font-size: 14px; color: var(--ink-mid);
  min-height: 44px; display: flex; align-items: center; gap: 8px;
}
.af-tools > summary::marker { color: var(--ink-lo); }


/* ───────────────────────────────────────────────────────────────────
 *  Safe areas (S138) — Sir, on the iPhone: "top is cut off".
 *  The native shell draws the web view edge to edge, under the Dynamic
 *  Island (AeroWebView … .ignoresSafeArea(), contentInsetAdjustment .never),
 *  and the installed PWA does the same through status-bar-style
 *  black-translucent. Nothing here reserved that space, so the top bar sat
 *  under the island. viewport-fit=cover (base.html) makes iOS report the
 *  real insets; on every other screen each env() is 0 and nothing moves.
 * ─────────────────────────────────────────────────────────────────── */
.top, .topbar {
  padding-top: env(safe-area-inset-top);
  padding-left: max(var(--space-5), env(safe-area-inset-left));
  padding-right: max(var(--space-5), env(safe-area-inset-right));
  min-height: calc(60px + env(safe-area-inset-top));
  box-sizing: border-box;
}
.shell { grid-template-rows: calc(72px + env(safe-area-inset-top)) 1fr; }
@media (max-width: 768px) {
  .shell, .shell.with-rail { grid-template-rows: calc(64px + env(safe-area-inset-top)) 1fr; }
  .shell.with-rail { grid-template-rows: calc(64px + env(safe-area-inset-top)) 1fr auto; }
  .top, .topbar {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    min-height: calc(64px + env(safe-area-inset-top));
  }
  main, .main { padding-bottom: env(safe-area-inset-bottom); }
}
/* .aero-fab / .aero-panel carry their insets inline in base.html, where they are defined. */


/* ───────────────────────────────────────────────────────────────────
 *  The layout may never be wider than the screen (S138).
 *  Seen in the simulator, measured after: inside the native shell the top bar
 *  gains a padlock button, and at exactly 440px — an iPhone Pro Max, Sir's
 *  phone — the bar measured 455. A `1fr` grid track cannot shrink below its
 *  content, so the whole shell followed it and every card lost its right
 *  gutter. The tight-phone rule stopped at 430. Both fixed: the rule now covers
 *  480, and the track and the bar are allowed to shrink (min 0).
 * ─────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .shell, .shell.with-rail { grid-template-columns: minmax(0, 1fr); }
  .top, .topbar { min-width: 0; max-width: 100vw; }
  .top > *, .top-right { min-width: 0; }
  .top-right { gap: 8px; flex-shrink: 0; }
  main, .main { min-width: 0; }
}


/* Sub-items under a menu entry (AeroPAS's departments), indented and quieter. */
.nav-subgroup { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 8px; }
.nav-item.nav-subitem { height: 32px; padding-left: 26px; font-size: 13px; color: var(--ink-lo); }
.nav-item.nav-subitem.is-active { color: var(--ink); font-weight: 600; }
.nav-item.nav-subitem.nav-sub2 { height: 30px; padding-left: 40px; font-size: 12.5px; }
.nav-subhead { padding: 6px 0 2px 26px; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-lo); }

/* ───────────────────────────────────────────────────────────────────
 *  The phone top bar — the estate-wide rule (S143, Sir): on a phone the MARK
 *  is centred; from tablet width up it heads the rail, top-left, as before.
 *  Where the Personal / Executive / Aviation switch is shown it takes its
 *  own row beneath (iOS segmented-control style), so the mark no longer
 *  gives way to it. ONE height (--top-h) drives the shell row, the drawer
 *  and the backdrop — the layered 60/64/72px rules above stay untouched.
 * ─────────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  body:has(.top .side-switch) { --top-h: calc(116px + env(safe-area-inset-top)); }
  body:has(.top .side-switch) .shell,
  body:has(.top .side-switch) .shell.with-rail { grid-template-rows: var(--top-h) 1fr; }
  body:has(.top .side-switch) .shell.with-rail { grid-template-rows: var(--top-h) 1fr auto; }
  .top:has(.side-switch) {
    display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    grid-template-rows: 52px 44px; align-items: center; row-gap: 8px; column-gap: 8px;
    min-height: var(--top-h); padding-bottom: 10px;
  }
  .top:has(.side-switch) .nav-toggle { grid-area: 1 / 1; justify-self: start; }
  .top:has(.side-switch) .top-brand { display: flex; grid-area: 1 / 2; justify-self: center; }
  .top:has(.side-switch) .top-right { grid-area: 1 / 3; justify-self: end; margin-left: 0; }
  .top:has(.side-switch) .side-switch { grid-area: 2 / 1 / 3 / 4; justify-self: center; }
  body:has(.top .side-switch) .nav,
  body:has(.top .side-switch) .sidebar { top: var(--top-h); }
  body.nav-open:has(.top .side-switch) .nav-backdrop { inset: var(--top-h) 0 0 0; }
}

/* ───────────────────────────────────────────────────────────────────
 *  The brand, split (S146, Sir — two directions the same day):
 *  1. "move the icon to the middle like the mobile version … increase the
 *     size of the aero logo with personal, executive or aviation written
 *     underneath … proportional and professional."
 *  2. "put the logo back to the left side and keep the icon in the middle.
 *     make the logo slightly bigger."
 *  So from tablet width up: the winged EMBLEM sits dead centre over the whole
 *  bar (absolute against .top — .top-brand stays unpositioned so .top is its
 *  containing block; still inside the brand link), and the AERO WORDMARK with
 *  the side named beneath heads the bar at the left, before the switch. The
 *  hairline divider has nothing to divide and goes. Sized by HEIGHT only, so
 *  each asset keeps its artwork's proportions (emblem ≈2:1, wordmark 3.75:1).
 *  The phone rule above (mark centred, switch on row 2) is untouched.
 * ─────────────────────────────────────────────────────────────────── */
@media (min-width: 769px) {
  .top { position: relative; }
  .top-brand { gap: 0; }
  .top-brand .symbol {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 1;
  }
  .top-brand .symbol, .top-brand .symbol img { height: 38px; max-height: 38px; max-width: none; }
  .top-brand .divider { display: none; }
  .top-brand .eyebrow-text { display: flex; flex-direction: column; align-items: flex-start; margin-right: 10px; }
  .top-brand .eyebrow-text img.wordmark { height: 21px; margin: 0 0 7px; }
  .top-brand .eyebrow-text .sub {
    font-size: 11px; font-weight: 600; line-height: 1;
    letter-spacing: 0.2em; text-transform: uppercase; margin: 0;
  }
  /* S167 — the top search is gone (one place to ask: the bar at the bottom), so
     the controls keep their own auto margin on every side. */
}
/* Room for the centred brand: below 1200px the search folds to its icon
   (it still opens the palette), and below 960px the switch tightens. */
@media (min-width: 769px) and (max-width: 1199px) {
}
@media (min-width: 769px) and (max-width: 959px) {
  /* With the wordmark back at the left the switch starts further in; at a
     narrow tablet it must still end before the centred emblem (gated at 800). */
  .side-switch a { padding: 7px 9px; font-size: 12px; }
  .top-brand .eyebrow-text { margin-right: 6px; }
}

/* -- The side Dashboards (S146) — one tile per section ---------------------- */
.mer-dash-head { margin: 6px 4px 18px; }
.mer-dash-title { margin: 6px 0 0; font-size: 28px; font-weight: 300; letter-spacing: -0.02em; color: var(--ink); }
.mer-dash-date { margin: 4px 0 0; font-size: 14px; font-weight: 500; color: var(--ink-mid); letter-spacing: 0.01em; }
.mer-dash { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.mer-dash-tile {
  display: flex; flex-direction: column; gap: 6px; min-height: 176px;
  padding: 20px 22px; border-radius: var(--r-lg); text-decoration: none; color: inherit;
  background: var(--card-fill); border: 1px solid var(--card-edge); box-shadow: var(--card-lift);
  transition: transform .2s var(--ease), border-color .2s var(--ease);
}
.mer-dash-tile > .mer-lbl { margin-bottom: 6px; }
@media (hover: hover) {
  a.mer-dash-tile:hover { transform: translateY(-2px); border-color: var(--accent-line); }
}
a.mer-dash-tile:active { transform: scale(0.99); }
.mer-dash-tile.is-soon { background: transparent; box-shadow: none; border-style: dashed; }
.mer-dash-tile.is-soon .mer-dash-line { color: var(--ink-lo); }
.mer-dash-big { margin: 0; font-size: 34px; font-weight: 300; line-height: 1.1; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; color: var(--ink); }
.mer-dash-unit { font-size: 16px; font-weight: 400; color: var(--ink-mid); margin-left: 2px; }
.mer-dash-line { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-mid); }
.mer-dash-line.is-quiet { color: var(--ink-lo); font-size: 12.5px; }
.mer-dash-foot { margin-top: auto; padding-top: 10px; font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-lo); }
a.mer-dash-tile .mer-dash-foot { color: var(--accent-line); }
@media (prefers-reduced-motion: reduce) { .mer-dash-tile { transition: none; } a.mer-dash-tile:hover { transform: none; } }
@media (max-width: 768px) { .mer-dash { grid-template-columns: 1fr; gap: 12px; } .mer-dash-tile { min-height: 0; } }

/* 21 Oct — Sir: the editorial layout only. A lead brief on the left, the day's items as a ruled
   column beside it, then the tiles. Aero's own type, colours and glass stay exactly as they are. */
.mer-lead { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); margin: 0 4px 22px;
  border-top: 1px solid var(--ink-faint); border-bottom: 1px solid var(--surface-3); }
.mer-lead-story { padding: 18px 28px 20px 0; border-right: 1px solid var(--surface-3); display: grid; gap: 8px; align-content: start; min-width: 0; }
.mer-lead-story .mer-lbl { margin: 0; }
.mer-lead-head { margin: 0; font-size: 24px; font-weight: 400; line-height: 1.2; letter-spacing: -0.015em; color: var(--ink); text-wrap: balance; }
.mer-lead-brief { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ink-mid); max-width: 60ch; }
.mer-lead-col { padding: 14px 0 14px 28px; display: grid; align-content: start; min-width: 0; }
.mer-lead-item { display: grid; grid-template-columns: 12px 52px minmax(0, 1fr); gap: 4px 10px; align-items: baseline;
  padding: 10px 0; border-bottom: 1px solid var(--surface-3); }
.mer-lead-item:last-child { border-bottom: 0; }
.mer-lead-item time { font-size: 14px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.mer-lead-item b { font-size: 14px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.mer-lead-item small { grid-column: 3; font-size: 12.5px; color: var(--ink-lo); }
.mer-lead-empty { margin: 0; padding: 12px 0; font-size: 13.5px; color: var(--ink-lo); }
@media (max-width: 768px) {
  .mer-lead { grid-template-columns: 1fr; }
  .mer-lead-story { padding: 16px 0; border-right: 0; border-bottom: 1px solid var(--surface-3); }
  .mer-lead-col { padding: 8px 0; }
}

/* The marker: a small dot, coloured by meaning, always paired with words (title + hidden label). */
.pri { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; transform: translateY(-1px); }
.pri-green { background: var(--pri-green); }
.pri-amber { background: var(--pri-amber); }
.pri-red   { background: var(--pri-red); }
.pri-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mer-dash-line .pri, .mer-dash-big .pri { margin-right: 8px; }

/* -- Personal ▸ Health ▸ Workouts (S146) — Whoop's six HR zones ------------- */
.mer-workouts { display: flex; flex-direction: column; gap: 16px; margin-top: 4px; }
.mer-workout-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.mer-workout-sport { font-size: 16px; font-weight: 600; color: var(--ink); }
.mer-workout-when { font-size: 12.5px; color: var(--ink-lo); }
.mer-workout-strain { margin-left: auto; font-size: 20px; font-weight: 300; font-variant-numeric: tabular-nums; color: var(--ink); }
.mer-workout-strain small { font-size: 11px; color: var(--ink-lo); letter-spacing: 0.08em; text-transform: uppercase; }
.mer-workout-meta { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-mid); }
.mer-zones { display: flex; height: 8px; margin-top: 8px; border-radius: var(--r-pill); overflow: hidden; background: var(--nav-active); }
.mer-zone { display: block; height: 100%; }
/* A sequential ramp, rest → peak, in the estate's own inks. */
.mer-zone.is-z0 { background: rgba(120, 128, 146, 0.35); }
.mer-zone.is-z1 { background: #8FA5D6; }
.mer-zone.is-z2 { background: #4E6AA8; }
.mer-zone.is-z3 { background: #D4B98C; }
.mer-zone.is-z4 { background: #C98A4B; }
.mer-zone.is-z5 { background: #B5523B; }
.mer-stage-key i.mer-zone { height: 8px; }

/* -- Personal ▸ Health ▸ readings (S146) — blood pressure, VO2 max ---------- */
.hr-slash { color: var(--ink-lo); margin: 0 2px; }
.hr-cat { margin: 6px 0 0; font-size: 13px; font-weight: 600; color: var(--ink-mid); }
.hr-cat.is-normal { color: #2F7D4F; }
.hr-cat.is-elevated { color: #A8650A; }
.hr-cat.is-stage1 { color: #B5523B; }
.hr-cat.is-stage2, .hr-cat.is-crisis { color: #C4161C; }
.theme-dark .hr-cat.is-normal { color: #6FCF97; }
.theme-dark .hr-cat.is-elevated { color: #FFB340; }
.theme-dark .hr-cat.is-stage1 { color: #FF8A65; }
.theme-dark .hr-cat.is-stage2, .theme-dark .hr-cat.is-crisis { color: #FF6B61; }
.hr-rows { margin-top: 12px; border-top: 1px solid var(--card-edge); }
.hr-row { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr) 10px 24px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--card-edge); }
.hr-row-val { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.hr-row-val small { font-weight: 400; color: var(--ink-lo); }
.hr-row-when { font-size: 12.5px; color: var(--ink-lo); }
.hr-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-lo); }
.hr-dot.is-normal { background: #2F7D4F; } .hr-dot.is-elevated { background: #D08A1E; }
.hr-dot.is-stage1 { background: #C9673F; } .hr-dot.is-stage2, .hr-dot.is-crisis { background: #C4161C; }
.hr-x { border: 0; background: transparent; color: var(--ink-lo); font-size: 18px; cursor: pointer; line-height: 1; }
.hr-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--card-edge); }
.hr-form label { display: flex; flex-direction: column; gap: 5px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-lo); min-width: 0; }
.hr-form input { font: inherit; font-size: 15px; text-transform: none; letter-spacing: 0; padding: 10px 12px; border-radius: var(--r-md); border: 1px solid var(--card-edge); background: var(--canvas); color: var(--ink); min-width: 0; width: 100%; box-sizing: border-box; }
.hr-form input:focus { outline: 2px solid var(--accent-line); outline-offset: 1px; }
.hr-form .wide { grid-column: 1 / -1; }
.hr-form .mer-primary { grid-column: 1 / -1; justify-self: start; padding: 11px 20px; border-radius: var(--r-md); font-weight: 600; }
@media (max-width: 720px) { .hr-form { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
