/* clock.bh studio — the configurator and installer for the reTerminal E1001.
   Tokens are the site's own (assets/css/styles.css §1), copied: this page links only fonts.css.

   1 Tokens   2 Base   3 Header + rail   4 Layout   5 Preview   6 Steps + fields   7 Faces
   8 Battery life   9 Install   10 Footer   11 Motion + contrast */

/* ============================== 1. TOKENS ============================== */
:root {
  --f-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --f-ui: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --bg: #F6F3EC;
  --bg-deep: #EFEAE0;
  --surface: #FFFDF9;
  --ink: #16120E;
  --ink-2: #463F37;
  --ink-3: #6C645B;
  --line: rgba(22, 18, 14, 0.12);
  --line-strong: rgba(22, 18, 14, 0.26);
  --red: #CE1126;
  --red-deep: #A80E20;
  --red-tint: rgba(206, 17, 38, 0.08);
  --red-text: #A80E20;
  --gold: #7A5D1E;
  --ok-text: #1F7A47;
  --ok: #2E8B57;
  --warn-text: #8A5A00;
  --warn-tint: rgba(201, 138, 11, 0.12);
  --code-bg: #17130F;
  --code-ink: #F0E9DD;
  --code-dim: #92887B;
  --focus: #CE1126;
  --shadow: 0 1px 2px rgba(22, 18, 14, 0.04), 0 22px 44px -26px rgba(22, 18, 14, 0.22);
  --header-bg: rgba(246, 243, 236, 0.86);
  --bezel: #111;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --maxw: 88rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --radius: 1.1rem;
  --top-h: 6.4rem;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0F0D0B;
  --bg-deep: #0A0908;
  --surface: #171310;
  --ink: #F4EFE6;
  --ink-2: #CFC6B9;
  --ink-3: #9C9286;
  --line: rgba(244, 239, 230, 0.13);
  --line-strong: rgba(244, 239, 230, 0.3);
  --red: #F0485C;
  --red-deep: #FF6B7B;
  --red-tint: rgba(240, 72, 92, 0.12);
  --red-text: #FF8A98;
  --gold: #CDAA63;
  --ok-text: #4CC17E;
  --ok: #4CC17E;
  --warn-text: #E9B23A;
  --warn-tint: rgba(233, 178, 58, 0.12);
  --code-bg: #1D1915;
  --focus: #FF6B7B;
  --shadow: 0 0 0 1px rgba(244, 239, 230, 0.02), 0 22px 44px -26px rgba(0, 0, 0, 0.7);
  --header-bg: rgba(15, 13, 11, 0.84);
  --bezel: #050404;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F0D0B;
    --bg-deep: #0A0908;
    --surface: #171310;
    --ink: #F4EFE6;
    --ink-2: #CFC6B9;
    --ink-3: #9C9286;
    --line: rgba(244, 239, 230, 0.13);
    --line-strong: rgba(244, 239, 230, 0.3);
    --red: #F0485C;
    --red-deep: #FF6B7B;
    --red-tint: rgba(240, 72, 92, 0.12);
    --red-text: #FF8A98;
    --gold: #CDAA63;
    --ok-text: #4CC17E;
    --ok: #4CC17E;
    --warn-text: #E9B23A;
    --warn-tint: rgba(233, 178, 58, 0.12);
    --code-bg: #1D1915;
    --focus: #FF6B7B;
    --shadow: 0 0 0 1px rgba(244, 239, 230, 0.02), 0 22px 44px -26px rgba(0, 0, 0, 0.7);
    --header-bg: rgba(15, 13, 11, 0.84);
    --bezel: #050404;
    color-scheme: dark;
  }
}

