/* Schnapszahl – Tokens wie in der WG-App („WG App“-Design). Hell und dunkel, folgt dem Gerät. */
:root {
    color-scheme: light;
    --bg: #f6f5f1;
    --surface: #ffffff;
    --surface-2: #eeece6;
    --ink: #1a1d1b;
    --muted: #5f6661;
    --line: #e2dfd7;
    --accent: #1f6b4a;
    --accent-ink: #ffffff;
    --accent-soft: #e3f1e9;
    --hi: #f08a4b;
    --hi-ink: #2a1406;
    --hi-soft: #fdeee3;
    --hi-text: #a3460f;
    --neg: #b42f25;
    --neg-soft: #fbe7e4;
    --warn: #a3460f;
    --warn-soft: #fdeee3;
    --shadow: 0 1px 2px rgba(26,29,27,0.06), 0 4px 16px rgba(26,29,27,0.05);
    --shadow-float: 0 8px 24px rgba(26,29,27,0.14);
    --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #4a3aa7;
    --radius: 22px;
    --radius-md: 14px;
    --tabs-h: 76px;
    --ease: cubic-bezier(.2,.7,.3,1);
    --glass-demo: color-mix(in srgb, #f0b23c 75%, transparent);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --bg: #121413;
        --surface: #1b1e1c;
        --surface-2: #0d0f0e;
        --ink: #eef0ec;
        --muted: #a3aaa5;
        --line: #2c302d;
        --accent: #5cc893;
        --accent-ink: #0b1f15;
        --accent-soft: #173326;
        --hi: #f5a06b;
        --hi-ink: #2a1406;
        --hi-soft: #3a2416;
        --hi-text: #f5a06b;
        --neg: #ff7a6e;
        --neg-soft: #3a1a17;
        --warn: #f5a06b;
        --warn-soft: #3a2416;
        --shadow: 0 1px 2px rgba(0,0,0,0.4);
        --shadow-float: 0 8px 24px rgba(0,0,0,0.5);
        --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9;
    }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 15px/22px "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p, ul, ol, fieldset { margin: 0; padding: 0; }
ul, ol { list-style: none; }
h1, h2, h3 { font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }
h2 { font-size: 22px; line-height: 28px; }
h3 { font-size: 17px; line-height: 24px; font-weight: 600; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.icon { width: 22px; height: 22px; flex: none; stroke-width: 1.9; }
.icon.xs { width: 16px; height: 16px; }
.drink-art { flex: none; color: var(--ink); }

/* ------------------------------------------------------------ Rahmen */
#app { max-width: 560px; margin: 0 auto; min-height: 100dvh; }
.top {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; gap: 8px;
    padding: calc(env(safe-area-inset-top) + 24px) 16px 12px;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.top h1 { flex: 1; min-width: 0; font-size: clamp(24px, 7.5vw, 32px); line-height: 38px; font-weight: 800; letter-spacing: -0.02em; }
.round-btn { width: 44px; height: 44px; background: var(--surface); box-shadow: var(--shadow); color: var(--ink); }
.round-btn[aria-current] { background: var(--accent-soft); color: var(--accent); }

#view { padding: 8px 16px calc(var(--tabs-h) + env(safe-area-inset-bottom) + 40px); }
.view { display: flex; flex-direction: column; gap: 12px; }

.tabs {
    position: fixed; bottom: calc(env(safe-area-inset-bottom) + 12px); left: 50%; transform: translateX(-50%); z-index: 10;
    width: calc(100% - 24px); max-width: 536px;
    display: grid; grid-template-columns: repeat(4, 1fr);
    padding: 6px; border-radius: var(--radius);
    background: var(--surface); box-shadow: var(--shadow-float); border: 1px solid var(--line);
}
.tabs a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    padding: 6px 0; border-radius: var(--radius-md); min-height: 52px;
    color: var(--muted); font-size: 12px; line-height: 16px; font-weight: 600;
    transition: background .16s var(--ease), color .16s var(--ease);
}
.tabs a[aria-current] { color: var(--accent); background: var(--accent-soft); }

.loading { color: var(--muted); text-align: center; padding: 32px 0; }
.empty { color: var(--muted); text-align: center; padding: 24px 16px; background: var(--surface); border-radius: var(--radius); border: 1px dashed var(--line); }

/* ------------------------------------------------------------ Text */
.section { margin-top: 12px; font-size: 22px; line-height: 28px; font-weight: 700; }
.meta { color: var(--muted); font-size: 12px; line-height: 16px; font-weight: 500; }
.label { color: var(--muted); font-size: 13px; line-height: 18px; font-weight: 600; }
.hint { color: var(--muted); font-size: 12px; line-height: 17px; font-weight: 500; }
.lead { color: var(--muted); }
.lead strong { color: var(--ink); }
.warn-text { color: var(--warn); font-weight: 700; }
.ok-text { color: var(--accent); font-weight: 700; }
.center { text-align: center; align-items: center; }
.grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.split-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }

/* ------------------------------------------------------------ Karten */
.card { display: block; padding: 16px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); color: var(--ink); border: 0; }
.card.stack { display: flex; }

