/* =========================================================================
   Drankjes — stijl (licht thema)
   De accentkleur komt uit het profiel van de ingelogde gebruiker en wordt
   als --accent op <html> gezet. Alles daaromheen mengt mee.
   ========================================================================= */

:root {
    --accent: #7c5cff;
    --bg: #f6f4ef;
    --paper: #ffffff;
    --surface: #ffffff;
    --surface-2: #f1eee8;
    --line: rgba(28, 25, 20, .11);
    --line-soft: rgba(28, 25, 20, .07);
    --text: #1c1a17;
    --muted: #736f68;
    --danger: #c8332f;
    --ok: #2f8f5b;
    --warn: #c98a12;
    --radius: 20px;
    --radius-sm: 13px;
    --shadow-sm: 0 1px 2px rgba(28, 25, 20, .06), 0 2px 6px rgba(28, 25, 20, .04);
    --shadow: 0 2px 6px rgba(28, 25, 20, .06), 0 14px 34px rgba(28, 25, 20, .09);
    --accent-soft: color-mix(in srgb, var(--accent) 12%, white);
    --accent-softer: color-mix(in srgb, var(--accent) 7%, white);
    --accent-line: color-mix(in srgb, var(--accent) 32%, white);
    /* Deze twee worden per gebruiker berekend en op <html> gezet, zodat tekst
       op de accentkleur altijd leesbaar blijft — ook bij lichte kleuren. */
    --accent-fg: #ffffff;
    --accent-text: color-mix(in srgb, var(--accent) 82%, #1c1a17);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", sans-serif;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

body {
    min-height: 100dvh;
    background-image:
        radial-gradient(900px 500px at 12% -12%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 62%),
        radial-gradient(700px 420px at 108% 4%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 58%);
    background-attachment: fixed;
    padding-bottom: env(safe-area-inset-bottom);
}

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0 0 .4em; line-height: 1.15; letter-spacing: -.022em; font-weight: 700; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.22rem; }
h3 { font-size: 1rem; }
p { line-height: 1.6; }

.muted { color: var(--muted); }
.small { font-size: .86rem; }
.tiny { font-size: .76rem; }
.center { text-align: center; }
.mt { margin-top: 1rem; }
.mt2 { margin-top: 1.75rem; }
.mb { margin-bottom: 1rem; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.row { display: flex; align-items: center; gap: .6rem; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------------ layout */

.app {
    max-width: 1060px;
    margin: 0 auto;
    padding: 0 1rem 6.5rem;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .85rem 1rem;
    margin: 0 -1rem 1.2rem;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line-soft);
}

.topbar .brand {
    font-weight: 750;
    letter-spacing: -.02em;
    font-size: 1.06rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.brand-logo {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    display: block;
}

.brand-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

/* onderste navigatiebalk */
.nav {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(.8rem + env(safe-area-inset-bottom));
    z-index: 50;
    display: flex;
    align-items: center;
    gap: .15rem;
    padding: .35rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(16px);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    max-width: calc(100% - 2rem);
}

.nav a {
    position: relative;
    z-index: 1;
    flex: 1 1 0;                 /* alle knoppen even breed */
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: .5rem .3rem;
    border-radius: 999px;
    color: var(--muted);
    font-size: .66rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: color .25s ease;
}
.nav a .ico { font-size: 1.15rem; line-height: 1; }
.nav a span:not(.ico) {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nav a.active { color: var(--accent-text); }

/* Het schuifje achter de actieve knop */
.nav-indicator {
    position: absolute;
    top: .35rem;
    bottom: .35rem;
    left: 0;
    width: 0;
    border-radius: 999px;
    background: var(--accent-soft);
    opacity: 0;
    pointer-events: none;
    z-index: 0;
    transform: translateX(0);
    transition:
        transform .42s cubic-bezier(.34, 1.32, .42, 1),
        width .42s cubic-bezier(.34, 1.32, .42, 1),
        opacity .2s ease;
}
.nav-indicator.ready { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
    .nav-indicator { transition: opacity .2s ease; }
}
/* De hoofdknop: één grote plus.
   De plus is met CSS getekend (twee balkjes) — een plusteken uit een
   lettertype staat namelijk zelden precies in het midden. */
.nav a.primary {
    background: var(--accent);
    color: var(--accent-fg);
    box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 38%, transparent);
    width: 52px;
    height: 52px;
    padding: 0;
    margin: 0 .3rem;
    border-radius: 50%;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}
.nav a.primary .ico {
    position: relative;
    display: block;
    width: 22px;
    height: 22px;
    font-size: 0;              /* het teken zelf verbergen */
    line-height: 0;
    margin: 0;
}
.nav a.primary .ico::before,
.nav a.primary .ico::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: currentColor;
    border-radius: 2px;
}
.nav a.primary .ico::before { width: 22px; height: 3px; }
.nav a.primary .ico::after  { width: 3px;  height: 22px; }
.nav a.primary:active { transform: scale(.93); }

/* -------------------------------------------------------------- componenten */

.card {
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 1.05rem;
    box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: .9rem; }
/* In een raster regelt de gap de ruimte al — anders zakt de tweede kaart scheef. */
.grid > .card + .card,
.grid > .card { margin-top: 0; }
.card.tight { padding: .8rem; }
.card.accent { border-color: var(--accent-line); background: var(--accent-softer); }

.section-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin: 1.8rem 0 .7rem;
}
.section-title h2 { margin: 0; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .72rem 1.1rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--text);
    font-size: .93rem;
    font-weight: 650;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: transform .12s ease, background .15s, border-color .15s;
}
.btn:hover { text-decoration: none; background: var(--surface-2); }
.btn:active { transform: scale(.97); }
.btn-primary {
    background: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 70%, black);
    color: var(--accent-fg);
    box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 34%, transparent);
}
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, black); color: #fff; }
.btn-ghost { background: transparent; box-shadow: none; }
.btn-danger { background: color-mix(in srgb, var(--danger) 8%, white); border-color: color-mix(in srgb, var(--danger) 35%, white); color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { padding: .45rem .8rem; font-size: .82rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.field { margin-bottom: .9rem; }
.field label { display: block; font-size: .82rem; color: var(--muted); margin-bottom: .35rem; font-weight: 650; }
.input, select, textarea {
    width: 100%;
    padding: .78rem .9rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
}
.input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
textarea { min-height: 90px; resize: vertical; line-height: 1.55; }
select {
    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) 52%, calc(100% - 13px) 52%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.flash {
    padding: .8rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    border: 1px solid var(--line);
    background: var(--paper);
    box-shadow: var(--shadow-sm);
    font-size: .92rem;
}
.flash.ok { border-color: color-mix(in srgb, var(--ok) 35%, white); background: color-mix(in srgb, var(--ok) 8%, white); color: color-mix(in srgb, var(--ok) 80%, black); }
.flash.error { border-color: color-mix(in srgb, var(--danger) 35%, white); background: color-mix(in srgb, var(--danger) 8%, white); color: var(--danger); }

/* avatar */
.avatar {
    --size: 38px;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: calc(var(--size) * .38);
    color: var(--user-fg, var(--accent-fg));
    background: var(--user-color, var(--accent));
    object-fit: cover;
    flex: none;
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px color-mix(in srgb, var(--user-color, var(--accent)) 35%, white);
    text-decoration: none;
}
.avatar.lg { --size: 76px; }
.avatar.sm { --size: 30px; }

.username { color: var(--user-text, var(--accent-text)); font-weight: 700; }

/* ------------------------------------------------- naar iemands overzicht
   Overal waar een profielfoto of een naam staat kun je erop tikken. Staat
   dat binnen een rij die zélf ergens naartoe linkt, dan krijgt de rijlink
   .link-fill (die vult de hele rij) en de persoonlijke link .link-front
   (die ligt er bovenop). Zo blijft de html geldig: geen link in een link. */

/* een link die er niet als een link uitziet */
.plain, .plain:hover { color: inherit; text-decoration: none; }

.person-link, .person-link:hover { color: inherit; text-decoration: none; }
.person-link:hover .username { text-decoration: underline; }
.person-link:hover .avatar,
.person-link:hover .pill { filter: brightness(.97); }

.link-row { position: relative; }
.link-row .link-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    /* boven alles wat zelf position:relative heeft (de foto bijvoorbeeld),
       anders vangt dát de tik op en gebeurt er niets */
    z-index: 1;
    border-radius: inherit;
}
.link-row .link-front { position: relative; z-index: 2; }

/* cijferbadge */
.score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    padding: .3rem .5rem;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1.05rem;
    color: #fff;
    background: var(--score-color, var(--accent));
    flex: none;
}
.score.sm { min-width: 36px; font-size: .85rem; padding: .2rem .4rem; border-radius: 9px; }
.score.lg { min-width: 68px; font-size: 1.7rem; border-radius: 16px; }