/* ============================== 2. BASE ============================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--top-h) + 1rem); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--f-ui); font-size: 1rem; line-height: 1.55;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
svg, canvas, img { display: block; }
code, .mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
code { font-size: 0.86em; padding: 0.05em 0.35em; border-radius: 0.3em; background: var(--bg-deep); overflow-wrap: anywhere; }
::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
main:focus { outline: none; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip-link {
  position: fixed; top: 0.75rem; left: 0.75rem; z-index: 300; padding: 0.6rem 1rem; border-radius: 999px;
  background: var(--ink); color: var(--bg); text-decoration: none; font-weight: 600;
  transform: translateY(-200%); transition: transform 180ms var(--ease-out);
}
.skip-link:focus { transform: none; }
.noscript { padding: 1rem var(--gutter); text-align: center; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  min-height: 2.6rem; padding: 0.6rem 1.15rem; border-radius: 999px; border: 1px solid transparent;
  font-size: 0.9rem; font-weight: 650; line-height: 1.2; text-decoration: none; cursor: pointer; text-align: center;
  transition: transform 140ms var(--ease-out), background-color 180ms ease, color 180ms ease, border-color 180ms ease, opacity 180ms ease;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { cursor: not-allowed; opacity: 0.45; }
.btn-lg { min-height: 3.1rem; padding: 0.85rem 1.6rem; font-size: 1rem; }
.btn-red { background: var(--red); color: #fff; }
:root[data-theme="dark"] .btn-red, :root[data-theme="dark"] .fstart, :root[data-theme="dark"] .play.is-playing { color: #1A0508; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-red, :root:not([data-theme="light"]) .fstart, :root:not([data-theme="light"]) .play.is-playing { color: #1A0508; } }
.btn-ink { background: var(--ink); color: var(--bg); }
.btn-line { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-quiet { background: transparent; color: var(--ink-2); border-color: transparent; text-decoration: underline; text-underline-offset: 0.2em; text-decoration-color: var(--line-strong); }
.btn-arrow { width: 1.1rem; height: 1.1rem; transition: transform 260ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .btn-red:hover:not(:disabled) { background: var(--red-deep); }
  .btn-ink:hover:not(:disabled) { opacity: 0.86; }
  .btn-line:hover:not(:disabled) { border-color: var(--ink); background: var(--red-tint); }
  .btn-quiet:hover:not(:disabled) { color: var(--ink); text-decoration-color: currentColor; }
  .btn:hover .btn-arrow { transform: translateX(3px); }
}
.chip {
  display: inline-flex; align-items: center; min-height: 2rem; padding: 0.3rem 0.8rem; border-radius: 999px;
  border: 1px solid var(--line-strong); background: transparent; font-size: 0.8rem; font-weight: 600; cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease;
}
.chip:disabled { opacity: 0.45; cursor: not-allowed; }
@media (hover: hover) and (pointer: fine) { .chip:hover:not(:disabled) { border-color: var(--ink); background: var(--red-tint); } }
.kbd {
  display: inline-block; padding: 0 0.35em; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 0.3em;
  font-family: var(--f-mono); font-size: 0.72em; font-weight: 600; line-height: 1.5; color: var(--ink-2); white-space: nowrap;
}

/* ============================== 3. HEADER + RAIL ============================== */
.top {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(1.5) blur(16px); backdrop-filter: saturate(1.5) blur(16px);
}
.top-in, .rail-list {
  max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter);
}
.top-in { display: flex; align-items: center; gap: 0.9rem; min-height: 3.5rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); }
.brand-mark { width: 29px; height: 29px; flex: none; color: var(--ink); }
.brand-mark .bm-hand { transform-box: view-box; transform-origin: 50px 50px; }
.brand-mark .bm-hour { transform: rotate(305deg); }
.brand-mark .bm-minute { transform: rotate(60deg); }
.brand-mark .bm-second { transform: rotate(180deg); visibility: hidden; }
.bm-live .brand-mark .bm-second { visibility: visible; }
.brand-name { font-family: var(--f-display); font-weight: 500; font-size: 1.25rem; letter-spacing: -0.02em; line-height: 1; }
.brand-studio {
  font-family: var(--f-display); font-style: italic; font-weight: 400; font-size: 1.25rem; line-height: 1;
  color: var(--red-text); margin-left: -0.45rem;
}
.top-nav { display: flex; gap: 0.15rem; margin-left: auto; }
.top-nav a {
  padding: 0.45rem 0.75rem; border-radius: 999px; font-size: 0.85rem; font-weight: 550; color: var(--ink-2); text-decoration: none;
}
@media (hover: hover) and (pointer: fine) { .top-nav a:hover { color: var(--ink); background: var(--red-tint); } }
.theme-toggle {
  position: relative; width: 2.4rem; height: 2.4rem; padding: 0; cursor: pointer; flex: none;
  display: grid; place-items: center; border-radius: 50%;
  background: transparent; border: 1px solid var(--line); color: var(--ink);
  transition: transform 140ms var(--ease-out), border-color 180ms ease, background-color 180ms ease;
}
.theme-toggle:active { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) { .theme-toggle:hover { border-color: var(--line-strong); background: var(--red-tint); } }
.theme-toggle-icons { position: relative; width: 1.2rem; height: 1.2rem; display: block; }
.theme-toggle svg { position: absolute; inset: 0; width: 100%; height: 100%; transition: transform 420ms var(--ease-out), opacity 260ms ease; }
.icon-moon { opacity: 0; transform: rotate(-70deg) scale(0.6); }
:root[data-theme="dark"] .icon-sun { opacity: 0; transform: rotate(70deg) scale(0.6); }
:root[data-theme="dark"] .icon-moon { opacity: 1; transform: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { opacity: 0; transform: rotate(70deg) scale(0.6); }
  :root:not([data-theme="light"]) .icon-moon { opacity: 1; transform: none; }
}

