/* ════════════════════════════════════════════════════════════════════════
   Thing Control on the Car Thing, 0.4: "Signal".
   800×480, landscape, dark only. A matte instrument face: hairlines, square keys, ruled scales and
   mono readings. One signal colour, tuned from whatever is on air and pushed to full screen
   saturation, marks what's live or being set. Now playing and the saver wear that cover's colour as
   their whole face; Mixer, Controls, Launch and Settings stay on the black face.

   Tokens first; components below use only these.
   ════════════════════════════════════════════════════════════════════════ */

/* the tuned colours are set on the root by screen.js; registered so a new source cross-fades */
@property --sig { syntax: "<color>"; inherits: true; initial-value: #ff5a1f; }
@property --field { syntax: "<color>"; inherits: true; initial-value: #b8321c; }
@property --tint { syntax: "<color>"; inherits: true; initial-value: #651a07; }

:root {
  /* The black face, fixed: parts that stay black on every face (top bar, panels, banner, toast, sleep,
     the mic badge) use these directly. Contrast measured with the WCAG formula on --black-ground. */
  --base-ground: #0c0c0b;      /* the black face's own values, before any tint */
  --base-key: #1f1f1d;
  --base-key-hi: #2c2c29;
  --base-raised: #1c1c1a;
  --base-rule: #2f2f2b;
  --black-ground: var(--base-ground);
  --black-key: var(--base-key);
  --black-key-hi: var(--base-key-hi);
  --black-raised: var(--base-raised);     /* the banner, over whatever is under it */
  --black-rule: var(--base-rule);
  --black-tick: #77756d;       /* 4.2:1 */
  --black-ink: #f4f3ef;        /* 17.6:1 */
  --black-ink-2: #bcbab2;      /* 10.1:1 */
  --black-ink-3: #a3a198;      /*  7.6:1, 5.4:1 on --black-key-hi; the floor */
  --ink-light: #fff;           /* ink on a deep colour face */
  --ink-dark: #0c0c0b;         /* ink on a light colour face */
  --off: #000;                 /* the screen off with the Mac */

  /* Face tokens: the black face by default; the colour face below swaps them */
  --c-ground: var(--black-ground);
  --c-key: var(--black-key);           /* keys, tiles, panels */
  --c-key-hi: var(--black-key-hi);     /* under the knob */
  --c-rule: var(--black-rule);         /* hairlines */
  --c-tick: var(--black-tick);         /* scale ticks */
  --c-ink: var(--black-ink);
  --c-ink-2: var(--black-ink-2);
  --c-ink-3: var(--black-ink-3);
  --c-on-live: var(--ink-dark);  /* glyphs on the signal, 5.0:1 or better at every hue */
  --c-on-ink: var(--ink-dark);   /* glyphs on an ink-filled key */
  --c-danger: #ff5f7e;         /* mic muted, errors; always with a word or an icon */
  --c-on-danger: #1c0508;
  --c-focus: var(--c-ink);

  /* Type: one family, IBM Plex; Arabic in its matched face. The screen is small and read from arm's
     length, so everything is set big: a 1.2 scale from a 20px body, five sizes in regular use (legend 15,
     caption 17, body 20, label 24, title 28) and condensed display sizes for the one big thing on each
     screen. Nothing on screen is smaller than 15px. */
  --font-sans: "IBM Plex Sans", "IBM Plex Sans Arabic", "Helvetica Neue", Arial, sans-serif;
  --font-cond: "IBM Plex Sans Condensed", "IBM Plex Sans Arabic", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "IBM Plex Sans Arabic", Menlo, monospace;
  --t-display: 700 200px/0.82 var(--font-cond);   /* saver clock: it has the whole top of the saver to itself */
  --t-hero: 700 132px/0.84 var(--font-cond);      /* home clock */
  --t-huge: 700 60px/0.9 var(--font-cond);        /* a level: a Mixer channel, a Controls slider */
  --t-level: 700 120px/0.84 var(--font-cond);     /* the Mac output's level on the Mixer, the only big number there */
  --t-caller: 700 72px/0.98 var(--font-cond);     /* who's calling, on the ringing screen */
  --t-big: 700 42px/1.02 var(--font-cond);        /* a notification's title in the list, a state's title */
  --t-heading: 600 28px/1.1 var(--font-sans);     /* screen titles; the app under the knob in Launch */
  --t-name: 500 28px/1.15 var(--font-sans);       /* who's playing, the date */
  --t-label: 500 24px/1.2 var(--font-sans);       /* names of tiles, settings and notifications */
  --t-body: 400 20px/1.3 var(--font-sans);
  --t-caption: 400 17px/1.3 var(--font-sans);     /* details under a name */
  --t-read-xl: 500 48px/1 var(--font-mono);
  --t-read-lg: 500 36px/1 var(--font-mono);
  --t-read: 500 24px/1 var(--font-mono);
  --t-read-sm: 500 20px/1.2 var(--font-mono);
  --t-legend: 500 15px/1 var(--font-mono);        /* uppercase legends, the smallest type on screen */

  /* Space, 4px base: 4 and 8 inside a part, 16 between related parts, 24–32 between groups */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --gutter: 32px;
  /* The grid: four 165px columns with 16px gutters, from the left margin to the knob's clearance */
  --col: 165px;
  --col-gap: 16px;

  /* Radius: art, keys and tiles are near-square; only status dots are round */
  --r-art: 2px; --r-key: 3px;
  --r-icon: 22.5%;   /* app icons keep the macOS squircle's proportion at any size */

  /* The cover's glow on Now playing: how strongly its blurred colours show around it */
  --glow: 0.6;
  /* The muted key's black backing on the black face, where its red reads at any density (5.8:1 or better);
     colour faces need more (below) */
  --mute-tint: 40%;

  /* Motion */
  --dur-fast: 120ms;
  --dur: 160ms;
  --dur-tune: 240ms;
  --dur-bar: 280ms;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);

  /* The knob: it overlaps the screen's top-right corner. Measured on Spotify's front render of the Car Thing,
     whose 948×568 screen sets the scale (0.108mm a pixel; the device comes out 124mm across the dial and tag,
     as published): a 33.7mm dial. The preview draws its knob here too; Settings › Fit the dial to the knob
     sets this device's own centre and radius on the screen's root. Anything in its band keeps --knob-clear
     from the right edge. */
  --knob-x: 914px; --knob-y: 148px; --knob-r: 156px;
  --knob-clear: 60px;

  /* Layout */
  --bar-h: 64px;
  --head-h: 80px;   /* the header row every screen starts with, hairline at 64px */
}
@media (prefers-reduced-motion: reduce) {
  :root { --dur-fast: 0ms; --dur: 0ms; --dur-tune: 0ms; --dur-bar: 0ms; }
}

/* The colour face: Now playing and the saver, in the cover's colour. Light ink on deep fields (7.0–7.8:1,
   6.0:1 on the fallback); dark ink where a hue is most saturated at lightness 0.8 or above, roughly amber
   through cyan (10–15:1). */
.face, .saver-slot.is-face, .is-colour .halo, .is-saver-face .halo, .is-colour .mute-key, .is-saver-face .mute-key {
  --c-ground: var(--field);
  --c-key: rgba(0, 0, 0, 0.22); --c-key-hi: rgba(0, 0, 0, 0.34);
  --c-rule: rgba(255, 255, 255, 0.26); --c-tick: rgba(255, 255, 255, 0.62);
  --c-ink: var(--ink-light); --c-ink-2: rgba(255, 255, 255, 0.88); --c-ink-3: rgba(255, 255, 255, 0.8);
  --c-live: var(--ink-light); --c-on-live: var(--field); --c-on-ink: var(--field);
  color: var(--c-ink);   /* colour resolves where it's set, so the face sets its own ink */
}
.is-ink-dark .face, .is-ink-dark .saver-slot.is-face, .is-colour.is-ink-dark .halo, .is-saver-face.is-ink-dark .halo, .is-colour.is-ink-dark .mute-key, .is-saver-face.is-ink-dark .mute-key {
  --c-key: rgba(12, 12, 11, 0.1); --c-key-hi: rgba(12, 12, 11, 0.18);
  --c-rule: rgba(12, 12, 11, 0.24); --c-tick: rgba(12, 12, 11, 0.62);
  --c-ink: var(--ink-dark); --c-ink-2: rgba(12, 12, 11, 0.86); --c-ink-3: rgba(12, 12, 11, 0.78);
  --c-live: var(--ink-dark); --c-on-live: var(--field); --c-on-ink: var(--field);
  color: var(--c-ink);
}

/* The cover's colour seeps through: while something is on air, every black surface (the other screens, the
   top bar, panels, cards) takes a deep tint of its hue (--tint: the cover's hue at OKLCH lightness 0.34, set
   by screen.js), and cross-fades with it when the source changes. The ink stays the same and keeps its
   contrast at every hue: ink-3 5.1:1 or better on the tinted key-hi, ink-2 6.8:1. */
.tc-screen.is-tinted {
  --black-ground: color-mix(in oklab, var(--tint) 36%, var(--base-ground));
  --black-key: color-mix(in oklab, var(--tint) 34%, var(--base-key));
  --black-key-hi: color-mix(in oklab, var(--tint) 30%, var(--base-key-hi));
  --black-raised: color-mix(in oklab, var(--tint) 34%, var(--base-raised));
  --black-rule: color-mix(in oklab, var(--tint) 36%, var(--base-rule));
  --c-ground: var(--black-ground); --c-key: var(--black-key); --c-key-hi: var(--black-key-hi); --c-rule: var(--black-rule);
}

/* ── Root: the instrument's face ─────────────────────────────────────── */
.tc-screen {
  /* The Back button's centre: 256px below the knob's (a 99px, 10.7mm button, measured on the same render). Set
     here rather than on :root, so it follows the knob's fit on this screen. What Back does on screen lines up
     with it. */
  --back-y: calc(var(--knob-y) + 256px);
  /* live, being set: tuned from the cover. Declared here, where screen.js sets --sig, so it resolves to the
     tuned colour (on :root it would freeze at the fallback before the screen sets it) */
  --c-live: var(--sig);
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--c-ground); color: var(--c-ink);
  font: var(--t-body);
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: --sig var(--dur-tune) var(--ease-out), --field var(--dur-tune) var(--ease-out), --tint var(--dur-tune) var(--ease-out);
}
.tc-screen *, .tc-screen *::before, .tc-screen *::after { box-sizing: border-box; }
:where(.tc-screen) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }   /* no specificity, so every component styles its own */
:where(.tc-screen) :where(p, h1, h2) { margin: 0; }   /* no specificity, so components set their own margins */
.tc-screen svg { display: block; }
.tc-screen ::selection { background: var(--c-key-hi); color: var(--c-ink); }
.tc-screen button:focus { outline: none; }
.tc-screen button:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; }
.tc-screen kbd { font: var(--t-legend); padding: 2px 6px; border-radius: var(--r-key); background: var(--c-key); color: var(--c-ink); }