.pill {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .28rem .6rem;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--line-soft);
    font-size: .76rem;
    color: var(--muted);
}
.pill.accent { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }

/* rasters */
.grid { display: grid; gap: .8rem; }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); }
.grid.drinks { grid-template-columns: repeat(auto-fill, minmax(152px, 1fr)); }
.grid.two { grid-template-columns: 1fr; }
@media (min-width: 760px) {
    .grid.two { grid-template-columns: 1fr 1fr; }
    .grid.drinks { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}

.stat {
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    padding: .85rem;
    box-shadow: var(--shadow-sm);
}
.stat .value { font-size: 1.6rem; font-weight: 800; letter-spacing: -.03em; }
.stat .label { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 650; }

/* drankkaart */
.drink-card {
    display: block;
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: transform .15s ease, box-shadow .15s, border-color .15s;
}
.drink-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--accent-line); }
.drink-thumb {
    position: relative;
    aspect-ratio: 1 / 1;
    background: linear-gradient(160deg, var(--surface-2), #e9e5dd);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.6rem;
}
.drink-thumb img { width: 100%; height: 100%; object-fit: cover; }
.drink-thumb .score {
    position: absolute;
    right: .45rem;
    bottom: .45rem;
    box-shadow: 0 2px 10px rgba(28, 25, 20, .35);
    border: 2px solid #fff;
}
.drink-body { padding: .6rem .7rem .7rem; }
.drink-body .name {
    font-weight: 700;
    font-size: .93rem;
    line-height: 1.28;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.4em;
}
.drink-body .meta { font-size: .74rem; color: var(--muted); margin-top: .15rem; }

.who { display: flex; }
.who .avatar { --size: 22px; }
.who > * { margin-left: -6px; }
.who > :first-child { margin-left: 0; }

/* drankjes selecteren en samenvoegen (beheerder) */
.drink-cell { position: relative; }
.drink-cell.selected .drink-card {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent) inset;
}