.rail { border-top: 1px solid var(--line); }
.rail-list {
  display: flex; gap: 0.15rem; overflow-x: auto; scrollbar-width: none; counter-reset: none;
  padding-block: 0.3rem;
}
.rail-list::-webkit-scrollbar { display: none; }
.rail-list li { flex: 1 0 auto; }
.rail a {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 0.45rem;
  padding: 0.4rem 0.7rem; border-radius: 999px; white-space: nowrap;
  text-decoration: none; color: var(--ink-3); font-size: 0.82rem; font-weight: 600;
  transition: color 160ms ease, background-color 160ms ease;
}
.rail a:focus-visible { outline-offset: -2px; }
.rail-n { font-family: var(--f-mono); font-size: 0.72rem; font-weight: 500; color: var(--gold); }
.rail a::after {
  content: ""; position: absolute; left: 0.7rem; right: 0.7rem; bottom: 0.1rem; height: 2px; border-radius: 2px;
  background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform 280ms var(--ease-out);
}
.rail a[aria-current="step"] { color: var(--ink); }
.rail a[aria-current="step"]::after { transform: scaleX(1); }
@media (hover: hover) and (pointer: fine) { .rail a:hover { color: var(--ink); background: var(--red-tint); } }
.rail-mark { width: 0.85rem; height: 0.85rem; flex: none; display: none; }
.rail a[data-status="done"] .rail-mark {
  display: block;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3L13 4.5' fill='none' stroke='%232E8B57' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.rail a[data-status="error"] .rail-mark { display: block; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--red); }

/* ============================== 4. LAYOUT ============================== */
.intro { padding: 0 0 clamp(1.75rem, 3vw, 2.5rem); }
.eyebrow { font-size: 0.72rem; font-weight: 650; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-3); }
.intro h1 {
  margin-top: 0.9rem; font-family: var(--f-display); font-weight: 400;
  font-size: clamp(2.4rem, 1.4rem + 3.4vw, 4.4rem); line-height: 1; letter-spacing: -0.03em; text-wrap: balance;
}
.lede { margin-top: 1.1rem; max-width: 40rem; font-size: clamp(1rem, 0.95rem + 0.3vw, 1.15rem); color: var(--ink-2); text-wrap: pretty; }

.layout {
  max-width: var(--maxw); margin: 0 auto; padding: clamp(1.75rem, 5vw, 3.5rem) var(--gutter) clamp(3rem, 6vw, 5rem);
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem;
}
.stage { min-width: 0; }
.intro, .steps { min-width: 0; }
@media (min-width: 64rem) {
  .layout {
    grid-template-columns: minmax(0, 1fr) minmax(25rem, 0.92fr);
    grid-template-rows: auto 1fr;
    grid-template-areas: "intro stage" "steps stage"; column-gap: clamp(2.5rem, 4vw, 4.5rem); row-gap: 0; align-items: start;
  }
  .intro { grid-area: intro; }
  .steps { grid-area: steps; }
  .stage { grid-area: stage; position: sticky; top: calc(var(--top-h) + 1rem); }
  .stage-in { max-height: calc(100vh - var(--top-h) - 2rem); overflow-y: auto; scrollbar-width: thin; padding: 2px; }
  /* short screens: a smaller panel rather than a preview that scrolls */
  .device { max-width: max(24rem, calc((100vh - 26rem) / 0.6)); margin-inline: auto; }
}
@media (min-width: 64rem) and (max-height: 52rem) { .pv-keys { display: none; } }