.hero { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 22px 16px 18px; transition: background .3s var(--ease); }
.figure { font-size: 28px; line-height: 32px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.figure.big { font-size: 64px; line-height: 70px; font-weight: 800; }
.figure .of { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.hero.level-low .figure { color: var(--accent); }
.hero.level-mid { background: var(--warn-soft); }
.hero.level-mid .figure { color: var(--warn); }
.hero.level-high { background: var(--neg-soft); }
.hero.level-high .figure { color: var(--neg); }
.hero > .btn, .profile-chips { margin-top: 8px; }
.profile-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 0; border: 0; background: none; }

.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 12px; }
.kpi { display: flex; flex-direction: column; gap: 2px; }
.kpi .figure { font-size: 22px; line-height: 28px; }

.basis summary { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; list-style: none; color: var(--muted); }
.basis summary::-webkit-details-marker { display: none; }
.basis p { margin-top: 10px; color: var(--muted); font-size: 13px; line-height: 19px; }
.basis strong { color: var(--ink); }

/* ------------------------------------------------------------ Diagramme */
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 10px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart .tick.strong { fill: var(--ink); }
.chart .tick.warn { fill: var(--warn); }
.chart .tick.neg { fill: var(--neg); }
.chart .total { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; }
.chart .limit { stroke-width: 1.4; stroke-dasharray: 5 4; }
.chart .limit.warn { stroke: var(--warn); }
.chart .limit.neg { stroke: var(--neg); }
.chart .now { stroke: var(--ink); stroke-width: 1.4; }
.chart .marker { stroke: var(--accent); stroke-width: 1.6; stroke-dasharray: 3 3; }
.chart .marker-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart .drink-tick { stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; }
.chart .bar { fill: var(--accent); }
.chart .bar.over { fill: var(--hi); }

.donut-wrap { display: flex; align-items: center; gap: 16px; }
.donut { width: 128px; height: 128px; flex: none; }
.donut .donut-big { fill: var(--ink); font-size: 20px; font-weight: 800; }
.donut .tick { fill: var(--muted); font-size: 10px; font-weight: 600; }
.legend-list { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; font-size: 13px; }
.legend-list li { display: flex; align-items: center; gap: 8px; }
.legend-list i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend-list .grow { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 360px) { .donut-wrap { flex-direction: column; align-items: stretch; } .donut { align-self: center; } }

.sober-lines { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.slider { gap: 4px; }
.slider-label { text-align: center; color: var(--ink); font-weight: 600; }

/* ------------------------------------------------------------ Listen */
.rows { display: flex; flex-direction: column; gap: 8px; }
.row {
    display: flex; align-items: center; gap: 10px; padding: 8px 6px 8px 10px;
    background: var(--surface); box-shadow: var(--shadow); border-radius: var(--radius-md);
}
.row strong { font-weight: 600; }
.row .time { white-space: nowrap; }
.row-art { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2); flex: none; }
.sheet .row { box-shadow: none; background: var(--bg); }

.link-row {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px; width: 100%; text-align: left;
    background: var(--surface); box-shadow: var(--shadow); border-radius: var(--radius-md); color: var(--ink); border: 0;
}
.link-row > .icon:last-child { color: var(--muted); }
.link-row strong { font-weight: 600; }
.tile-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); flex: none; }

.evening { width: 100%; text-align: left; display: flex; flex-direction: column; gap: 10px; }
.evening-arts { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }

/* ------------------------------------------------------------ Getränkekacheln */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 480px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 14px 6px 12px; border: 0; border-radius: var(--radius-md);
    background: var(--surface); box-shadow: var(--shadow); text-align: center;
    transition: transform .12s var(--ease);
}
.tile:active { transform: scale(0.96); }
.tile strong { font-size: 14px; line-height: 18px; font-weight: 600; margin-top: 4px; overflow-wrap: anywhere; }
.tile.add { border: 1.5px dashed var(--line); box-shadow: none; background: none; color: var(--muted); justify-content: center; }
.tile.add .icon { width: 28px; height: 28px; margin: 8px 0; }
.fav-dot { position: absolute; top: 8px; right: 8px; color: var(--hi); }
.fav-dot .icon { fill: currentColor; }