.select-box {
    position: absolute;
    top: .45rem;
    left: .45rem;
    z-index: 3;   /* boven de kaartlink en de proevers */
    display: none;
    cursor: pointer;
}
body.selecting .select-box { display: block; }
.select-box input { position: absolute; opacity: 0; }
.select-box span {
    display: block;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .9);
    border: 2px solid var(--line);
    box-shadow: 0 2px 6px rgba(28, 25, 20, .2);
}
.select-box input:checked + span {
    background: var(--accent);
    border-color: var(--accent);
}
.select-box input:checked + span::after {
    content: '✓';
    display: block;
    text-align: center;
    line-height: 22px;
    color: var(--accent-fg);
    font-size: .85rem;
    font-weight: 700;
}

.select-bar {
    position: fixed;
    left: 50%;
    /* standaard onzichtbaar: alleen wegschuiven is niet genoeg, want de balk
       zweeft boven de navigatiebalk en blijft dan in beeld hangen. */
    transform: translate(-50%, 14px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    bottom: calc(5.6rem + env(safe-area-inset-bottom));
    z-index: 60;
    display: flex;
    align-items: center;
    gap: .5rem;
    width: min(520px, calc(100% - 1.6rem));
    padding: .6rem .7rem .6rem 1rem;
    border-radius: 999px;
    background: var(--paper);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    font-size: .9rem;
    transition: transform .25s ease, opacity .2s ease, visibility .25s;
}
.select-bar.open {
    transform: translate(-50%, 0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.merge-option {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .7rem 0;
    border-bottom: 1px solid var(--line-soft);
    cursor: pointer;
}
.merge-option:last-child { border-bottom: 0; }
.merge-option input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.merge-option .keep-pill { opacity: 0; }
.merge-option:has(input:checked) .keep-pill { opacity: 1; background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }

/* lijstitem */
.list-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem 0;
    border-bottom: 1px solid var(--line-soft);
    color: inherit;
    text-decoration: none;
}
.list-item:last-child { border-bottom: 0; }
.list-item:hover { text-decoration: none; }
.list-thumb {
    width: 46px; height: 46px; border-radius: 12px; flex: none;
    background: var(--surface-2);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; overflow: hidden;
}
.list-thumb img { width: 100%; height: 100%; object-fit: cover; }

.rank {
    width: 26px; height: 26px; flex: none;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px; font-weight: 800; font-size: .8rem;
    background: var(--surface-2); color: var(--muted);
}
.rank-1 { background: linear-gradient(140deg, #ffd76a, #e0a80f); color: #3a2a00; }
.rank-2 { background: linear-gradient(140deg, #e6ebf2, #b6bfcc); color: #23282f; }
.rank-3 { background: linear-gradient(140deg, #edb98d, #c07f3c); color: #2d1706; }

/* verhaal / quote */
.story {
    font-size: .96rem;
    line-height: 1.7;
    color: #2c2a26;
    border-left: 3px solid var(--accent-line);
    padding-left: .9rem;
    margin: .6rem 0 0;
}

/* ------------------------------------------------------------------- login */

.login-wrap {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;
}
.login-card {
    width: 100%;
    max-width: 380px;
    text-align: center;
    background: var(--paper);
    border: 1px solid var(--line-soft);
    border-radius: 26px;
    padding: 2rem 1.5rem 1.5rem;
    box-shadow: var(--shadow);
}
.code-dots { display: flex; justify-content: center; gap: .8rem; margin: 1.4rem 0; }
.code-dot {
    width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid var(--line);
    transition: transform .15s, background .15s, border-color .15s;
}
.code-dot.filled { background: var(--accent); border-color: var(--accent); transform: scale(1.15); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.key {
    aspect-ratio: 1.6 / 1;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
    font-size: 1.45rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform .1s, background .15s;
}
.key:active { transform: scale(.94); background: var(--accent-soft); }
.key.wide { font-size: 1.05rem; }
.shake { animation: shake .4s; }
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-9px); }
    40% { transform: translateX(9px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}

/* ----------------------------------------------------------------- scanner */

.scanner {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius);
    overflow: hidden;
    background: #14130f;
    border: 1px solid var(--line);
}
.scanner video { width: 100%; height: 100%; object-fit: cover; }
.scanner-frame {
    position: absolute;
    inset: 16% 10%;
    border-radius: 14px;
    box-shadow: 0 0 0 100vmax rgba(10, 9, 7, .42);
    border: 2px solid rgba(255, 255, 255, .55);
}
.scanner-frame::before, .scanner-frame::after {
    content: '';
    position: absolute;
    left: -2px; right: -2px;
    height: 22px;
    border: 3px solid var(--accent);
}
.scanner-frame::before { top: -2px; border-bottom: 0; border-radius: 14px 14px 0 0; }
.scanner-frame::after { bottom: -2px; border-top: 0; border-radius: 0 0 14px 14px; }
.scanline {
    position: absolute;
    left: 10%; right: 10%;
    height: 2px;
    background: var(--accent);
    box-shadow: 0 0 12px 2px var(--accent);
    animation: scan 2.2s ease-in-out infinite;
}
@keyframes scan {
    0%, 100% { top: 20%; opacity: .3; }
    50% { top: 78%; opacity: 1; }
}
.scanner-status {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: .6rem .8rem;
    font-size: .82rem;
    color: #fff;
    background: linear-gradient(transparent, rgba(0,0,0,.72));
    text-align: center;
}

/* ------------------------------------------------------------------ wizard */

.wizard-progress {
    height: 5px;
    border-radius: 999px;
    background: var(--surface-2);
    overflow: hidden;
    margin-bottom: 1.2rem;
}
.wizard-progress span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--accent);
    border-radius: 999px;
    transition: width .5s cubic-bezier(.4, 0, .2, 1);
}

.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem .85rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--text);
    font-size: .9rem;
    font-family: inherit;
    cursor: pointer;
    transition: transform .12s, background .15s, border-color .15s;
}
.chip:active { transform: scale(.95); }
.chip.selected {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent-text);
    font-weight: 650;
}
.chip.disabled { opacity: .4; pointer-events: none; }

.thinking { display: flex; align-items: center; gap: .6rem; color: var(--muted); font-size: .92rem; padding: .5rem 0; }
.dots { display: inline-flex; gap: 4px; }
.dots i {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent);
    animation: blink 1.2s infinite ease-in-out;
}
.dots i:nth-child(2) { animation-delay: .18s; }
.dots i:nth-child(3) { animation-delay: .36s; }
@keyframes blink {
    0%, 80%, 100% { opacity: .25; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-3px); }
}