/* ============================== 5. PREVIEW ============================== */
.device { margin: 0; }
.bezel {
  padding: clamp(0.7rem, 2.2vw, 1.5rem) clamp(0.7rem, 2.2vw, 1.5rem) clamp(1rem, 3vw, 2rem);
  background: var(--bezel); border-radius: calc(var(--radius) + 0.3rem); box-shadow: var(--shadow);
}
.screen { position: relative; aspect-ratio: 800 / 480; background: rgb(232, 230, 223); border-radius: 0.2rem; overflow: hidden; }
.screen img, .screen canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.screen img { transition: opacity 260ms ease, filter 260ms ease; }
.screen img:not([src]) { visibility: hidden; }
.screen[data-state="loading"] img { opacity: 0.45; filter: blur(1px); }
.screen[data-state="loading"] canvas { opacity: 0; }
.screen[data-state="error"] img { opacity: 0.3; }
.screen-msg {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 80%;
  padding: 0.35rem 0.8rem; border-radius: 999px; background: rgba(22, 18, 14, 0.78); color: #F4EFE6;
  font-size: 0.78rem; font-weight: 600; text-align: center; opacity: 0; transition: opacity 200ms ease; pointer-events: none;
}
.screen[data-state="loading"] .screen-msg, .screen[data-state="error"] .screen-msg { opacity: 1; }
.pv-caption { margin-top: 0.9rem; font-size: 0.85rem; color: var(--ink-3); text-wrap: pretty; }
.pv-face { font-family: var(--f-display); font-size: 1.15rem; color: var(--ink); margin-right: 0.35rem; }
.pv-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; margin-top: 0.9rem; }
.pv-charge { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; font-weight: 600; color: var(--ink-2); flex: 1 1 12rem; }
.pv-charge input { flex: 1; min-width: 6rem; accent-color: var(--red); }
.pv-charge output { min-width: 2.8rem; text-align: right; font-size: 0.82rem; }
.pv-state { margin-top: 0.6rem; font-size: 0.82rem; color: var(--ink-2); min-height: 1.3em; }
.pv-state b { font-weight: 650; color: var(--ink); }
.pv-readout {
  display: flex; flex-wrap: wrap; align-items: stretch; gap: 0.75rem; margin-top: 0.9rem;
}
.pv-life {
  flex: 1 1 11rem; display: flex; flex-direction: column; justify-content: center; gap: 0.1rem;
  padding: 0.8rem 1rem; border: 1px solid var(--line); border-radius: calc(var(--radius) - 0.3rem); background: var(--surface);
}
.pv-life-k { font-size: 0.72rem; font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.pv-life-v { font-family: var(--f-display); font-weight: 400; font-size: 1.6rem; line-height: 1.15; letter-spacing: -0.01em; }
.pv-life-dh { font-size: 0.82rem; color: var(--ink-3); }
.pv-loupe {
  flex: 0 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.3rem;
  padding: 0.6rem; border: 1px solid var(--line); border-radius: calc(var(--radius) - 0.3rem); background: var(--surface);
}
.stage[data-state="loading"] .pv-loupe canvas { opacity: 0.35; }
.pv-loupe canvas { transition: opacity 200ms ease; width: 216px; max-width: 100%; height: auto; image-rendering: pixelated; border-radius: 0.3rem; background: rgb(232, 230, 223); }
.pv-loupe-k { font-size: 0.68rem; color: var(--ink-3); letter-spacing: 0.06em; }
.pv-keys { margin-top: 0.9rem; font-size: 0.78rem; color: var(--ink-3); line-height: 1.9; }
@media (max-width: 63.99rem) {
  .stage-in { max-width: 40rem; margin-inline: auto; }
  .pv-keys { display: none; }
}
@media (max-width: 30rem) {
  .pv-readout { flex-wrap: nowrap; gap: 0.6rem; }
  .pv-life { flex: 1 1 auto; min-width: 0; padding: 0.7rem 0.8rem; }
  .pv-life-v { font-size: 1.3rem; }
  .pv-life-k { font-size: 0.66rem; letter-spacing: 0.1em; }
  .pv-loupe { padding: 0.45rem; }
  .pv-loupe canvas { width: 144px; }
  .pv-loupe-k { font-size: 0.62rem; }
}

/* segmented control (radios) */
.seg {
  display: inline-flex; flex-wrap: wrap; gap: 0.2rem; padding: 0.2rem; max-width: 100%;
  border: 1px solid var(--line-strong); border-radius: 1.4rem; background: var(--surface);
}
.seg label { position: relative; display: inline-flex; }
.seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg span {
  display: inline-flex; align-items: center; justify-content: center; min-height: 2.3rem; min-width: 2.9rem;
  padding: 0.35rem 0.9rem; border-radius: 999px; font-size: 0.86rem; font-weight: 650; color: var(--ink-2);
  font-variant-numeric: tabular-nums; white-space: nowrap; transition: background-color 180ms var(--ease-out), color 180ms var(--ease-out);
}
.seg-sm span { min-height: 2rem; padding: 0.3rem 0.8rem; font-size: 0.8rem; }
.seg input:checked + span { background: var(--ink); color: var(--bg); }
.seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .seg input:not(:checked):hover + span { color: var(--ink); background: var(--red-tint); } }
@media (max-width: 30rem) {
  .seg[data-steps] { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; border-radius: 1.3rem; }
  .seg[data-steps] label, .seg[data-steps] span { width: 100%; min-width: 0; padding-inline: 0.4rem; }
  .seg[data-steps] label { padding: 0; }
}

/* ============================== 6. STEPS + FIELDS ============================== */
.step { padding: clamp(2rem, 4vw, 2.75rem) 0; border-top: 1px solid var(--line); }
.step:first-child { border-top: 0; padding-top: 0; }
.step-head { display: flex; align-items: baseline; gap: 0.9rem; }
.step-n { font-family: var(--f-mono); font-size: 0.8rem; font-weight: 500; letter-spacing: 0.1em; color: var(--gold); }
.step h2 {
  font-family: var(--f-display); font-weight: 400; font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.4rem);
  line-height: 1.08; letter-spacing: -0.02em;
}
.step-sub { margin-top: 0.6rem; max-width: 38rem; color: var(--ink-2); text-wrap: pretty; }
.step > * + * { margin-top: 1.4rem; }
.step > .step-sub { margin-top: 0.6rem; }

.group { margin: 1.4rem 0 0; padding: 0; border: 0; min-width: 0; }
.group legend, .label, .field label:not(.check) {
  display: block; padding: 0; margin-bottom: 0.55rem; font-size: 0.86rem; font-weight: 700; color: var(--ink);
}
.label-hint { font-weight: 500; color: var(--ink-3); margin-left: 0.4rem; }
.group > * + * { margin-top: 0.8rem; }
.group-tight { margin-top: 0; }
.field { min-width: 0; }
.field + .field { margin-top: 1.1rem; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 1.1rem 1.25rem; }
.field-row .field + .field { margin-top: 0; }
.field-row-hours { grid-template-columns: repeat(2, minmax(0, 9rem)); }
.field-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.field-inline label { margin-bottom: 0 !important; font-weight: 600 !important; }
.field-inline input[type="number"] { width: 6.5rem; }
.unit { font-size: 0.86rem; color: var(--ink-3); }
.with-unit { display: flex; align-items: center; gap: 0.6rem; }
.with-unit input { width: 8rem; }

