/* The hardware pages: the design of the Time Watch. The visual language of the wallet (web-v4/wallet/styles.css):
   its tokens below are copied from it as they are, so every Time page has the same names and values. Flat, grouped by
   spacing and headings; the drawings are made by app.js on canvases, in the two colours --page and --ink. Colours
   follow the reader's system setting; nothing is loaded from elsewhere. */
:root {
  color-scheme: light dark;
  --page: #ffffff; --surface: #f1f1f1; --track: #e4e4e4; --card: #ffffff; --ink: #222222; --soft: #666666;
  --line: #dddddd; --edge: #767676; --link: #222222; --ribbon: #f4f4f4;
  --ok: #1b6e3a; --ok-bg: #e7f3ea; --bad: #b3261e; --bad-bg: #fcebe9; --warn: #6f4700; --warn-bg: #fff2d4;
  --unknown-bg: #f1f1f1; --busy-bg: #f1f1f1; --day-bg: #f1f1f1; --warn-ink: #6f4700;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Sizes: the spacing scale 4, 8, 12, 16, 24, 32, 48, 64; controls tall enough for a thumb; brief, calm movement. */
  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem; --s5: 1.5rem; --s6: 2rem; --s7: 3rem; --s8: 4rem;
  --gutter: 1.5rem; --radius-field: .875rem; --radius-sheet: 1.25rem; --pill: 999px;
  --button-height: 3.25rem; --field-height: 3.5rem; --row-height: 4rem; --fast: 180ms; --sheet: 260ms; --ease: cubic-bezier(.2, .7, .2, 1);
}
/* The dark palette: the same roles, checked for contrast on their own (text at least 4.5:1, controls 3:1). */
@media (prefers-color-scheme: dark) {
  :root {
    --page: #121212; --surface: #1e1e1e; --track: #2c2c2c; --card: #1a1a1a; --ink: #ededed; --soft: #a8a8a8;
    --line: #2f2f2f; --edge: #8d8d8d; --link: #ededed; --ribbon: #191919;
    --ok: #7fd49a; --ok-bg: #12291a; --bad: #ff9d93; --bad-bg: #3a1714; --warn: #ffd27a; --warn-bg: #352705;
    --unknown-bg: #1e1e1e; --busy-bg: #1e1e1e; --day-bg: #1e1e1e; --warn-ink: #ffd27a;
  }
}
@media (max-width: 22.5rem) { :root { --gutter: 1rem; } }

* { box-sizing: border-box; }
html { font: 16px/1.5 var(--sans); background: var(--page); color: var(--ink); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 3.5rem; }
body { margin: 0; background: var(--page); color: var(--ink); }
[hidden] { display: none !important; }
a { color: var(--link); text-underline-offset: .2em; }
a:focus-visible, button:focus-visible, canvas:focus-visible, input:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
h1 { font-size: 2.5rem; line-height: 1.1; letter-spacing: -.03em; font-weight: 800; margin: 0 0 var(--s3); }
h2 { font-size: 1.5rem; line-height: 1.25; letter-spacing: -.01em; margin: 0 0 var(--s2); }
h3 { font-size: 1.0625rem; line-height: 1.35; margin: var(--s4) 0 var(--s1); }
h4 { font-size: 1rem; line-height: 1.35; margin: 0 0 var(--s1); }
p { margin: var(--s2) 0; }
ul, ol { margin: var(--s2) 0; }
.soft { color: var(--soft); }
.small { font-size: .875rem; }

