@font-face {
  font-family: "Brewery Display";
  src: url("assets/fonts/libertine-display.otf") format("opentype");
  font-display: swap;
}

@font-face {
  font-family: "Brewery Initials";
  src: url("assets/fonts/libertine-initials.otf") format("opentype");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink: #fff5df;
  --muted: #bcae99;
  --wood-950: #130c09;
  --wood-900: #1c110c;
  --wood-800: #2a1810;
  --wood-700: #3a2115;
  --copper: #b96f3d;
  --brass: #d2a452;
  --cream: #f0dfbd;
  --green: #8fa567;
  --danger: #d47766;
  --mobile-header-height: clamp(100px, 15.5dvh, 142px);
  --mobile-nav-height: 58px;
  --pipe-vertical: linear-gradient(90deg, #4a2814 0%, #ce9c4d 42%, #72431e 75%, #3b1e0f 100%);
  --pipe-horizontal: linear-gradient(180deg, #4a2814 0%, #ce9c4d 42%, #72431e 75%, #3b1e0f 100%);
  --line: rgba(226, 185, 112, 0.22);
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
  --radius: 20px;
  --font-display: "Brewery Display", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --font-ornate: "Brewery Initials", "Brewery Display", Georgia, serif;
  --font-label: "Avenir Next", Avenir, "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  font-family: var(--font-label);
  background: var(--wood-950);
  color: var(--ink);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--wood-950); }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 50% 8%, rgba(185, 111, 61, 0.16), transparent 36%),
    var(--wood-950);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input { font: inherit; }
button { touch-action: manipulation; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--cream); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.app-shell { position: relative; width: min(100%, 760px); min-height: 100dvh; margin: 0 auto; padding-bottom: calc(66px + env(safe-area-inset-bottom)); background: linear-gradient(90deg, rgba(40, 21, 13, 0.13), transparent 18% 82%, rgba(40, 21, 13, 0.13)); box-shadow: 0 0 45px rgba(0, 0, 0, 0.28); }