input[type="text"], input[type="password"], input[type="number"], input[type="url"], input[type="time"], select {
  width: 100%; min-height: 2.75rem; padding: 0.55rem 0.8rem;
  border: 1px solid var(--line-strong); border-radius: 0.65rem; background: var(--surface); color: var(--ink);
  font-size: 1rem; transition: border-color 160ms ease, box-shadow 160ms ease;
}
select { width: auto; max-width: 100%; padding-right: 2.2rem; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' fill='none' stroke='%23857C71' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.75rem center; background-size: 0.75rem;
}
.field-row-hours select { width: 100%; }
input::placeholder { color: var(--ink-3); opacity: 0.8; }
input:focus-visible, select:focus-visible { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--red-tint), 0 0 0 1px var(--ink); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--red); }
input:disabled, select:disabled { opacity: 0.5; }
input.mono { font-family: var(--f-mono); font-size: 0.95rem; }
.help { margin-top: 0.4rem; font-size: 0.82rem; color: var(--ink-3); text-wrap: pretty; }
.help code { font-size: 0.8rem; }
.err { margin-top: 0.35rem; font-size: 0.82rem; font-weight: 600; color: var(--red-text); }
.err:empty { display: none; }
.note { font-size: 0.86rem; color: var(--ink-2); padding: 0.8rem 1rem; border-left: 2px solid var(--gold); background: var(--surface); border-radius: 0 0.6rem 0.6rem 0; }
.fine { font-size: 0.78rem; color: var(--ink-3); text-wrap: pretty; }
.notice {
  padding: 0.9rem 1.1rem; border: 1px solid var(--line-strong); border-radius: calc(var(--radius) - 0.3rem);
  background: var(--warn-tint); font-size: 0.9rem; color: var(--ink-2);
}
.notice strong { display: block; color: var(--ink); margin-bottom: 0.2rem; }

.pw-wrap { position: relative; display: flex; }
.pw-wrap input { padding-right: 4.2rem; }
.pw-eye {
  position: absolute; right: 0.35rem; top: 50%; transform: translateY(-50%);
  min-height: 2rem; padding: 0.2rem 0.6rem; border: 0; border-radius: 0.45rem; background: transparent;
  font-size: 0.78rem; font-weight: 650; color: var(--ink-2); cursor: pointer;
}
@media (hover: hover) and (pointer: fine) { .pw-eye:hover { background: var(--red-tint); color: var(--ink); } }
.pw-wrap-big input { font-size: 1.15rem; letter-spacing: 0.04em; min-height: 3rem; }
.pw-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; margin-top: 0.6rem; }
.pw-said { font-size: 0.8rem; color: var(--ok-text); font-weight: 600; }

.check { display: flex; align-items: flex-start; gap: 0.65rem; font-size: 0.92rem; color: var(--ink-2); cursor: pointer; }
.check input { flex: none; width: 1.15rem; height: 1.15rem; margin: 0.18rem 0 0; accent-color: var(--red); cursor: pointer; }
.check input:disabled + span { opacity: 0.55; }
.check-inline { display: inline-flex; align-items: center; }
.check-inline input { margin-top: 0; }
.check-hint { display: block; font-size: 0.8rem; color: var(--ink-3); }
.check-hint:empty { display: none; }
.check-play { display: flex; align-items: center; gap: 0.6rem; }

.more { border: 1px solid var(--line); border-radius: calc(var(--radius) - 0.3rem); background: var(--surface); }
.more > summary {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.6rem; padding: 0.85rem 1rem; cursor: pointer;
  font-weight: 650; font-size: 0.92rem; list-style: none;
}
.more > summary::-webkit-details-marker { display: none; }
.more > summary::before {
  content: ""; align-self: center; width: 0.5rem; height: 0.5rem; border-right: 1.6px solid var(--ink-3); border-bottom: 1.6px solid var(--ink-3);
  transform: rotate(-45deg); transition: transform 200ms var(--ease-out); margin-right: 0.2rem;
}
.more[open] > summary::before { transform: rotate(45deg); }
.more-hint { font-weight: 500; font-size: 0.82rem; color: var(--ink-3); }
.more > :not(summary) { margin: 0 1rem 1rem; }

/* choice cards (radios) */
.cards { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.5rem), 1fr)); }
.cards-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.cards-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr)); }
.cards-5 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 7rem), 1fr)); }
.card {
  position: relative; display: flex; flex-direction: column; gap: 0.25rem; height: 100%;
  padding: 0.8rem 0.9rem 0.85rem; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) - 0.35rem);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.card input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.card-t { font-weight: 700; font-size: 0.92rem; color: var(--ink); }
