/* The Long Road - a private tracker.
   Colour tokens come from the validated data-viz reference palette; the chart
   marks were run through the palette validator (blue vs orange: CVD dE 24.7
   light / 26.8 dark, both well clear of the 8.0 target). */

:root {
    color-scheme: light;

    --plane:          #f9f9f7;
    --surface:        #fcfcfb;
    --surface-sunken: #f2f1ed;
    --ink:            #0b0b0b;
    --ink-2:          #52514e;
    --muted:          #898781;
    --grid:           #e1e0d9;
    --rule:           #c3c2b7;
    --border:         rgba(11, 11, 11, 0.10);

    --accent:         #2a78d6;
    --accent-soft:    #e8f0fc;
    --goal:           #eb6834;
    --raw:            #898781;

    --good:           #0ca30c;
    --warning:        #fab219;
    --critical:       #d03b3b;
    --good-text:      #006300;

    --radius:   12px;
    --radius-s: 8px;
    --gap:      1rem;
    --shadow:   0 1px 2px rgba(11, 11, 11, 0.05);
    --font:     system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --plane:          #0d0d0d;
        --surface:        #1a1a19;
        --surface-sunken: #232322;
        --ink:            #ffffff;
        --ink-2:          #c3c2b7;
        --muted:          #898781;
        --grid:           #2c2c2a;
        --rule:           #383835;
        --border:         rgba(255, 255, 255, 0.10);
        --accent:         #3987e5;
        --accent-soft:    #16243a;
        --goal:           #d95926;
        --raw:            #898781;
        --good-text:      #0ca30c;
        --shadow:         none;
    }
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --plane:          #0d0d0d;
    --surface:        #1a1a19;
    --surface-sunken: #232322;
    --ink:            #ffffff;
    --ink-2:          #c3c2b7;
    --muted:          #898781;
    --grid:           #2c2c2a;
    --rule:           #383835;
    --border:         rgba(255, 255, 255, 0.10);
    --accent:         #3987e5;
    --accent-soft:    #16243a;
    --goal:           #d95926;
    --raw:            #898781;
    --good-text:      #0ca30c;
    --shadow:         none;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--plane);
    color: var(--ink);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); }

/* --- Layout ------------------------------------------------------------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding-top: env(safe-area-inset-top, 0);
}

.topbar-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 1rem;
}

.wordmark {
    font-weight: 700;
    letter-spacing: -0.01em;
    text-decoration: none;
    color: var(--ink);
    font-size: 1.05rem;
    white-space: nowrap;
}

.nav {
    display: flex;
    gap: 0.15rem;
    overflow-x: auto;
    scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }

.nav a {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-s);
    color: var(--ink-2);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    white-space: nowrap;
}
.nav a:hover { background: var(--surface-sunken); }
.nav a.is-current { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

main {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.25rem 1rem 4rem;
}

h1 { font-size: 1.5rem; margin: 0 0 0.2rem; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; margin: 0 0 0.75rem; }
h3 { font-size: 0.95rem; margin: 0 0 0.5rem; }
.page-sub { color: var(--ink-2); margin: 0 0 1.5rem; font-size: 0.95rem; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem;
    margin-bottom: var(--gap);
    box-shadow: var(--shadow);
}

.card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
}
.card-head h2, .card-head h1 { margin: 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }

@media (max-width: 720px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* --- Figures ------------------------------------------------------------ */

.stat-label {
    font-size: 0.8rem;
    color: var(--ink-2);
    text-transform: none;
    margin-bottom: 0.15rem;
}

/* Proportional figures on purpose: tabular-nums makes 121 look loose at
   display sizes. Tabular is reserved for the tables and the axis ticks. */
.hero {
    font-size: 2.75rem;
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -0.02em;
}
.hero .unit { font-size: 1.1rem; font-weight: 500; color: var(--ink-2); }

.stat-value { font-size: 1.6rem; font-weight: 600; line-height: 1.15; }
.stat-value .unit { font-size: 0.85rem; font-weight: 500; color: var(--ink-2); }

.delta { font-size: 0.9rem; font-weight: 600; }
.delta.down { color: var(--good-text); }
.delta.up   { color: var(--critical); }
.delta.flat { color: var(--ink-2); }

.meter {
    height: 8px;
    background: var(--surface-sunken);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 0.5rem;
}
.meter span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.meter.over span { background: var(--warning); }

/* --- Chart -------------------------------------------------------------- */

.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; touch-action: pan-y; }

.chart .grid-line { stroke: var(--grid); stroke-width: 1; }
.chart .axis-line { stroke: var(--rule); stroke-width: 1; }
.chart .tick-text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }

.chart .trend-line {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}
/* Dashing is legitimate here: it means "projected", not "gridline". */
.chart .projection-line {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    stroke-dasharray: 5 5;
    opacity: 0.75;
    stroke-linecap: round;
}
.chart .goal-line { stroke: var(--goal); stroke-width: 2; }
.chart .goal-label { fill: var(--ink-2); font-size: 11px; font-weight: 600; }

/* Raw readings recede: they are the same measurement as the trend, just noisy.
   Muted grey clears 3:1 on both surfaces (3.50 light / 4.85 dark). */
.chart .raw-dot { fill: var(--raw); stroke: var(--surface); stroke-width: 2; }
.chart .end-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart .end-label { fill: var(--ink); font-size: 12px; font-weight: 600; }

.chart .hit { fill: transparent; }
.chart .crosshair { stroke: var(--rule); stroke-width: 1; opacity: 0; }
.chart .focus-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; opacity: 0; }

.chart-tooltip {
    position: absolute;
    pointer-events: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-s);
    box-shadow: 0 4px 14px rgba(11, 11, 11, 0.12);
    padding: 0.5rem 0.65rem;
    font-size: 0.82rem;
    line-height: 1.4;
    opacity: 0;
    transition: opacity 0.1s;
    white-space: nowrap;
    z-index: 5;
}
.chart-tooltip .tt-date { color: var(--ink-2); margin-bottom: 0.2rem; }
.chart-tooltip .tt-row { display: flex; align-items: center; gap: 0.4rem; }
.chart-tooltip b { font-variant-numeric: tabular-nums; }

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.1rem;
    margin-top: 0.6rem;
    font-size: 0.85rem;
    color: var(--ink-2);
}
.legend-item { display: inline-flex; align-items: center; gap: 0.4rem; }
.key { width: 14px; height: 3px; border-radius: 2px; flex-shrink: 0; }
.key.dot { width: 9px; height: 9px; border-radius: 50%; }
.key.dash {
    background: repeating-linear-gradient(90deg,
        var(--accent) 0 5px, transparent 5px 9px);
}

/* --- Range filter row (above the chart, never inside the card body) ------ */

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
    align-items: center;
}
.chip {
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink-2);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
}
.chip.is-current { background: var(--accent); border-color: var(--accent); color: #fff; }

/* --- Forms -------------------------------------------------------------- */

.field { margin-bottom: 0.85rem; }
.field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink-2);
    margin-bottom: 0.3rem;
}
.field .help { font-size: 0.78rem; color: var(--muted); margin-top: 0.25rem; }
.field .error { font-size: 0.82rem; color: var(--critical); margin-top: 0.25rem; }

input[type="text"], input[type="number"], input[type="date"],
input[type="password"], select, textarea {
    width: 100%;
    padding: 0.6rem 0.7rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius-s);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-color: var(--accent);
}

.form-row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: flex-end; }
.form-row .field { flex: 1 1 8rem; margin-bottom: 0; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.62rem 1.1rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--radius-s);
    border: 1px solid transparent;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    min-height: 2.6rem;
}
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--rule); }
.btn.ghost { background: transparent; color: var(--ink-2); border-color: transparent; padding: 0.4rem 0.6rem; }
.btn.danger { background: var(--critical); }
.btn.small { padding: 0.35rem 0.7rem; font-size: 0.85rem; min-height: 2.1rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

/* --- Tables ------------------------------------------------------------- */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--grid); }
th { font-size: 0.78rem; color: var(--ink-2); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: none; }
tfoot td { font-weight: 600; border-top: 1px solid var(--rule); border-bottom: none; }

details.table-view { margin-top: 0.9rem; }
details.table-view summary {
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--ink-2);
    padding: 0.35rem 0;
}

/* --- Lists & misc ------------------------------------------------------- */

.item-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--grid);
}
.item-row:last-child { border-bottom: none; }
.item-row .grow { flex: 1; min-width: 0; }
.item-row .title { font-weight: 600; }
.item-row .sub { font-size: 0.83rem; color: var(--ink-2); }
.item-row.done .title { text-decoration: line-through; color: var(--muted); }