/* Anything that scrolls can be swiped; the knob keeps its selection in view. */
[data-scroll] { overscroll-behavior: contain; scrollbar-width: none; scroll-behavior: smooth; }
[data-scroll]::-webkit-scrollbar { display: none; }
[data-scroll="y"] { overflow-x: hidden; overflow-y: auto; touch-action: pan-y; }
[data-scroll="x"] { overflow-x: auto; overflow-y: hidden; touch-action: pan-x; }

.view { position: absolute; inset: 0; }
.layer { position: absolute; inset: 0; pointer-events: none; }

/* ── Shared vocabulary ───────────────────────────────────────────────── */
.readout { display: flex; align-items: center; gap: var(--s-3); min-width: 0; font: var(--t-legend); letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-ink-3); white-space: nowrap; }
.readout > span { overflow: hidden; text-overflow: ellipsis; }
.readout__on { display: inline-flex; align-items: center; gap: 6px; color: var(--c-ink); flex: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }
.dot--live { background: var(--c-live); }
.dot--ink { width: 8px; height: 8px; background: var(--c-ink); }

/* Keys: near-square, they press in */
.key { width: 56px; height: 56px; flex: none; border-radius: var(--r-key); display: grid; place-items: center; background: var(--c-key); color: var(--c-ink); transition: transform var(--dur-fast) var(--ease-out), background var(--dur) var(--ease-out), color var(--dur) var(--ease-out); }
.key svg { width: 26px; height: 26px; }
.key:active { transform: scale(0.96); }
.key:disabled { opacity: 0.35; cursor: default; }
.key:disabled:active { transform: none; }
.key.is-on { background: var(--c-key-hi); box-shadow: inset 0 0 0 2px var(--c-ink); }   /* a ring: solid ink is kept for play */
.key--play { width: 80px; background: var(--c-live); color: var(--c-on-live); }
.key--play svg { width: 30px; height: 30px; }

/* The ruled scale: a hairline base, ticks, a filled stretch and a needle. Used by the timeline, the
   Mixer and Settings; positions move on transform/translate only. */
.scale { position: relative; container-type: inline-size; touch-action: none; }
.scale[data-scrub], .scale[data-fader] { cursor: pointer; }
.scale::before { content: ""; position: absolute; inset: -10px 0; }   /* a finger-sized hit area */
.scale__base { position: absolute; left: 0; right: 0; height: 1px; background: var(--c-tick); }
.scale__done { position: absolute; left: 0; width: 100%; height: 3px; background: var(--c-ink); transform-origin: left center; transform: scaleX(0); }
.scale__tick { position: absolute; width: 1px; height: 6px; background: var(--c-tick); }
.scale__tick.is-major { height: 12px; background: var(--c-ink-3); }
.scale__needle { position: absolute; left: -1px; width: 2px; background: var(--c-ink); }
.scale__label { position: absolute; font: var(--t-legend); color: var(--c-ink-3); transform: translateX(-50%); }
.scale__label:first-of-type { transform: none; }
.scale__label.is-end { transform: translateX(-100%); }

/* ── Top bar: four equal columns, one under each hardware button ─────── */
.bar-wrap {
  position: absolute; top: 0; right: 0; left: 0; z-index: 5;
  background: var(--black-ground); box-shadow: inset 0 -1px 0 var(--black-rule);
  transition: transform var(--dur-bar) var(--ease-out), opacity var(--dur-bar) var(--ease-out);
}
.bar-hidden .bar-wrap { transform: translateY(-100%); opacity: 0; pointer-events: none; }
.bar { height: var(--bar-h); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tab { display: flex; align-items: center; justify-content: center; gap: var(--s-3); font: var(--t-body); font-weight: 500; color: var(--black-ink-3); transition: color var(--dur) var(--ease-out); }
.tab__key { font: var(--t-legend); width: 30px; height: 30px; display: grid; place-items: center; border-radius: var(--r-key); background: var(--black-key); color: var(--black-ink-2); transition: background var(--dur) var(--ease-out), color var(--dur) var(--ease-out); }
.tab.is-active { color: var(--black-ink); }
.tab.is-active .tab__key { background: var(--sig); color: var(--ink-dark); }
.bar-indicator {   /* the signal line: one size, centred under the current button */
  position: absolute; top: 0; left: 0; z-index: 6; width: 40px; height: 3px;
  background: var(--sig);
  transform: translate(var(--ind-x, 0), calc(var(--bar-h) - 3px));
  transition: transform var(--dur-bar) var(--ease-out), opacity var(--dur) var(--ease-out), background var(--dur-tune) var(--ease-out);
  pointer-events: none;
}
.bar-hidden .bar-indicator { transform: translate(var(--ind-x, 0), 0); }
.is-colour.bar-hidden .bar-indicator { background: var(--ink-light); }   /* on the colour face the line is ink */
.is-colour.is-ink-dark.bar-hidden .bar-indicator { background: var(--ink-dark); }
.no-indicator .bar-indicator { opacity: 0; }
.bar-reveal { position: absolute; top: 0; right: 0; left: 0; z-index: 4; height: 24px; opacity: 0; }
.tc-screen:not(.bar-hidden) .bar-reveal { display: none; }
.tc-screen.bar-pinned { --head-top: var(--bar-h); }
/* headers step aside while the sliding bar covers them */
.status, .screen-head, .home__side > .badges { transition: opacity var(--dur) var(--ease-out); }
.tc-screen:not(.bar-hidden):not(.bar-pinned) :is(.status, .screen-head, .home__side > .badges) { opacity: 0; }

/* Status badges: notifications, a muted mic; they live in each screen's header */
.badges { display: inline-flex; gap: var(--s-2); flex: none; }
.badge { height: 36px; padding: 0 12px; border-radius: var(--r-key); display: inline-flex; align-items: center; gap: 6px; font: var(--t-legend); letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap; flex: none; background: var(--c-key); color: var(--c-ink-2); }
.badge svg { width: 20px; height: 20px; }
.badge--note.is-unread { background: var(--c-live); color: var(--c-on-live); }
/* the mic badge sits on black on every face, so its pink always reads */
.badge--mic { background: var(--black-ground); color: var(--c-danger); box-shadow: inset 0 0 0 1.5px var(--c-danger); }

/* ── Shared pieces ─────────────────────────────────────────────────────── */
.state { position: absolute; inset: 0; display: grid; align-content: center; justify-items: start; row-gap: var(--s-3); padding: 0 var(--s-7); max-width: 680px; }
.state__icon { width: 56px; height: 56px; color: var(--c-ink-3); margin-bottom: var(--s-2); }
.state__icon svg { width: 100%; height: 100%; }
.state__title { font: var(--t-big); letter-spacing: -0.005em; max-width: 18ch; }
.state__text { font: var(--t-body); color: var(--c-ink-2); max-width: 40ch; }
.state__hint { font: var(--t-caption); color: var(--c-ink-3); margin-top: var(--s-2); }
.spinner { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--c-rule); border-top-color: var(--c-live); animation: spin 900ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.screen-head { position: absolute; top: calc(var(--head-top, 0px) + 16px); left: var(--gutter); right: var(--gutter); height: 48px; display: flex; align-items: center; gap: var(--s-3); box-shadow: inset 0 -1px 0 var(--c-rule); }
.screen-title { font: var(--t-heading); white-space: nowrap; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.screen-meta { font: var(--t-legend); letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.screen-hint { font: var(--t-legend); letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-ink-3); margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
/* with a status badge in the header, the hint gives way first */
.screen-head:has(.badges) .screen-hint { display: none; }
.screen-head .badges { margin-left: auto; }
.screen-body { position: absolute; top: calc(var(--head-top, 0px) + var(--head-h)); right: 0; bottom: 0; left: 0; }
.pill-btn { display: inline-flex; align-items: center; gap: var(--s-2); height: 52px; padding: 0 var(--s-5) 0 var(--s-4); flex: none; border-radius: var(--r-key); background: var(--c-key); font: var(--t-body); font-weight: 500; transition: transform var(--dur-fast) var(--ease-out), background var(--dur) var(--ease-out); }
.pill-btn svg { width: 22px; height: 22px; color: var(--c-ink-2); }
.pill-btn:active { transform: scale(0.97); }

/* Weather line, with the city */
.wx { display: flex; align-items: center; gap: 7px; font: var(--t-legend); letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-ink-2); white-space: nowrap; }
.wx svg { width: 22px; height: 22px; color: var(--c-ink); flex: none; }
.wx__temp { color: var(--c-ink); }
.wx__city { color: var(--c-ink-2); }
.wx__range { white-space: nowrap; }   /* the high and the low stay together, whatever their digits */
.wx__range::before { content: " · "; }
.wx--empty { white-space: normal; font: var(--t-caption); text-transform: none; letter-spacing: 0; color: var(--c-ink-3); }
.next { display: flex; align-items: center; gap: 7px; font: var(--t-legend); letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-ink-3); min-width: 0; }
.next .dot { width: 8px; height: 8px; }
:is(.face, .is-face) :is(.next, .saver__event) .dot { box-shadow: 0 0 0 1.5px var(--c-ink); }   /* a calendar's colour can match the face */
.next__when { color: var(--c-ink); white-space: nowrap; }
.next__title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; color: var(--c-ink-2); }
.ampm { font: var(--t-legend); color: var(--c-ink-3); margin-left: 4px; }