.card-d { font-size: 0.8rem; line-height: 1.4; color: var(--ink-3); text-wrap: pretty; }
.card:has(input:checked) { border-color: var(--ink); box-shadow: var(--shadow); }
.card:has(input:checked)::before {
  content: ""; position: absolute; top: -1px; left: 0.9rem; width: 2rem; height: 3px; background: var(--red); border-radius: 0 0 3px 3px;
}
.card:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) { .card:not(:has(input:checked)):hover { border-color: var(--line-strong); } }
.card-px canvas.px {
  box-sizing: content-box; width: 128px; height: 40px; max-width: calc(100% - 1rem); object-fit: contain; image-rendering: pixelated;
  margin-bottom: 0.45rem; padding: 0.35rem 0.5rem; border-radius: 0.35rem; background: rgb(232, 230, 223);
}
.cards-5 .card-px canvas.px { width: 80px; height: 22px; }
.card-wrap { position: relative; }
.cards-play .card { padding-right: 2.9rem; }
.play {
  position: absolute; right: 0.55rem; top: 0.6rem; z-index: 1;
  width: 2.1rem; height: 2.1rem; display: grid; place-items: center; padding: 0 0 0 0.12rem;
  border: 1px solid var(--line-strong); border-radius: 50%; background: var(--bg); color: var(--ink);
  font-size: 0.72rem; cursor: pointer; transition: background-color 160ms ease, color 160ms ease, transform 140ms var(--ease-out);
}
.play:active { transform: scale(0.92); }
.play.is-playing { background: var(--red); border-color: var(--red); color: #fff; }
.play-sm { position: static; width: 1.9rem; height: 1.9rem; flex: none; }
@media (hover: hover) and (pointer: fine) { .play:hover { border-color: var(--ink); } }
.sub { margin-top: 0.9rem; padding: 1rem; border-radius: calc(var(--radius) - 0.35rem); background: var(--bg-deep); }

/* ============================== 7. FACES ============================== */
.faces-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1rem; }
.faces-count { font-size: 0.92rem; color: var(--ink-2); }
.faces-count strong { font-family: var(--f-display); font-weight: 500; font-size: 1.35rem; color: var(--ink); }
.faces-tools { display: flex; gap: 0.4rem; }
.loading-line { font-size: 0.86rem; color: var(--ink-3); }
.face-groups > * + * { margin-top: 1.4rem; }
.fgroup { margin: 0; padding: 0; border: 0; min-width: 0; }
.fgroup-head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.7rem; }
.fgroup-name {
  margin: 0; padding: 0; font-size: 0.72rem; font-weight: 650; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3);
}
.fgroup-head::after { content: ""; flex: 1; border-top: 1px solid var(--line); order: 1; }
.fgroup-tools { order: 2; display: flex; gap: 0.15rem; }
.fgroup-tools button {
  padding: 0.2rem 0.5rem; border: 0; border-radius: 999px; background: transparent; cursor: pointer;
  font-size: 0.75rem; font-weight: 650; color: var(--ink-3);
}
@media (hover: hover) and (pointer: fine) { .fgroup-tools button:hover { color: var(--ink); background: var(--red-tint); } }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 10.5rem), 1fr)); gap: 0.7rem; clear: both; }
.fcard {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) - 0.35rem);
  transition: border-color 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}