.fade-in { animation: fadeIn .35s ease both; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

/* cijferkiezer */
.rating-display {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: -.04em;
    line-height: 1;
    text-align: center;
    color: var(--score-color, var(--accent));
    transition: color .2s;
}
.rating-face { text-align: center; font-size: 2rem; margin-top: .2rem; }
input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 34px;
    background: transparent;
    margin: .6rem 0 0;
}
input[type=range]::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, #d64545, #e3a008, #46a758);
}
input[type=range]::-moz-range-track {
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, #d64545, #e3a008, #46a758);
}
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 30px; height: 30px;
    margin-top: -11px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--score-color, var(--accent));
    box-shadow: 0 2px 8px rgba(28,25,20,.25);
    cursor: pointer;
}
input[type=range]::-moz-range-thumb {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--score-color, var(--accent));
    cursor: pointer;
}

.quick-scores { display: flex; gap: .35rem; justify-content: center; flex-wrap: wrap; margin-top: .8rem; }
.quick-scores button {
    width: 38px; height: 38px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--text);
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}
.quick-scores button:hover { background: var(--accent-soft); border-color: var(--accent); }

/* fotokiezer — compact regeltje in plaats van een groot vlak */
.photo-pick {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .45rem .55rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    cursor: pointer;
    background: var(--paper);
    transition: border-color .15s, background .15s;
}
.photo-pick:hover { border-color: var(--accent); background: var(--accent-softer); }
.photo-pick > .grow { min-width: 0; }
.photo-pick .photo-text { display: block; font-size: .88rem; font-weight: 600; line-height: 1.25; }
.photo-pick .photo-sub {
    display: block;
    font-size: .74rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.photo-pick .photo-action {
    flex: none;
    padding: .35rem .7rem;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--line-soft);
    font-size: .78rem;
    font-weight: 650;
    color: var(--muted);
}
.photo-pick.has-photo .photo-action { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }

/* Verplichte foto: duidelijk in beeld tot er één gekozen is */
.photo-pick.is-required {
    border-style: dashed;
    border-color: color-mix(in srgb, var(--accent) 55%, white);
    background: var(--accent-softer);
}
.photo-pick.is-required .photo-action {
    background: var(--accent);
    border-color: transparent;
    color: var(--accent-fg);
}
.photo-pick.is-required.has-photo {
    border-style: solid;
    border-color: color-mix(in srgb, var(--ok) 45%, white);
    background: color-mix(in srgb, var(--ok) 7%, white);
}
.photo-pick.is-required.has-photo .photo-action {
    background: var(--surface-2);
    border-color: var(--line-soft);
    color: var(--muted);
}
.photo-warning {
    margin: .45rem 0 0;
    font-size: .82rem;
    font-weight: 600;
    color: var(--danger);
}
.req {
    display: inline-block;
    padding: .05rem .4rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--danger) 10%, white);
    border: 1px solid color-mix(in srgb, var(--danger) 30%, white);
    color: var(--danger);
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    vertical-align: middle;
}