.tick {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    border: 2px solid var(--rule);
    background: var(--surface);
    cursor: pointer;
    flex-shrink: 0;
    font-size: 1rem;
    line-height: 1;
    color: transparent;
    padding: 0;
}
.tick.is-done { background: var(--good); border-color: var(--good); color: #fff; }

.pill {
    display: inline-block;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--surface-sunken);
    color: var(--ink-2);
}
.pill.stretch  { background: #e8f0fc; color: #1c5cab; }
.pill.strength { background: #fdece4; color: #a83c12; }
.pill.cardio   { background: #e6f6ef; color: #0d6b4c; }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .pill.stretch  { background: #16243a; color: #86b6ef; }
    :root:not([data-theme="light"]) .pill.strength { background: #33190e; color: #eb6834; }
    :root:not([data-theme="light"]) .pill.cardio   { background: #0e2a20; color: #1baf7a; }
}

.day-nav { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 1rem; }
.day-nav .day-name { font-weight: 600; font-size: 1.05rem; }
.day-nav .day-sub { font-size: 0.8rem; color: var(--ink-2); }

.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.messages li {
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-s);
    border-left: 3px solid var(--accent);
    background: var(--accent-soft);
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}
.messages li.success { border-left-color: var(--good); }

.empty { color: var(--ink-2); font-size: 0.92rem; padding: 0.8rem 0; }

.bar-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.3rem 0; }
.bar-row .bar-label { width: 5.5rem; font-size: 0.82rem; color: var(--ink-2); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.bar-row .bar-track { flex: 1; height: 18px; position: relative; background: var(--surface-sunken); border-radius: 4px; overflow: hidden; }
/* 4px rounded data-end, square at the baseline. */
.bar-row .bar-fill { height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.bar-row .bar-fill.over { background: var(--warning); }
.bar-row .bar-value { width: 4.5rem; text-align: right; font-size: 0.85rem; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.target-marker { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--goal); }

.login-shell { max-width: 380px; margin: 12vh auto; padding: 0 1rem; }
.login-shell .wordmark { font-size: 1.4rem; display: block; margin-bottom: 0.3rem; }
.login-shell .tagline { color: var(--ink-2); margin: 0 0 1.5rem; font-size: 0.92rem; }

.step-list { padding-left: 1.3rem; margin: 0; }
.step-list li { margin-bottom: 0.5rem; }

.formset-row {
    border: 1px solid var(--border);
    border-radius: var(--radius-s);
    padding: 0.75rem;
    margin-bottom: 0.6rem;
    background: var(--surface-sunken);
}
.formset-row .delete-box { font-size: 0.82rem; color: var(--ink-2); }
.formset-row input[type="checkbox"] { width: auto; margin-right: 0.3rem; }

/* --- Phone: tab bar, safe areas, touch behaviour ------------------------ */

/* Stop the grey flash on every tap in a standalone iOS app. */
a, button, .tick, .chip { -webkit-tap-highlight-color: transparent; }

/* Nothing here is meant to be selected by a long press, except real prose. */
.topbar, .tabbar, .btn, .tick { -webkit-user-select: none; user-select: none; }

.nav-narrow { display: none; }

.tabbar { display: none; }

@media (max-width: 720px) {
    .nav-wide { display: none; }
    .nav-narrow { display: flex; }

    .topbar-inner { padding: 0.55rem 0.9rem; }
    .wordmark { font-size: 0.98rem; }
    .nav-narrow a { padding: 0.45rem 0.6rem; font-size: 0.85rem; }

    main {
        padding: 1rem 0.9rem;
        /* Clear the tab bar plus the home indicator underneath it. */
        padding-bottom: calc(4.6rem + env(safe-area-inset-bottom, 0px));
    }

    .tabbar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 30;
        display: flex;
        background: var(--surface);
        border-top: 1px solid var(--border);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .tabbar a {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.15rem;
        /* Comfortably past the 44px Apple asks for. */
        min-height: 3.4rem;
        padding: 0.4rem 0.2rem 0.45rem;
        color: var(--ink-2);
        text-decoration: none;
        font-size: 0.68rem;
        font-weight: 600;
        letter-spacing: 0.01em;
    }

    .tabbar a svg {
        width: 22px;
        height: 22px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .tabbar a.is-current { color: var(--accent); }
    .tabbar a:active { background: var(--surface-sunken); }

    /* One column, and roomier targets, on a phone. */
    h1 { font-size: 1.3rem; }
    .hero { font-size: 2.4rem; }
    .card { padding: 0.95rem; border-radius: 10px; }
    .form-row { gap: 0.5rem; }
    .form-row .field { flex: 1 1 100%; }
    .btn { min-height: 2.9rem; }
    .item-row { padding: 0.8rem 0; }
    .tick { width: 2.4rem; height: 2.4rem; }

    /* Tables scroll rather than squeeze. */
    table { font-size: 0.85rem; }
    th, td { padding: 0.5rem 0.45rem; }
}

/* Landscape on a notched phone: keep content clear of the rounded corners. */
@media (max-width: 900px) and (orientation: landscape) {
    main, .topbar-inner {
        padding-left: max(0.9rem, env(safe-area-inset-left, 0px));
        padding-right: max(0.9rem, env(safe-area-inset-right, 0px));
    }
}

/* iOS zooms the page in when a focused field is under 16px. Every input here
   is already 16px; this just makes that explicit so it survives edits. */
input, select, textarea { font-size: max(16px, 1rem); }

/* --- Theme toggle ------------------------------------------------------- */

.theme-form { margin: 0 auto 0 0.4rem; display: flex; }

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.3rem;
    height: 2.3rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-s);
    background: var(--surface);
    color: var(--ink-2);
    cursor: pointer;
}
.theme-toggle svg {
    width: 17px; height: 17px;
    fill: none; stroke: currentColor;
    stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.theme-toggle:active { background: var(--surface-sunken); }

/* --- Form field widths --------------------------------------------------- */
/* A name needs room; grams and kcal are three or four characters. Without
   these, flex hands every field the same width and a 120-character name
   competes with a number. */

.field-name    { flex: 4 1 14rem; }
.field-medium  { flex: 2 1 9rem; }
.field-number  { flex: 0 1 7rem; }
.field-full    { flex: 1 1 100%; }

@media (max-width: 720px) {
    .field-name, .field-medium, .field-number { flex: 1 1 100%; }
}

/* --- Minimal skin -------------------------------------------------------- */
/* Same information, no furniture: panels become plain sections separated by
   space and a hairline, buttons lose their fill, and the page does the work
   instead of the chrome. */

[data-skin="minimal"] {
    --radius: 0px;
    --radius-s: 4px;
    --shadow: none;
}

[data-skin="minimal"] body { background: var(--surface); }

[data-skin="minimal"] .topbar {
    background: transparent;
    border-bottom: 1px solid var(--grid);
}

[data-skin="minimal"] .nav a.is-current {
    background: transparent;
    color: var(--ink);
    box-shadow: inset 0 -2px 0 var(--ink);
    border-radius: 0;
}

[data-skin="minimal"] .card {
    background: transparent;
    border: none;
    border-top: 1px solid var(--grid);
    border-radius: 0;
    box-shadow: none;
    padding: 1.6rem 0 0.4rem;
    margin-bottom: 1.6rem;
}
[data-skin="minimal"] .card:first-of-type { border-top: none; padding-top: 0.4rem; }

[data-skin="minimal"] .grid-2,
[data-skin="minimal"] .grid-3 { gap: 0 2.5rem; }

[data-skin="minimal"] h1 { font-weight: 500; letter-spacing: -0.02em; }
[data-skin="minimal"] h2 {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

[data-skin="minimal"] .hero { font-weight: 400; letter-spacing: -0.03em; }
[data-skin="minimal"] .stat-value { font-weight: 500; }

[data-skin="minimal"] .btn {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--rule);
    font-weight: 500;
}
[data-skin="minimal"] .btn:active { background: var(--surface-sunken); }
[data-skin="minimal"] .btn.danger { color: var(--critical); border-color: var(--critical); }
[data-skin="minimal"] .btn.ghost { border-color: transparent; color: var(--ink-2); }

[data-skin="minimal"] input[type="text"],
[data-skin="minimal"] input[type="number"],
[data-skin="minimal"] input[type="date"],
[data-skin="minimal"] input[type="password"],
[data-skin="minimal"] select,
[data-skin="minimal"] textarea {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--rule);
    border-radius: 0;
    padding: 0.5rem 0.1rem;
}
[data-skin="minimal"] input:focus,
[data-skin="minimal"] select:focus,
[data-skin="minimal"] textarea:focus {
    outline: none;
    border-bottom: 2px solid var(--ink);
}

[data-skin="minimal"] .chip {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 0.3rem 0.1rem;
    margin-right: 1rem;
}
[data-skin="minimal"] .chip.is-current {
    background: transparent;
    color: var(--ink);
    border-bottom-color: var(--ink);
}

[data-skin="minimal"] .pill {
    background: transparent;
    color: var(--muted);
    padding: 0 0.3rem 0 0;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.68rem;
}

[data-skin="minimal"] .meter { height: 2px; border-radius: 0; background: var(--grid); }
[data-skin="minimal"] .meter span { border-radius: 0; }

[data-skin="minimal"] .theme-toggle,
[data-skin="minimal"] .tabbar { background: transparent; }
[data-skin="minimal"] .theme-toggle { border-color: transparent; }
[data-skin="minimal"] .tabbar {
    border-top: 1px solid var(--grid);
    backdrop-filter: blur(12px);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
}
[data-skin="minimal"] .tabbar a.is-current { color: var(--ink); }

[data-skin="minimal"] .messages li {
    background: transparent;
    border-left: 2px solid var(--ink);
    border-radius: 0;
}

[data-skin="minimal"] .formset-row {
    background: transparent;
    border: none;
    border-top: 1px dashed var(--grid);
    border-radius: 0;
    padding: 0.9rem 0 0;
}

/* --- Batch calculator disclosure ---------------------------------------- */

details.batch-box {
    margin-top: 0.9rem;
    border-top: 1px solid var(--grid);
    padding-top: 0.7rem;
}
details.batch-box summary {
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ink-2);
    padding: 0.2rem 0;
}