/* What this page is, always in view: a draft, not a product. */
.strip { position: sticky; top: 0; z-index: 5; margin: 0; padding: var(--s2) var(--gutter); background: var(--warn-bg); color: var(--warn); text-align: center; font-size: .875rem; line-height: 1.4; }
.top { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); max-width: 68rem; margin: 0 auto; padding: var(--s2) var(--gutter); }
.brand { display: inline-flex; align-items: center; gap: var(--s2); min-height: 2.75rem; font-weight: 800; font-size: 1.125rem; letter-spacing: -.01em; text-decoration: none; white-space: nowrap; }
.brand .soft { font-weight: 600; }
.brand-mark { width: 1.5rem; height: 1.5rem; flex: none; }
.brand-mark circle { fill: var(--ink); }
.brand-mark path { fill: none; stroke: var(--page); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.top ul { display: flex; gap: var(--s1); list-style: none; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
.top li a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 var(--s3); border-radius: var(--pill); text-decoration: none; font-weight: 600; font-size: .9375rem; white-space: nowrap; }
@media (hover: hover) { .top li a:hover { background: var(--surface); } }
@media (max-width: 40rem) { .top { flex-direction: column; align-items: stretch; gap: 0; } .top ul { margin: 0 calc(-1 * var(--s3)); } }
main { max-width: 68rem; margin: 0 auto; padding: 0 var(--gutter) var(--s6); }

/* The opening: what it is in one paragraph, and the watch itself. */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s5); padding: var(--s4) 0 var(--s5); align-items: center; }
.lede { margin: 0; font-size: 1.125rem; line-height: 1.55; }
.points { margin: var(--s4) 0; padding: 0; list-style: none; }
.points li { position: relative; padding: var(--s1) 0 var(--s1) 1.5rem; }
.points li::before, .rules li::before { content: ""; position: absolute; left: 0; top: .95em; width: .75rem; height: 2px; background: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin: var(--s4) 0 0; }
@media (min-width: 56rem) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s7); padding: var(--s6) 0 var(--s7); }
  h1 { font-size: 3.25rem; }
  .lede { font-size: 1.25rem; }
}

/* A drawing: a pale stage, the canvas, and what belongs under it. */
.stage { margin: 0; }
.scene { display: block; width: 100%; aspect-ratio: 100 / 92; border-radius: var(--radius-sheet); background: var(--ribbon); touch-action: pan-y; cursor: grab; -webkit-user-select: none; user-select: none; }
.scene:active { cursor: grabbing; }
.stage.wide .scene { aspect-ratio: 104 / 88; }
.stage.tall .scene { aspect-ratio: 100 / 125; }
.stage figcaption { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s4); padding-top: var(--s3); }
.stage .names { justify-content: space-around; font-weight: 600; font-size: .9375rem; }
.views, .units { display: flex; flex-wrap: wrap; gap: var(--s2); }

/* Buttons: one filled pill for the next thing to do, outlined pills beside it, small pills that stay pressed. */
.button { display: inline-flex; align-items: center; justify-content: center; min-height: var(--button-height); padding: .75rem 1.5rem; border: 1px solid var(--ink); border-radius: var(--pill); background: var(--ink); color: var(--page); text-decoration: none; font: inherit; font-weight: 600; line-height: 1.25; cursor: pointer; touch-action: manipulation; transition: background-color var(--fast) var(--ease), opacity var(--fast) var(--ease); }
.button.secondary { background: transparent; color: var(--ink); border-color: var(--edge); }
.chip { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: 0 var(--s4); border: 1px solid var(--edge); border-radius: var(--pill); background: transparent; color: var(--ink); font: inherit; font-weight: 600; font-size: .9375rem; cursor: pointer; touch-action: manipulation; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--page); }
.round { display: inline-flex; align-items: center; justify-content: center; width: 3.5rem; height: 3.5rem; flex: none; border: 1px solid var(--edge); border-radius: 50%; background: transparent; color: var(--ink); font: inherit; font-size: 1.75rem; font-weight: 500; line-height: 1; cursor: pointer; touch-action: manipulation; }
button:disabled { opacity: .45; cursor: not-allowed; }
@media (hover: hover) {
  .button:not(.secondary):not(:disabled):hover { opacity: .88; }
  .button.secondary:not(:disabled):hover, .chip:not([aria-pressed="true"]):not(:disabled):hover, .round:not(:disabled):hover { background: var(--surface); }
}