.photo-preview {
    width: 44px; height: 44px;
    border-radius: 10px;
    background: var(--surface-2);
    border: 1px solid var(--line-soft);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem; overflow: hidden; flex: none;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }

/* suggesties */
.suggestion {
    display: flex;
    align-items: center;
    gap: .7rem;
    width: 100%;
    padding: .6rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--accent-line);
    background: var(--accent-softer);
    color: inherit;
    text-align: left;
    font-family: inherit;
    cursor: pointer;
    margin-bottom: .4rem;
}
.suggestion:hover { background: var(--accent-soft); }

/* badges */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .6rem; }
.badge {
    display: block;
    width: 100%;
    text-align: center;
    padding: .7rem .4rem;
    border-radius: var(--radius-sm);
    background: var(--paper);
    border: 1px solid var(--line-soft);
    color: inherit;
    font-family: inherit;
    cursor: pointer;
    transition: transform .12s, border-color .15s;
}
.badge:active { transform: scale(.96); }
.badge.earned { border-color: var(--accent-line); background: var(--accent-softer); }
.badge:not(.earned) { opacity: .45; filter: grayscale(1); }
.badge .emoji { font-size: 1.6rem; display: block; }
.badge .title { display: block; font-size: .72rem; font-weight: 700; margin-top: .25rem; }

/* het venstertje met de uitleg bij een badge */
.sheet-badge { text-align: center; padding-top: .5rem; }
.sheet-badge .sheet-close { position: absolute; right: 1rem; top: 1rem; margin: 0; }
.sheet-badge h2 { margin: .6rem 0 .5rem; }
.sheet-badge .badge-desc { margin: .9rem 0 .2rem; font-weight: 650; }
.sheet-badge p { margin-left: auto; margin-right: auto; max-width: 34ch; }

.badge-big {
    width: 66px;
    height: 66px;
    margin: .4rem auto 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    border: 1px solid var(--line-soft);
}
.badge-big .ic { color: var(--muted); }
.sheet-badge.is-earned .badge-big {
    background: var(--accent-soft);
    border-color: var(--accent-line);
}
.sheet-badge.is-earned .badge-big .ic { color: var(--accent-text); }

/* kleurkiezer */
.color-swatches { display: flex; flex-wrap: wrap; gap: .5rem; }
.swatch {
    width: 38px; height: 38px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    box-shadow: 0 0 0 1px var(--line);
}
.swatch.selected { border-color: #fff; box-shadow: 0 0 0 2px var(--text); transform: scale(1.06); }

/* tabel */
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .55rem .4rem; border-bottom: 1px solid var(--line-soft); }
th { color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 650; }

/* diversen */
.empty {
    text-align: center;
    padding: 2.2rem 1rem;
    color: var(--muted);
}
.empty .big { font-size: 2.4rem; display: block; margin-bottom: .4rem; }

.tabs { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .3rem; margin-bottom: .9rem; }
.tabs a {
    padding: .45rem .85rem;
    border-radius: 999px;
    background: var(--paper);
    border: 1px solid var(--line-soft);
    color: var(--muted);
    font-size: .84rem;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
}
.tabs a.active { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }

details.block { border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: .7rem .9rem; background: var(--paper); }
details.block + details.block { margin-top: .6rem; }
details.block summary { cursor: pointer; font-weight: 650; }

code { background: var(--surface-2); padding: .1rem .35rem; border-radius: 6px; font-size: .85em; }
pre { background: var(--surface-2); padding: .8rem; border-radius: var(--radius-sm); overflow-x: auto; font-size: .8rem; line-height: 1.5; border: 1px solid var(--line-soft); }

hr { border: 0; border-top: 1px solid var(--line-soft); margin: 1.2rem 0; }

/* =========================================================================
   Onderdelen voor de telefoon-eerst indeling
   ========================================================================= */

/* Kop van een pagina: titel links, actieknop rechts */
.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .9rem;
}
.page-head h1 { margin: 0 0 .15rem; }
.page-head .btn { flex: none; }

/* Grote knop voor de belangrijkste actie op een scherm */
.btn-lg { padding: .95rem 1.2rem; font-size: 1rem; border-radius: 16px; }
.btn-block + .btn-block { margin-top: .5rem; }

.input-error { border-color: var(--danger) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 15%, transparent) !important; }

/* ---------------------------------------------------------- filtermenu */

.filterbar { margin-bottom: 1rem; }

.searchrow { display: flex; gap: .5rem; }
.searchrow .input { flex: 1; min-width: 0; }

.filter-toggle {
    flex: none;
    gap: .4rem;
    padding-inline: .9rem;
}
.filter-toggle::before { content: '⚙'; font-size: 1rem; }
.filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-fg);
    font-size: .72rem;
    font-weight: 700;
}

.filter-panel {
    margin-top: .6rem;
    padding: .9rem;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    animation: fadeIn .2s ease both;
}
.filter-panel .field:last-of-type { margin-bottom: .6rem; }

