:root {
    --bg: #fafaf7;
    --surface: #ffffff;
    --sunken: #f3f2ed;
    --text: #15171a;
    --muted: #6b6f76;
    --faint: #a5a8ad;
    --line: #e6e4dd;
    --line-strong: #d3d0c6;
    --accent: #d9480f;
    --accent-ink: #b83a0a;
    --accent-soft: rgba(217, 72, 15, 0.1);
    --code-bg: #f1efe8;
    --work: #ffffff;
    --edge: #f1eee6;
    --night: #e2e5ec;
    --night-text: #69717f;
    --ok: #2f7d4f;
    --mono: "JetBrains Mono", "Cascadia Mono", "SF Mono", ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --max: 1160px;
    --gutter: clamp(16px, 4vw, 32px);
    --radius: 12px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0f1115;
        --surface: #161920;
        --sunken: #12141a;
        --text: #e9e7e1;
        --muted: #8d9199;
        --faint: #5b6069;
        --line: #262a33;
        --line-strong: #353a45;
        --accent: #ff7a3d;
        --accent-ink: #ff8f5c;
        --accent-soft: rgba(255, 122, 61, 0.13);
        --code-bg: #1d2129;
        --work: #262b35;
        --edge: #1b1f27;
        --night: #111419;
        --night-text: #5f6776;
        --ok: #5cc48a;
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #0f1115;
    --surface: #161920;
    --sunken: #12141a;
    --text: #e9e7e1;
    --muted: #8d9199;
    --faint: #5b6069;
    --line: #262a33;
    --line-strong: #353a45;
    --accent: #ff7a3d;
    --accent-ink: #ff8f5c;
    --accent-soft: rgba(255, 122, 61, 0.13);
    --code-bg: #1d2129;
    --work: #262b35;
    --edge: #1b1f27;
    --night: #111419;
    --night-text: #5f6776;
    --ok: #5cc48a;
    color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.6 var(--sans);
    overflow-x: hidden;
}

a { color: inherit; }
a:hover { color: var(--accent-ink); }
code, kbd { font-family: var(--mono); font-size: 0.88em; background: var(--code-bg); padding: 1px 5px; border-radius: 4px; }
kbd { border: 1px solid var(--line-strong); border-bottom-width: 2px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { display: block; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 20; background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 8px; text-decoration: none; }
.skip:focus { top: 12px; color: var(--bg); }

main, footer.site { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- header ---------- */

header.site {
    position: sticky;
    top: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
    max-width: none;
    padding: 0 max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
    height: 64px;
    background: var(--bg);
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    backdrop-filter: saturate(1.4) blur(10px);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}
header.site.scrolled { border-bottom-color: var(--line); }
.logo { text-decoration: none; font: 600 18px var(--mono); white-space: nowrap; }
.logo:hover { color: inherit; }
.logo .dot { color: var(--accent); }
.logo .date { color: var(--muted); }
header.site nav { display: flex; gap: 4px; justify-content: flex-end; }
header.site nav a {
    text-decoration: none;
    color: var(--muted);
    font-size: 15px;
    padding: 6px 10px;
    border-radius: 8px;
    white-space: nowrap;
}
header.site nav a:hover { color: var(--text); background: var(--sunken); }
header.site nav a[aria-current="true"] { color: var(--text); background: var(--sunken); }

.theme {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--muted);
}
.theme:hover { color: var(--text); }
.theme svg { width: 20px; height: 20px; display: none; }
.theme .i-auto { display: block; }
:root[data-theme="light"] .theme .i-auto, :root[data-theme="dark"] .theme .i-auto { display: none; }
:root[data-theme="light"] .theme .i-light { display: block; }
:root[data-theme="dark"] .theme .i-dark { display: block; }

/* ---------- hero: the live counter ---------- */

.hero { padding: clamp(28px, 6vw, 64px) 0 clamp(36px, 6vw, 64px); }
.eyebrow {
    margin: 0;
    font: 600 13px var(--mono);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-ink);
}
.eyebrow-note { color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0; margin-left: 10px; }