/* The Mac volume as a ruled scale: vertical beside the knob, level on home */
.vol { display: grid; font: var(--t-read); color: var(--c-ink); }
.vol__label { font: var(--t-legend); letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-ink-3); }
.vol__scale { position: relative; touch-action: none; cursor: pointer; }
.vol__scale::before { content: ""; position: absolute; inset: -12px; }   /* a finger-sized hit area */
.vol__fill { position: absolute; background: var(--c-ink); transition: transform var(--dur-fast) linear, background var(--dur) var(--ease-out); }
.vol.is-active .vol__fill { background: var(--c-live); }
.vol.is-muted .vol__value { color: var(--c-ink-3); }
.vol--h { grid-template-columns: auto 180px 3ch; align-items: center; column-gap: var(--s-3); }
.vol--h .vol__label { grid-column: 1; grid-row: 1; }
.vol--h .vol__scale { grid-column: 2; grid-row: 1; height: 14px; background: repeating-linear-gradient(to right, var(--c-tick) 0 1px, transparent 1px 10%) top / 100% 8px no-repeat; }
.vol--h .vol__fill { left: 0; bottom: 0; width: 100%; height: 3px; transform-origin: left center; }
.vol--h .vol__value { grid-column: 3; grid-row: 1; text-align: right; font: var(--t-read-sm); }

/* ══ Now playing: the sleeve, on the colour face ═══════════════════════ */
.np { position: absolute; inset: 0; background: var(--c-ground); isolation: isolate; }   /* isolated so the cover's glow sits under all of it */
.status { position: absolute; top: calc(var(--head-top, 0px) + 16px); left: var(--gutter); right: var(--gutter); height: 48px; display: flex; align-items: center; gap: 18px; box-shadow: inset 0 -1px 0 var(--c-rule); }
.status__time { display: flex; align-items: baseline; }
.status__clock { font: var(--t-read); font-variant-numeric: tabular-nums; }
.status__date { font: var(--t-legend); letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-ink-3); white-space: nowrap; }
.status__right { margin-left: auto; display: flex; align-items: center; gap: 18px; min-width: 0; }
.np__top { position: absolute; left: var(--gutter); right: var(--knob-clear); top: calc(var(--head-top, 0px) + 76px); height: 189px; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--gutter); }
/* the cover sits in a soft glow of its own colours, as light: a small blurred copy made once per cover (lib.js
   glowOf), scaled up behind it, so nothing blurs live. Screen-blended, so it only ever lightens the face (a dark
   cover casts no shadow and the field never greys), and it fades to nothing at the gutter on every side. */
