/* Stremselpist — warm, ambachtelijk, mobiel eerst. Geen build: gewone CSS met tokens. */

:root {
    --bg: #f6f1e9;
    --surface: #ffffff;
    --surface-2: #faf6f0;
    --text: #22190f;
    --muted: #7a6b5c;
    --border: #e7ddcf;
    --border-strong: #d6c8b5;
    --accent: #c0660f;
    --accent-hover: #a3550a;
    --accent-text: #ffffff;
    --accent-soft: #fbe9d4;
    --success: #2d7a47;
    --success-bg: #e2f2e7;
    --success-text: #1f5c34;
    --warning-bg: #fcf0d4;
    --warning-text: #7a5208;
    --error: #b23a2c;
    --error-bg: #fbe5e1;
    --error-text: #8a2c1d;
    --series-1: #2a78d6;
    --series-2: #eb6834;
    --series-3: #1baf7a;
    --grid: #ece5da;
    --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 4px 16px rgba(60, 40, 20, .05);
    --radius: 14px;
    --radius-sm: 9px;
    --font-display: "Bricolage Grotesque", system-ui, sans-serif;
    --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bottom-nav: 0px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #130f0b;
        --surface: #1d1712;
        --surface-2: #241d17;
        --text: #f3ebe0;
        --muted: #a5968a;
        --border: #33291f;
        --border-strong: #4a3c2e;
        --accent: #f0a04b;
        --accent-hover: #f5b46c;
        --accent-text: #1d1209;
        --accent-soft: #3a2814;
        --success: #5cc27f;
        --success-bg: #1b3324;
        --success-text: #a6e0b6;
        --warning-bg: #3a2c10;
        --warning-text: #f2cf86;
        --error: #ef7a6b;
        --error-bg: #42201a;
        --error-text: #f5b6a9;
        --series-1: #3987e5;
        --series-2: #d95926;
        --series-3: #199e70;
        --grid: #30271f;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
        color-scheme: dark;
    }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.55 var(--font-body);
    padding-bottom: var(--bottom-nav);
}

a { color: var(--accent); text-underline-offset: .15em; }
a:hover { color: var(--accent-hover); }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); font-weight: 700; margin: 0 0 .5rem; }
h2 { font-size: 1.2rem; font-weight: 650; }
h3 { font-size: 1.05rem; font-weight: 600; }