/* ------------------------------------------------------------ Knöpfe */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 0 18px; border-radius: var(--radius-md);
    border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; font-size: 15px;
    transition: transform .12s var(--ease), background .16s var(--ease);
}
.btn:active, .chip-btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.hi { background: var(--hi); border-color: var(--hi); color: var(--hi-ink); }
.btn.ghost { background: none; border-color: transparent; color: var(--muted); }
.btn.danger { color: var(--neg); }
.btn.primary.danger { background: var(--neg); border-color: var(--neg); color: var(--surface); }
.btn.block { width: 100%; }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 13px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1; }

.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%; background: none; color: var(--muted); }
.icon-btn:active { background: var(--surface-2); }
.icon-btn.fav.on { color: var(--hi); }
.icon-btn.fav.on .icon { fill: currentColor; }

.chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink); font-size: 13px; line-height: 18px; font-weight: 600;
}
.chip.warn, .chip.level-mid { background: var(--warn-soft); color: var(--warn); }
.chip.level-high { background: var(--neg-soft); color: var(--neg); }
.chip.level-low { background: var(--accent-soft); color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn {
    display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px 6px 10px;
    border-radius: 999px; border: 0; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 700;
}

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: var(--radius-md); background: var(--surface-2); }
.segmented > button, .segmented > label > span {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 8px; border: 0; border-radius: 10px; background: none;
    color: var(--muted); font-weight: 600; font-size: 13px; line-height: 18px; white-space: nowrap;
}
.segmented > label { display: block; cursor: pointer; }
.segmented > label > input { position: absolute; opacity: 0; pointer-events: none; }
.segmented > [aria-current], .segmented > label > input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.segmented > label > input:focus-visible + span { outline: 2px solid var(--accent); }

.choice { cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: inline-block; padding: 9px 16px; border-radius: 999px; background: var(--surface-2); font-weight: 700; font-size: 14px; color: var(--ink); }
.choice input:checked + span { background: var(--accent); color: var(--accent-ink); }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.art-pick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.art-pick label { cursor: pointer; }
.art-pick input { position: absolute; opacity: 0; pointer-events: none; }
.art-pick span { display: grid; place-items: center; aspect-ratio: 1; border-radius: 12px; background: var(--surface-2); border: 2px solid transparent; }
.art-pick input:checked + span { border-color: var(--accent); background: var(--accent-soft); }

/* ------------------------------------------------------------ Formulare */
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--muted); }
label output { color: var(--ink); font-weight: 700; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field.disabled { opacity: .5; }
input, select {
    width: 100%; min-height: 48px; padding: 10px 14px; border-radius: var(--radius-md);
    border: 1px solid transparent; background: var(--surface-2); color: var(--ink); font-size: 16px; font-weight: 400;
}
input[type="range"] { min-height: 32px; padding: 0; border: 0; background: none; accent-color: var(--accent); }
input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; padding: 0; accent-color: var(--accent); flex: none; }
input[type="date"] { text-align: center; }
label.check { flex-direction: row; align-items: center; gap: 10px; color: var(--ink); font-size: 15px; font-weight: 400; }
fieldset { border: 0; min-width: 0; }
legend { padding: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.form-error { color: var(--neg); font-size: 13px; font-weight: 600; }

/* Uhrzeit-Räder */
.wheels { display: flex; justify-content: center; align-items: center; gap: 6px; }
.wheel {
    height: 120px; width: 84px; overflow-y: scroll; scroll-snap-type: y mandatory; scrollbar-width: none;
    border-radius: var(--radius-md); background: var(--surface-2);
    -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent);
    mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent);
}
.wheel::-webkit-scrollbar { display: none; }
.wheel > div { height: 40px; display: grid; place-items: center; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; scroll-snap-align: center; }
.wheel > .pad { scroll-snap-align: none; }
.colon { font-size: 22px; font-weight: 800; }