.np__sleeve { position: relative; justify-self: start; }
.np__glow { position: absolute; inset: calc(-1 * var(--gutter)); z-index: -1; background: center / 100% 100% no-repeat; mix-blend-mode: screen; opacity: var(--glow); pointer-events: none; }
@media (prefers-reduced-transparency: reduce) { .np__glow { display: none; } }
.np__art { position: relative; height: 189px; aspect-ratio: var(--ar, 1.778); max-width: 336px; border-radius: var(--r-art); overflow: hidden; background: rgba(0, 0, 0, 0.3); box-shadow: 0 0 0 1px var(--c-rule); }
.np__art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.np__art.is-app { aspect-ratio: 1; display: grid; place-items: center; background: var(--c-key); }
.np__art.is-app img { width: 96px; height: 96px; object-fit: contain; }
.np__art.is-app svg { width: 56px; height: 56px; color: var(--c-ink-3); }
.np__meta { min-width: 0; height: 189px; display: grid; grid-template-rows: auto auto minmax(0, 1fr); }
.np__who { font: var(--t-name); margin-top: var(--s-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crate { min-height: 0; margin-top: var(--s-4); display: grid; grid-template-rows: auto 64px; align-content: start; }   /* one sleeve at a time; it scrolls while choosing */
.crate:not(:has(.rec)) { grid-template-rows: auto minmax(0, 1fr); }   /* only a note: it gets the room */
.crate__head { padding-bottom: var(--s-2); box-shadow: inset 0 -1px 0 var(--c-rule); }
.crate__list { min-height: 0; }
.rec { width: 100%; display: grid; grid-template-columns: 86px minmax(0, 1fr); column-gap: var(--s-4); align-items: center; padding: 8px 8px 8px 0; box-shadow: inset 0 -1px 0 var(--c-rule); border-radius: var(--r-key); transition: background var(--dur) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
.rec:active { transform: scale(0.99); }
.rec.is-focused { background: var(--c-key-hi); box-shadow: inset 0 0 0 2px var(--c-focus); padding-left: 8px; grid-template-columns: 78px minmax(0, 1fr); }
.rec__thumb { justify-self: start; height: 48px; aspect-ratio: var(--ar, 1.778); max-width: 86px; border-radius: var(--r-art); background: rgba(0, 0, 0, 0.3) center / cover no-repeat; }   /* 86×48 for video, 48×48 for a song */
.rec__thumb.is-icon { aspect-ratio: 1; background-size: 34px; background-color: var(--c-key); }
.rec__text { min-width: 0; display: grid; row-gap: 6px; }
.rec__title { font: var(--t-body); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--c-ink-2); }
.rec__meta { display: flex; align-items: center; gap: 6px; min-width: 0; font: var(--t-legend); letter-spacing: 0.05em; text-transform: uppercase; color: var(--c-ink-3); white-space: nowrap; }
.rec__meta > span:first-of-type { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.rec__meta .dot { width: 9px; height: 9px; box-shadow: 0 0 0 1.5px var(--c-ink); }   /* each source's own signal, ringed so it reads on any face */
.crate__note { font: var(--t-caption); color: var(--c-ink-3); padding-top: var(--s-2); }
.np__title { position: absolute; left: var(--gutter); right: var(--gutter); top: calc(var(--head-top, 0px) + 272px); height: 100px; margin: 0; display: flex; align-items: center; gap: var(--s-4); font: 700 var(--fs, 112px)/0.9 var(--font-cond); letter-spacing: -0.012em; }   /* centred in its band, so the space above and below it is the same at any size */
.np__main { min-width: 0; white-space: nowrap; overflow: hidden; padding-bottom: 0.1em; margin-inline-start: -0.05em; }   /* the face's side bearing, so the letters line up with the margin at any size */
.np__run { display: inline-block; white-space: nowrap; }
/* too long for the band: it slides to show the rest (lib.js slideText), on transform only */
.np__title.is-running .np__run, .saver__np-title.is-running .saver__run { will-change: transform; }
.np__title.is-rtl .np__main { line-height: 1.25; padding-bottom: 0.15em; }
.np__aside { flex: none; font: var(--t-legend); letter-spacing: 0.08em; text-transform: uppercase; color: var(--c-ink-3); white-space: nowrap; }
.np__title.is-running .np__aside { display: none; }
.np__time { position: absolute; left: var(--gutter); right: var(--gutter); top: calc(var(--head-top, 0px) + 374px); height: 36px; }
.np__time .scale { position: absolute; inset: 0; }
.np__time .scale__base { top: 30px; }
.np__time .scale__done { top: 29px; background: var(--c-live); }
.np__time .scale__tick { top: 24px; }
.np__time .scale__tick.is-major { top: 18px; }
.np__time .scale__needle { top: 4px; height: 30px; background: var(--c-live); transition: transform var(--dur) var(--ease-out); }
.scale__at { position: absolute; top: 0; left: 0; margin-left: 8px; font: var(--t-legend); font-size: 17px; white-space: nowrap; }
.scale__at.is-flipped { margin-left: 0; transform: translateX(calc(-100% - 8px)); }
.scale__end { position: absolute; right: 0; top: 0; font: var(--t-legend); font-size: 17px; color: var(--c-ink-3); pointer-events: none; }
.scale__end.is-hidden { opacity: 0; }
/* seeking with the knob: the needle thickens and a reading shows where it will land */
.scale__bubble { position: absolute; left: 0; bottom: calc(100% + 6px); display: grid; justify-items: center; row-gap: 2px; padding: 6px 10px 5px; border-radius: var(--r-key); background: var(--c-ink); color: var(--c-on-ink); font: var(--t-read-sm); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity var(--dur) var(--ease-out); }
.scale__bubble small { font: var(--t-legend); opacity: 0.8; }
.np__time.is-seeking .scale__bubble { opacity: 1; }
.np__time.is-seeking .scale__needle, .np__time.is-scrubbing .scale__needle { transform: scaleX(2); }   /* thicker, on transform: the chip is slow */
.np__keys { position: absolute; left: var(--gutter); right: var(--gutter); top: calc(var(--head-top, 0px) + 416px); height: 56px; display: flex; align-items: center; gap: var(--s-2); }
.keys__sep { width: 1px; height: 40px; background: var(--c-rule); margin: 0 6px; flex: none; }
.np__note { font: var(--t-caption); color: var(--c-ink-2); max-width: 300px; }
.np__hint { margin-left: auto; font: var(--t-legend); line-height: 1.2; letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-ink-3); text-align: right; white-space: nowrap; }
/* a new source arrives from the direction of the swipe; its colour cross-fades on the root */
.np.is-arriving :is(.np__top, .np__title) { animation: arrive var(--dur-tune) var(--ease-out) both; }
@keyframes arrive { from { opacity: 0; transform: translateY(var(--from, 16px)); } to { opacity: 1; transform: none; } }

/* Home: nothing on air, on the black face */
.home { position: absolute; inset: 0; }
.home__clock { position: absolute; left: var(--gutter); top: calc(var(--head-top, 0px) + 48px); }
.home__time { font: var(--t-hero); letter-spacing: -0.015em; font-variant-numeric: tabular-nums; }
.home__date { font: var(--t-name); color: var(--c-ink-2); margin-top: var(--s-4); }
.home__side { position: absolute; right: var(--knob-clear); top: calc(var(--head-top, 0px) + 28px); width: 330px; display: grid; row-gap: var(--s-4); justify-items: stretch; }
.home__side > .badges { justify-self: end; }
.wx--home { justify-content: flex-end; flex-wrap: wrap; row-gap: 6px; }
.wx--home svg { width: 34px; height: 34px; }
.wx--home .wx__temp { font: var(--t-read-lg); letter-spacing: 0; }
.wx--home .wx__text { flex-basis: 100%; text-align: right; }
.agenda { display: grid; }
.event { display: grid; grid-template-columns: 10px minmax(0, 1fr); column-gap: var(--s-3); align-items: baseline; padding: var(--s-4) 0; box-shadow: inset 0 1px 0 var(--c-rule); }
.event__when { font: var(--t-legend); letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-ink-2); }
.event__title { font: var(--t-label); margin: 6px 0 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.event__cal { font: var(--t-caption); color: var(--c-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda__empty { font: var(--t-caption); color: var(--c-ink-3); text-align: right; }
.home__foot { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 24px; display: flex; align-items: center; gap: var(--s-5); padding-top: var(--s-4); box-shadow: inset 0 1px 0 var(--c-rule); }
.home__idle { font: var(--t-body); color: var(--c-ink-3); max-width: 430px; }
.vol--home, .home__foot .vol { margin-left: auto; }

/* ══ Mixer: the Mac's output large on top, the apps in a strip below ══ */
/* Content lines up on the grid's left margin; a focused part's ring sits 16px outside it. Only the
   output gets the big number; an app shows its level in its cell (and round the knob while it's set). */
.mixer { position: absolute; inset: 0; }
.mixer__out { position: absolute; left: calc(var(--gutter) - var(--s-4)); right: calc(var(--knob-clear) - var(--s-4)); top: calc(var(--head-top, 0px) + 84px); height: 233px; padding: var(--s-4); border-radius: var(--r-key); transition: background var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out); }
.mixer__out.is-focused { box-shadow: inset 0 0 0 2px var(--c-focus); }   /* a ring only: a filled panel this size would outweigh the number */
.mixer__out.is-editing { box-shadow: inset 0 0 0 2px var(--c-live); }
.mixer__pick { position: absolute; inset: 0; border-radius: var(--r-key); }   /* the whole block is one tap target */
.mixer__none { font: var(--t-body); color: var(--c-ink-3); }
.mixer__who { position: relative; display: flex; align-items: center; gap: var(--s-4); min-width: 0; max-width: calc(100% - 240px); pointer-events: none; }
.mixer__icon { width: 48px; height: 48px; flex: none; border-radius: var(--r-key); display: grid; place-items: center; background: var(--c-key); color: var(--c-ink-2); }
.mixer__icon svg { width: 28px; height: 28px; }
.mixer__names { display: grid; row-gap: 6px; min-width: 0; }
.mixer__name { font: var(--t-label); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mixer__out.is-muted .readout__on { color: var(--c-danger); }
.mixer__value { position: relative; margin-top: var(--s-2); display: flex; align-items: baseline; font: var(--t-level); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none; }
.mixer__value small { font: var(--t-read); color: var(--c-ink-3); margin-left: var(--s-2); letter-spacing: 0; }
.mixer__out.is-muted .mixer__value, .mixer__out.is-fixed .mixer__value { color: var(--c-ink-2); }
.mixer__side { position: absolute; z-index: 1; top: var(--s-4); right: var(--s-4); display: grid; justify-items: end; row-gap: var(--s-3); }
.mixer__mute.is-muted { background: var(--black-ground); color: var(--c-danger); box-shadow: inset 0 0 0 1.5px var(--c-danger); }
.mixer__state { color: var(--c-ink-3); }
.mixer__scale { position: absolute; z-index: 1; left: var(--s-4); right: var(--s-4); bottom: var(--s-2); height: 46px; }
.mixer__scale .scale__base { top: 22px; }
.mixer__scale .scale__done { top: 21px; }
.mixer__scale .scale__tick { top: 16px; }
.mixer__scale .scale__tick.is-major { top: 10px; }
.mixer__scale .scale__needle { top: 2px; height: 26px; transition: transform var(--dur) var(--ease-out); }
.mixer__scale .scale__label { top: 31px; }
.mixer__out.is-editing .mixer__scale :is(.scale__done, .scale__needle) { background: var(--c-live); }
.mixer__out.is-editing .mixer__scale .scale__needle { transform: scaleX(2); }
/* the strip: cells under a hairline, split by hairlines; it slides a page (four cells) at a time and the
   next page's first cell peeks in at the right edge */
.mixer__strip {
  position: absolute; left: 0; right: 0; top: calc(var(--head-top, 0px) + 323px); height: 120px;
  overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-padding-left: calc(var(--gutter) - var(--s-4));
  overscroll-behavior: contain; scrollbar-width: none; touch-action: pan-x;
}
.mixer__strip::-webkit-scrollbar { display: none; }
.mixer__row {
  position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: calc(var(--col) + var(--col-gap));
  height: 100%; padding: 0 var(--knob-clear) 0 calc(var(--gutter) - var(--s-4)); width: max-content;
  min-width: calc((var(--pages, 1) - 1) * 4 * (var(--col) + var(--col-gap)) + 100%);   /* the last page can scroll fully in */
}
.mixer__row::before { content: ""; position: absolute; top: 0; left: var(--gutter); right: 0; height: 1px; background: var(--c-rule); }
.mixer__row > :nth-child(4n + 1) { scroll-snap-align: start; }
.mcell { position: relative; min-width: 0; padding: 14px var(--s-4) 12px; display: grid; grid-template-rows: 28px 36px 10px; align-content: start; row-gap: 10px; text-align: left; border-radius: var(--r-key); box-shadow: inset 1px 0 0 var(--c-rule); transition: background var(--dur) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
.mcell:first-child { box-shadow: none; }
.mcell:active { transform: scale(0.98); }
.mcell.is-focused { background: var(--c-key-hi); box-shadow: inset 0 0 0 2px var(--c-focus); }
.mcell.is-editing { box-shadow: inset 0 0 0 2px var(--c-live); }
.mcell__name { display: flex; align-items: center; gap: var(--s-2); min-width: 0; font: var(--t-body); font-weight: 500; color: var(--c-ink-2); }
.mcell__name > span:last-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mcell.is-focused .mcell__name { color: var(--c-ink); }
.mcell__icon { width: 28px; height: 28px; flex: none; border-radius: var(--r-icon); background: center / contain no-repeat; }
.mcell__icon.is-glyph { display: grid; place-items: center; color: var(--c-ink-2); }
.mcell__icon.is-glyph svg { width: 22px; height: 22px; }
.mcell__value { font: var(--t-read-lg); display: flex; align-items: center; gap: var(--s-2); font-variant-numeric: tabular-nums; }
.mcell.is-playing .mcell__value::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c-live); }
.mcell.is-muted .mcell__value { color: var(--c-ink-3); }
.mcell__bar { position: relative; height: 10px; background: repeating-linear-gradient(to right, var(--c-tick) 0 1px, transparent 1px 10%) top / 100% 6px no-repeat; }
.mcell__bar i { position: absolute; left: 0; bottom: 0; width: 100%; height: 4px; background: color-mix(in oklab, var(--c-ink) 42%, var(--c-key)); transform-origin: left center; transition: transform var(--dur-fast) linear, background var(--dur) var(--ease-out); }
.mcell.is-focused .mcell__bar i { background: var(--c-ink); }
.mcell.is-editing .mcell__bar i { background: var(--c-live); }
.mixer__note { grid-column: span 3; padding: 14px var(--s-4); font: var(--t-body); color: var(--c-ink-2); box-shadow: inset 1px 0 0 var(--c-rule); }
.mixer__note b { display: block; margin-bottom: var(--s-1); font: var(--t-label); color: var(--c-ink); }
/* page dots under a strip that slides: the current page is a bar */
.pager-dots { position: absolute; left: var(--gutter); right: var(--knob-clear); bottom: 14px; height: 12px; display: flex; justify-content: center; align-items: center; gap: var(--s-2); }
.pager-dots i { width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--c-ink-3); transition: background var(--dur) var(--ease-out); }
.pager-dots i.is-on { width: 28px; border-radius: 5px; background: var(--c-ink); box-shadow: none; }

/* ══ Controls: one four-column grid; the two sliders stand two rows tall ═ */
.controls__grid {
  position: absolute; top: var(--s-2); left: var(--gutter); right: var(--knob-clear); bottom: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 160px; grid-auto-flow: row dense;
  gap: var(--col-gap); align-content: start; padding: 2px 2px var(--s-4);
}
.vslider { grid-row: span 2; position: relative; display: grid; grid-template-rows: auto auto minmax(0, 1fr); row-gap: var(--s-2); padding: var(--s-4); border-radius: var(--r-key); background: var(--c-key); touch-action: none; cursor: ns-resize; transition: background var(--dur) var(--ease-out); }
.vslider__value { font: var(--t-huge); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vslider__value small { font: var(--t-read-sm); color: var(--c-ink-3); margin-left: 2px; letter-spacing: 0; }
.vslider__name { display: flex; align-items: center; gap: var(--s-2); font: var(--t-body); font-weight: 500; color: var(--c-ink-2); }
.vslider__name svg { width: 24px; height: 24px; }
.vslider__scale { position: relative; margin-top: var(--s-3); background: repeating-linear-gradient(to top, var(--c-tick) 0 1px, transparent 1px 10%) left / 12px 100% no-repeat; }
.vslider__fill { position: absolute; left: 22px; right: 0; bottom: 0; height: 100%; background: color-mix(in oklab, var(--c-ink) 42%, var(--c-key)); transform-origin: center bottom; transition: transform var(--dur-fast) linear, background var(--dur) var(--ease-out); }
.vslider.is-focused { background: var(--c-key-hi); box-shadow: inset 0 0 0 2px var(--c-focus); }
.vslider.is-focused .vslider__fill { background: var(--c-ink); }
.vslider.is-editing .vslider__fill { background: var(--c-live); }
.vslider.is-editing { box-shadow: inset 0 0 0 2px var(--c-live); }
.vslider.is-unavailable :is(.vslider__name, .vslider__value, .vslider__scale) { opacity: 0.45; }
.vslider.is-muted .vslider__value { font-size: 40px; color: var(--c-ink-2); }
.tile { min-width: 0; padding: var(--s-4); display: grid; grid-template-rows: 1fr auto auto; justify-items: stretch; row-gap: var(--s-1); border-radius: var(--r-key); background: var(--c-key); transition: background var(--dur) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
.tile:active { transform: scale(0.97); }
.tile.is-focused { background: var(--c-key-hi); box-shadow: inset 0 0 0 2px var(--c-focus); }
.tile__top { display: flex; justify-content: space-between; align-items: flex-start; }
.tile__icon { width: 40px; height: 40px; color: var(--c-ink-3); transition: color var(--dur) var(--ease-out); }
.tile__icon svg { width: 40px; height: 40px; }
.tile.is-on .tile__icon { color: var(--c-ink); }
.tile__state { color: var(--c-ink-3); gap: 6px; }
.tile.is-on .tile__state { color: var(--c-ink); }
.tile__name { font: var(--t-label); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile__detail { font: var(--t-caption); color: var(--c-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile__detail:empty { display: none; }
.tile.is-unavailable :is(.tile__icon, .tile__name) { opacity: 0.45; }
.tile--add { background: none; box-shadow: inset 0 0 0 1.5px var(--c-rule); }
.tile--add.is-focused { box-shadow: inset 0 0 0 2px var(--c-focus); }
.tile--add .tile__icon { color: var(--c-ink-2); }

/* ══ Launch: big icons, four to a row, no names; the header names the one under the knob ═ */
.settings__list, .panel__body {   /* a soft edge where a list scrolls on */
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 26px), transparent); mask-image: linear-gradient(180deg, #000 calc(100% - 26px), transparent);
}
.icon-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 160px; gap: var(--col-gap); align-content: start; padding: 2px 2px var(--s-4); }
/* the side column: the Dock button and two pinned apps in three equal cells, standing exactly as tall as
   the page's two rows and starting where they start, with a hairline between it and the pages; it stays put
   while the pages turn. The pages take the rest of the width, four icons across. */
.launch__side { position: absolute; top: 10px; left: var(--gutter); width: 112px; height: calc(2 * 160px + var(--col-gap)); display: grid; grid-template-rows: repeat(3, minmax(0, 1fr)); row-gap: var(--s-3); }
.launch__side::after { content: ""; position: absolute; top: 0; bottom: 0; right: calc(-1 * var(--col-gap) / 2 - 1px); width: 1px; background: var(--c-rule); }
.side-dock { position: relative; display: grid; justify-items: center; align-content: center; row-gap: var(--s-2); border-radius: var(--r-key); background: var(--c-ink); color: var(--c-on-ink); transition: transform var(--dur-fast) var(--ease-out); }
.side-dock svg { width: 32px; height: 32px; }
.side-dock__name { font: var(--t-legend); letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; }
.side-dock__n { position: absolute; top: var(--s-2); right: var(--s-2); min-width: 24px; height: 24px; padding: 0 7px; display: grid; place-items: center; border-radius: 12px; background: var(--c-on-ink); color: var(--c-ink); font: var(--t-legend); font-size: 13px; }
.side-dock:active { transform: scale(0.96); }
.side-dock.is-focused { box-shadow: 0 0 0 3px var(--c-ground), 0 0 0 5px var(--c-focus); }   /* a filled key: the ring sits outside, past a gap */
.side-pins { display: contents; }
.side-pin { position: relative; display: grid; place-items: center; border-radius: var(--r-key); background: var(--c-key); transition: background var(--dur) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
.side-pin img, .side-pin .app-ph { width: 72px; height: 72px; border-radius: var(--r-icon); }
.side-pin .app-ph { font-size: 32px; }
.side-pin:active { transform: scale(0.96); }
.side-pin.is-focused { background: var(--c-key-hi); box-shadow: inset 0 0 0 2px var(--c-focus); }
.side-pin.is-front::after, .side-pin.is-running::after { content: ""; position: absolute; bottom: 6px; left: 50%; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--c-live); }
.side-pin.is-running::after { background: var(--c-ink-2); }
.side-pin.is-empty { background: none; color: var(--c-ink-3); box-shadow: inset 0 0 0 1.5px var(--c-rule); }
.side-pin.is-empty svg { width: 26px; height: 26px; }
.launch__drawer { position: absolute; top: 0; left: calc(var(--gutter) + 112px + var(--col-gap)); right: 0; bottom: 0; }
.launch__drawer .app-page { padding-left: 0; }
.launch__drawer .icon-grid { column-gap: 12px; }
.launch__drawer .app-tile img, .launch__drawer .app-tile .app-ph { width: 100px; height: 100px; }
.launch__drawer .pager-dots--knob { right: 0; }
/* pages of eight, one shown at a time: turning a page moves the whole page up or down at once, the way its
   dots stack under the knob; nothing scrolls and nothing of the next page shows */
.app-pager { position: absolute; top: var(--s-2); left: 0; right: 0; bottom: 0; overflow: hidden; touch-action: none; }
.app-pages { height: 100%; display: flex; flex-direction: column; transform: translate3d(0, calc(var(--page, 0) * -100%), 0); transition: transform 320ms var(--ease-out); will-change: transform; }
.app-page { flex: none; height: 100%; padding: 2px var(--knob-clear) 0 var(--gutter); align-content: start; }
@media (prefers-reduced-motion: reduce) { .app-pages { transition: none; } }
/* the page dots, stacked in the strip under the knob, where nothing else goes */
.pager-dots--knob { left: auto; right: 0; bottom: auto; width: var(--knob-clear); height: auto; flex-direction: column; justify-content: flex-start; }
.pager-dots--knob i.is-on { width: 10px; height: 28px; }
.launch__empty { position: absolute; left: calc(var(--gutter) + 112px + var(--col-gap)); top: 24px; font: var(--t-body); color: var(--c-ink-3); }
.app-tile { position: relative; min-width: 0; display: grid; place-items: center; border-radius: var(--r-key); transition: background var(--dur) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
.app-tile:active { transform: scale(0.96); }
.app-tile img, .app-tile .app-ph { width: 112px; height: 112px; border-radius: var(--r-icon); }
.app-ph { display: grid; place-items: center; background: var(--c-key); color: var(--c-ink-2); font: 700 48px/1 var(--font-cond); }
.app-tile.is-focused { background: var(--c-key-hi); box-shadow: inset 0 0 0 2px var(--c-focus); }
/* under the icon: the signal dot for the app in front, an ink dot for a pinned app that's open */
.app-tile.is-front::after, .app-tile.is-running::after { content: ""; position: absolute; bottom: 8px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--c-live); }
.app-tile.is-running::after { width: 8px; height: 8px; margin-left: -4px; background: var(--c-ink-2); }
.app-add { width: 112px; height: 112px; border-radius: var(--r-icon); box-shadow: inset 0 0 0 1.5px var(--c-rule); display: grid; place-items: center; color: var(--c-ink-2); }
.app-add svg { width: 40px; height: 40px; }
.panel--folder { background: var(--black-raised); }   /* a layer over Launch, not Launch again */
.folder__body { position: absolute; top: 88px; left: 0; right: 0; bottom: 0; }
.folder__body .app-pager { top: 0; }
.result .app-ph { width: 72px; height: 72px; font-size: 30px; }

/* ══ Panels (choose controls, pinned apps, pin apps, notifications) ═════ */
.overlay {
  position: absolute; inset: 0; z-index: 8; background: var(--black-ground);
  opacity: 0; visibility: hidden; transform: translateY(14px);
  transition: opacity var(--dur-tune) var(--ease-out), transform var(--dur-tune) var(--ease-out), visibility 0s linear var(--dur-tune);
}
.has-overlay .overlay { opacity: 1; visibility: visible; transform: none; transition: opacity var(--dur-tune) var(--ease-out), transform var(--dur-tune) var(--ease-out); }
.panel { position: absolute; inset: 0; }
.panel__head { position: absolute; top: 16px; left: var(--gutter); right: var(--knob-clear); height: 48px; display: flex; align-items: center; gap: var(--s-4); box-shadow: inset 0 -1px 0 var(--c-rule); }
.panel__head .pill-btn { height: 40px; margin-bottom: 4px; }
.panel--pin .panel__head { box-shadow: none; height: 56px; }
.panel__title { font: var(--t-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.panel__head .screen-hint { margin-left: auto; }
.panel__body { position: absolute; top: 88px; left: var(--gutter); right: var(--knob-clear); bottom: 0; padding: 0 2px 24px; }
.panel__group { font: var(--t-legend); letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-ink-3); margin: var(--s-5) 0 0; padding-bottom: var(--s-2); box-shadow: inset 0 -1px 0 var(--c-rule); }
.panel__group:first-child { margin-top: 0; }
.panel__empty { font: var(--t-body); color: var(--c-ink-3); max-width: 520px; padding-top: var(--s-4); }
.pick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s-5); }
.pick { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; column-gap: var(--s-4); padding: 0 var(--s-3) 0 var(--s-3); min-height: 72px; box-shadow: inset 0 -1px 0 var(--c-rule); border-radius: var(--r-key); transition: background var(--dur) var(--ease-out); }
.pick.is-focused { background: var(--c-key-hi); box-shadow: inset 0 0 0 2px var(--c-focus); }
.pick__icon { width: 30px; height: 30px; color: var(--c-ink-3); }
.pick__icon svg { width: 30px; height: 30px; }
.pick__name { font: var(--t-label); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick__check { width: 36px; height: 36px; border-radius: var(--r-key); display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px var(--c-tick); color: var(--c-ink-3); }
.pick__check svg { width: 20px; height: 20px; }
.pick.is-added .pick__icon { color: var(--c-ink); }
.pick.is-added .pick__check { background: var(--c-ink); box-shadow: none; color: var(--c-on-ink); }
/* Pin apps */
.panel--pin .panel__head { right: var(--knob-clear); }
.search { flex: 1; min-width: 0; height: 56px; padding: 0 var(--s-4); border-radius: var(--r-key); display: flex; align-items: center; gap: var(--s-3); background: var(--c-key); box-shadow: inset 0 0 0 1px var(--c-rule); font: var(--t-label); font-weight: 400; }
.search svg { width: 24px; height: 24px; color: var(--c-ink-3); flex: none; }
.search__text { white-space: nowrap; overflow: hidden; }
.search__placeholder { color: var(--c-ink-3); }
.search__caret { width: 2px; height: 28px; background: var(--c-live); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.panel--pin .screen-hint { display: none; }
.results { position: absolute; top: 84px; left: var(--gutter); right: var(--knob-clear); height: 150px; display: flex; gap: var(--s-2); padding: 2px; }
.results .panel__empty { align-self: center; }
.result { flex: 0 0 140px; display: grid; justify-items: center; align-content: center; row-gap: var(--s-2); padding: var(--s-2) var(--s-1); border-radius: var(--r-key); }
.result img { width: 72px; height: 72px; border-radius: var(--r-icon); }
.result__name { font: var(--t-caption); font-weight: 500; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result__state { display: inline-flex; align-items: center; gap: 4px; font: var(--t-legend); letter-spacing: 0.05em; color: var(--c-ink-3); text-transform: uppercase; }
.result__state svg { width: 14px; height: 14px; }
.result.is-pinned .result__state { color: var(--c-ink); }
.result.is-focused { background: var(--c-key-hi); box-shadow: inset 0 0 0 2px var(--c-focus); }
.kb { position: absolute; left: 0; right: 0; bottom: 12px; display: grid; row-gap: 6px; }
.kb__row { display: flex; justify-content: center; gap: 6px; }
.kb__key { flex: 0 0 68px; height: 50px; border-radius: var(--r-key); background: var(--c-key); font: var(--t-label); display: grid; place-items: center; transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
.kb__key svg { width: 24px; height: 24px; }
.kb__key:active { background: var(--c-key-hi); transform: scale(0.95); }
.kb__key--wide { flex-basis: 108px; font: var(--t-body); font-weight: 500; }
.kb__key--space { flex: 0 1 380px; color: var(--c-ink-3); font: var(--t-legend); letter-spacing: 0.06em; text-transform: uppercase; }

/* ══ Notifications: Apple Watch cards ═══════════════════════════════════ */
/* A card is a raised region on black; the app's icon breaks out over its top-left corner, cut out of the
   card by a ring of the ground; the app's name sits right in a lighter band; then the title, the message
   and when. A new one takes the whole screen; the list stacks the same cards. */
.banner-slot { position: absolute; inset: 0; z-index: 9; pointer-events: none; }
.wcard { position: relative; border-radius: var(--r-key); background: var(--black-key); color: var(--black-ink); }
.wcard__icon { position: absolute; top: -26px; left: 18px; width: 72px; height: 72px; border-radius: var(--r-icon); box-shadow: 0 0 0 4px var(--black-ground); }
.wcard__icon.is-glyph { display: grid; place-items: center; background: var(--black-key-hi); color: var(--black-ink); border-radius: var(--r-key); }
.wcard__icon.is-glyph svg { width: 36px; height: 36px; }
.wcard__head { height: 56px; padding: 0 var(--s-5) 0 108px; display: flex; align-items: center; justify-content: flex-end; border-radius: var(--r-key) var(--r-key) 0 0; background: var(--black-key-hi); }
.wcard__app { font: 600 20px/1 var(--font-sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--black-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wcard__body { padding: var(--s-4) var(--s-5) var(--s-5); display: grid; row-gap: var(--s-2); }
.wcard__title { font: var(--t-big); letter-spacing: -0.005em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wcard__text { font: var(--t-label); font-weight: 400; color: var(--black-ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wcard__time { font: var(--t-legend); letter-spacing: 0.06em; text-transform: uppercase; color: var(--black-ink-3); }
/* arriving: the whole screen, the card in the upper part, its actions as big keys along the bottom */
.alert { position: absolute; inset: 0; pointer-events: auto; background: var(--black-ground); color: var(--black-ink); animation: alert-in var(--dur-tune) var(--ease-out) both; }
@keyframes alert-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.alert__stack { position: absolute; top: 48px; left: var(--gutter); right: var(--knob-clear); }
.wcard--alert { z-index: 1; cursor: pointer; }
.wcard--alert .wcard__title { font-size: 60px; line-height: 1; }   /* arriving, it can be read across the desk */
.wcard--alert .wcard__body { row-gap: var(--s-3); padding-top: var(--s-5); }
.alert.is-important .wcard__head { background: var(--sig); }
.alert.is-important .wcard__app { color: var(--ink-dark); }
/* more waiting: the edge of the next card shows under this one */
.wcard-behind { height: 14px; margin: 0 var(--s-4); border-radius: 0 0 var(--r-key) var(--r-key); background: color-mix(in oklab, var(--black-key) 60%, var(--black-ground)); box-shadow: inset 0 1px 0 var(--black-rule); }
.alert__more { margin-top: var(--s-2); text-align: right; font: var(--t-legend); letter-spacing: 0.06em; text-transform: uppercase; color: var(--black-ink-3); }
.alert__actions { display: flex; gap: var(--col-gap); margin-top: var(--s-5); }
.akey, .nkey { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); border-radius: var(--r-key); background: var(--black-key-hi); color: var(--black-ink); white-space: nowrap; transition: box-shadow var(--dur) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
.akey:active, .nkey:active { transform: scale(0.97); }
.akey { flex: 1; height: 72px; padding: 0 var(--s-5); font: var(--t-label); }
.akey svg { width: 26px; height: 26px; }
.akey--positive, .nkey--positive { background: var(--black-ink); color: var(--ink-dark); }
.akey--dismiss { flex: 0 0 auto; min-width: 200px; color: var(--black-ink-2); }
.akey.is-focused, .nkey.is-focused { box-shadow: 0 0 0 3px var(--black-ground), 0 0 0 5px var(--c-focus); }   /* filled keys: the ring sits outside, past a gap */
/* the list: the same cards, stacked, each with its actions */
.notes { display: grid; align-content: start; row-gap: 48px; padding-top: 30px; }
.wcard.is-current { outline: 2px solid var(--c-focus); outline-offset: 3px; }   /* outside, so the band doesn't cover it */
.wcard__actions { display: flex; gap: var(--s-3); margin-top: var(--s-3); }
.nkey { height: 56px; padding: 0 var(--s-5); font: var(--t-body); font-weight: 500; }
.nkey svg { width: 22px; height: 22px; }
.nkey--dismiss { margin-left: auto; color: var(--black-ink-2); }
.notes .wcard__title { font: var(--t-heading); }
.notes .wcard__text { font: var(--t-body); }
.notes .state { position: relative; padding: var(--s-6) 0 0; }

/* over the screen saver, which neither a notification nor a call wakes */
.is-saving .banner-slot { z-index: 23; }

/* ══ Calls ═════════════════════════════════════════════════════════════ */
.call-slot { position: absolute; inset: 0; z-index: 10; pointer-events: none; }
.is-saving .call-slot { z-index: 24; }
/* ringing: the whole screen; rings pulse out from under the knob, the caller large on the left */
.ring { position: absolute; inset: 0; pointer-events: auto; background: var(--black-ground); color: var(--black-ink); overflow: hidden; animation: alert-in var(--dur-tune) var(--ease-out) both; }
.ring__waves i {
  position: absolute; left: var(--knob-x); top: var(--knob-y);
  width: calc(2 * (var(--knob-r) + 24px)); height: calc(2 * (var(--knob-r) + 24px)); margin: calc(-1 * (var(--knob-r) + 24px)) 0 0 calc(-1 * (var(--knob-r) + 24px));
  border-radius: 50%; box-shadow: inset 0 0 0 3px var(--sig); opacity: 0; will-change: transform, opacity;
  animation: ring-wave 1.8s var(--ease-out) infinite;
}
.ring__waves i:nth-child(2) { animation-delay: 0.6s; }
.ring__waves i:nth-child(3) { animation-delay: 1.2s; }
@keyframes ring-wave { 0% { transform: scale(1); opacity: 0.9; } 100% { transform: scale(1.8); opacity: 0; } }
.ring__who { position: absolute; left: var(--gutter); top: 36px; width: 540px; display: grid; justify-items: start; row-gap: var(--s-3); }
.ring__face { grid-row: 1; width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: var(--black-key-hi); color: var(--black-ink); font: 700 40px/1 var(--font-cond); letter-spacing: 0.02em; }
.ring__what { grid-row: 2; margin-top: var(--s-2); }
.ring__name { grid-row: 3; font: var(--t-caller); letter-spacing: -0.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 100%; }
.ring__keys { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 52px; display: flex; gap: var(--col-gap); }
.ring__key { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-3); height: 76px; padding: 0 var(--s-5); border-radius: var(--r-key); font: var(--t-label); font-weight: 600; transition: box-shadow var(--dur) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
.ring__key:active { transform: scale(0.97); }
.ring__key svg { width: 30px; height: 30px; }
.ring__key--answer { flex: 1; background: var(--sig); color: var(--ink-dark); }
.ring__key--decline { flex: 0 0 240px; background: var(--c-danger); color: var(--c-on-danger); }
.ring__key--decline svg { transform: rotate(135deg); }
.ring__key.is-focused { box-shadow: 0 0 0 3px var(--black-ground), 0 0 0 5px var(--black-ink); }   /* filled keys: the ring sits outside, past a gap */
.ring__hint { position: absolute; left: var(--gutter); bottom: 20px; margin: 0; }
/* in progress: a bar across the top, over every screen and the screen saver */
.callbar {
  position: absolute; top: 10px; left: var(--gutter); right: var(--gutter); height: 52px; pointer-events: auto;
  display: flex; align-items: center; gap: var(--s-3); padding: 0 6px 0 var(--s-4); border-radius: var(--r-key);
  background: var(--black-ground); color: var(--black-ink); box-shadow: inset 0 0 0 1.5px var(--sig);
  transition: transform var(--dur-bar) var(--ease-out), opacity var(--dur-bar) var(--ease-out);
  animation: callbar-in var(--dur-tune) var(--ease-out) both;
}
@keyframes callbar-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
.callbar__dot { background: var(--sig); animation: call-beat 1.2s ease-in-out infinite; }
@keyframes call-beat { 50% { opacity: 0.3; } }
.callbar__what { font: var(--t-legend); letter-spacing: 0.06em; text-transform: uppercase; color: var(--black-ink-2); white-space: nowrap; }
.callbar__name { font: var(--t-body); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.callbar__time { font: var(--t-read-sm); color: var(--black-ink-2); font-variant-numeric: tabular-nums; margin-left: auto; }
.callbar__end { flex: none; display: inline-flex; align-items: center; gap: var(--s-2); height: 40px; padding: 0 var(--s-4); border-radius: var(--r-key); background: var(--c-danger); color: var(--c-on-danger); font: var(--t-body); font-weight: 600; }
.callbar__end svg { width: 22px; height: 22px; transform: rotate(135deg); }
.callbar__end:active { transform: scale(0.97); }
.callbar.is-held { box-shadow: inset 0 0 0 1.5px var(--black-tick); }
.callbar.is-held .callbar__dot { background: var(--black-ink-3); animation: none; }
/* the sliding top bar takes the top while it shows; a pinned bar keeps the call bar under it */
.tc-screen:not(.bar-hidden):not(.bar-pinned):not(.is-saving) .callbar { opacity: 0; transform: translateY(-12px); pointer-events: none; }
.bar-pinned:not(.is-saving) .callbar { top: calc(var(--bar-h) + 8px); }
/* the line the call bar covers steps aside, so nothing of it shows round the bar */
.has-call:not(.bar-pinned) :is(.status, .screen-head) { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .ring__waves i, .callbar__dot { animation: none; } .ring__waves i { opacity: 0.5; } }

/* ══ Settings ══════════════════════════════════════════════════════════ */
/* Fit the dial to the knob: the steps on the left, the dial and its fitting line round the knob */
.panel--fit { background: var(--black-ground); }
.fit { position: absolute; top: 84px; left: var(--gutter); width: 440px; display: grid; row-gap: var(--s-4); }
.fit__lead { font: var(--t-label); font-weight: 400; color: var(--c-ink); max-width: 22ch; }
.fit__steps { list-style: none; margin: 0; padding: 0; display: grid; row-gap: var(--s-2); }
.fit__step { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; column-gap: var(--s-3); height: 48px; padding: 0 var(--s-4) 0 var(--s-2); border-radius: var(--r-key); color: var(--c-ink-3); font: var(--t-body); font-weight: 500; }
.fit__n { width: 30px; height: 30px; display: grid; place-items: center; border-radius: var(--r-key); background: var(--c-key); font: var(--t-legend); color: var(--c-ink-2); }
.fit__v { font: var(--t-read-sm); color: var(--c-ink-3); font-variant-numeric: tabular-nums; }
.fit__step.is-done { color: var(--c-ink-2); }
.fit__step.is-on { background: var(--c-key-hi); box-shadow: inset 0 0 0 2px var(--c-live); color: var(--c-ink); }
.fit__step.is-on .fit__n { background: var(--c-live); color: var(--c-on-live); }
.fit__step.is-on .fit__v { color: var(--c-ink); }
.fit__keys { margin-left: 0; }
.fit__actions { display: flex; gap: var(--s-3); }
.settings__list { position: absolute; top: 0; left: var(--gutter); right: var(--knob-clear); bottom: 0; padding: 0 2px 40px; }
.settings__group { font: var(--t-legend); letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-ink-3); margin: var(--s-6) 0 0; padding: 0 var(--s-4) var(--s-3); box-shadow: inset 0 -1px 0 var(--c-rule); }
.settings__group:first-child { margin-top: var(--s-2); }
.setting { width: 100%; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; column-gap: var(--s-4); padding: var(--s-4); text-align: left; box-shadow: inset 0 -1px 0 var(--c-rule); border-radius: var(--r-key); transition: background var(--dur) var(--ease-out); }
.setting.is-focused { background: var(--c-key-hi); box-shadow: inset 0 0 0 2px var(--c-focus); }
.setting.is-editing { box-shadow: inset 0 0 0 2px var(--c-live); }
.setting__icon { width: 30px; height: 30px; color: var(--c-ink-3); }
.setting__icon svg { width: 30px; height: 30px; }
.setting__icon.is-on { color: var(--c-ink); }
.setting__text { display: grid; row-gap: 6px; min-width: 0; }
.setting__name { font: var(--t-label); }
.setting__detail { font: var(--t-caption); color: var(--c-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.setting__value { font: var(--t-read); color: var(--c-ink-2); }
.setting__go svg { width: 24px; height: 24px; color: var(--c-ink-3); }
.setting--info { grid-template-columns: 1fr; padding: var(--s-4); }
.setting--slider { row-gap: var(--s-4); }
.setting--slider .hslider { grid-column: 1 / -1; }
.switch { position: relative; width: 64px; height: 36px; border-radius: var(--r-key); background: var(--c-key); box-shadow: inset 0 0 0 1px var(--c-tick); transition: background var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out); }
.switch__knob { position: absolute; top: 6px; left: 6px; width: 24px; height: 24px; border-radius: 2px; background: var(--c-ink-3); transition: transform var(--dur) var(--ease-out), background var(--dur) var(--ease-out); }
.switch.is-on { background: var(--c-ink); box-shadow: none; }
.switch.is-on .switch__knob { transform: translateX(28px); background: var(--c-on-ink); }
.setting--choice { row-gap: var(--s-4); }
/* the detent strip: equal cells under hairline dividers; a lit copy of the labels is clipped to the chosen
   cell and slides between cells, so the fill and the label colour move as one */
.detents { grid-column: 1 / -1; position: relative; height: 56px; border-radius: var(--r-key); background: var(--c-key); --cell: calc(100% / var(--n)); }
.detents__base, .detents__lit { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
.detents__cell { display: grid; place-items: center; font: var(--t-body); font-weight: 500; color: var(--c-ink-3); white-space: nowrap; }
.detents__base .detents__cell + .detents__cell { box-shadow: inset 1px 0 0 var(--c-rule); }
.detents__base .detents__cell:active { background: var(--c-key-hi); }
.detents__lit {
  pointer-events: none; border-radius: var(--r-key); background: var(--c-ink);
  clip-path: inset(0 calc(100% - (var(--at) + 1) * var(--cell)) 0 calc(var(--at) * var(--cell)) round var(--r-key));
  transition: clip-path 200ms var(--ease-out), background var(--dur) var(--ease-out);
}
.detents__lit .detents__cell { color: var(--c-on-ink); font-weight: 600; }
/* being set with the knob: the lit cell is the signal */
.setting.is-editing .detents__lit { background: var(--c-live); }
.setting.is-editing .detents__lit .detents__cell { color: var(--c-on-live); }
@media (prefers-reduced-motion: reduce) { .detents__lit { transition: none; } }
.hslider { position: relative; height: 32px; margin: 0 2px; touch-action: none; cursor: ew-resize; background: repeating-linear-gradient(to right, var(--c-tick) 0 1px, transparent 1px 5%) top / 100% 10px no-repeat; }
.hslider::before { content: ""; position: absolute; inset: -10px 0; }
.hslider__fill { position: absolute; left: 0; bottom: 4px; width: 100%; height: 10px; background: var(--c-ink-2); transform-origin: left center; transition: transform var(--dur-fast) linear, background var(--dur) var(--ease-out); }
.setting.is-editing .hslider__fill { background: var(--c-live); }
.setting.is-following .hslider__fill { background: var(--c-tick); }

/* ══ Screen saver ══════════════════════════════════════════════════════ */
.saver-slot { position: absolute; inset: 0; z-index: 20; pointer-events: none; opacity: 0; visibility: hidden; color: var(--c-ink); transition: opacity 900ms var(--ease-out), visibility 0s linear 900ms; }
.is-saving .saver-slot { pointer-events: auto; opacity: 1; visibility: visible; transition: opacity 900ms var(--ease-out); }
.saver-bg { position: absolute; inset: 0; background: var(--c-ground); }
/* The whole composition wanders a little around the screen, all the time. */
.saver-drift { position: absolute; inset: 0; animation: wander 420s ease-in-out infinite; transition: opacity 1.2s var(--ease-out); }
.saver-drift.is-swapping { opacity: 0; }
@keyframes wander {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-34px, -22px); }
  40% { transform: translate(30px, -24px); }
  60% { transform: translate(34px, 22px); }
  80% { transform: translate(-30px, 24px); }
}
@media (prefers-reduced-motion: reduce) { .saver-drift { animation-duration: 900s; } }
.saver-content { position: absolute; inset: 48px 100px 48px 68px; }   /* room for the drift on every side, and for the knob */
.has-call .saver-content { inset: 88px 100px 36px 68px; }   /* the call bar takes the top while a call goes on */
.saver { position: relative; width: 100%; height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 230px; grid-template-rows: auto auto 1fr auto; grid-template-areas: "clock clock" "date date" ". ." "np side"; column-gap: var(--s-6); }
/* the clock has the top to itself; what's playing and the weather and what's next share the bottom row */
.saver-drift.is-mirrored .saver { grid-template-columns: 230px minmax(0, 1fr); grid-template-areas: "clock clock" "date date" ". ." "side np"; }
.saver-drift.is-mirrored :is(.saver__clock, .saver__date) { justify-self: end; text-align: right; }
.saver-drift.is-mirrored .saver__side { justify-items: start; text-align: left; }
.saver-drift.is-mirrored .wx--saver { justify-content: flex-start; }
.saver__clock { grid-area: clock; display: flex; align-items: baseline; }
.saver__time { font: var(--t-display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.saver__ampm { font: var(--t-read-lg); color: var(--c-ink-2); margin-left: var(--s-2); }
.saver__date { grid-area: date; font: var(--t-name); color: var(--c-ink-2); margin-top: var(--s-4); }
.saver__side { grid-area: side; align-self: stretch; display: grid; align-content: start; justify-items: end; row-gap: var(--s-4); padding-top: var(--s-4); box-shadow: inset 0 1px 0 var(--c-rule); text-align: right; }
.wx--saver { flex-wrap: wrap; justify-content: flex-end; row-gap: 6px; white-space: normal; }
.wx--saver svg { width: 30px; height: 30px; }
.wx--saver .wx__temp { font: var(--t-read-xl); letter-spacing: 0; }
.wx--saver .wx__text { flex-basis: 100%; display: grid; justify-items: inherit; row-gap: 4px; }
.wx--saver :is(.wx__place, .wx__range) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.wx--saver .wx__range::before { content: none; }
.saver__events { display: grid; row-gap: var(--s-2); }
.saver__event { display: flex; align-items: center; gap: 7px; justify-content: inherit; font: var(--t-legend); letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-ink-3); }
.saver__event .dot { width: 8px; height: 8px; }
.saver__event-when { color: var(--c-ink); white-space: nowrap; }
.saver__event-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; color: var(--c-ink-2); }
.saver__np { grid-area: np; align-self: stretch; align-content: start; min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--s-4); align-items: center; padding-top: var(--s-4); box-shadow: inset 0 1px 0 var(--c-rule); }
.saver__thumb { height: 80px; aspect-ratio: var(--ar, 1.778); max-width: 128px; border-radius: var(--r-art); background: rgba(0, 0, 0, 0.3) center / cover no-repeat; }
.saver__thumb.is-app { aspect-ratio: 1; background-size: 44px; background-color: var(--c-key); display: grid; place-items: center; }
.saver__thumb svg { width: 32px; height: 32px; color: var(--c-ink-3); }
.saver__np-text { min-width: 0; display: grid; row-gap: 6px; }
.saver__np-title { font: 700 36px/1 var(--font-cond); white-space: nowrap; overflow: hidden; }
.saver__run { display: inline-block; white-space: nowrap; }
.saver__np-who { font: var(--t-body); color: var(--c-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.saver__line { position: relative; display: block; height: 3px; background: var(--c-rule); margin-top: 2px; }
.saver__line-fill { position: absolute; inset: 0; background: var(--c-ink); transform-origin: left center; transform: scaleX(0); transition: transform 1s linear; }
.saver-badges { position: absolute; top: 16px; right: 18px; }
.saver__away { grid-area: side; align-self: end; justify-self: end; font: var(--t-legend); letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-ink-3); padding-top: var(--s-4); }

/* ══ Asleep with the Mac ═══════════════════════════════════════════════ */
/* Black over everything while the backlight is off; a touch lights the clock and the reason. */
.sleep-slot { position: absolute; inset: 0; z-index: 35; background: var(--off); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 700ms var(--ease-out), visibility 0s linear 700ms; }
.is-sleeping .sleep-slot { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity 700ms var(--ease-out); }
.is-sleeping.is-peeking:not(.is-offline) .sleep-slot { opacity: 0; visibility: hidden; pointer-events: none; }  /* display off, Mac awake: the screen works */
.sleep { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; row-gap: var(--s-3); opacity: 0; transition: opacity 500ms var(--ease-out); color: var(--black-ink-2); }
.is-peeking .sleep { opacity: 1; }
.sleep__clock { font: var(--t-hero); letter-spacing: -0.015em; font-variant-numeric: tabular-nums; }
.sleep__time { display: flex; align-items: baseline; }
.sleep__why { font: var(--t-name); }
.sleep__hint { font: var(--t-legend); letter-spacing: 0.06em; text-transform: uppercase; color: var(--black-ink-3); }

/* ── Toast ──────────────────────────────────────────────────────────── */
.toast {
  position: absolute; left: 50%; bottom: 26px; z-index: 30; transform: translate(-50%, 10px); opacity: 0;
  padding: var(--s-4) var(--s-5); border-radius: var(--r-key); background: var(--black-ink); color: var(--ink-dark); font: var(--t-body); font-weight: 500;
  transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
  pointer-events: none; white-space: nowrap; max-width: calc(100% - 48px); overflow: hidden; text-overflow: ellipsis;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: var(--c-danger); color: var(--c-on-danger); }

/* ══ The halo: what the knob sets comes out from under the knob ═════════ */
/* an 800px square centred on the knob, mostly off-screen; only the dial's left side shows. Everything in it
   moves by transform and opacity on layers of its own: the Car Thing's chip repaints slowly. */
.halo {
  --c-fan: var(--sig);   /* the lit sweep; ink on light colour faces, where the signal is the face */
  position: absolute; z-index: 4; pointer-events: none;   /* under the top bar while it shows, so the bar stays whole */
  left: calc(var(--knob-x) - 400px); top: calc(var(--knob-y) - 400px); width: 800px; height: 800px;
  opacity: 0; transition: opacity 160ms var(--ease-out); will-change: opacity;
}
.is-colour.is-ink-dark .halo, .is-saver-face.is-ink-dark .halo { --c-fan: var(--ink-dark); }
.is-saving .halo { z-index: 21; }   /* over the screen saver, which a turn of the knob doesn't wake */
.halo.is-shown { opacity: 1; transition-duration: 140ms; }
/* a soft field behind the dial, so it reads cleanly over whatever is under it */
.halo__scrim { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--c-ground) 96%, transparent) 88%, transparent 98%); }   /* covers the ring and the readout beside it */
/* the dial swings up round the knob (clockwise, as the knob turns) and back down when it rests */
.halo__dial { position: absolute; inset: 0; transform-origin: 400px 400px; transform: rotate(-10deg); transition: transform 180ms var(--ease-out); will-change: transform; }
.halo.is-shown .halo__dial { transform: none; transition-duration: 260ms; }
/* blocks: arc edges concentric with the knob, rounded corners, a 5px gap between them. Each starts tucked
   28px in toward the knob (--in) and slides out along its radius, the bottom one first (--d, 14ms apart);
   at rest they all slide back in together, quicker. The tick as a block lights runs on `transform`
   (screen.js), so it adds to this slide on `translate`. */
.halo__block { position: absolute; translate: var(--in, 0 0); opacity: 0; transition: translate 150ms var(--ease-out), opacity 120ms var(--ease-out); will-change: transform, opacity; }
.halo.is-shown .halo__block { translate: 0 0; opacity: 1; transition: translate 280ms var(--ease-out) var(--d, 0ms), opacity 140ms var(--ease-out) var(--d, 0ms); }
.halo__block svg { position: absolute; inset: 0; overflow: visible; }
.halo__block path { stroke-width: 3; stroke-linejoin: round; }
.halo__seg path { --c-seg: color-mix(in oklab, var(--c-ink) 10%, var(--c-ground)); fill: var(--c-seg); stroke: var(--c-seg); }
/* lit, the scale deepens toward zero: each block holds its share of the signal (--mix) */
.halo__lit { visibility: hidden; }
.halo__lit path { fill: color-mix(in oklab, var(--c-fan) var(--mix, 100%), var(--c-ground)); stroke: color-mix(in oklab, var(--c-fan) var(--mix, 100%), var(--c-ground)); }
.halo__block.is-lit .halo__lit { visibility: visible; }
/* the value and what it is, beside the lit end, on the scrim's solid field */
.halo__readout { position: absolute; left: 0; top: 0; text-align: right; white-space: nowrap; will-change: transform; }
.halo__label { font: 500 16px/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--c-ink-2); margin-bottom: 6px; }
.halo__value { display: flex; justify-content: flex-end; align-items: baseline; font: 700 64px/0.84 var(--font-cond); color: var(--c-ink); font-variant-numeric: tabular-nums; }
.halo__value small { font: 500 22px/1 var(--font-mono); color: var(--c-ink-3); margin-left: 3px; }
/* fitting the dial to the knob (Settings): a line 6px off the knob's edge, to line up against it */
.halo__guide { position: absolute; border-radius: 50%; box-shadow: 0 0 0 2px var(--c-live); opacity: 0; }
.is-fitting .halo { z-index: 9; }
.is-fitting .halo__guide { opacity: 1; }
.is-fitting .halo__readout { display: none; }
@media (prefers-reduced-motion: reduce) {
  .halo, .halo.is-shown, .halo__dial, .halo.is-shown .halo__dial, .halo__block, .halo.is-shown .halo__block { transform: none; translate: none; transition: opacity 0ms; }
}

/* ── The mute key, level with the Back button ──────────────────────────── */
/* While the dial shows the Mac volume it slides out from under the right edge beside the Back button, which
   does the same, on the dial's scrim, and back under it when the dial goes. Muted, it stays on every screen
   (and the saver) in the mic badge's pink on black, until it's tapped or Back unmutes on the dial. */
.mute-key {
  position: absolute; z-index: 8; right: -4px; top: calc(var(--back-y) - 28px);   /* past the edge, so it comes from under it */
  height: 56px; padding: 0 calc(var(--s-4) + 4px) 0 var(--s-4);
  display: inline-flex; align-items: center; gap: var(--s-2);
  border-radius: var(--r-key) 0 0 var(--r-key);
  background: var(--c-key-hi); color: var(--c-ink);
  font: var(--t-legend); letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap;
  transform: translateX(100%); transform-origin: 100% 50%; visibility: hidden;
  transition: transform var(--dur-tune) var(--ease-out), visibility 0s linear var(--dur-tune);
}
.mute-key svg { width: 28px; height: 28px; flex: none; }
.mute-key.is-shown { transform: none; visibility: visible; transition: transform var(--dur-tune) var(--ease-out), visibility 0s; }
.mute-key.is-shown:active { transform: scale(0.97); transition-duration: var(--dur-fast); }
/* muted it goes see-through: the red ring, glyph and word over a black backing only as dense as each face needs
   for the word to read at 4.5:1 (measured over every hue): light on the black face, more on deep colour faces,
   most on light ones */
.tc-screen .mute-key.is-muted { background: color-mix(in srgb, var(--base-ground) var(--mute-tint), transparent); color: var(--c-danger); box-shadow: inset 0 0 0 1.5px var(--c-danger); }   /* red on every face, over the face's own ink */
.is-colour .mute-key.is-muted, .is-saver-face .mute-key.is-muted { --mute-tint: 55%; }
.is-colour.is-ink-dark .mute-key.is-muted, .is-saver-face.is-ink-dark .mute-key.is-muted { --mute-tint: 85%; }
.is-saving .mute-key { z-index: 22; }   /* over the saver and the dial on it, under a notification or a call */
/* muted over the saver, its content keeps clear of the key: the key's 108px, the drift's 34px and a 12px gap */
.has-mute-key .saver-content { right: 154px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