.counter { width: fit-content; max-width: 100%; }
.now {
    display: block;
    margin: 10px 0 0 -0.04em;
    padding: 0;
    border: 0;
    background: none;
    text-align: left;
    font: 650 clamp(38px, 14.5vw, 156px)/0.95 var(--mono);
    letter-spacing: -0.045em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.now:focus-visible { outline-offset: 6px; border-radius: 8px; }
.now-digits .g + .g { margin-left: 0.22em; }
.now-digits .g:last-child { color: var(--accent); }
.now-hint { font: 13px var(--sans); color: var(--faint); }
.now-hint .when-copied { display: none; color: var(--ok); }
.now-hint.copied .when-idle { display: none; }
.now-hint.copied .when-copied { display: inline; }
@media (hover: hover) {
    .now-hint .when-idle { opacity: 0; transition: opacity 0.2s; }
    .now:hover ~ .now-lines .when-idle, .now:focus-visible ~ .now-lines .when-idle { opacity: 1; }
}
.now-lines {
    margin: 18px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 28px;
    font: 15px/1.5 var(--mono);
    color: var(--muted);
}
.now-lines > span:first-child { color: var(--text); }

.int32 { margin: clamp(24px, 3.5vw, 40px) 0 0; }
.bits { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(5px, 1.4vw, 16px); }
.byte { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: clamp(2px, 0.45vw, 5px); }
.bit {
    aspect-ratio: 1 / 1.5;
    border-radius: 3px;
    border: 1.5px solid var(--line-strong);
    background: transparent;
    transition: background-color 0.5s ease, border-color 0.5s ease;
}
.bit.on { background: var(--text); border-color: var(--text); }
.bit.sign { border-style: dashed; border-color: var(--accent); }
.bit.flip { background: var(--accent); border-color: var(--accent); transition: none; }
.bits-scale { display: flex; justify-content: space-between; margin-top: 8px; font: 12px var(--mono); color: var(--muted); }
.bits-scale span:first-child { color: var(--accent-ink); }
.int32 figcaption { margin-top: 14px; color: var(--muted); max-width: 70ch; }
.int32 figcaption #overflow-left { color: var(--text); font-family: var(--mono); font-size: 0.94em; white-space: nowrap; }
.year { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.year b { color: var(--text); font: 600 0.94em var(--mono); }

@media (prefers-reduced-motion: reduce) {
    .bit { transition: none; }
    .bit.flip { background: var(--text); border-color: var(--text); }
    .bit.sign.flip { border-color: var(--accent); }
}

/* ---------- sections ---------- */

.block { padding: clamp(40px, 6vw, 72px) 0; border-top: 1px solid var(--line); }
.block-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 22px; }
.block-head.split { flex-direction: row; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 32px; }
.block-head h2 { margin: 0; font-size: clamp(22px, 2.6vw, 28px); line-height: 1.2; letter-spacing: -0.015em; }
.block-head p { margin: 0; color: var(--muted); max-width: 62ch; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.grow { flex: 1; }
.field label { font-size: 13px; color: var(--muted); }

input, select {
    min-width: 0;
    height: 48px;
    padding: 0 14px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 10px;
}
input { font: 17px var(--mono); }
input::placeholder { color: var(--faint); }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
select { padding-right: 34px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px; background-size: 5px 5px; background-repeat: no-repeat; max-width: 100%; }

button.primary, .add-zone button[type="submit"], .pick-actions button {
    height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    background: var(--text);
    color: var(--bg);
    font-weight: 600;
    white-space: nowrap;
}
.pick-actions button + button { background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); }
.text-btn {
    padding: 4px 2px;
    border: 0;
    background: none;
    color: var(--accent-ink);
    font-size: 15px;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}
.text-btn:hover { text-decoration-thickness: 2px; }
.hint { margin: 10px 0 0; color: var(--muted); font-size: 14px; min-height: 1.6em; }
.hint.err, .detect-text.err { color: var(--accent-ink); }

/* ---------- converter ---------- */

.convert { display: flex; gap: 12px; align-items: flex-end; }
.convert .field:last-child { flex: 0 1 300px; }
.qbox { position: relative; }
.qbox input { width: 100%; height: 56px; font-size: 19px; padding-right: 48px; }
.clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--muted);
}
.clear:hover { background: var(--sunken); color: var(--text); }
.clear svg { width: 18px; height: 18px; }
.convert select { height: 56px; width: 100%; }