.segmented {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--surface-2);
    border-radius: 999px;
}
.segmented label {
    flex: 1;
    text-align: center;
    padding: .5rem .3rem;
    border-radius: 999px;
    font-size: .84rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    margin: 0;
    white-space: nowrap;
    transition: background .15s, color .15s;
}
.segmented label.on { background: #fff; color: var(--accent-text); box-shadow: var(--shadow-sm); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }

.filter-chips { margin-top: .6rem; }
.chip-remove {
    text-decoration: none;
    background: var(--accent-softer);
    border-color: var(--accent-line);
    color: var(--accent-text);
    font-size: .82rem;
    padding: .4rem .7rem;
}
.chip-remove span { opacity: .6; }
.chip-remove:hover { text-decoration: none; background: var(--accent-soft); }

/* ------------------------------------------------------- sommelier / cijfer */

.sommelier-head {
    display: flex;
    align-items: center;
    gap: .7rem;
    margin-bottom: .7rem;
}
.sommelier-avatar {
    width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    font-size: 1.4rem;
    flex: none;
}

.estimate {
    margin-top: 1rem;
    padding: .85rem .9rem;
    border-radius: var(--radius-sm);
    background: var(--accent-softer);
    border: 1px solid var(--accent-line);
}
.estimate-head { display: flex; align-items: center; gap: .5rem; font-size: .95rem; }
.estimate ul { margin: .5rem 0 0; padding-left: 1.1rem; color: var(--muted); font-size: .84rem; line-height: 1.55; }
.estimate li { margin-bottom: .15rem; }
.estimate .btn { margin-top: .6rem; }

/* Gevonden in de open productendatabase */
.found-banner {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .65rem .7rem;
    margin-bottom: .9rem;
    border-radius: var(--radius-sm);
    background: var(--accent-softer);
    border: 1px solid var(--accent-line);
}
.found-banner strong { display: block; font-size: .92rem; line-height: 1.25; }
.found-banner .tiny { display: block; }
.found-thumb {
    width: 44px; height: 44px; flex: none;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--line-soft);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    font-size: 1.3rem;
}
.found-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* --------------------------------------------------- detailpagina drankje */

.drink-hero {
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.drink-hero-media {
    position: relative;
    aspect-ratio: 16 / 10;
    background: linear-gradient(160deg, var(--surface-2), #e9e5dd);
    display: flex; align-items: center; justify-content: center;
    font-size: 3.4rem;
}
.drink-hero-media img { width: 100%; height: 100%; object-fit: cover; }
.drink-hero-body { padding: 1rem; }

/* Voedingswaarden */
.nutri-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: .5rem;
}
.nutri-tile {
    text-align: center;
    padding: .7rem .4rem;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--line-soft);
}
.nutri-tile .value { font-weight: 800; font-size: 1.05rem; letter-spacing: -.02em; }
.nutri-tile .label { font-size: .7rem; color: var(--muted); margin-top: .1rem; }

.nutriscore {
    display: inline-flex;
    align-items: center;
    padding: .3rem .7rem;
    border-radius: 999px;
    color: #fff;
    font-weight: 700;
    font-size: .8rem;
}

/* Knoppen onder een drankje: altijd even hoog, ook als de tekst omloopt */
.hero-actions {
    display: flex;
    align-items: stretch;
    gap: .5rem;
}
.hero-actions .btn { flex: 1 1 auto; }
.hero-actions .btn:last-child { flex: 0 0 auto; }

/* Profielfoto kiezen */
.avatar-picker {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.avatar-drop {
    position: relative;
    flex: none;
    cursor: pointer;
    border-radius: 50%;
}
.avatar-drop .avatar { --size: 84px; }
.avatar-drop .avatar-badge {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-fg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 3px var(--paper);
    transition: transform .15s;
}
.avatar-drop:hover .avatar-badge { transform: scale(1.08); }
.avatar-picker .avatar-info strong { display: block; font-size: .95rem; }
.avatar-picker .avatar-info .tiny { display: block; margin-top: .1rem; }
.avatar-picker .avatar-remove {
    display: inline-block;
    margin-top: .5rem;
    font-size: .8rem;
    color: var(--danger);
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
}

/* Beoordeling van één persoon */
.review-head { display: flex; align-items: center; gap: .7rem; }
.review-actions { display: flex; gap: .4rem; margin-top: .8rem; flex-wrap: wrap; }
.review-actions form { margin: 0; }

/* ---------------------------------------------------------------- reacties
   Eén emoji per persoon op andermans proefbeurt. Gegeven reacties staan als
   naamplaatjes in de kleur van die persoon; daaronder mag je zelf kiezen. */

.reactions { margin-top: .8rem; }

.reaction-given { display: flex; flex-wrap: wrap; gap: .35rem; }
.reaction-given:not(:empty) + .reaction-pick { margin-top: .6rem; }

.reaction-pill {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .55rem .2rem .35rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--user-color) 11%, white);
    border: 1px solid color-mix(in srgb, var(--user-color) 26%, white);
    color: var(--user-text);
    font-size: .78rem;
    font-weight: 600;
    line-height: 1.5;
}
.reaction-emoji { font-size: 1rem; line-height: 1; }

.reaction-pick {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .3rem;
}
.reaction-pick .tiny { margin-right: .15rem; }