.fpick { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.55rem 0.55rem 0.4rem; cursor: pointer; flex: 1; }
.fpick input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.fthumb { position: relative; display: block; padding: 4px; margin-bottom: 0.3rem; background: #111; border-radius: 0.5rem; }
.fthumb img { width: 100%; height: auto; aspect-ratio: 800 / 480; background: #1c1a19; border-radius: 2px; transition: opacity 300ms ease; }
.fthumb img:not([src]) { opacity: 0; }
.fthumb .fnone {
  position: absolute; inset: 4px; display: grid; place-items: center; font-size: 0.7rem; color: #9C9286; text-align: center; padding: 0.4rem;
}
.fstart {
  position: absolute; left: 0.5rem; bottom: 0.5rem; padding: 0.12rem 0.45rem; border-radius: 999px;
  background: var(--red); color: #fff; font-size: 0.64rem; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase;
  opacity: 0; transform: translateY(3px); transition: opacity 180ms ease, transform 220ms var(--ease-out);
}
.fname { font-family: var(--f-display); font-size: 1.02rem; line-height: 1.15; color: var(--ink); }
.fline { font-size: 0.74rem; line-height: 1.4; color: var(--ink-3); text-wrap: pretty;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fkey {
  display: flex; align-items: center; gap: 0.5rem; margin: 0 0.55rem 0.55rem; padding: 0.4rem 0.5rem;
  border-radius: 0.5rem; background: var(--bg-deep); font-size: 0.78rem; font-weight: 650; color: var(--ink-2); cursor: pointer;
}
.fkey input { width: 1.05rem; height: 1.05rem; margin: 0; accent-color: var(--red); cursor: pointer; flex: none; }
.fcard.is-off .fthumb img { opacity: 0.45; filter: grayscale(1); }
.fcard.is-off .fname { color: var(--ink-3); }
.fcard.is-start { border-color: var(--ink); box-shadow: var(--shadow); }
.fcard.is-start::before {
  content: ""; position: absolute; top: -1px; left: 0.9rem; width: 2rem; height: 3px; background: var(--red); border-radius: 0 0 3px 3px; z-index: 1;
}
.fcard.is-start .fstart { opacity: 1; transform: none; }
.fcard:has(.fpick input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) { .fcard:not(.is-start):hover { border-color: var(--line-strong); } }
@media (max-width: 30rem) {
  .fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
  .fline { display: none; }
  .fpick { padding: 0.4rem 0.4rem 0.3rem; }
  .fkey { margin: 0 0.4rem 0.4rem; }
}

.sched { display: grid; gap: 0.5rem; margin: 0.6rem 0; counter-reset: sched; }
.sched-row { display: grid; grid-template-columns: minmax(7.5rem, 10rem) minmax(0, 1fr) auto; gap: 0.5rem; align-items: center; }
.sched-row select { width: 100%; }
.sched-row input[type="time"] { font-family: var(--f-mono); }
.sched-del {
  width: 2.4rem; height: 2.4rem; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface);
  cursor: pointer; font-size: 1.1rem; line-height: 1; color: var(--ink-2);
}
@media (hover: hover) and (pointer: fine) { .sched-del:hover { border-color: var(--red); color: var(--red-text); } }
.sched-empty { font-size: 0.84rem; color: var(--ink-3); }

/* ============================== 8. BATTERY LIFE ============================== */
.life {
  margin-top: 1.6rem; padding: clamp(1rem, 2.5vw, 1.4rem); border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
}
.life > * + * { margin-top: 0.6rem; }
.life-h { font-size: 0.72rem; font-weight: 650; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); }
.life-big { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 0.8rem; }
.life-big strong { font-family: var(--f-display); font-weight: 400; font-size: clamp(2rem, 1.6rem + 1.6vw, 2.8rem); line-height: 1.05; letter-spacing: -0.02em; }
.life-dh { font-size: 0.95rem; color: var(--ink-3); }
.life-chart { display: grid; gap: 0.3rem; margin-top: 0.9rem; }
.lc-row { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr) 4.4rem; align-items: center; gap: 0.6rem; font-size: 0.8rem; }
.lc-k { color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.lc-bar { position: relative; height: 0.7rem; }
.lc-fill {
  position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; background: var(--line-strong);
  transition: width 420ms var(--ease-out);
}
.lc-v { text-align: right; color: var(--ink-3); font-family: var(--f-mono); font-size: 0.76rem; }
.lc-row.is-now .lc-fill { background: var(--red); }
.lc-row.is-now .lc-k, .lc-row.is-now .lc-v { color: var(--ink); font-weight: 700; }

/* ============================== 9. INSTALL ============================== */
.link-card { padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.link-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1rem; }
.link-dot { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--line-strong); flex: none; }
.link-card[data-state="busy"] .link-dot { background: var(--gold); animation: pulse 1.1s ease-in-out infinite; }
.link-card[data-state="ready"] .link-dot { background: var(--ok); }
.link-card[data-state="error"] .link-dot { background: var(--red); }
@keyframes pulse { 50% { opacity: 0.3; } }
.link-text { flex: 1 1 14rem; display: flex; flex-direction: column; min-width: 0; }
.link-text strong { font-size: 1rem; }
.link-text span { font-size: 0.84rem; color: var(--ink-3); }
.link-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.link-facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: 0.6rem 1rem;
  margin-top: 0.9rem; padding-top: 0.9rem; border-top: 1px solid var(--line);
}
.link-facts dt { font-size: 0.68rem; font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.link-facts dd { font-size: 0.88rem; font-weight: 600; overflow-wrap: anywhere; }
.link-msg { margin-top: 0.7rem; font-size: 0.86rem; color: var(--ink-2); }
.link-msg:empty { display: none; }
.link-msg.is-error { color: var(--red-text); font-weight: 600; }
.choice { padding: 1rem 1.1rem; border-radius: 0 var(--radius) var(--radius) 0; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--gold); }
.choice p { font-size: 0.92rem; }
.choice-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.8rem; }