.detect { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 14px; }
.detect-text { margin: 0; flex: 1 1 320px; color: var(--muted); }
.detect-text b { color: var(--text); font-weight: 600; }
.units { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; }
.units button { border: 0; background: var(--surface); padding: 5px 12px; font: 14px var(--mono); color: var(--muted); }
.units button + button { border-left: 1px solid var(--line-strong); }
.units button[aria-pressed="true"] { background: var(--text); color: var(--bg); }

.examples { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 14px; font-size: 14px; color: var(--muted); }
.examples span { margin-right: 4px; }
.examples button {
    border: 1px dashed var(--line-strong);
    background: none;
    border-radius: 999px;
    padding: 3px 11px;
    font: 13px var(--mono);
    color: var(--muted);
}
.examples button:hover { color: var(--text); border-style: solid; }

.out {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
    margin: 24px 0 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
/* inner rules only: the right and bottom borders of the outer cells slide under the frame */
.out .row {
    position: relative;
    padding: 12px 52px 13px 16px;
    min-width: 0;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    margin: 0 -1px -1px 0;
}
.out dt { font-size: 13px; color: var(--muted); }
.out dd { margin: 2px 0 0; font: 15.5px/1.45 var(--mono); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.out .row.key dd { font-weight: 600; }
.out .copy { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
.out.stale .row dd { color: var(--faint); }

.copy {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--faint);
}
.copy:hover { color: var(--text); background: var(--sunken); }
.copy .ic { width: 18px; height: 18px; grid-area: 1 / 1; }
.copy .ic-check { display: none; color: var(--ok); }
.copy.done .ic-copy { display: none; }
.copy.done .ic-check { display: block; }
@media (hover: hover) {
    .out .copy { opacity: 0; transition: opacity 0.15s; }
    .out .row:hover .copy, .out .copy:focus-visible, .out .copy.done { opacity: 1; }
}

/* ---------- world clock ---------- */

.clock-status { display: flex; align-items: baseline; gap: 12px; }
#clock-status { font: 13px var(--mono); }
#clock-status.live::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--accent);
    vertical-align: 1px;
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { #clock-status.live::before { animation: none; } }

.zones { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 12px; }
@media (max-width: 520px) { .zones { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.zone {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px 16px;
    min-width: 0;
    transition: background-color 0.4s;
}
.zone.night { background: var(--night); border-color: transparent; }
.zone.you { border-color: var(--text); }
.zone header { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 24px; }
.zone h3 { margin: 0; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zone .chip { display: inline-block; font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--bg); background: var(--text); border-radius: 5px; padding: 1px 6px; margin-right: 7px; vertical-align: 2px; }
.zone .remove { width: 28px; height: 28px; margin: -4px -8px -4px 0; display: grid; place-items: center; border: 0; border-radius: 7px; background: none; color: var(--faint); flex: none; }
.zone .remove svg { width: 15px; height: 15px; }
.zone .remove:hover { color: var(--text); background: var(--sunken); }
@media (hover: hover) {
    .zone .remove { opacity: 0; }
    .zone:hover .remove, .zone .remove:focus-visible { opacity: 1; }
}
.zone .clock { margin: 4px 0 0; font: 600 clamp(26px, 3vw, 32px)/1.1 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.zone .clock .ss { font-size: 0.55em; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.zone .meta, .zone .diff { margin: 2px 0 0; font: 13px/1.45 var(--mono); color: var(--muted); }
.zone .diff { color: var(--text); font-family: var(--sans); }
.zone.night .meta { color: var(--night-text); }
.daybar {
    position: relative;
    height: 6px;
    margin-top: 12px;
    border-radius: 3px;
    background: linear-gradient(to right, var(--line-strong) 0 29.17%, var(--line) 29.17% 37.5%, var(--faint) 37.5% 70.83%, var(--line) 70.83% 91.67%, var(--line-strong) 91.67%);
    opacity: 0.8;
}
.zone .tick { position: absolute; top: -4px; bottom: -4px; left: calc(var(--day, 0) * 100%); width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--accent); }

.add-zone { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; }
.add-zone input { flex: 1 1 280px; height: 44px; font-size: 15px; }

/* ---------- planner ---------- */

.planner-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; margin-bottom: 14px; }
.day-nav { display: flex; align-items: center; gap: 6px; }
.day-nav > button:not(.text-btn) {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface);
}
.day-nav svg { width: 18px; height: 18px; }
.day-nav input { height: 40px; font-size: 15px; padding: 0 10px; }
.day-nav .text-btn { margin-left: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.legend li::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; border: 1px solid var(--line-strong); }
.legend .work::before { background: var(--work); }
.legend .edge::before { background: var(--edge); }
.legend .night::before { background: var(--night); }

.planner-scroll {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    scrollbar-width: thin;
    overscroll-behavior-x: contain;
}
.planner-scroll:focus-visible { outline-offset: 3px; }
.planner { --label-w: 168px; --cell: 38px; min-width: calc(var(--label-w) + var(--cols, 24) * var(--cell)); }
.prow { display: grid; grid-template-columns: var(--label-w) 1fr; border-top: 1px solid var(--line); }
.prow:first-child { border-top: 0; }
.plabel {
    position: sticky;
    left: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 6px 12px 6px 14px;
    background: var(--surface);
    border-right: 1px solid var(--line);
    min-width: 0;
}
.pcity { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow.you .pcity::after { content: " · you"; color: var(--accent-ink); font-weight: 500; }
.poff { font: 12px var(--mono); color: var(--muted); }
.ptrack { position: relative; display: grid; grid-template-columns: repeat(var(--cols, 24), minmax(var(--cell), 1fr)); }
.pcell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 2px 0;
    font: 14px/1.1 var(--mono);
    font-variant-numeric: tabular-nums;
    border-left: 1px solid var(--line);
    cursor: pointer;
    user-select: none;
}
.pcell:first-child { border-left: 0; }
.pcell.work { background: var(--work); color: var(--text); font-weight: 600; }
.pcell.edge { background: var(--edge); color: var(--muted); }
.pcell.night { background: var(--night); color: var(--night-text); }
.pcell .pm { font-size: 10px; opacity: 0.8; }
.pcell .pdate { font: 600 10.5px/1.15 var(--sans); text-transform: uppercase; letter-spacing: 0.03em; text-align: center; color: var(--accent-ink); }
.pcell.sel { box-shadow: inset 2px 0 0 var(--text), inset -2px 0 0 var(--text); }
.prow:first-child .pcell.sel { box-shadow: inset 2px 0 0 var(--text), inset -2px 0 0 var(--text), inset 0 2px 0 var(--text); }
.prow:last-child .pcell.sel { box-shadow: inset 2px 0 0 var(--text), inset -2px 0 0 var(--text), inset 0 -2px 0 var(--text); }
.pnow { position: absolute; top: 0; bottom: 0; left: calc(var(--now, 0) * 100%); width: 2px; margin-left: -1px; background: var(--accent); pointer-events: none; z-index: 1; }
.planner:not(.today) .pnow { display: none; }
.prow:first-child .pnow::before { content: ""; position: absolute; top: 0; left: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.pick { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; margin-top: 16px; }
.pick p { margin: 0; flex: 1 1 420px; font-size: 15px; color: var(--muted); }
.pick p b { color: var(--text); font-family: var(--mono); font-weight: 600; }
.pick-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- time between ---------- */

.between { display: flex; gap: 10px; align-items: flex-end; }
.between input { width: 100%; }
.swap { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--muted); }
.swap:hover { color: var(--text); }
.swap svg { width: 20px; height: 20px; }
.span-out { margin-top: 12px; }
.span-big { margin: 0 0 18px; font: 600 clamp(22px, 3.2vw, 34px)/1.25 var(--mono); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.span-big .neg { display: block; margin-top: 6px; font: 15px var(--sans); color: var(--accent-ink); letter-spacing: 0; }
.span-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); gap: 12px; margin: 0; }
.span-grid div { padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.span-grid dt { font-size: 13px; color: var(--muted); }
.span-grid dd { margin: 2px 0 0; font: 600 17px var(--mono); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* ---------- code ---------- */

.tabs { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 2px; margin-bottom: 14px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; border: 1px solid transparent; background: none; padding: 6px 12px; border-radius: 8px; font-size: 14px; color: var(--muted); }
.tabs button:hover { color: var(--text); background: var(--sunken); }
.tabs button[aria-selected="true"] { color: var(--text); border-color: var(--line-strong); background: var(--surface); font-weight: 600; }
.snippets { display: grid; gap: 10px; }
.snippet { margin: 0; background: var(--code-bg); border-radius: var(--radius); min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
.snippet header { display: contents; }
.snippet figcaption { grid-column: 1; padding: 10px 16px 0; font-size: 13px; color: var(--muted); }
.snippet .copy { grid-column: 2; grid-row: 1 / span 2; margin: 6px 6px 0 0; }
.snippet pre { grid-column: 1; margin: 0; padding: 4px 16px 14px; overflow-x: auto; font: 14px/1.6 var(--mono); }
.snippet code { background: none; padding: 0; font-size: inherit; }
.snippet .c { color: var(--muted); }

/* ---------- notes ---------- */

.notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 8px 40px; }
.notes .block-head { grid-column: 1 / -1; margin-bottom: 10px; }
.notes h3 { margin: 0 0 6px; font-size: 17px; }
.notes p { margin: 0 0 22px; color: var(--muted); }

footer.site { padding-bottom: 48px; color: var(--muted); font-size: 14px; }
footer.site p { margin: 0; padding-top: 28px; border-top: 1px solid var(--line); }

/* ---------- 404 ---------- */

.lost { padding: clamp(40px, 10vw, 120px) 0; }
.lost .now { cursor: default; white-space: normal; }
.lost p { color: var(--muted); max-width: 56ch; }

/* ---------- small screens ---------- */

@media (max-width: 860px) {
    header.site {
        grid-template-columns: 1fr auto;
        grid-template-areas: "logo theme" "nav nav";
        height: auto;
        gap: 0 12px;
        padding-top: 10px;
    }
    .logo { grid-area: logo; }
    .theme { grid-area: theme; }
    header.site nav {
        grid-area: nav;
        justify-content: flex-start;
        overflow-x: auto;
        scrollbar-width: none;
        margin: 6px calc(-1 * var(--gutter)) 0;
        padding: 0 var(--gutter) 8px;
    }
    header.site nav::-webkit-scrollbar { display: none; }
    header.site nav a { padding: 5px 10px; font-size: 14px; }
    header.site nav a:first-child { margin-left: -10px; }
    html { scroll-padding-top: 104px; }
}

@media (max-width: 640px) {
    .eyebrow-note { display: block; margin: 4px 0 0; }
    .now-lines { font-size: 13.5px; }
    .convert, .between { flex-direction: column; align-items: stretch; }
    .convert .field:last-child { flex-basis: auto; }
    .convert select { height: 48px; }
    .swap { align-self: center; transform: rotate(90deg); width: 40px; height: 40px; }
    .out .row { padding: 10px 48px 11px 14px; }
    .planner { --label-w: 108px; --cell: 40px; }
    .plabel { padding: 6px 8px 6px 10px; }
    .pcity { font-size: 13px; }
    .pick-actions { width: 100%; }
    .pick-actions button { flex: 1; }
    .add-zone input { flex-basis: 100%; }
    .add-zone button[type="submit"] { flex: 1; }
}