.reaction-btn {
    width: 2.1rem;
    height: 2.1rem;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--line-soft);
    background: var(--surface-2);
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    transition: transform .12s, background .15s, border-color .15s;
}
.reaction-btn:hover { background: var(--accent-softer); border-color: var(--accent-line); transform: translateY(-1px); }
.reaction-btn:active { transform: scale(.9); }
.reaction-btn:disabled { opacity: .45; cursor: default; transform: none; }
.reaction-btn.chosen {
    opacity: 1;
    background: var(--accent-soft);
    border-color: var(--accent);
    transform: scale(1.1);
}

.reaction-hint { margin: .45rem 0 0; }
.reaction-hint.mislukt { color: var(--danger); }

/* Net geplaatst: even een klein zwaaitje zodat je ziet dat het gelukt is. */
.net-gereageerd .reaction-pill:last-child { animation: reactie-pop .32s ease-out; }
@keyframes reactie-pop {
    0%   { transform: scale(.6); opacity: 0; }
    60%  { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); }
}

/* Compacte weergave in lijstjes (dashboard) */
.reaction-mini {
    display: inline-flex;
    align-items: center;
    gap: .1rem;
    font-size: .92rem;
    line-height: 1;
    vertical-align: -.12em;
}

/* ------------------------------------------------------------ smaakprofiel
   Balkjes per smaakas. De kleur zegt of die smaak meestal een pluspunt is
   (groen), een klacht (rood) of allebei (neutraal). */

.taste-axes { display: flex; flex-direction: column; gap: .55rem; }
.taste-axis {
    display: grid;
    grid-template-columns: minmax(6.5rem, 8.5rem) 1fr auto;
    align-items: center;
    gap: .6rem;
    --taste-color: var(--muted);
}
.taste-axis.goed   { --taste-color: var(--ok); }
.taste-axis.slecht { --taste-color: var(--danger); }
.taste-label {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .84rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.taste-label .ic { color: var(--taste-color); }
.taste-track {
    height: 9px;
    border-radius: 999px;
    background: var(--surface-2);
    overflow: hidden;
}
.taste-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: color-mix(in srgb, var(--taste-color) 80%, white);
}
.taste-value { font-size: .78rem; font-weight: 700; color: var(--muted); min-width: 2.4rem; text-align: right; }

.taste-key {
    display: inline-block;
    width: .6rem;
    height: .6rem;
    border-radius: 999px;
    margin: 0 .2rem 0 .7rem;
    vertical-align: -.02em;
    background: var(--muted);
}
.taste-key:first-child { margin-left: 0; }
.taste-key.goed   { background: color-mix(in srgb, var(--ok) 80%, white); }
.taste-key.slecht { background: color-mix(in srgb, var(--danger) 80%, white); }
.taste-key.neutraal { background: color-mix(in srgb, var(--muted) 60%, white); }

.taste-effect {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem 0;
    border-bottom: 1px solid var(--line-soft);
    font-size: .92rem;
}
.taste-effect:last-of-type { border-bottom: 0; }

/* kenmerk zonder knopgedrag (alleen tonen) */
.chip.static { cursor: default; padding: .4rem .7rem; font-size: .84rem; }
.chip.static.goed   { background: color-mix(in srgb, var(--ok) 10%, white); border-color: color-mix(in srgb, var(--ok) 30%, white); }
.chip.static.slecht { background: color-mix(in srgb, var(--danger) 9%, white); border-color: color-mix(in srgb, var(--danger) 26%, white); }
.chip-count { font-size: .74rem; color: var(--muted); font-weight: 700; }

/* =========================================================================
   Iconen (inline SVG). Ze volgen de tekstkleur en staan op de juiste hoogte.
   ========================================================================= */

.ic {
    display: inline-block;
    vertical-align: -.18em;
    flex: none;
}

h1 > .ic, h2 > .ic, h3 > .ic {
    vertical-align: -.14em;
    margin-right: .12em;
    color: var(--accent-text);
}

.btn .ic { vertical-align: -.2em; }
.pill .ic { vertical-align: -.22em; margin-right: .1em; }
.chip-icon { display: inline-flex; align-items: center; color: var(--muted); }
.chip.selected .chip-icon { color: var(--accent-text); }
.face { display: inline-block; vertical-align: -.2em; }

/* icoon in plaats van een foto */
.thumb-icon { color: color-mix(in srgb, var(--text) 32%, white); }
.list-thumb .ic, .found-thumb .ic, .photo-preview .ic { color: var(--muted); }

.nav .ico { display: flex; align-items: center; justify-content: center; }
.badge .emoji .ic { color: var(--accent-text); }
.badge:not(.earned) .emoji .ic { color: var(--muted); }
.empty .big .ic { color: var(--muted); }

/* Doorklikkaart, bijvoorbeeld naar de systeeminstellingen */
.system-link {
    display: flex;
    align-items: center;
    gap: .85rem;
    text-decoration: none;
    color: inherit;
    transition: border-color .15s, transform .12s;
}
.system-link:hover {
    text-decoration: none;
    border-color: var(--accent-line);
    transform: translateY(-1px);
}
.system-icon {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: var(--accent-soft);
    color: var(--accent-text);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
}
.flip { transform: rotate(180deg); color: var(--muted); }