.problem { margin: var(--s4) 0; padding: var(--s3) var(--s4); border-left: 4px solid var(--bad); border-radius: .5rem; background: var(--bad-bg); }
.part { margin: var(--s6) 0 0; padding: var(--s6) 0 0; border-top: 1px solid var(--line); }
.intro { max-width: 44rem; margin: 0 0 var(--s4); font-size: 1.0625rem; }

/* The demonstration: the two watches, and beside them what is happening and the one thing to do next. */
.demo, .inside { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s5); align-items: start; }
.story { margin: 0; font-size: 1.0625rem; }
.note { margin: var(--s3) 0 0; padding: var(--s3) var(--s4); border-radius: var(--radius-field); background: var(--surface); }
.controls { display: flex; flex-direction: column; gap: var(--s3); margin: var(--s4) 0; }
.controls p { margin: 0; }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); }
.amount { flex: 1; text-align: center; font-size: 2.5rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.units { justify-content: center; }
.review { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 var(--s4); margin: 0; }
.review dt, .review dd { margin: 0; padding: var(--s2) 0; border-top: 1px solid var(--line); }
.review dt:first-of-type, .review dt:first-of-type + dd { border-top: 0; }
.review dt { color: var(--soft); }
.review dd { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.switches { margin: var(--s5) 0 var(--s3); padding: var(--s2) var(--s4) var(--s3); border: 1px solid var(--line); border-radius: var(--radius-field); }
.switches legend { padding: 0 var(--s2); font-weight: 700; font-size: .9375rem; }
.switches label { display: flex; align-items: center; gap: var(--s3); min-height: 2.75rem; padding: var(--s1) 0; line-height: 1.35; }
.switches input { width: 1.25rem; height: 1.25rem; flex: none; accent-color: var(--ink); }
@media (min-width: 56rem) {
  .demo { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--s7); }
  .inside { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s7); }
  .inside .stage { position: sticky; top: 3.25rem; }
  .stage.tall .scene { aspect-ratio: 100 / 120; }
}

/* What it does: plain blocks under hairlines. */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0 var(--s6); list-style: none; margin: 0; padding: 0; }
.grid li { padding: var(--s3) 0 var(--s4); border-top: 1px solid var(--line); }
.grid h3 { margin-top: 0; }
.grid p { margin: 0; color: var(--soft); }

/* The parts: numbered as on the drawing. The chosen one stands on a pale ground. */
.parts { list-style: none; margin: 0; padding: 0; counter-reset: part; }
.parts > li { counter-increment: part; position: relative; padding: var(--s2) var(--s3) var(--s3) 3.5rem; border-top: 1px solid var(--line); border-radius: 0; }
.parts > li:first-child { border-top: 0; }
.parts > li::before { content: counter(part); position: absolute; left: var(--s2); top: var(--s3); display: flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; border: 1.5px solid var(--ink); border-radius: 50%; font-weight: 800; font-size: .9375rem; font-variant-numeric: tabular-nums; }
.parts > li.chosen { background: var(--surface); border-radius: var(--radius-field); border-top-color: transparent; }
.parts > li.chosen + li { border-top-color: transparent; }
.parts > li.chosen::before { background: var(--ink); color: var(--page); }
.part-name { display: flex; align-items: center; width: 100%; min-height: 2.75rem; padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: 1.0625rem; font-weight: 700; text-align: left; cursor: pointer; }
.parts p { margin: 0 0 var(--s2); }