.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Navigatie ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .65rem max(1rem, calc((100% - 1080px) / 2));
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: saturate(1.4) blur(10px);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--text); font-family: var(--font-display); font-weight: 750; font-size: 1.2rem; letter-spacing: -.02em; }
.brand:hover { color: var(--text); }
.brand-mark { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 10px; background: linear-gradient(145deg, #f2b04f, #c0660f); color: #fff; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .15); }
.brand-mark .icon { width: 1.2rem; height: 1.2rem; }

.mainnav { display: flex; align-items: center; gap: .25rem; }
.mainnav a, .mainnav button {
    display: inline-flex; align-items: center; gap: .45rem;
    min-height: 0; padding: .45rem .75rem; border-radius: 999px;
    color: var(--muted); text-decoration: none; font: inherit; font-weight: 500; font-size: .95rem;
    background: none; border: 0; cursor: pointer;
}
.mainnav a:hover, .mainnav button:hover { color: var(--text); background: var(--surface-2); }
.mainnav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

.bottomnav { display: none; }

@media (max-width: 760px) {
    :root { --bottom-nav: calc(64px + env(safe-area-inset-bottom)); }
    .mainnav { display: none; }
    .topbar { padding: .55rem 1rem; }
    .bottomnav {
        position: fixed; inset: auto 0 0 0; z-index: 30;
        display: grid; grid-template-columns: repeat(4, 1fr);
        height: var(--bottom-nav); padding-bottom: env(safe-area-inset-bottom);
        background: var(--surface); border-top: 1px solid var(--border);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, .06);
    }
    .bottomnav a {
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem;
        color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 600;
    }
    .bottomnav a .icon { width: 1.45rem; height: 1.45rem; }
    .bottomnav a[aria-current="page"] { color: var(--accent); }
}

/* ---------- Pagina ---------- */

main { max-width: 1080px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem 1rem; margin-bottom: 1.25rem; }
.page-head h1, .page-head h2 { margin-bottom: 0; }
.card > .page-head { margin-bottom: .75rem; align-items: center; }
.subtitle { margin: .35rem 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; }
.eyebrow { display: block; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .2rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
    overflow-x: auto;
}
.card h2 { margin: 0 0 .75rem; }
.card .card { border: 0; padding: 0; margin: 1.25rem 0 0; box-shadow: none; overflow: visible; }
.narrow { max-width: 440px; }
.card.narrow { margin-left: auto; margin-right: auto; }
main > h1 + .card.narrow, .grid + .card.narrow, .page-head + .card.narrow { margin-left: 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; margin-bottom: 1.25rem; }
.grid .card { margin-bottom: 0; }
.section-title { font-size: 1.1rem; margin: .5rem 0 .75rem; }

.muted { color: var(--muted); }
.small { font-size: .875rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.notes { margin: 0; }
ul.plain { list-style: none; padding: 0; margin: 0 0 1rem; }
ul.plain li { padding: .45rem 0; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem .75rem; }
ul.plain li:last-child { border-bottom: 0; }
ul.plain a, .page-head a.small, .card .page-head a { text-decoration: none; font-weight: 600; }
ul.plain a:hover, .page-head a.small:hover { text-decoration: underline; }

.empty { text-align: center; padding: 2rem 1rem; }
.empty .icon { width: 2.5rem; height: 2.5rem; color: var(--border-strong); margin-bottom: .5rem; }
.empty p { margin: .25rem 0 1rem; }

/* ---------- Knoppen ---------- */

button, .button {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    min-height: 2.6rem; padding: .55rem 1.1rem;
    font: inherit; font-weight: 600; font-size: .95rem; line-height: 1.2;
    border: 1px solid transparent; border-radius: 999px;
    background: var(--accent); color: var(--accent-text);
    text-decoration: none; cursor: pointer;
    transition: background-color .15s, box-shadow .15s, transform .05s;
}
button:hover, .button:hover { background: var(--accent-hover); color: var(--accent-text); }
button:active, .button:active { transform: translateY(1px); }
button:focus-visible, .button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px;
}
button.secondary, .button.secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
button.secondary:hover, .button.secondary:hover { background: var(--surface-2); color: var(--text); }
button.danger { background: transparent; color: var(--error); border-color: color-mix(in srgb, var(--error) 45%, transparent); }
button.danger:hover { background: var(--error-bg); color: var(--error-text); }
button.link { min-height: 0; padding: 0; border: 0; background: none; color: var(--accent); font-weight: 500; border-radius: 4px; }
button.link:hover { background: none; color: var(--accent-hover); text-decoration: underline; }
button.small, .button.small { min-height: 2.1rem; padding: .35rem .85rem; font-size: .875rem; }
.icon-button { min-height: 0; width: 2rem; height: 2rem; padding: 0; border-radius: 50%; background: none; color: var(--muted); border: 0; }
.icon-button:hover { background: var(--error-bg); color: var(--error-text); }
form.inline { display: inline; }

/* ---------- Formulieren ---------- */

form label { display: block; margin-bottom: 1rem; font-weight: 600; font-size: .9rem; }
input[type=text], input[type=password], input[type=email], input[type=date], input[type=datetime-local], input[type=file], input:not([type]), select, textarea {
    display: block; width: 100%;
    margin-top: .35rem; padding: .6rem .75rem;
    font: inherit; font-weight: 400; font-size: 1rem; color: var(--text);
    background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    transition: border-color .15s, background-color .15s;
}
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); background: var(--surface); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .7; }
textarea { resize: vertical; min-height: 4.5rem; }
label.check { display: flex; align-items: center; gap: .6rem; font-weight: 500; }
label.check input { width: 1.15rem; height: 1.15rem; accent-color: var(--accent); }