/* ------------------------------------------------------------ Sheet */
.sheet {
    width: 100%; max-width: 560px; max-height: 92dvh; margin: auto auto 0; padding: 0; border: 0;
    border-radius: 22px 22px 0 0; background: var(--surface); color: var(--ink);
    box-shadow: var(--shadow-float); animation: rise 0.22s ease-out;
}
.sheet { overflow-y: auto; overscroll-behavior: contain; }
.sheet::backdrop { background: rgb(0 0 0 / 45%); }
.sheet form { display: flex; flex-direction: column; gap: 16px; padding: 18px 18px calc(env(safe-area-inset-bottom) + 18px); }
.sheet header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sheet header h2 { flex: 1; }
.sheet-title { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.sheet footer { display: flex; gap: 10px; }
.sheet footer .primary { flex: 1; }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 620px) { .sheet { margin: auto; border-radius: 22px; } }

/* ------------------------------------------------------------ Toast */
#toasts {
    position: fixed; left: 0; right: 0; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 20px); z-index: 100;
    display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 16px; pointer-events: none;
}
.toast {
    max-width: 480px; padding: 12px 16px; border-radius: 12px;
    background: var(--ink); color: var(--bg); font-weight: 600; font-size: 13px;
    box-shadow: 0 6px 24px rgb(0 0 0 / 25%); animation: rise 0.2s ease-out;
}
.toast.error { background: var(--neg); color: var(--surface); }