/* Two sides and one link. */
.sides { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s3); margin: var(--s4) 0 var(--s5); }
.side { padding: var(--s4); border: 1.5px solid var(--ink); border-radius: var(--radius-sheet); }
.side.radio { border-style: dashed; border-color: var(--edge); }
.side h3 { margin: 0 0 var(--s3); }
.side p { margin: var(--s3) 0 0; }
.boxes { display: flex; flex-wrap: wrap; gap: var(--s2); list-style: none; margin: 0; padding: 0; }
.boxes li { padding: var(--s2) var(--s3); border: 1px solid var(--edge); border-radius: .625rem; font-weight: 600; font-size: .9375rem; }
.boxes li.strong { background: var(--ink); border-color: var(--ink); color: var(--page); }
.link { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s1); padding: var(--s2) var(--s3); border-left: 2px dashed var(--ink); margin-left: 50%; font-weight: 700; min-height: 4rem; }
.link span { margin-left: var(--s3); align-self: flex-start; }
@media (min-width: 48rem) {
  .sides { grid-template-columns: minmax(0, 1.6fr) auto minmax(0, 1fr); align-items: stretch; gap: 0; }
  .link { margin: 0; padding: 0 var(--s4); border-left: 0; text-align: center; background: linear-gradient(var(--ink), var(--ink)) center / 100% 2px no-repeat; min-width: 12rem; }
  .link span { margin: 0; align-self: center; padding: 0 var(--s2); background: var(--page); position: relative; top: -1.4rem; }
  .link span + span { top: 1.2rem; }
}

.two { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 var(--s7); }
@media (min-width: 48rem) { .two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rules { list-style: none; padding: 0; }
.rules li { position: relative; padding: var(--s1) 0 var(--s1) 1.5rem; }

/* Numbered things: the cases of paying, the ways to build, the steps. */
.cases, .ways, .steps { list-style: none; margin: var(--s3) 0; padding: 0; counter-reset: item; }
.cases > li, .ways > li, .steps > li { counter-increment: item; position: relative; }
.cases > li { padding: var(--s3) 0 var(--s4) 3.5rem; border-top: 1px solid var(--line); }
.cases > li:first-child { border-top: 0; }
.cases > li::before, .ways > li::before { content: counter(item); position: absolute; left: 0; top: var(--s3); display: flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--surface); font-weight: 800; }
.cases > li:first-child::before { background: var(--ink); color: var(--page); }
.cases h3 { margin-top: var(--s1); }
.cases p { margin: 0; max-width: 46rem; }
.ways { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s3); }
.ways > li { padding: var(--s4) var(--s4) var(--s4); border: 1px solid var(--edge); border-radius: var(--radius-sheet); }
.ways > li::before { content: counter(item, upper-alpha); position: static; margin-bottom: var(--s3); background: var(--ink); color: var(--page); }
@media (min-width: 56rem) { .ways { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); } }
.steps > li { padding: var(--s1) 0 var(--s1) 2.25rem; }
.steps > li::before { content: counter(item); position: absolute; left: 0; top: .3rem; display: flex; align-items: center; justify-content: center; width: 1.625rem; height: 1.625rem; border: 1.5px solid var(--ink); border-radius: 50%; font-weight: 800; font-size: .8125rem; }
.tag { display: inline-block; margin-left: var(--s1); padding: .0625rem .625rem; border: 1px solid var(--edge); border-radius: var(--pill); background: var(--surface); font-size: .8125rem; font-weight: 700; vertical-align: .1em; white-space: nowrap; }
.tag.later { border-style: dashed; background: transparent; }

/* The targets: a name and its value on each line. */
.specs { display: grid; grid-template-columns: minmax(0, 1fr); margin: 0; }
.specs dt { padding-top: var(--s3); border-top: 1px solid var(--line); color: var(--soft); font-size: .9375rem; }
.specs dd { margin: 0; padding-bottom: var(--s3); font-weight: 600; }
.specs dt:first-of-type { border-top: 0; }
@media (min-width: 40rem) {
  .specs { grid-template-columns: 12rem minmax(0, 1fr); }
  .specs dd { padding-top: var(--s3); border-top: 1px solid var(--line); }
  .specs dt:first-of-type + dd { border-top: 0; }
  .specs dt { font-size: 1rem; }
}

footer { margin-top: var(--s7); padding-top: var(--s4); border-top: 1px solid var(--line); color: var(--soft); font-size: .875rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