.topbar {
  height: calc(86px + env(safe-area-inset-top));
  min-height: 86px;
  padding: max(8px, env(safe-area-inset-top)) 12px 8px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  border-bottom: 0;
  position: relative;
  z-index: 1;
  overflow: hidden;
}
.brewery-banner { background: linear-gradient(to bottom, rgba(18, 10, 6, 0.06), rgba(18, 10, 6, 0.54)), url("assets/brauerei-banner.webp") center 48% / cover; box-shadow: inset 0 -10px 22px rgba(13, 7, 4, 0.42); }
.brewery-banner::after { content: ""; position: absolute; z-index: 0; left: 0; right: 0; bottom: 0; height: 24px; background: linear-gradient(to bottom, transparent, var(--wood-950)); pointer-events: none; }
.brand-plaque { position: relative; z-index: 2; min-width: 145px; padding: 10px 22px 8px; border: 0; border-radius: 50% 50% 16px 16px; color: var(--cream); text-align: center; background: linear-gradient(155deg, rgba(51, 29, 16, 0.97), rgba(21, 12, 8, 0.98)); box-shadow: 0 6px 16px rgba(9, 5, 3, 0.9), inset 0 0 0 2px rgba(163, 107, 48, 0.38); }
.brand-plaque strong { display: block; font: 400 25px/0.95 var(--font-ornate); letter-spacing: 0.09em; text-shadow: 0 2px #1a0d07, 0 0 16px rgba(216, 170, 87, 0.22); }
.brand-hops { display: none; }
.brand-hops .hop-cone { fill: #6f793d; stroke: #c4b76b; }
.status-pill { max-width: 145px; min-height: 38px; border: 0; border-radius: 99px; padding: 7px 10px; color: var(--muted); background: rgba(0, 0, 0, 0.2); display: flex; align-items: center; gap: 7px; font-size: 11px; text-align: left; }
.brewery-banner .status-pill { position: absolute; z-index: 3; right: 10px; top: max(8px, env(safe-area-inset-top)); bottom: auto; min-height: 24px; padding: 4px 7px; color: #ddcfb5; background: rgba(18, 11, 7, 0.82); backdrop-filter: blur(8px); font-size: 7px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; background: var(--green); box-shadow: 0 0 8px rgba(143, 165, 103, 0.8); }
.status-pill.offline .status-dot { background: var(--brass); }

main { position: relative; z-index: 2; padding: 0 0 18px; }
.view { display: none; animation: fade-in 160ms ease; }
.view.active { display: block; }
@keyframes fade-in { from { opacity: 0; transform: translateY(3px); } }

.card { position: relative; border: 0; border-radius: var(--radius); background: linear-gradient(145deg, rgba(73, 44, 27, 0.86), rgba(31, 19, 13, 0.93)); box-shadow: var(--shadow), inset 0 0 0 3px rgba(82, 48, 26, 0.28); }
.card::before, .card::after { content: ""; position: absolute; z-index: 1; width: 25px; height: 25px; border-color: rgba(210, 164, 82, 0.4); pointer-events: none; }
.card::before { left: 7px; top: 7px; border-left: 1px solid; border-top: 1px solid; border-radius: 10px 0 0; }
.card::after { right: 7px; bottom: 7px; border-right: 1px solid; border-bottom: 1px solid; border-radius: 0 0 10px; }
.page-heading h1 { margin: 3px 0 8px; color: var(--cream); font: 700 30px/1.08 var(--font-display); }
.button { border: 1px solid transparent; border-radius: 14px; min-height: 52px; padding: 0 17px; font-weight: 760; color: var(--ink); background: rgba(255, 255, 255, 0.08); }
.button.primary { color: #21140d; background: linear-gradient(135deg, #ebcd8d, #c99543); box-shadow: 0 6px 18px rgba(201, 149, 67, 0.2); }
.button.secondary { border-color: transparent; background: rgba(0, 0, 0, 0.2); }
.button.ghost { background: rgba(0, 0, 0, 0.12); border-color: transparent; }
.button.danger { color: #f0afa3; }
.button:disabled { opacity: 0.42; }

.drink-section { margin-top: 4px; transition: opacity 160ms; }
.drink-section.disabled { opacity: 0.4; pointer-events: none; }
.tap-board { position: relative; height: clamp(320px, 94vw, 430px); border: 0; border-radius: 46% 46% 24px 24px; background: radial-gradient(ellipse at 50% 43%, rgba(157, 99, 52, 0.18), transparent 34%), linear-gradient(154deg, #4b2c1b, #28160e 66%, #1b0f0a); box-shadow: inset 0 -30px 40px rgba(0, 0, 0, 0.25), inset 0 5px 14px rgba(224, 166, 91, 0.05), var(--shadow); overflow: hidden; }
.tap-board::before { content: ""; position: absolute; z-index: 0; inset: 12px; border-radius: 40% 40% 15px 15px; box-shadow: inset 0 0 0 1px rgba(157, 105, 48, 0.14); pointer-events: none; }
.tap-board::after { content: "❦"; position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%); color: rgba(185, 146, 72, 0.38); font: 31px/1 var(--font-ornate); pointer-events: none; }
.tap-vines { position: absolute; z-index: 1; inset: 5px; width: calc(100% - 10px); height: calc(100% - 10px); pointer-events: none; }
.tap-vines .stem { fill: none; stroke: #68703d; stroke-width: 2.2; stroke-linecap: round; opacity: 0.72; }
.tap-vines .leaf { fill: #5c6537; stroke: #8b8d51; stroke-width: 0.7; opacity: 0.75; }
.tap-vines .cone { fill: #77783b; stroke: #b29d53; stroke-width: 0.9; opacity: 0.82; }
.beer-grid { position: absolute; z-index: 3; inset: 13px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 4px; }
.beer-grid [data-drink-id="helles"] { grid-column: 2; grid-row: 1; }
.beer-grid [data-drink-id="dunkles"] { grid-column: 3; grid-row: 2; }
.beer-grid [data-drink-id="hefe-alkoholfrei"] { grid-column: 2; grid-row: 3; }
.beer-grid [data-drink-id="hefe"] { grid-column: 1; grid-row: 2; }
.other-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.drink-button { position: relative; overflow: hidden; border: 0; border-radius: 18px; color: var(--cream); text-align: left; background: linear-gradient(145deg, #4a2a18, #29170f); box-shadow: 0 7px 18px rgba(0, 0, 0, 0.3); }
.drink-button.beer { align-self: center; justify-self: center; width: 100%; max-width: 128px; min-height: 98px; padding: 23px 10px 15px; overflow: visible; border-radius: 46% 46% 23% 23% / 38% 38% 19% 19%; text-align: center; background-image: url("assets/tap-filigree.svg"), linear-gradient(145deg, #674025, #2c190f 72%); background-position: center, center; background-repeat: no-repeat; background-size: 100% 100%, cover; box-shadow: 0 10px 19px rgba(0, 0, 0, 0.44), inset 0 0 0 2px #261309, inset 0 0 0 3px rgba(180, 126, 60, 0.45), inset 0 7px 13px rgba(234, 188, 111, 0.06); }
.drink-button.beer::before { content: ""; position: absolute; z-index: -1; width: 17px; height: 39px; left: 50%; bottom: -26px; transform: translateX(-50%); border: 0; border-radius: 2px 2px 9px 9px; background: linear-gradient(90deg, #5e3519, #b9803c 28%, #d2a255 49%, #875426 75%, #4a2713); box-shadow: 0 5px 8px rgba(0, 0, 0, 0.34), inset 2px 0 rgba(239, 199, 126, 0.16); }
.drink-button.beer::after { content: none; }
.drink-button.beer[data-drink-id="helles"] { background-image: url("assets/tap-filigree.svg"), linear-gradient(145deg, #765034, #342014 72%); }
.drink-button.beer[data-drink-id="dunkles"] { background-image: url("assets/tap-filigree.svg"), linear-gradient(145deg, #4a2b20, #1e100c 74%); }
.drink-button.beer[data-drink-id="hefe"] { background-image: url("assets/tap-filigree.svg"), linear-gradient(145deg, #654528, #2a1b10 74%); }
.drink-button.beer[data-drink-id="hefe-alkoholfrei"] { background-image: url("assets/tap-filigree.svg"), linear-gradient(145deg, #5b4b2b, #282516 74%); }
.drink-button.other { min-height: 54px; padding: 8px 3px 7px; border-radius: 10px; text-align: center; background: linear-gradient(145deg, #493020, #321d13); box-shadow: 0 5px 9px rgba(0, 0, 0, 0.24), inset 0 1px rgba(224, 178, 104, 0.08); }
.drink-button.other::before { content: none; }
.drink-button.other::after { content: none; }
.tap-rivets { position: absolute; z-index: 2; inset: 0; pointer-events: none; }
.drink-button.beer .tap-rivets::before, .drink-button.beer .tap-rivets::after { content: ""; position: absolute; top: 13px; width: 4px; height: 4px; border-radius: 50%; background: #c6974e; box-shadow: 0 67px #8f632e, inset 0 1px rgba(255, 229, 166, 0.35); }
.drink-button.beer .tap-rivets::before { left: 13px; }
.drink-button.beer .tap-rivets::after { right: 13px; }
.drink-button.other .tap-rivets { display: none; }
.drink-button strong { position: relative; z-index: 2; display: block; font: 400 19px/1.02 var(--font-display); letter-spacing: 0.01em; text-shadow: 0 1px 2px #130905; }
.drink-button.beer[data-drink-id="hefe-alkoholfrei"] strong { font-size: 14px; }
.drink-button.other strong { overflow: hidden; max-width: 100%; font-size: clamp(10px, 2.7vw, 13px); text-overflow: ellipsis; white-space: nowrap; }
.drink-button small { position: relative; z-index: 2; display: block; margin-top: 7px; color: #c8b799; font-size: 8px; letter-spacing: 0.09em; text-transform: uppercase; }
.drink-button.other small { margin-top: 4px; font-size: 6px; }
.counter-block { position: relative; margin-top: 20px; padding: 18px 7px 8px; border: 0; border-radius: 8px 8px 18px 18px; background: linear-gradient(180deg, #77502f 0 7px, #2d1a11 8px 100%); box-shadow: 0 10px 18px rgba(0, 0, 0, 0.27); }
.counter-label { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 4px 14px; border: 0; border-radius: 99px; color: #d8c8aa; background: #25140d; font-size: 9px; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.24); }
.drink-button.tap { animation: dark-press 180ms ease-out; }
@keyframes dark-press {
  0%, 100% { filter: brightness(1); }
  45% { filter: brightness(0.67) saturate(0.9); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5), inset 0 5px 14px rgba(0, 0, 0, 0.5); }
}

/* Mobile Erfassung in der gewählten Schankbuch-Gestaltung */
#session-panel { position: relative; z-index: 10; }
.evening-summary { position: relative; height: 118px; margin: 0 10px; padding: 15px 8px 0; }
.evening-summary-head { height: 46px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
.evening-total { grid-column: 1; grid-row: 1; display: flex; align-items: center; gap: 5px; }
.evening-total strong { position: relative; z-index: 3; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: #201108; background: radial-gradient(circle at 40% 32%, #f1d28d, #b47a34 70%); box-shadow: inset 0 0 0 2px #6f451e, 0 5px 11px rgba(12, 6, 3, 0.72); font: 700 21px/1 var(--font-display); font-variant-numeric: tabular-nums; transform: translateY(-25px); }
.evening-total span { color: #a99980; font-size: 7px; line-height: 1.15; text-transform: uppercase; }
.evening-title { grid-column: 2; grid-row: 1; text-align: center; }
.evening-title > span { display: block; color: #8f8249; font: 16px/1 var(--font-ornate); }
.evening-title strong { display: block; color: var(--cream); font: 400 15px/1 var(--font-display); }
.evening-reset { grid-column: 3; grid-row: 1; min-width: 63px; min-height: 38px; padding: 4px 9px 4px 7px; border: 0; border-radius: 9px; display: inline-flex; align-items: center; gap: 5px; color: #dfcda9; background: linear-gradient(145deg, #51321f, #2d1a11); box-shadow: 0 4px 9px rgba(0, 0, 0, 0.28), inset 0 1px rgba(235, 190, 115, 0.12); font-size: 7px; font-weight: 750; letter-spacing: 0.04em; line-height: 1.1; text-align: left; text-transform: uppercase; }
.evening-reset:active { filter: brightness(0.7); }
.reset-icon { color: var(--brass); font-size: 14px; line-height: 1; }
.evening-tallies { height: 51px; margin: 0; padding-top: 6px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 5px; row-gap: 3px; border-top: 1px solid rgba(204, 158, 78, 0.19); }
.evening-tally { position: relative; min-width: 0; min-height: 0; padding: 3px 4px 0; display: block; border-radius: 0; background: none; text-align: center; }
.evening-tally:nth-child(n + 5) { opacity: 0.76; }
.evening-tally:nth-child(n + 5)::before { content: ""; position: absolute; left: 2px; right: 2px; top: 0; height: 1px; background: rgba(197, 148, 72, 0.13); }
.evening-tally span { display: block; overflow: hidden; color: #a99b85; font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.evening-tally strong { display: block; color: #f0d493; font-size: 13px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.evening-tally:nth-child(n + 5) strong { color: #ebd6ae; font-size: 11px; }
.quick-correction { position: fixed; z-index: 40; left: 50%; bottom: calc(64px + env(safe-area-inset-bottom)); width: max-content; max-width: calc(100% - 32px); min-height: 0; margin: 0; padding: 8px 11px; border: 0; border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 9px; color: #d1c2aa; background: rgba(22, 13, 9, 0.96); box-shadow: 0 7px 20px rgba(0, 0, 0, 0.42), inset 0 0 0 1px rgba(198, 151, 74, 0.18); font-size: 8px; transform: translateX(-50%); animation: correction-in 160ms ease-out; }
.quick-correction strong { color: #d3aa61; font-size: 8px; text-transform: none; }
@keyframes correction-in { from { opacity: 0; transform: translate(-50%, 8px); } }

.drink-section { margin-top: 44px; }
.tap-board { height: clamp(300px, 77vw, 430px); margin: 0 12px; border-radius: 46% 46% 19px 19px; background: radial-gradient(ellipse at 50% 42%, rgba(155, 99, 51, 0.18), transparent 34%), linear-gradient(154deg, #4a2b1a, #27150e 67%, #190d08); box-shadow: inset 0 0 0 1px rgba(180, 126, 62, 0.16), inset 0 -26px 34px rgba(0, 0, 0, 0.25), 0 12px 25px rgba(0, 0, 0, 0.32); }
.tap-board::before { inset: 10px; border-radius: 40% 40% 14px 14px; }
.tap-board::after { content: none; }
.tap-vines { z-index: 0; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); transform: scaleX(1.1); transform-origin: center; }
.tap-vines .leaf { opacity: 0.58; }
.tap-pipes { position: absolute; z-index: 1; inset: 11px; pointer-events: none; }
.tap-pipe { position: absolute; border-radius: 99px; box-shadow: 0 4px 7px rgba(0, 0, 0, 0.38), inset 2px 0 rgba(248, 210, 139, 0.12); }
.tap-pipe.horizontal { width: 66.666%; height: 14px; left: 16.667%; top: 50%; transform: translateY(-50%); box-shadow: none; }
.tap-pipe.horizontal::before, .tap-pipe.horizontal::after { content: ""; position: absolute; top: 0; bottom: 0; width: calc(50% - 22px); background: var(--pipe-horizontal); box-shadow: 0 4px 7px rgba(0, 0, 0, 0.38), inset 2px 0 rgba(248, 210, 139, 0.12); }
.tap-pipe.horizontal::before { left: 0; border-radius: 99px 3px 3px 99px; }
.tap-pipe.horizontal::after { right: 0; border-radius: 3px 99px 99px 3px; }
.tap-pipe.vertical { width: 14px; height: 66.666%; left: 50%; top: 16.667%; transform: translateX(-50%); background: var(--pipe-vertical); }
.beer-grid { z-index: 3; inset: 11px; gap: 0; }
.drink-button.beer { width: min(94px, 27vw); min-height: 76px; max-width: none; padding: 12px 8px; display: grid; place-items: center; border-radius: 46% 46% 23% 23% / 38% 38% 19% 19%; background-image: url("assets/tap-filigree.svg"), linear-gradient(145deg, #654024, #29170e 73%); box-shadow: 0 8px 16px rgba(0, 0, 0, 0.46), inset 0 0 0 2px #251309, inset 0 0 0 3px rgba(180, 126, 60, 0.42); }
.drink-button.beer::before { content: none; }
.drink-button.beer strong { font-size: 16px; line-height: 0.95; }
.drink-button.beer[data-drink-id="hefe-alkoholfrei"] strong { font-size: 13px; line-height: 1.05; }
.drink-button.beer small { display: none; }
.drink-button.beer .tap-rivets::before, .drink-button.beer .tap-rivets::after { top: 12px; box-shadow: 0 52px #8f632e, inset 0 1px rgba(255, 229, 166, 0.35); }
.tap-fixture { position: absolute; z-index: 2; left: 50%; top: 50%; width: 44px; height: 88px; transform: translate(-50%, -50%); border-radius: 45% 45% 11px 11px; background: linear-gradient(90deg, #321a0d, #714522 24%, #8b572a 48%, #70421f 72%, #2a150b); box-shadow: 0 9px 15px rgba(0, 0, 0, 0.48), inset 2px 0 rgba(222, 165, 88, 0.08); }
.tap-fixture::before, .tap-fixture::after { content: none; }
.fixture-ornament { position: absolute; z-index: 2; width: 38px; height: 30px; left: 50%; top: 50%; transform: translate(-50%, -50%); display: grid; place-items: center; border-radius: 50% / 44%; background: radial-gradient(ellipse at 42% 34%, #8f5c28, #3d2111 52%, #aa7130 56% 66%, #29140a 71%); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.48), inset 0 0 0 1px rgba(244, 209, 141, 0.26); }
.fixture-ornament svg { width: 31px; height: 23px; overflow: visible; }
.fixture-ornament .sprig { fill: none; stroke: #e0b76d; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.fixture-ornament .sprig-leaf { fill: #77723d; stroke: #e3bd70; stroke-width: 0.85; stroke-linejoin: round; }
.fixture-ornament .bud { fill: #8a7437; stroke: #e6c37a; stroke-width: 0.9; stroke-linejoin: round; }
.counter-block { height: 79px; margin: 28px 12px 0; padding: 16px 6px 6px; border-radius: 8px 8px 15px 15px; background: linear-gradient(180deg, #321d13, #24140d); box-shadow: 0 8px 15px rgba(0, 0, 0, 0.28), inset 0 1px rgba(177, 137, 70, 0.08); }
.counter-vine { position: absolute; z-index: 0; left: 3px; top: -19px; width: calc(100% - 6px); height: 38px; overflow: visible; pointer-events: none; opacity: 0.82; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.25)); }
.counter-vine .stem, .counter-vine .tendril { fill: none; stroke: #737a47; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.counter-vine .tendril { stroke-width: 1.25; opacity: 0.78; }
.counter-vine .leaf { fill: #626b3d; stroke: #92965b; stroke-width: 0.65; opacity: 0.82; }
.counter-vine .cone { fill: #797b41; stroke: #b3a15c; stroke-width: 0.8; opacity: 0.86; }
.counter-label { z-index: 2; top: -10px; padding: 4px 13px; font-size: 7px; }
.other-grid { position: relative; z-index: 1; gap: 5px; }
.drink-button.other { height: 48px; min-height: 48px; padding: 5px 2px; border-radius: 9px; }
.drink-button.other strong { font-size: clamp(10px, 2.8vw, 12px); }
.drink-button.other small { margin-top: 4px; font-size: 6px; letter-spacing: 0; text-transform: none; }

#history-view, #stats-view { padding: 20px 14px; }

.page-heading { padding: 8px 3px 14px; text-align: center; }
.page-heading p { margin: 0; color: var(--brass); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.page-heading h1::after { content: "  ❦"; color: rgba(210, 164, 82, 0.62); font-family: var(--font-ornate); font-size: 0.72em; }
.history-group-title { margin: 17px 4px 8px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; }
.history-card { width: 100%; margin-bottom: 8px; padding: 14px; border: 0; border-radius: 16px; color: var(--ink); background: rgba(48, 28, 18, 0.76); box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18); text-align: left; display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 10px; }
.history-time { color: var(--brass); font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.history-items { color: var(--muted); font-size: 12px; line-height: 1.4; }
.history-count { min-width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--cream); background: rgba(210, 164, 82, 0.13); font-weight: 800; }
.empty-state { padding: 35px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }

.stats-hero { padding: 20px; text-align: center; }
.stats-hero strong { display: block; color: var(--cream); font-size: 50px; line-height: 1; font-variant-numeric: tabular-nums; }
.stats-hero span { color: var(--muted); font-size: 12px; }
.stats-list { margin-top: 10px; padding: 7px 14px; }
.stat-row { padding: 13px 0; border-bottom: 1px solid var(--line); }
.stat-row:last-child { border-bottom: 0; }
.stat-label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 7px; font-size: 13px; }
.stat-label span:last-child { color: var(--brass); font-weight: 800; }
.stat-track { height: 5px; overflow: hidden; border-radius: 99px; background: rgba(255, 255, 255, 0.07); }
.stat-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--copper), var(--brass)); }

.bottom-nav { position: fixed; z-index: 30; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%, 760px); min-height: 58px; padding: 5px 8px calc(7px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(3, 1fr); border-top: 0; background: rgba(21, 12, 8, 0.97); box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.32); backdrop-filter: blur(18px); }
.nav-button { min-height: 46px; border: 0; border-radius: 12px; color: #928573; background: transparent; display: grid; place-items: center; align-content: center; gap: 2px; font-size: 8px; font-weight: 700; }
.nav-icon { font-size: 15px; line-height: 1; font-weight: 400; }
.nav-button.active { color: var(--cream); background: rgba(210, 164, 82, 0.1); }

.sheet-dialog { width: min(100%, 760px); max-width: none; height: auto; max-height: 90dvh; margin: auto auto 0; padding: 0; border: 0; border-radius: 24px 24px 0 0; color: var(--ink); background: var(--wood-900); box-shadow: 0 -16px 50px rgba(0, 0, 0, 0.55); }
.sheet-dialog::backdrop { background: rgba(0, 0, 0, 0.66); backdrop-filter: blur(2px); }
.dialog-card { padding: 8px 15px calc(18px + env(safe-area-inset-bottom)); }
.dialog-handle { width: 42px; height: 4px; margin: 0 auto 15px; border-radius: 10px; background: #65584b; }
.dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.dialog-heading p { margin: 0; color: var(--brass); font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; }
.dialog-heading h2 { margin: 4px 0; color: var(--cream); font: 700 24px/1.1 var(--font-display); }
.icon-button { width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: transparent; font-size: 25px; }
.edit-row { min-height: 54px; padding: 7px 0; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.edit-row span { color: var(--cream); font-size: 14px; }
.stepper { display: grid; grid-template-columns: 44px 36px 44px; align-items: center; text-align: center; }
.stepper button { height: 44px; border: 1px solid var(--line); color: var(--cream); background: rgba(255, 255, 255, 0.04); font-size: 20px; }
.stepper button:first-child { border-radius: 12px 0 0 12px; }
.stepper button:last-child { border-radius: 0 12px 12px 0; }
.stepper strong { font-variant-numeric: tabular-nums; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1.3fr; gap: 8px; margin-top: 18px; }
.toast-region { position: fixed; z-index: 50; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(calc(100% - 28px), 500px); pointer-events: none; }
.toast { margin-top: 7px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 13px; color: var(--cream); background: #382217; box-shadow: var(--shadow); text-align: center; font-size: 13px; animation: toast-in 180ms ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (min-width: 600px) {
  .app-shell { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .topbar { height: calc(175px + env(safe-area-inset-top)); min-height: 175px; padding-bottom: 8px; }
  .brand-plaque { min-width: 170px; padding: 13px 23px 10px; }
  .brand-plaque strong { font-size: 28px; }
  .brewery-banner .status-pill { right: 14px; top: max(12px, env(safe-area-inset-top)); bottom: auto; min-height: 30px; padding: 6px 10px; font-size: 9px; }
  main { padding-inline: 28px; }
  .evening-summary { height: 146px; margin-inline: 14px; padding: 22px 16px 0; }
  .evening-summary-head { height: 60px; gap: 18px; }
  .evening-total { gap: 9px; }
  .evening-total strong { width: 56px; height: 56px; font-size: 27px; transform: translateY(-34px); }
  .evening-total span { font-size: 9px; }
  .evening-title > span { font-size: 20px; }
  .evening-title strong { font-size: 20px; }
  .evening-reset { min-width: 84px; min-height: 44px; padding-inline: 11px; font-size: 9px; }
  .reset-icon { font-size: 17px; }
  .evening-tallies { height: 64px; padding-top: 8px; column-gap: 9px; row-gap: 5px; }
  .evening-tally span { font-size: 9px; }
  .evening-tally strong { font-size: 15px; }
  .evening-tally:nth-child(n + 5) strong { font-size: 13px; }
  .drink-section { margin-top: 60px; }
  .tap-board { height: 430px; }
  .beer-grid { grid-template-columns: repeat(3, 1fr); }
  .drink-button.beer { width: 132px; min-height: 104px; max-width: 150px; }
  .drink-button.beer strong { font-size: 20px; }
  .drink-button.beer[data-drink-id="hefe-alkoholfrei"] strong { font-size: 16px; }
  .drink-button.beer .tap-rivets::before, .drink-button.beer .tap-rivets::after { box-shadow: 0 78px #8f632e, inset 0 1px rgba(255, 229, 166, 0.35); }
  .tap-fixture { width: 54px; height: 112px; }
  .fixture-ornament { width: 44px; height: 34px; }
  .fixture-ornament svg { width: 35px; height: 25px; }
  .counter-block { height: 96px; margin-top: 38px; padding: 20px 9px 8px; }
  .counter-label { top: -12px; padding: 5px 17px; font-size: 9px; }
  .other-grid { gap: 8px; }
  .drink-button.other { height: 60px; min-height: 60px; }
  .drink-button.other strong { font-size: 15px; }
  .drink-button.other small { font-size: 8px; }
  .bottom-nav { min-height: 66px; padding: 6px 12px calc(8px + env(safe-area-inset-bottom)); }
  .nav-button { min-height: 52px; font-size: 10px; }
  .nav-icon { font-size: 19px; }
  .quick-correction { bottom: calc(74px + env(safe-area-inset-bottom)); padding: 10px 14px; font-size: 10px; }
  .quick-correction strong { font-size: 10px; }
}

@media (min-width: 600px) and (max-height: 1100px) {
  :root {
    --desktop-header-height: clamp(115px, 16dvh, 175px);
    --desktop-nav-height: 66px;
  }
  .app-shell {
    height: 100dvh;
    min-height: 0;
    padding-bottom: calc(var(--desktop-nav-height) + env(safe-area-inset-bottom));
    overflow: hidden;
  }
  .topbar {
    height: calc(var(--desktop-header-height) + env(safe-area-inset-top));
    min-height: var(--desktop-header-height);
  }
  main {
    height: calc(100dvh - var(--desktop-header-height) - var(--desktop-nav-height) - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    padding-bottom: 0;
  }
  #capture-view.active {
    height: 100%;
    display: flex;
    flex-direction: column;
  }
  #history-view.active, #stats-view.active { height: 100%; overflow-y: auto; }
  #session-panel { flex: 0 0 auto; }
  .evening-summary {
    height: clamp(116px, 15dvh, 146px);
    padding-top: clamp(14px, 2dvh, 22px);
  }
  .evening-summary-head { height: clamp(46px, 6dvh, 60px); }
  .evening-tallies { height: clamp(50px, 6.4dvh, 64px); }
  .drink-section {
    flex: 1 1 auto;
    min-height: 0;
    margin-top: clamp(18px, 3dvh, 30px);
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
  }
  .tap-board {
    flex: 0 1 auto;
    height: clamp(280px, calc(100dvh - 490px), 430px);
    min-height: 0;
  }
  .counter-block {
    flex: 0 0 clamp(76px, 10dvh, 96px);
    height: clamp(76px, 10dvh, 96px);
    margin-top: clamp(18px, 3dvh, 30px);
  }
}

@media (max-width: 599px) and (max-height: 720px) {
  :root { --mobile-header-height: 94px; }
  .app-shell { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  .topbar { height: calc(78px + env(safe-area-inset-top)); min-height: 78px; }
  .evening-summary { height: 108px; padding-top: 12px; }
  .evening-summary-head { height: 42px; }
  .evening-total strong { width: 40px; height: 40px; font-size: 19px; transform: translateY(-21px); }
  .evening-tallies { height: 47px; padding-top: 4px; }
  .drink-section { margin-top: 24px; }
  .tap-board { height: 270px; }
  .drink-button.beer { width: min(86px, 27vw); min-height: 68px; }
  .drink-button.beer .tap-rivets::before, .drink-button.beer .tap-rivets::after { box-shadow: 0 44px #8f632e, inset 0 1px rgba(255, 229, 166, 0.35); }
  .counter-block { height: 72px; margin-top: 18px; padding-top: 14px; }
  .drink-button.other { height: 44px; min-height: 44px; }
}

@media (max-width: 599px) {
  .brand-plaque {
    min-width: 116px;
    padding: 7px 13px 6px;
    background: linear-gradient(155deg, rgba(51, 29, 16, 0.82), rgba(21, 12, 8, 0.88));
  }
  .brand-plaque strong { font-size: 20px; }
  .app-shell {
    height: 100dvh;
    min-height: 0;
    padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
    overflow: hidden;
  }
  .topbar {
    height: calc(var(--mobile-header-height) + env(safe-area-inset-top));
    min-height: var(--mobile-header-height);
  }
  main {
    height: calc(100dvh - var(--mobile-header-height) - var(--mobile-nav-height) - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    padding-bottom: 0;
    overflow: visible;
  }
  #capture-view.active {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: visible;
  }
  #history-view.active, #stats-view.active { height: 100%; overflow-y: auto; }
  #session-panel { flex: 0 0 auto; }
  .drink-section {
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
  }
  .tap-board {
    flex: 0 1 auto;
    width: calc(100% - 24px);
    height: clamp(270px, calc(100% - 110px), min(430px, 105vw));
    min-height: 0;
    margin: 0 12px;
  }
  .counter-block {
    flex: 0 0 79px;
    width: calc(100% - 24px);
    margin: 0 12px;
  }
}

@media (max-width: 599px) and (max-height: 720px) {
  .tap-board { height: clamp(245px, calc(100% - 101px), min(380px, 105vw)); }
  .counter-block { flex-basis: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
