/* Weinkeller – dunkles Gewölbe, Kerzenlicht, Bordeaux und Messing */

:root {
  --bg: #100b09;
  --bg-2: #171009;
  --card: rgba(255, 238, 214, .045);
  --card-2: rgba(255, 238, 214, .075);
  --card-solid: #1b130f;
  --line: rgba(236, 214, 186, .10);
  --line-2: rgba(236, 214, 186, .18);
  --text: #f3e9db;
  --text-2: #cdbca8;
  --muted: #94826f;
  --wine: #a12746;
  --wine-2: #c8405f;
  --wine-deep: #5c0f23;
  --brass: #caa25c;
  --brass-2: #e6c783;
  --brass-soft: rgba(202, 162, 92, .14);
  --ok: #9bb877;
  --warn: #e0a252;
  --bad: #e06a7e;
  --glow-1: rgba(222, 142, 66, .20);
  --glow-2: rgba(161, 39, 70, .16);
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, .75);
  --radius: 20px;
  --serif: "New York", ui-serif, "Iowan Old Style", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --tab-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f3ebdf;
  --bg-2: #eadfcd;
  --card: rgba(255, 252, 246, .72);
  --card-2: rgba(255, 252, 246, .95);
  --card-solid: #fbf7f0;
  --line: rgba(74, 42, 26, .12);
  --line-2: rgba(74, 42, 26, .22);
  --text: #2a1b14;
  --text-2: #5b4538;
  --muted: #8c7565;
  --wine: #8c1d39;
  --wine-2: #a8304e;
  --wine-deep: #5c0f23;
  --brass: #9b7431;
  --brass-2: #7c5a20;
  --brass-soft: rgba(155, 116, 49, .13);
  --ok: #5d7f3a;
  --warn: #b0671c;
  --bad: #b23a50;
  --glow-1: rgba(222, 160, 90, .22);
  --glow-2: rgba(161, 39, 70, .08);
  --shadow: 0 16px 34px -20px rgba(70, 40, 20, .45);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font: 16px/1.5 var(--sans);
  color: var(--text);
  background:
    radial-gradient(900px 520px at 50% -180px, var(--glow-1), transparent 72%),
    radial-gradient(700px 600px at 115% 0%, var(--glow-2), transparent 62%),
    radial-gradient(600px 500px at -20% 100%, var(--glow-2), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tab-h) + var(--safe-b) + 24px);
  overflow-x: clip;
}
/* feines Korn wie Kellerputz */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: .07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 .9  0 0 0 0 .8  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
:root[data-theme="light"] body::before { opacity: .12; mix-blend-mode: multiply; }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; margin: 0; line-height: 1.15; }
h1 { font-size: clamp(30px, 7vw, 40px); }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { margin: 0; }
small, .small { font-size: 13px; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.serif { font-family: var(--serif); }
.num { font-variant-numeric: tabular-nums; }
.hidden, [hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.stack > * + * { margin-top: 14px; }
.stack-lg > * + * { margin-top: 28px; }
.center { text-align: center; }

.icon { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 17px; height: 17px; }
.icon-lg { width: 28px; height: 28px; }

.eyebrow {
  font: 600 11.5px/1.2 var(--sans);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--brass);
}

/* ---------- Kopf und Navigation ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: calc(var(--safe-t) + 10px) 18px 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(var(--bg) 30%, color-mix(in srgb, var(--bg) 70%, transparent));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 9px; font: 600 19px/1 var(--serif); letter-spacing: .01em; }
.brand svg { width: 30px; height: 30px; color: var(--brass); }
.top-back { display: inline-flex; align-items: center; gap: 2px; color: var(--brass); font-weight: 500; margin-left: -6px; padding: 6px 6px 6px 0; }
.top-nav { display: none; }
.top .top-scan { display: none; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  font: 600 14px/1 var(--serif);
  color: var(--brass-2);
  background: var(--brass-soft);
  border: 1px solid var(--line-2);
}

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  height: calc(var(--tab-h) + var(--safe-b));
  padding: 6px 8px var(--safe-b);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: start;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-top: 1px solid var(--line);
}
.tabbar.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding-top: 6px;
  font-size: 10.5px; font-weight: 500; letter-spacing: .02em;
  color: var(--muted);
  position: relative;
}
.tab .icon { width: 25px; height: 25px; }
.tab.on { color: var(--brass-2); }
.tab.on::after {
  content: ""; position: absolute; top: -7px; width: 22px; height: 2px; border-radius: 2px;
  background: var(--brass); box-shadow: 0 0 10px var(--brass);
}
.tab-scan { margin-top: -26px; gap: 4px; color: var(--text-2); }
.tab-scan .seal {
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff4e6;
  background: radial-gradient(circle at 34% 28%, var(--wine-2), var(--wine) 45%, var(--wine-deep) 100%);
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 4.5px color-mix(in srgb, var(--brass) 70%, transparent), 0 10px 28px -6px rgba(161, 39, 70, .8);
  transition: transform .15s ease;
}
.tab-scan:active .seal { transform: scale(.94); }
.tab-scan .icon { width: 28px; height: 28px; stroke-width: 1.8; }

.page { max-width: 1080px; margin: 0 auto; padding: 6px 18px 0; }
.page-head { display: flex; align-items: flex-end; gap: 12px; margin: 8px 0 22px; }
.page-head p { color: var(--text-2); margin-top: 6px; }

@media (min-width: 960px) {
  body { padding-bottom: 60px; }
  .tabbar { display: none; }
  .top { padding: 16px 32px; }
  .top-nav { display: flex; gap: 4px; margin-left: 28px; }
  .top-nav a { padding: 8px 14px; border-radius: 999px; color: var(--text-2); font-weight: 500; font-size: 15px; }
  .top-nav a:hover { color: var(--text); background: var(--card); }
  .top-nav a.on { color: var(--brass-2); background: var(--brass-soft); }
  .top .top-scan { display: inline-flex; }
  .page { padding: 10px 32px 0; }
}

/* ---------- Bausteine ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head h2 { font-size: 20px; }
.card-link { display: block; transition: border-color .2s, transform .2s; }
.card-link:hover { border-color: var(--line-2); }
.card-link:active { transform: scale(.99); }
.section-title { display: flex; align-items: baseline; gap: 10px; margin: 30px 2px 12px; }
.section-title h2 { font-size: 21px; }
.section-title a { margin-left: auto; color: var(--brass); font-size: 14px; font-weight: 500; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--card-2);
  color: var(--text);
  font: 600 15.5px/1 var(--sans);
  cursor: pointer;
  transition: transform .12s ease, background .2s, border-color .2s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:hover { border-color: var(--brass); }
.btn-wine {
  border-color: transparent;
  color: #fff6ea;
  background: linear-gradient(180deg, var(--wine-2), var(--wine) 55%, var(--wine-deep));
  box-shadow: 0 10px 24px -10px rgba(161, 39, 70, .9), inset 0 1px 0 rgba(255, 255, 255, .15);
}
.btn-wine:hover { border-color: transparent; filter: brightness(1.08); }
.btn-brass { color: var(--brass-2); border-color: color-mix(in srgb, var(--brass) 55%, transparent); background: var(--brass-soft); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--brass); padding: 0 10px; }
.btn-ghost:hover { border-color: transparent; color: var(--brass-2); }
.btn-danger { color: var(--bad); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn-lg { min-height: 56px; font-size: 17px; padding: 0 26px; }
.btn-block { display: flex; width: 100%; }
.btn-icon { width: 42px; min-height: 42px; padding: 0; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12.5px; font-weight: 600;
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--text-2);
  white-space: nowrap;
}
.chip .icon { width: 14px; height: 14px; }
.chip-brass { color: var(--brass-2); background: var(--brass-soft); border-color: color-mix(in srgb, var(--brass) 35%, transparent); }
.chip-lock { color: #ffd9a8; background: rgba(224, 162, 82, .14); border-color: rgba(224, 162, 82, .35); }
:root[data-theme="light"] .chip-lock { color: #8a4b10; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.ripe { --c: var(--muted); color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); border-color: color-mix(in srgb, var(--c) 35%, transparent); }
.ripe::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.ripe-lagern { --c: #8fa6c4; }
.ripe-reif { --c: var(--ok); }
.ripe-hoehepunkt { --c: var(--brass-2); }
.ripe-bald { --c: var(--warn); }
.ripe-drueber { --c: var(--bad); }

.seg {
  display: flex; gap: 4px; padding: 4px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg a, .seg button, .seg label {
  flex: 1; text-align: center; white-space: nowrap;
  padding: 9px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--text-2);
  border: 0; background: none; cursor: pointer; font-family: inherit;
}
.seg .on, .seg input:checked + span { color: var(--text); background: var(--card-2); box-shadow: 0 2px 10px rgba(0, 0, 0, .25), inset 0 0 0 1px var(--line-2); }
.seg label { padding: 0; display: flex; }
.seg label span { flex: 1; padding: 9px 14px; border-radius: 999px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }

.search { position: relative; }
.search .icon { position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--muted); }


/* ---------- Formulare ---------- */

.field { display: block; }
.field > span, .label { display: block; margin: 0 0 6px 2px; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.input, .field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .field select, .field textarea, .search input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  color: var(--text);
  font: 16px/1.35 var(--sans);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;
}
.field textarea { min-height: 96px; resize: vertical; }
.search input { padding-left: 44px; }
.field select { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23caa25c' stroke-width='2' stroke-linecap='round'><path d='M7 10l5 5 5-5'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; background-size: 20px; padding-right: 40px; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus, .search input:focus { border-color: var(--brass); box-shadow: 0 0 0 4px var(--brass-soft); }
.field .err, .err { color: var(--bad); font-size: 13.5px; margin-top: 6px; }
.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.form-grid > .full { grid-column: 1 / -1; }
@media (max-width: 520px) { .form-grid.tight { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--wine); }
.stepper { display: flex; align-items: center; gap: 0; border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; width: max-content; }
.stepper button { width: 48px; height: 48px; border: 0; background: var(--card-2); color: var(--brass-2); font-size: 22px; cursor: pointer; }
.stepper input { width: 64px !important; min-height: 48px; border: 0 !important; border-radius: 0 !important; text-align: center; font: 600 18px var(--serif) !important; box-shadow: none !important; }
fieldset { border: 0; padding: 0; margin: 0; }

.stars { display: inline-flex; gap: 2px; color: var(--brass); }
.stars .icon { width: 16px; height: 16px; }
.stars .on { fill: currentColor; }
.stars .off { opacity: .35; }
.rate { display: flex; gap: 6px; }
.rate input { position: absolute; opacity: 0; pointer-events: none; }
.rate label { cursor: pointer; color: var(--brass); padding: 4px; }
.rate label .icon { width: 34px; height: 34px; stroke-width: 1.4; }
.rate label.on .icon { fill: currentColor; filter: drop-shadow(0 0 8px color-mix(in srgb, var(--brass) 60%, transparent)); }

/* ---------- Flaschen, Nischen, Regal ---------- */

/* Gewölbte Nische wie im Kellerregal */
.niche {
  --w: 64px;
  width: var(--w);
  aspect-ratio: 3 / 4;
  flex: none;
  border-radius: calc(var(--w) / 2) calc(var(--w) / 2) 10px 10px;
  overflow: hidden;
  background: linear-gradient(180deg, #2a1d15, #120c09);
  box-shadow: inset 0 10px 22px rgba(0, 0, 0, .65), 0 0 0 1px var(--line-2), 0 8px 18px -10px rgba(0, 0, 0, .9);
  display: grid;
  place-items: center;
  position: relative;
}
.niche img { width: 100%; height: 100%; object-fit: cover; }
.niche::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), inset 0 -18px 24px -14px rgba(0, 0, 0, .6); pointer-events: none; }
.niche .ghost { width: 46%; color: var(--c, #6d1428); opacity: .95; }
.niche-xl { --w: min(250px, 64vw); }
.niche-sm { --w: 46px; }

.t-rot { --c: #7a1730; --c2: #2c0711; --hi: rgba(255, 130, 150, .45); }
.t-rose { --c: #d0717f; --c2: #6c2834; --hi: rgba(255, 220, 225, .55); }
.t-weiss { --c: #d2b960; --c2: #5c4c17; --hi: rgba(255, 246, 200, .6); }
.t-schaumwein { --c: #34573a; --c2: #0e1e12; --hi: rgba(190, 255, 200, .3); }
.t-suesswein { --c: #b8711f; --c2: #4a2507; --hi: rgba(255, 210, 150, .5); }
.t-andere, .t- { --c: #6e5f53; --c2: #241d18; --hi: rgba(255, 240, 220, .3); }

.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 30%, transparent); flex: none; }
.dot.ring { background: transparent; box-shadow: inset 0 0 0 2px var(--brass), 0 0 6px var(--brass); }

/* Weinregal: jede Flasche von vorne als Flaschenboden */
.rack {
  position: relative;
  padding: 16px;
  border-radius: 22px;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .18) 0 1px, transparent 1px 44px),
    linear-gradient(180deg, #2b1d14, #1a110c 60%, #140d09);
  box-shadow: inset 0 2px 0 rgba(255, 220, 170, .06), inset 0 -20px 40px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(0, 0, 0, .5), var(--shadow);
  overflow: hidden;
}
.rack::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(420px 160px at 50% -40px, rgba(255, 190, 120, .18), transparent 70%);
}
.rack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(32px, 1fr)); gap: 7px; position: relative; }
.btl {
  aspect-ratio: 1;
  border-radius: 50%;
  position: relative;
  background: radial-gradient(circle at 36% 32%, var(--hi) 0 7%, var(--c) 34%, var(--c2) 78%, #000 100%);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .45), inset 0 -3px 6px rgba(0, 0, 0, .45), 0 3px 5px rgba(0, 0, 0, .55);
  transition: transform .15s ease;
}
.btl::after { content: ""; position: absolute; inset: 27%; border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .1), 0 0 0 1px rgba(0, 0, 0, .25); }
.btl.t-schaumwein::after { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--brass) 70%, transparent); }
.btl.precious { box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .45), 0 0 0 2px color-mix(in srgb, var(--brass) 80%, transparent), 0 0 12px color-mix(in srgb, var(--brass) 50%, transparent); }
.btl.reserved::before { content: ""; position: absolute; right: -2px; top: -2px; width: 11px; height: 11px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 2px #1a110c; z-index: 1; }
a.btl:hover { transform: scale(1.12); z-index: 2; }
.rack-more { display: grid; place-items: center; aspect-ratio: 1; border-radius: 50%; border: 1px dashed rgba(255, 220, 170, .25); color: #d9c3a3; font-size: 12px; font-weight: 600; }
.rack-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12.5px; color: var(--text-2); }
.rack-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rack-empty { padding: 28px 10px; text-align: center; color: #cdb69a; }

/* ---------- Weinliste ---------- */

.wines { display: grid; gap: 10px; }
@media (min-width: 760px) { .wines.cols { grid-template-columns: 1fr 1fr; } }
.wine {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px 12px 12px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  transition: border-color .2s, transform .15s;
}
.wine:hover { border-color: var(--line-2); }
.wine:active { transform: scale(.99); }
.wine-main { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; }
.wine .chip { white-space: normal; }
.wine-name { font: 600 18px/1.2 var(--serif); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.wine-sub { color: var(--text-2); font-size: 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.wine-kicker { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.wine .chips { margin-top: 5px; }
.wine-side { display: grid; justify-items: end; gap: 6px; text-align: right; }
.price { font: 600 17px/1 var(--serif); color: var(--brass-2); white-space: nowrap; }
.price.big { font-size: 34px; }
.count { font-size: 13px; font-weight: 600; color: var(--text-2); padding: 3px 9px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); }

/* ---------- Start ---------- */

.hello { margin: 10px 0 22px; }
.hello h1 { font-size: clamp(32px, 8vw, 44px); }
.hello p { color: var(--text-2); margin-top: 6px; }
.home-grid { display: grid; gap: 14px; }
.home-grid > *, .detail > *, .stack > *, .stack-lg > *, .wines > *, .mini-list > *, .list > *, .tiles > * { min-width: 0; }
@media (min-width: 960px) { .home-grid { grid-template-columns: 1.35fr 1fr; align-items: start; } }

.cellar-card { padding: 0; overflow: hidden; }
.cellar-card .rack { border-radius: 0; box-shadow: inset 0 -20px 40px rgba(0, 0, 0, .5); }
.cellar-card-foot { display: flex; align-items: center; gap: 12px; padding: 16px 18px; }
.cellar-card-foot h2 { font-size: 24px; }
.stat-row { display: flex; gap: 22px; margin-top: 4px; color: var(--text-2); font-size: 14px; }
.stat-row b { display: block; font: 600 22px/1.1 var(--serif); color: var(--text); }
.go { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--brass-soft); color: var(--brass-2); border: 1px solid var(--line-2); flex: none; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { display: grid; gap: 8px; padding: 16px; }
.tile .icon { color: var(--brass); }
.tile b { font: 600 28px/1 var(--serif); }
.tile span { color: var(--text-2); font-size: 14px; }

.mini-list { display: grid; }
.mini { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.mini:first-child { border-top: 0; padding-top: 0; }
.mini:last-child { padding-bottom: 0; }
.mini-main { flex: 1; min-width: 0; }
.mini-main b { display: block; font: 600 16px/1.25 var(--serif); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mini-main span { display: flex; align-items: center; gap: 5px; color: var(--text-2); font-size: 13.5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mini-main .icon { width: 14px; height: 14px; flex: none; }

/* ---------- Detail ---------- */

.detail { display: grid; gap: 18px; }
@media (min-width: 960px) {
  .detail { grid-template-columns: 340px 1fr; gap: 36px; align-items: start; }
  .detail-aside { position: sticky; top: 90px; }
}
.hero { position: relative; display: grid; justify-items: center; text-align: center; padding: 10px 0 4px; }
.hero::before { content: ""; position: absolute; top: -30px; left: 50%; width: min(420px, 100%); height: 380px; translate: -50% 0; background: radial-gradient(closest-side, rgba(230, 160, 80, .22), transparent); pointer-events: none; z-index: -1; }
.hero .niche { box-shadow: inset 0 14px 30px rgba(0, 0, 0, .7), 0 0 0 1px var(--line-2), 0 0 0 7px color-mix(in srgb, var(--bg) 60%, transparent), 0 0 0 8px var(--line), 0 30px 60px -24px rgba(0, 0, 0, .95); }
.hero-photo { position: relative; }
.hero-photo-btn { position: absolute; right: -10px; bottom: -6px; }
.hero-photo-btn .btn { background: var(--card-solid); }
.hero h1 { margin-top: 22px; font-size: clamp(28px, 7.4vw, 38px); text-wrap: balance; }
.hero .producer { color: var(--text-2); margin-top: 6px; font-size: 16px; }
.hero .chips { justify-content: center; margin-top: 14px; }
.hero-meta { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; color: var(--muted); font-size: 14px; }
@media (min-width: 960px) { .hero { padding-top: 0; } }

.banner {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: 16px;
  border: 1px solid rgba(224, 162, 82, .38);
  background: linear-gradient(180deg, rgba(224, 162, 82, .14), rgba(224, 162, 82, .06));
}
.banner .icon { color: var(--warn); margin-top: 1px; }
.banner > div > b:first-child { display: block; }
.banner p { color: var(--text-2); font-size: 14.5px; margin-top: 2px; }
.banner-wine { border-color: color-mix(in srgb, var(--wine-2) 45%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--wine) 22%, transparent), color-mix(in srgb, var(--wine) 8%, transparent)); }
.banner-wine .icon { color: var(--wine-2); }

.value { display: grid; gap: 8px; }
.value-top { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.sources { display: grid; gap: 2px; margin-top: 6px; }
.sources a { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14.5px; color: var(--text-2); }
.sources a:hover { color: var(--text); }
.sources a b { margin-left: auto; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Trinkreife-Zeitleiste */
.meter { margin-top: 36px; }
.meter-track { position: relative; height: 12px; border-radius: 999px; background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line); }
.meter-window {
  position: absolute; top: 0; bottom: 0; border-radius: 999px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--ok) 55%, transparent), var(--brass) 55%, color-mix(in srgb, var(--wine-2) 85%, transparent));
  box-shadow: 0 0 16px -2px color-mix(in srgb, var(--brass) 60%, transparent);
}
.meter-peak { position: absolute; top: 50%; width: 18px; height: 18px; translate: -50% -50%; border-radius: 50%; background: var(--brass-2); box-shadow: 0 0 0 3px var(--bg), 0 0 14px var(--brass); }
.meter-now { position: absolute; top: -9px; bottom: -9px; width: 2px; translate: -1px 0; background: var(--text); border-radius: 2px; }
.meter-now i { position: absolute; bottom: calc(100% + 4px); left: 50%; translate: -50% 0; font: 600 11px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; font-style: normal; color: var(--text); white-space: nowrap; }
.meter-years { position: relative; height: 20px; margin-top: 10px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.meter-years span { position: absolute; translate: -50% 0; white-space: nowrap; }
.meter-years span.peak { color: var(--brass-2); font-weight: 600; }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 15px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; color: var(--text-2); }

.list { display: grid; }
.list-item { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.list-item > .grow { flex: 1 1 170px; }
.list-actions { display: flex; gap: 8px; margin-left: auto; }
.list-item:first-child { border-top: 0; padding-top: 2px; }
.list-item:last-child { padding-bottom: 0; }
.list-item .grow { min-width: 0; }
.list-item b { font-weight: 600; }
.list-item .sub { color: var(--text-2); font-size: 14px; }
.list-item.off { opacity: .6; }
.bottle-ico { width: 34px; height: 34px; border-radius: 50%; flex: none; background: radial-gradient(circle at 36% 32%, var(--hi) 0 7%, var(--c) 34%, var(--c2) 80%, #000); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .4), 0 2px 4px rgba(0, 0, 0, .45); }

.tasting { padding: 14px 0; border-top: 1px solid var(--line); }
.tasting:first-child { border-top: 0; padding-top: 0; }
.tasting-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tasting-head b { font-weight: 600; }
.tasting p { color: var(--text-2); margin-top: 6px; font-size: 15px; white-space: pre-line; }
.who { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font: 600 11px/1 var(--serif); background: var(--brass-soft); color: var(--brass-2); }

/* Claude-Fortschritt */
.ai {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: 18px;
  background: linear-gradient(90deg, var(--brass-soft), transparent);
  border: 1px solid color-mix(in srgb, var(--brass) 30%, transparent);
}
.ai b { display: block; }
.ai p { color: var(--text-2); font-size: 14px; }
.ai.error { background: linear-gradient(90deg, color-mix(in srgb, var(--bad) 16%, transparent), transparent); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.pour { position: relative; width: 26px; height: 32px; flex: none; }
.pour svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pour .liquid { transform-origin: 50% 100%; animation: pour 2.4s ease-in-out infinite; }
@keyframes pour { 0% { transform: scaleY(0); } 55% { transform: scaleY(1); } 80% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }
.shimmer { position: relative; overflow: hidden; }
.shimmer::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 230, 190, .08) 50%, transparent 70%); animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.skeleton { height: 14px; border-radius: 8px; background: var(--card-2); }

/* ---------- Scannen ---------- */

.viewfinder {
  position: relative;
  margin: 18px auto 0;
  width: min(300px, 78vw);
  aspect-ratio: 3 / 4;
  border-radius: 150px 150px 26px 26px;
  background: radial-gradient(circle at 50% 30%, rgba(230, 160, 80, .16), transparent 65%), linear-gradient(#1e140f, #0f0a08);
  box-shadow: inset 0 18px 40px rgba(0, 0, 0, .7), 0 0 0 1px var(--line-2), 0 0 0 10px color-mix(in srgb, var(--bg) 50%, transparent), 0 0 0 11px var(--line);
  display: grid; place-items: center;
  overflow: hidden;
  cursor: pointer;
}
.viewfinder img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.viewfinder .hint { display: grid; justify-items: center; gap: 12px; color: #c6ae8f; text-align: center; padding: 30px; font-size: 14.5px; }
.viewfinder .hint svg { width: 92px; height: 92px; color: rgba(230, 199, 131, .65); stroke-width: 1; }
.viewfinder.drag { box-shadow: inset 0 18px 40px rgba(0, 0, 0, .7), 0 0 0 2px var(--brass), 0 0 30px var(--brass-soft); }
.corners { position: absolute; inset: 16% 14%; pointer-events: none; }
.corners i { position: absolute; width: 26px; height: 26px; border: 2px solid var(--brass-2); opacity: .8; }
.corners i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
.corners i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 8px; }
.corners i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 8px; }
.corners i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 8px; }
.progress { height: 6px; border-radius: 999px; background: var(--card-2); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--wine), var(--brass)); transition: width .2s; }
.scan-actions { display: grid; gap: 10px; max-width: 360px; margin: 26px auto 0; }

/* ---------- Getrunken ---------- */

.month { margin: 26px 2px 10px; }
.month:first-child { margin-top: 6px; }
.drunk { display: flex; gap: 14px; align-items: stretch; padding: 12px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); }
.drunk + .drunk { margin-top: 10px; }
.date-tag { width: 54px; flex: none; display: grid; align-content: center; justify-items: center; border-radius: 14px; background: var(--brass-soft); border: 1px solid color-mix(in srgb, var(--brass) 25%, transparent); padding: 6px 0; }
.date-tag b { font: 600 24px/1 var(--serif); color: var(--brass-2); }
.date-tag span { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.drunk-main { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; align-content: center; }
.drunk-main .wine-name { font-size: 17px; }
.place { display: inline-flex; align-items: center; gap: 5px; color: var(--text-2); font-size: 14px; }
.place .icon { width: 15px; height: 15px; color: var(--wine-2); }
.place.home .icon { color: var(--brass); }
.drunk-note { color: var(--text-2); font-size: 14px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.places { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.places::-webkit-scrollbar { display: none; }

/* ---------- Mehr / Einstellungen ---------- */

.group { padding: 0; overflow: hidden; }
.group > .g-row, .group > form > .g-row { display: flex; align-items: center; gap: 14px; padding: 15px 18px; border-top: 1px solid var(--line); }
.group > :first-child, .group > form:first-child > .g-row { border-top: 0; }
.g-row .icon { color: var(--brass); }
.g-row .grow { min-width: 0; }
.g-row b { display: block; font-weight: 600; }
.g-row .sub { color: var(--text-2); font-size: 14px; }
a.g-row:hover, button.g-row:hover { background: var(--card); }
button.g-row { width: 100%; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.g-body { padding: 18px; border-top: 1px solid var(--line); }

.linkbox { display: grid; gap: 12px; padding: 18px; border-radius: 20px; border: 1px solid color-mix(in srgb, var(--brass) 45%, transparent); background: linear-gradient(180deg, var(--brass-soft), transparent); }
.linkbox code { display: block; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--bg) 70%, transparent); border: 1px solid var(--line); font-size: 13px; word-break: break-all; color: var(--text-2); user-select: all; }

/* ---------- Anmelden ---------- */

.auth { min-height: 100dvh; display: grid; place-items: center; padding: calc(var(--safe-t) + 30px) 24px calc(var(--safe-b) + 30px); }
.auth-box { width: min(380px, 100%); text-align: center; display: grid; justify-items: center; gap: 14px; }
.vault {
  width: 220px; height: 250px; margin-bottom: 14px;
  border-radius: 110px 110px 18px 18px;
  display: grid; place-items: end center;
  padding-bottom: 26px;
  background: radial-gradient(circle at 50% 45%, rgba(230, 160, 80, .30), transparent 62%), linear-gradient(#24170f, #0d0806);
  box-shadow: inset 0 22px 50px rgba(0, 0, 0, .75), 0 0 0 1px var(--line-2), 0 0 0 12px color-mix(in srgb, var(--bg) 40%, transparent), 0 0 0 13px var(--line), 0 40px 80px -30px rgba(0, 0, 0, .9);
}
.vault svg { width: 74px; height: 150px; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .7)); }
.auth h1 { font-size: 42px; }
.auth p { color: var(--text-2); }
.auth .btn { margin-top: 12px; }

/* ---------- Meldungen und Dialoge ---------- */

.flash { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 16px; margin: 0 0 16px; font-weight: 500; border: 1px solid; animation: drop .35s ease; }
.flash .icon { flex: none; }
.flash-ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, transparent); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.flash-ok span { color: var(--text); }
.flash-error { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); border-color: color-mix(in srgb, var(--bad) 32%, transparent); }
.flash-error span { color: var(--text); }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }

dialog.sheet {
  border: 1px solid var(--line-2);
  padding: 0;
  color: var(--text);
  background: var(--card-solid);
  width: min(560px, 100%);
  max-width: 100%;
  max-height: 92dvh;
  margin: auto auto 0;
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, .6);
}
dialog.sheet[open] { animation: up .28s cubic-bezier(.2, .9, .3, 1); }
dialog.sheet::backdrop { background: rgba(5, 3, 2, .62); backdrop-filter: blur(3px); }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
.sheet-in { padding: 10px 20px calc(var(--safe-b) + 22px); overflow-y: auto; max-height: 92dvh; }
.sheet-in::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 0 auto 14px; }
.sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.sheet-head h2 { font-size: 22px; }
@media (min-width: 700px) {
  dialog.sheet { margin: auto; border-radius: 26px; }
  .sheet-in::before { display: none; }
  .sheet-in { padding: 24px; }
}

.empty { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 36px 20px; }
.empty svg { width: 70px; height: 70px; color: var(--brass); opacity: .7; stroke-width: 1.1; }
.empty p { color: var(--text-2); max-width: 340px; }

.pager { display: flex; justify-content: center; gap: 10px; margin-top: 22px; }
.foot { margin: 40px 0 10px; text-align: center; color: var(--muted); font-size: 12.5px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.hero-stats { display: flex; justify-content: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.hero-stats > div { display: grid; gap: 2px; min-width: 132px; padding: 11px 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.hero-stats b { font: 600 21px/1.15 var(--serif); }
.hero-stats span { font-size: 12.5px; color: var(--muted); }

.source { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 14.5px; color: var(--text-2); }
.source .icon { color: var(--muted); }
.source.gift { color: var(--brass-2); }
.source.gift .icon { color: var(--brass); }
.gift-line { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; padding: 6px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--brass-2); background: var(--brass-soft); border: 1px solid color-mix(in srgb, var(--brass) 35%, transparent); }
.notes { white-space: pre-line; color: var(--text); font-size: 16px; }
.seg label span .icon { vertical-align: -3px; margin-right: 2px; }

.gain { font-size: 14px; color: var(--text-2); margin-top: 2px; }
.gain b, .trend-total { font-weight: 700; color: var(--text-2); }
.gain b.up, .trend-total.up { color: var(--ok); }
.gain b.down, .trend-total.down { color: var(--bad); }
.trend { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.trend-total { font-size: 14px; }
.spark { width: 100%; height: 64px; overflow: visible; }
.spark polyline { fill: none; stroke: var(--brass); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--brass) 50%, transparent)); }
.trend-list { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13.5px; }
.trend-list > span { display: inline-flex; gap: 6px; }
.trend-list b { font-weight: 600; font-variant-numeric: tabular-nums; }

.qr-row { display: flex; align-items: center; gap: 16px; }
.qr { flex: none; width: 132px; height: 132px; padding: 8px; border-radius: 14px; background: #fbf7f0; box-shadow: 0 0 0 1px var(--line-2); }
.qr svg { display: block; width: 100%; height: 100%; }
@media (max-width: 420px) { .qr-row { flex-direction: column; align-items: flex-start; } .qr { width: 180px; height: 180px; } }