/* ---------------------------------------------------- sheets (iOS-stijl) */

.sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(24, 21, 17, .42);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .28s ease;
    z-index: 80;
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }

.sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    background: var(--paper);
    border-radius: 24px 24px 0 0;
    max-height: 88vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: .5rem 1rem calc(1.6rem + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 40px rgba(24, 21, 17, .2);
    transform: translateY(101%);
    transition: transform .34s cubic-bezier(.32, .72, 0, 1);
    visibility: hidden;
}
.sheet.open { transform: none; visibility: visible; }

.sheet-handle {
    width: 40px;
    height: 5px;
    border-radius: 99px;
    background: var(--line);
    margin: .35rem auto .9rem;
    flex: none;
}

.sheet-head {
    display: flex;
    align-items: center;
    gap: .7rem;
    margin-bottom: .9rem;
}
.sheet-head h2 { margin: 0; font-size: 1.15rem; }
.sheet-close {
    margin-left: auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 0;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    flex: none;
}
.sheet-close:hover { background: var(--line); }

.sheet-section + .sheet-section { margin-top: 1.2rem; }
.sheet-section h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .5rem; }

.data-list { display: grid; gap: 0; }
.data-list div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .55rem 0;
    border-bottom: 1px solid var(--line-soft);
    font-size: .92rem;
}
.data-list div:last-child { border-bottom: 0; }
.data-list dt, .data-list .k { color: var(--muted); }
.data-list .v { font-weight: 600; text-align: right; }

.nutri-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0 .7rem; }
.nutri-form .field { margin-bottom: .6rem; }
.nutri-form label { font-size: .74rem; }

/* Blokjes binnen een sheet-formulier */
.form-block {
    border: 1px solid var(--line-soft);
    border-radius: 16px;
    padding: .85rem;
    background: var(--surface);
    margin-bottom: .8rem;
}
.form-block > h3 {
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    margin: 0 0 .7rem;
}
.form-block .field:last-child { margin-bottom: 0; }

details.form-block > summary {
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}
details.form-block > summary::-webkit-details-marker { display: none; }
details.form-block > summary::after { content: ' ▾'; }
details.form-block[open] > summary { margin-bottom: .7rem; }
details.form-block[open] > summary::after { content: ' ▴'; }

/* Vaste opslaanknop onderin een sheet */
.sheet-actions {
    position: sticky;
    bottom: -.2rem;
    margin: .4rem -1rem -.6rem;
    padding: .8rem 1rem calc(.8rem + env(safe-area-inset-bottom));
    background: linear-gradient(to bottom, transparent, var(--paper) 45%);
}

@media (min-width: 720px) {
    .sheet {
        left: 50%;
        width: min(580px, 94vw);
        bottom: 0;
        border-radius: 24px 24px 0 0;
        transform: translate(-50%, 101%);
    }
    .sheet.open { transform: translate(-50%, 0); }
}

/* ------------------------------------------------------------ telefoon */

@media (max-width: 720px) {
    .app { padding: 0 .9rem 6.5rem; }
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.12rem; }

    .topbar { margin: 0 -.9rem 1rem; padding: .8rem .9rem; }
    .section-title { margin: 1.4rem 0 .6rem; }

    .card { padding: .9rem; border-radius: 16px; }
    .grid.drinks { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
    .grid.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .stat .value { font-size: 1.35rem; }

    /* alles waar je op tikt minstens 44px hoog */
    .btn, .chip, .key, .quick-scores button, .segmented label { min-height: 44px; }
    .chip { padding: .6rem .9rem; }

    .page-head { align-items: center; }
    .page-head .btn { padding: .6rem .9rem; font-size: .88rem; }

    .rating-display { font-size: 3.4rem; }
    .quick-scores button { width: 40px; height: 44px; }

    table { display: block; overflow-x: auto; white-space: nowrap; }

    /* Op de telefoon pakt de balk bijna de volle breedte, zodat elk label past */
    .nav {
        gap: 0;
        padding: .3rem;
        width: calc(100% - 1.4rem);
        max-width: 460px;
    }
    .nav a { padding: .45rem .15rem; font-size: .625rem; letter-spacing: -.01em; }
    .nav a .ico { font-size: 1.05rem; }
    .nav a.primary { width: 46px; height: 46px; margin: 0 .15rem; }
    .nav a.primary .ico { width: 19px; height: 19px; }
    .nav a.primary .ico::before { width: 19px; height: 2.6px; }
    .nav a.primary .ico::after  { width: 2.6px; height: 19px; }
    .nav-indicator { top: .3rem; bottom: .3rem; }

    .avatar.lg { --size: 64px; }
    .drink-hero-media { aspect-ratio: 4 / 3; }
}

@media (max-width: 380px) {
    .nav a { padding: .5rem .45rem; }
    .grid.drinks { gap: .55rem; }
    .filter-toggle span:first-of-type { display: none; }
}

/* Als de app als PWA draait iets meer ruimte onderaan */
@media (display-mode: standalone) {
    .nav { bottom: calc(1.1rem + env(safe-area-inset-bottom)); }
    .app { padding-bottom: 7.5rem; }
}
