:root {
    --paper: #F4F7F7;
    --surface: #FFFFFF;
    --ink: #0C2E31;
    --ink-soft: #4C6C6F;
    --ink-faint: #7A9497;
    --rule: #D3E0E0;
    --rule-soft: #E4EDED;
    --accent: #0F5C63;
    --accent-soft: #E1EFEF;
    --flag: #8A5200;
    --flag-soft: #FBEFDD;
    --shadow: 0 1px 2px rgba(12,46,49,.05), 0 10px 30px rgba(12,46,49,.06);

    --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
    --sans: ui-sans-serif, "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
    --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", monospace;
  }
  /* Dark mode is the OWC website's own palette (Bootswatch "Darkly", as
     used by cloud.occultwatcher.net and the OW Mobile privacy policy):
     #222 ground, #303030 surfaces, #00bc8c links, #444 rules, #16332c
     tint. Muted greys are lifted a little above the site's #888, which
     is too faint for body-length reading on this ground. */
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --paper: #222222;
      --surface: #303030;
      --ink: #FFFFFF;
      --ink-soft: #ADADAD;
      --ink-faint: #8C8C8C;
      --rule: #444444;
      --rule-soft: #3A3A3A;
      --accent: #00BC8C;
      --accent-soft: #16332C;
      --flag: #76B8E4;
      --flag-soft: #2A3D4F;
      --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.3);
    }
  }
  :root[data-theme="dark"] {
    --paper: #222222;
    --surface: #303030;
    --ink: #FFFFFF;
    --ink-soft: #ADADAD;
    --ink-faint: #8C8C8C;
    --rule: #444444;
    --rule-soft: #3A3A3A;
    --accent: #00BC8C;
    --accent-soft: #16332C;
    --flag: #76B8E4;
    --flag-soft: #2A3D4F;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.3);
  }

  * { box-sizing: border-box; }
  /* Belt and braces: nothing should ever be able to widen the page. */
  img { max-width: 100%; }
  body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 16px/1.68 var(--sans);
    -webkit-font-smoothing: antialiased;
  }
  a { color: var(--accent); text-underline-offset: 2px; }
  a:focus-visible, button:focus-visible {
    outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px;
  }

  /* ---------- shell ---------- */
  .shell { display: grid; grid-template-columns: 1fr; }
  @media (min-width: 62rem) {
    .shell { grid-template-columns: 17rem minmax(0, 1fr); }
  }

  .sidebar {
    border-bottom: 1px solid var(--rule);
    background: var(--surface);
    padding: 1.4rem 1.25rem;
  }
  @media (min-width: 62rem) {
    .sidebar {
      border-bottom: 0; border-right: 1px solid var(--rule);
      height: 100vh; position: sticky; top: 0; overflow-y: auto;
      padding: 2.2rem 1.6rem;
    }
  }
  .brand { display: flex; flex-direction: column; gap: .15rem; margin-bottom: 1.6rem; }
  .brand b { font: 600 1.02rem/1.2 var(--sans); letter-spacing: -.01em; }
  .brand span {
    font: 500 .68rem/1.4 var(--mono);
    letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint);
  }
  nav h6 {
    margin: 1.4rem 0 .5rem;
    font: 600 .66rem/1.4 var(--mono);
    letter-spacing: .13em; text-transform: uppercase; color: var(--ink-faint);
  }
  nav h6:first-of-type { margin-top: 0; }
  nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
  nav a {
    display: block; padding: .3rem 0 .3rem .7rem;
    border-left: 2px solid var(--rule-soft);
    color: var(--ink-soft); text-decoration: none; font-size: .89rem;
  }
  nav a:hover { color: var(--ink); border-left-color: var(--rule); }
  nav a[aria-current="page"] {
    color: var(--accent); border-left-color: var(--accent); font-weight: 600;
  }

  /* ---------- article ---------- */
  main { padding: clamp(1.6rem, 4vw, 3.4rem) clamp(1.1rem, 4vw, 3rem) 5rem; }
  article { max-width: 46rem; margin: 0 auto; }
  .eyebrow {
    font: 600 .68rem/1 var(--mono);
    letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
    margin: 0 0 .8rem;
  }
  h1 {
    font: 400 clamp(2rem, 5vw, 2.9rem)/1.1 var(--serif);
    letter-spacing: -.015em; margin: 0 0 .7rem; text-wrap: balance;
  }
  .standfirst {
    font-size: 1.08rem; color: var(--ink-soft); margin: 0 0 2.6rem; max-width: 40ch;
  }
  h2 {
    font: 400 1.5rem/1.25 var(--serif);
    margin: 3rem 0 .9rem; padding-top: 1.6rem; border-top: 1px solid var(--rule);
    text-wrap: balance;
  }
  h3 { font: 600 1rem/1.4 var(--sans); margin: 1.9rem 0 .5rem; }
  p { margin: 0 0 1.1rem; max-width: 66ch; }
  ul.body, ol.body { margin: 0 0 1.1rem; padding-left: 1.2rem; max-width: 64ch; }
  ul.body li, ol.body li { margin-bottom: .45rem; }

  code {
    font: .87em/1 var(--mono);
    background: var(--accent-soft); color: var(--accent);
    padding: .16em .38em; border-radius: 2px;
  }
  .ui { font-weight: 600; color: var(--ink); }

  /* ---------- figure row: prose beside a phone capture ---------- */
  .row { display: grid; gap: 1.6rem; margin: 1.8rem 0 2rem; align-items: start; }
  @media (min-width: 48rem) {
    .row { grid-template-columns: minmax(0, 1fr) 15rem; gap: 2.2rem; }
    .row.flip { grid-template-columns: 15rem minmax(0, 1fr); }
    .row.flip .shot { order: -1; }
  }
  .row > div > :last-child { margin-bottom: 0; }

  figure.shot { margin: 0; }
  .phone {
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 14px;
    padding: 7px;
    box-shadow: var(--shadow);
  }
  /* Load-bearing. Captures are 1080x2400, and without a width rule they
     render at that intrinsic size and blow the whole layout apart. The
     placeholder below sizes itself, so this was missed until real
     screenshots went in. */
  .phone img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
  }
  .phone .screen {
    aspect-ratio: 9 / 19.5;
    border-radius: 8px;
    background:
      repeating-linear-gradient(135deg, var(--rule-soft) 0 8px, transparent 8px 16px),
      var(--accent-soft);
    display: grid; place-items: center;
    color: var(--ink-faint);
    font: 500 .7rem/1.5 var(--mono);
    letter-spacing: .06em; text-align: center; padding: 1rem;
  }
  figure.shot figcaption {
    margin-top: .6rem; font-size: .78rem; line-height: 1.5; color: var(--ink-faint);
  }

  /* ---------- cutout: a cropped fragment, not a whole screen ----------
     Dialogs, menus and icon pairs are not screens, so a phone bezel
     around them reads as a mistake and wastes half the width. These sit
     inline in the prose column at their own scale. */
  figure.cutout { margin: 1.6rem 0; }
  figure.cutout img {
    display: block; width: 100%; max-width: 26rem; height: auto;
    border: 1px solid var(--rule); border-radius: 3px;
    box-shadow: var(--shadow);
  }
  figure.cutout.wide img { max-width: 34rem; }
  figure.cutout figcaption {
    margin-top: .55rem; font-size: .78rem; line-height: 1.5;
    color: var(--ink-faint); max-width: 34rem;
  }

  /* ---------- icon cells ----------
     The app's own PNGs, shown at 24px. Native sizes vary (16, 19, 64,
     100), and several are not square — the thermometers are 1:2 — so
     height is fixed and width follows. */
  td.ic { width: 3.2rem; padding-right: .6rem; }
  td.ic img, .iconrow img { height: 24px; width: auto; display: block; }
  .iconrow {
    display: flex; align-items: center; gap: .55rem; flex-wrap: wrap;
    margin: 1.1rem 0;
  }
  .iconrow span {
    font: .78rem/1 var(--mono); color: var(--ink-faint); margin-right: .5rem;
  }

  /* ---------- callout ---------- */
  .note {
    margin: 1.8rem 0; padding: 1rem 1.1rem;
    border-top: 2px solid var(--accent); background: var(--surface);
    box-shadow: var(--shadow);
  }
  .note.flagged { border-top-color: var(--flag); background: var(--flag-soft); }
  .note .label {
    display: block; margin-bottom: .35rem;
    font: 600 .66rem/1.4 var(--mono);
    letter-spacing: .13em; text-transform: uppercase; color: var(--accent);
  }
  .note.flagged .label { color: var(--flag); }
  .note p { margin: 0; font-size: .93rem; }

  /* ---------- field reference table ---------- */
  .scroller { overflow-x: auto; margin: 1.4rem 0 1.8rem; }
  table { border-collapse: collapse; width: 100%; font-size: .9rem; }
  caption {
    text-align: left; font: 600 .66rem/1.4 var(--mono);
    letter-spacing: .13em; text-transform: uppercase; color: var(--ink-faint);
    padding-bottom: .6rem;
  }
  th, td { text-align: left; padding: .6rem .8rem .6rem 0; vertical-align: top; }
  thead th {
    font: 600 .74rem/1.4 var(--sans); color: var(--ink-faint);
    border-bottom: 1px solid var(--rule);
  }
  tbody tr + tr th, tbody tr + tr td { border-top: 1px solid var(--rule-soft); }
  tbody th { font-weight: 600; white-space: nowrap; padding-right: 1.4rem; }

  /* ---------- steps ---------- */
  ol.steps { list-style: none; counter-reset: step; margin: 1.4rem 0 1.8rem; padding: 0; }
  ol.steps li {
    counter-increment: step; position: relative;
    padding: 0 0 1.1rem 2.6rem; max-width: 62ch;
  }
  ol.steps li::before {
    content: counter(step, decimal-leading-zero);
    position: absolute; left: 0; top: .1rem;
    font: 600 .74rem/1.5 var(--mono); color: var(--accent);
  }
  ol.steps li::after {
    content: ""; position: absolute; left: .82rem; top: 1.5rem; bottom: .1rem;
    width: 1px; background: var(--rule);
  }
  ol.steps li:last-child { padding-bottom: 0; }
  ol.steps li:last-child::after { display: none; }

  /* ---------- theme toggle ---------- */
  .themebar { margin-top: 1.8rem; padding-top: 1.2rem; border-top: 1px solid var(--rule-soft); }
  .themetoggle {
    display: inline-flex; align-items: center; gap: .5rem;
    background: transparent; border: 1px solid var(--rule); color: var(--ink-soft);
    border-radius: 3px; padding: .38rem .7rem; cursor: pointer;
    font: 500 .74rem/1.4 var(--mono); letter-spacing: .06em;
  }
  .themetoggle:hover { color: var(--ink); border-color: var(--ink-faint); }
  .themetoggle svg { width: 14px; height: 14px; flex: none; }
  @media (prefers-reduced-motion: no-preference) {
    .themetoggle { transition: color .15s ease, border-color .15s ease; }
  }

  footer.page {
    margin-top: 3.4rem; padding-top: 1.4rem; border-top: 1px solid var(--rule);
    display: flex; flex-wrap: wrap; gap: .6rem 1.4rem;
    font-size: .82rem; color: var(--ink-faint);
  }