/* ------------------------------------------------------------ Selbst mischen */
.section-sm { margin-top: 4px; font-size: 15px; line-height: 20px; font-weight: 700; color: var(--muted); }
.mix-hero {
    display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px 14px 14px 10px;
    background: linear-gradient(135deg, var(--accent-soft), var(--surface) 70%);
}
.mix-hero strong { font-size: 19px; line-height: 24px; font-weight: 800; letter-spacing: -0.01em; }
.mix-hero > .icon { color: var(--accent); }
.mix-hero-art { display: flex; align-items: flex-end; gap: 0; flex: none; }
.mix-hero-art .mx-svg { margin-right: -6px; }
.recent-mixes { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scroll-snap-type: x proximity; scroll-padding-inline: 16px; scrollbar-width: none; }
.recent-mixes::-webkit-scrollbar { display: none; }
.recent-mix {
    flex: none; width: 112px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 8px 10px;
    border: 0; border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow); scroll-snap-align: start;
}
.mix-recipe { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--surface-2); font-size: 14px; }
.mix-recipe li { display: flex; align-items: center; gap: 10px; }
.mix-recipe i { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 25%, transparent); }
.sheet-title h2 { font-size: 20px; line-height: 26px; }
.tile .mx-svg { margin: -3px 0; }
.recent-mix-wrap { position: relative; flex: none; scroll-snap-align: start; }
.recent-x {
    position: absolute; top: 4px; right: 4px; display: grid; place-items: center; width: 28px; height: 28px;
    border: 0; border-radius: 50%; background: var(--surface-2); color: var(--muted);
}
.recent-x:active { background: var(--neg-soft); color: var(--neg); }
.recent-mix strong { margin-top: 6px; font-size: 13px; line-height: 17px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Glas */
.mx-svg { display: block; flex: none; overflow: visible; }
.mx-glass { fill: none; stroke: var(--ink); stroke-width: 1.4; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.mx-svg.big .mx-glass { stroke-width: 2.6; }
.mx-svg.big .mx-handle { stroke-width: 5; }
.mx-svg.big .mx-stem { stroke-width: 3.4; }
.mx-glass.mx-base { fill: color-mix(in srgb, var(--ink) 14%, transparent); }
.mx-tint { fill: color-mix(in srgb, var(--ink) 6%, transparent); }
.mx-ridge { stroke: var(--ink); stroke-opacity: .3; stroke-width: 1; vector-effect: non-scaling-stroke; }
.mx-tick { stroke: var(--ink); stroke-opacity: .5; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.mx-tick-label { fill: var(--ink); fill-opacity: .6; font-size: 7px; font-weight: 700; font-variant-numeric: tabular-nums; }
.row-art .mx-svg, .evening-arts .mx-svg { margin: 0 4px; }

.glass-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 480px) { .glass-grid { grid-template-columns: repeat(4, 1fr); } }
.glass-tile {
    display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 6px 10px;
    border: 2px solid transparent; border-radius: var(--radius-md); background: var(--surface-2); color: var(--ink);
    transition: transform .12s var(--ease);
}
.glass-tile:active { transform: scale(0.96); }
.glass-tile.on { border-color: var(--accent); }
.glass-tile strong { margin-top: 8px; font-size: 13px; line-height: 17px; font-weight: 700; }

/* Mischer */
.mixer { gap: 14px !important; }
.mix-name-field { gap: 6px; }
.mix-name-wrap { position: relative; display: block; }
.mix-name-wrap .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.mix-name { padding-left: 38px; font-size: 17px; font-weight: 700; }
.mix-name::placeholder { color: var(--muted); font-weight: 600; }
.mix-summary { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-radius: var(--radius); background: var(--accent-soft); }
.mix-abv { display: flex; align-items: baseline; gap: 4px; color: var(--accent); }
.mix-abv span { font-size: 46px; line-height: 50px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.mix-abv small { font-size: 14px; font-weight: 700; }
.mix-facts { display: flex; flex-direction: column; font-size: 13px; line-height: 18px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mix-facts strong { color: var(--ink); font-size: 15px; }

.stage { position: relative; display: grid; grid-template-columns: 72px 1fr 72px; height: var(--stage-h); margin: 4px 0 22px; user-select: none; -webkit-user-select: none; }
.mx-stage-glass { display: flex; justify-content: center; touch-action: none; cursor: ns-resize; }
.mx-stage-glass.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.vslider { position: relative; touch-action: none; cursor: ns-resize; border-radius: 12px; }
.vslider:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.vs-cap { position: absolute; left: 0; right: 0; bottom: -24px; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.vs-track { position: absolute; left: 50%; width: 12px; transform: translateX(-50%); border-radius: 6px; }
.vs-abv .vs-track { top: 8px; bottom: 8px; background: linear-gradient(to top, #a7d4f2, #f0cd56 30%, #e8a326 55%, #c0392b); }
.vs-fill .vs-track { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.vs-level {
    position: absolute; left: 0; right: 0; border-radius: 6px;
    bottom: calc(var(--fill-from) * 100%); top: calc((1 - var(--fill-pos)) * 100%);
    background: var(--layer-color); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 20%, transparent);
}
.vs-thumb {
    position: absolute; left: 50%; transform: translate(-50%, 50%);
    display: grid; place-items: center; min-width: 60px; height: 32px; padding: 0 8px; border-radius: 999px;
    background: var(--surface); color: var(--ink); border: 2px solid var(--accent); box-shadow: var(--shadow-float);
    font-size: 13px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums;
    transition: transform .12s var(--ease);
}
.vs-abv .vs-thumb { bottom: calc(var(--abv-pos) * 100%); }
.vs-fill .vs-thumb { bottom: calc(var(--fill-pos) * 100%); }
.vslider.dragging .vs-thumb { transform: translate(-50%, 50%) scale(1.1); }
.vs-fill .vs-thumb::before { content: ""; position: absolute; right: 100%; top: 50%; width: 10px; border-top: 2px dashed var(--accent); }

.glass-change { align-self: center; margin-top: -6px; background: var(--surface-2); color: var(--ink); font-weight: 700; }
.glass-change span { color: var(--accent); margin-left: 6px; }

.layers { display: flex; flex-direction: column; gap: 6px; }
.layer {
    display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 4px 4px 4px 12px; cursor: pointer;
    border-radius: 12px; background: var(--surface-2); border: 2px solid transparent; color: var(--ink);
}
.layer.on { border-color: var(--accent); background: var(--accent-soft); }
.layer strong { flex: 1; min-width: 0; font-weight: 700; }
.layer i, .ing i { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 25%, transparent); }
.layer.add { justify-content: center; gap: 6px; background: none; border: 1.5px dashed var(--line); color: var(--muted); font-weight: 700; font-size: 14px; padding: 4px 12px; }
.icon-btn.small { width: 36px; height: 36px; }

.ingredients { display: flex; gap: 8px; overflow-x: auto; margin: 0 -18px; padding: 2px 18px 6px; scrollbar-width: none; }
.ingredients::-webkit-scrollbar { display: none; }
.ing {
    flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 9px 12px; border: 0; border-radius: 999px;
    background: var(--surface-2); color: var(--ink); font-size: 13px; font-weight: 700;
}
.ing span { color: var(--muted); font-weight: 600; }
.ing.on { background: var(--accent); color: var(--accent-ink); }
.ing.on span { color: inherit; opacity: .8; }

.when { border-radius: var(--radius-md); background: var(--surface-2); }
.when summary { display: flex; align-items: center; gap: 8px; padding: 12px 14px; cursor: pointer; list-style: none; color: var(--muted); font-weight: 600; font-size: 14px; }
.when summary::-webkit-details-marker { display: none; }
.when summary strong { margin-left: auto; color: var(--ink); }
.when[open] summary { padding-bottom: 4px; }
.when .field { padding: 8px 14px 14px; }
.when .wheel, .when input { background: var(--surface); }