.release { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.release-row { display: grid; grid-template-columns: 6.5rem minmax(0, auto) minmax(0, 1fr); align-items: baseline; gap: 0.2rem 0.9rem; padding: 0.8rem 1.1rem; }
.release-row + .release-row { border-top: 1px solid var(--line); }
.release-k { font-size: 0.7rem; font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.release-v { font-family: var(--f-mono); font-size: 0.92rem; font-weight: 600; }
.release-d { font-size: 0.82rem; color: var(--ink-3); }
.release-d.is-warn { color: var(--warn-text); font-weight: 600; }
.release-d.is-ok { color: var(--ok-text); font-weight: 600; }
@media (max-width: 30rem) { .release-row { grid-template-columns: 1fr; } }
.problems { padding: 0.9rem 1.1rem; border-radius: var(--radius); border: 1px solid var(--red); background: var(--red-tint); font-size: 0.88rem; }
.problems ul { margin-top: 0.4rem; display: grid; gap: 0.25rem; }
.problems li::before { content: "– "; color: var(--red-text); }
.problems a { color: var(--red-text); font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center; }
.actions-why { font-size: 0.84rem; color: var(--ink-3); margin-top: 0.6rem !important; }
.actions-why:empty { display: none; }
.progress-track { position: relative; height: 0.6rem; border-radius: 999px; background: var(--bg-deep); overflow: hidden; border: 1px solid var(--line); }
.progress-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--red); border-radius: 999px; transition: width 240ms linear; }
.progress[data-state="done"] .progress-fill { background: var(--ok); }
.progress[data-state="error"] .progress-fill { background: var(--ink-3); }
.progress-text { display: flex; justify-content: space-between; gap: 1rem; margin-top: 0.5rem; font-size: 0.88rem; color: var(--ink-2); }
.progress[data-state="error"] .progress-text { color: var(--red-text); font-weight: 600; }
.done { padding: 1.1rem 1.2rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.done > * + * { margin-top: 0.7rem; }
.done-h { font-family: var(--f-display); font-size: 1.35rem; line-height: 1.2; }
.done-face { font-size: 0.92rem; color: var(--ink-2); }
.done-link .btn { max-width: 100%; white-space: normal; }
.log { border: 1px solid var(--line); border-radius: calc(var(--radius) - 0.3rem); background: var(--surface); }
.log > summary { display: flex; align-items: baseline; gap: 0.2rem 0.6rem; padding: 0.85rem 1rem; cursor: pointer; font-weight: 650; font-size: 0.92rem; list-style: none; }
.log > summary::-webkit-details-marker { display: none; }
.log > summary::before {
  content: ""; align-self: center; width: 0.5rem; height: 0.5rem; border-right: 1.6px solid var(--ink-3); border-bottom: 1.6px solid var(--ink-3);
  transform: rotate(-45deg); transition: transform 200ms var(--ease-out); margin-right: 0.2rem;
}
.log[open] > summary::before { transform: rotate(45deg); }
.log-count { font-weight: 500; color: var(--ink-3); font-size: 0.8rem; margin-left: 0.3rem; }
.log-tools { display: flex; gap: 0.4rem; justify-content: flex-end; padding: 0 0.8rem 0.5rem; }
.log-pre {
  margin: 0 0.6rem 0.6rem; padding: 0.8rem 0.9rem; max-height: 20rem; overflow: auto; border-radius: 0.6rem;
  background: var(--code-bg); color: var(--code-ink); font-family: var(--f-mono); font-size: 0.74rem; line-height: 1.6;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.log-pre:empty::before { content: "Nothing yet. After an install the clock's own lines appear here: Wi-Fi, the time, films, the battery."; color: var(--code-dim); }
.log-pre .l-tool { color: var(--code-dim); }
.log-pre .l-page { color: #8FE3B0; font-weight: 600; }
.log-pre .l-face { color: #F5C66B; }
.log-pre .l-err { color: #FF8A98; }
.log-pre .l-me { color: #9DB8FF; }
.keep { margin-top: 2rem !important; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.keep > * + * { margin-top: 0.8rem; }
.keep-h { font-family: var(--f-display); font-weight: 400; font-size: 1.3rem; }
.keep-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; }
.file-btn { cursor: pointer; }
.file-btn:has(+ input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }
.keep-msg { font-size: 0.86rem; color: var(--ink-2); }
.keep-msg:empty { display: none; }
.keep-msg.is-error { color: var(--red-text); font-weight: 600; }

/* ============================== 10. FOOTER ============================== */
.foot { border-top: 1px solid var(--line); background: var(--bg-deep); }
.foot-in {
  max-width: var(--maxw); margin: 0 auto; padding: clamp(2rem, 5vw, 3.5rem) var(--gutter) 1.5rem;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 2rem;
}
.foot h2 { font-family: var(--f-display); font-weight: 400; font-size: 1.2rem; margin-bottom: 0.6rem; }
.foot p, .foot li { font-size: 0.86rem; color: var(--ink-2); text-wrap: pretty; }
.foot-list { display: grid; gap: 0.4rem; }
.foot a { color: var(--ink); text-underline-offset: 0.2em; }
.foot-base { max-width: var(--maxw); margin: 0 auto; padding: 1rem var(--gutter) 2rem; font-size: 0.76rem; color: var(--ink-3); }

/* ============================== 11. MOTION + CONTRAST ============================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; transition-delay: 0ms !important; }
}
@media (prefers-contrast: more) {
  :root { --line: rgba(22, 18, 14, 0.4); --ink-3: #4F483F; }
  :root[data-theme="dark"] { --line: rgba(244, 239, 230, 0.45); --ink-3: #C2B8AB; }
}
@media (forced-colors: active) {
  .seg input:checked + span { outline: 2px solid Highlight; }
  .card:has(input:checked), .fcard.is-start { outline: 2px solid Highlight; }
  .progress-fill, .lc-fill { forced-color-adjust: none; background: Highlight; }
}
@media (max-width: 40rem) {
  :root { --top-h: 6rem; }
  .top-nav { display: none; }
  .theme-toggle { margin-left: auto; }
  .rail a { padding: 0.35rem 0.55rem; font-size: 0.78rem; }
  .actions .btn { flex: 1 1 100%; }
}
@media (max-width: 22rem) { .brand-name { display: none; } .brand-studio { margin-left: 0; } }