.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 1rem; }
.fields .wide { grid-column: 1 / -1; }

.inline-label { display: inline-flex; align-items: center; gap: .4rem; margin: 0; font-weight: 500; }

/* ---------- Meldingen ---------- */

.flash { display: flex; gap: .6rem; align-items: flex-start; padding: .8rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-weight: 500; }
.flash-success { background: var(--success-bg); color: var(--success-text); }
.flash-error { background: var(--error-bg); color: var(--error-text); }
.flash-info { background: var(--warning-bg); color: var(--warning-text); }
.flashes { position: fixed; z-index: 40; top: 4.5rem; left: 50%; transform: translateX(-50%); width: min(560px, calc(100% - 2rem)); }
.flashes .flash { box-shadow: var(--shadow); animation: flash-in .25s ease-out; }
.flashes .flash.hide { opacity: 0; transform: translateY(-8px); transition: opacity .3s, transform .3s; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-8px); } }
.error-text { color: var(--error); }
.hint { background: var(--success-bg); color: var(--success-text); padding: .5rem .75rem; border-radius: var(--radius-sm); }
.warning { background: var(--warning-bg); color: var(--warning-text); padding: .5rem .75rem; border-radius: var(--radius-sm); display: flex; gap: .5rem; align-items: flex-start; }

/* ---------- Tabellen ---------- */

table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td.derived { font-style: italic; color: var(--muted); }
td.wrap { white-space: normal; min-width: 10rem; }
td a { font-weight: 600; text-decoration: none; }
tr.subrow td { padding-top: 0; }
tr.subrow:hover td { background: none; }

table.rows td { padding: .3rem; }
table.rows th { padding: .3rem; white-space: normal; text-transform: none; letter-spacing: 0; }
table.rows input, table.rows select { margin-top: 0; padding: .45rem .55rem; min-width: 4.75rem; }
table.rows input[data-field="name"] { min-width: 12rem; }
table.rows ~ button { margin-top: .5rem; }
table.readings th[scope="row"] { color: var(--text); font-weight: 500; font-size: .875rem; white-space: normal; min-width: 11rem; }
table.readings input[type="datetime-local"] { min-width: 12rem; }

/* ---------- Kengetallen ---------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem 1rem; box-shadow: var(--shadow); }
.stat .label { display: block; color: var(--muted); font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.stat .value { display: block; font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.25; }
.stat .plan { display: block; color: var(--muted); font-size: .8rem; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem 1rem; margin: 0; }
.facts dt { color: var(--muted); font-size: .8rem; }
.facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.facts.compact { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: .5rem .75rem; }

.swatch { display: inline-block; width: .95em; height: .95em; border-radius: 4px; margin-right: .4em; vertical-align: -.1em; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }

.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.badge-brouwdag, .badge-hoofdgisting, .badge-nagisting { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge-lagering { background: color-mix(in srgb, var(--series-1) 15%, transparent); color: var(--series-1); border-color: transparent; }
.badge-gebotteld { background: var(--success-bg); color: var(--success-text); border-color: transparent; }

/* Voortgang van de vergisting */
.progress { margin: .25rem 0 1rem; }
.progress-title { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; margin-bottom: .35rem; font-size: .9rem; }
.progress-title strong { font-family: var(--font-display); font-size: 1.05rem; }
.progress-track { position: relative; height: .7rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.progress-fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: linear-gradient(90deg, #f2b04f, var(--accent)); }
.progress-labels { display: flex; justify-content: space-between; gap: .5rem; font-size: .8rem; color: var(--muted); margin-top: .3rem; font-variant-numeric: tabular-nums; }
.progress-labels strong { color: var(--text); }

/* Stortbalk */
.grist { display: flex; height: 1.1rem; border-radius: 999px; overflow: hidden; gap: 2px; margin: .25rem 0 .5rem; }
.grist span { min-width: 4px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }

/* ---------- Dashboard ---------- */

.hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.hero h1 { margin: 0; }
.fermentation { position: relative; border-top: 4px solid var(--beer, var(--accent)); }
.fermentation h3 { margin: 0 0 .25rem; font-size: 1.15rem; }
.fermentation h3 a { color: var(--text); text-decoration: none; }
.fermentation h3 a:hover { color: var(--accent); }
.fermentation .now { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin: .75rem 0 .25rem; }
.fermentation .now .value { display: block; font-family: var(--font-display); font-size: 2.4rem; font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; }
.sparkline { width: 45%; max-width: 160px; height: 44px; color: var(--series-1); }
.sparkline path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.sparkline .area { fill: currentColor; stroke: none; opacity: .12; }

/* ---------- Tabbladen ---------- */

.tabs { display: flex; gap: .25rem; overflow-x: auto; margin: 0 -1rem 1.25rem; padding: 0 1rem; scrollbar-width: none; border-bottom: 1px solid var(--border); }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
    display: inline-flex; align-items: center; gap: .4rem; flex: none;
    padding: .7rem .9rem; margin-bottom: -1px;
    color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem;
    border-bottom: 3px solid transparent;
}
.tabs a:hover { color: var(--text); }
.tabs a[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tabs .count { font-size: .75rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 0 .4rem; color: var(--muted); }
.tab-panel[hidden] { display: none; }

/* ---------- Grafieken ---------- */

.chart-title { font-size: .95rem; font-weight: 600; margin: 1rem 0 .25rem; color: var(--muted); font-family: var(--font-body); }
.chart { position: relative; height: 260px; }

/* ---------- Brouwsel: metingen, RAPT, bottelen, proeven ---------- */

.add-measurement { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.add-measurement input { width: 6.5rem; margin-top: 0; }
.add-measurement input[type="datetime-local"] { width: auto; }
.add-measurement input.grow { flex: 1 1 10rem; }
.add-measurement .inline-label input { width: 6.5rem; }
.add-measurement .inline-label input[type="datetime-local"] { width: auto; }
.link-device { margin-top: 1rem; }
.link-device select { width: auto; margin-top: 0; }

.result { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem; font-size: 1.05rem; margin: .25rem 0 1rem; padding: .85rem 1rem; border-radius: var(--radius-sm); background: var(--accent-soft); }
.result strong { font-family: var(--font-display); font-size: 1.5rem; }
details:not(.card) > summary { cursor: pointer; color: var(--accent); font-weight: 600; }
details:not(.card)[open] > summary { margin-bottom: .75rem; }
details.guide { margin-top: 1rem; }
details.card > summary { cursor: pointer; list-style: revert; }
details.card > summary h2 { display: inline; }
details.card[open] > summary { margin-bottom: 1rem; }

.tasting { border-top: 1px solid var(--border); padding: .85rem 0; }
.tasting header { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; }
.stars { color: #e6a01c; letter-spacing: .1em; font-size: 1.05rem; }
.tasting-notes { margin: .5rem 0 0; display: grid; gap: .35rem; }
.tasting-notes dt { color: var(--muted); font-size: .8rem; }
.tasting-notes dd { margin: 0; }
fieldset.rating { border: 0; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
fieldset.rating legend { font-weight: 600; font-size: .9rem; padding: 0; margin-bottom: .35rem; width: 100%; }
fieldset.rating label { margin: 0; position: relative; }
fieldset.rating input { position: absolute; opacity: 0; width: 1px; height: 1px; }
fieldset.rating label span { display: inline-flex; align-items: center; gap: .25rem; padding: .4rem .75rem; border: 1px solid var(--border-strong); border-radius: 999px; font-weight: 600; cursor: pointer; }
fieldset.rating input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
fieldset.rating input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }

pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem; overflow-x: auto; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .875rem; }

/* ---------- Inloggen ---------- */

.auth { min-height: calc(100vh - 8rem); display: grid; place-items: center; }
.auth .card { width: min(420px, 100%); padding: 1.75rem; }
.auth .brand { margin-bottom: 1rem; font-size: 1.4rem; }
.auth button[type="submit"] { width: 100%; }

/* ---------- Afdrukken ---------- */

@media print {
    :root { --bg: #fff; --surface: #fff; --surface-2: #fff; --text: #000; --muted: #444; --border: #bbb; --shadow: none; }
    body { font-size: 11pt; background: #fff; padding: 0; }
    .topbar, .bottomnav, .tabs, form, button, .actions, .flash, .flashes, .no-print { display: none !important; }
    main { max-width: none; padding: 0; }
    .card { border: 0; padding: 0; margin-bottom: 1rem; break-inside: avoid; box-shadow: none; }
    .stat { box-shadow: none; }
    a { color: inherit; text-decoration: none; }
}

.tile { display: flex; align-items: center; gap: .9rem; text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s; }
.tile:hover { color: var(--text); border-color: var(--accent); transform: translateY(-1px); }
.tile > .icon { width: 2.2rem; height: 2.2rem; padding: .45rem; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.tile > span { display: flex; flex-direction: column; }
@media print { .tab-panel[hidden] { display: block !important; } }

/* ---------- Lijsten (recepten, brouwsels) ---------- */

.list { display: grid; gap: .6rem; }
.list-item {
    display: flex; align-items: center; gap: 1rem;
    padding: .85rem 1rem; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
    color: var(--text); text-decoration: none;
    transition: border-color .15s, transform .15s;
}
.list-item:hover { color: var(--text); border-color: var(--accent); transform: translateY(-1px); }
.list-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.list-main strong { font-family: var(--font-display); font-size: 1.1rem; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; gap: 1.1rem; font-variant-numeric: tabular-nums; font-weight: 600; }
.chips span { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.chips small { color: var(--muted); font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
@media (max-width: 640px) {
    .list-item { flex-wrap: wrap; }
    .chips { width: 100%; justify-content: space-between; padding-left: 3.1rem; }
    .chips span { align-items: flex-start; }
}

/* Een glas in de kleur van het bier */
.glass {
    flex: none; width: 2.1rem; height: 2.6rem;
    border-radius: 3px 3px 10px 10px;
    background: linear-gradient(180deg, #fffaf0 0 18%, var(--beer) 18% 100%);
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .12), inset -5px 0 0 rgba(255, 255, 255, .18);
}
.glass.large { width: 3rem; height: 3.8rem; }
.title-with-glass { display: flex; align-items: center; gap: 1rem; }
.card h2 .icon { color: var(--accent); }
.sticky-actions { position: sticky; bottom: calc(var(--bottom-nav) + .75rem); z-index: 5; padding: .75rem 1rem; margin: 0 -.25rem; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow); width: fit-content; }

[id] { scroll-margin-top: 5rem; }
.tab-panel { scroll-margin-top: 9rem; }

/* Invoertabellen als kaartjes op de telefoon */
@media (max-width: 640px) {
    table.rows, table.rows tbody, table.rows tr, table.rows td, table.rows th { display: block; }
    table.rows thead { display: none; }
    table.rows tr {
        display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem .6rem;
        padding: .75rem; margin-bottom: .6rem;
        border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2);
    }
    table.rows tbody tr:hover td { background: none; }
    table.rows td, table.rows th { padding: 0; border: 0; white-space: normal; }
    table.rows th[scope="row"], table.rows td:has(input[data-field="name"]) { grid-column: 1 / -1; }
    table.rows td.na { display: none; }
    table.rows td[data-label]::before { content: attr(data-label); display: block; font-size: .75rem; font-weight: 600; color: var(--muted); margin-bottom: .15rem; }
    table.rows td:last-child:not([data-label]) { grid-column: 1 / -1; text-align: right; }
    table.rows input, table.rows select { min-width: 0; width: 100%; }
    table.rows input[data-field="name"] { min-width: 0; }
    table.readings input[type="datetime-local"] { min-width: 0; }
    table.readings td.sg { align-self: end; padding-bottom: .5rem; font-weight: 600; text-align: left; }
}
table.rows input, table.rows select { min-height: 2.5rem; }

/* ---------- Brouwdag-modus ---------- */

.start-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; border-left: 4px solid var(--accent); }
.start-card h2 { margin-bottom: .25rem; }
.start-card p { margin: 0; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.step { padding: 0; overflow: visible; }
.step-head {
    display: flex; align-items: center; gap: .85rem; width: 100%; min-height: 0;
    padding: 1rem 1.25rem; border: 0; border-radius: var(--radius);
    background: none; color: var(--text); text-align: left; font-family: var(--font-display); font-size: 1.15rem; font-weight: 650;
}
.step-head:hover { background: var(--surface-2); color: var(--text); }
.step-no { display: grid; place-items: center; flex: none; width: 2rem; height: 2rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 1rem; }
.step-title { flex: 1; }
.step-check { display: none; color: var(--success); }
.step-body { padding: 0 1.25rem 1.25rem; }
.step.done .step-body { display: none; }
.step.done .step-no { background: var(--success-bg); color: var(--success); }
.step.done .step-check { display: inline-flex; }
.step.done .step-title { color: var(--muted); }
.step.current { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.step-done { margin-top: 1rem; }

.checklist { list-style: none; padding: 0; margin: .5rem 0 1rem; display: grid; gap: .25rem; }
.checklist label { margin: 0; padding: .55rem .25rem; border-bottom: 1px solid var(--border); font-weight: 400; cursor: pointer; }
.checklist label strong { font-variant-numeric: tabular-nums; }
.checklist input { width: 1.4rem; height: 1.4rem; }
.checklist input:checked ~ * { opacity: .45; text-decoration: line-through; }

.substep { padding: 1rem 0; border-top: 1px solid var(--border); }
.substep:first-child { border-top: 0; padding-top: 0; }
.substep h3 { margin: 0 0 .75rem; }

.timer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: .85rem 1rem; margin-bottom: .75rem; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.timer-display { font-family: var(--font-display); font-size: 2.6rem; font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.timer-buttons { display: flex; gap: .5rem; }
.timer.running { border-color: var(--accent); background: var(--accent-soft); }
.timer.running .timer-display { color: var(--accent); }
.timer.finished { border-color: var(--success); background: var(--success-bg); }
.timer.finished .timer-display { color: var(--success); }
button.icon-only { width: 2.6rem; padding: 0; }

.reading-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .75rem; }
.reading-form { padding: .75rem; border-radius: var(--radius-sm); border: 1px dashed var(--border-strong); margin-bottom: .75rem; }
.reading-title { margin: 0 0 .5rem; font-weight: 600; }
.reading-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem; }
.reading-fields label { margin: 0; flex: 1 1 5.5rem; font-size: .8rem; color: var(--muted); }
.reading-fields input { margin-top: .2rem; }
.reading-status { margin: .4rem 0 0; min-height: 1.2em; }
.reading-status.ok { color: var(--success); }
.reading-status.error { color: var(--error); }

.schedule { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.schedule li { display: grid; grid-template-columns: 4.5rem 1fr auto; align-items: center; gap: .75rem; padding: .65rem .75rem; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.schedule .at { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); }
.schedule li.next { border-color: var(--accent); background: var(--accent-soft); }
.schedule li.next .at { color: var(--accent); }
.schedule li.due { opacity: .55; }
.schedule li.due strong { text-decoration: line-through; }
.pitch { width: 100%; margin-top: .5rem; min-height: 3.2rem; font-size: 1.05rem; }
[data-wakelock].active { border-color: var(--success); color: var(--success-text); background: var(--success-bg); }
ul.plain li .button { text-decoration: none; }
