/* Weinkeller – mobile-first Stylesheet */

:root {
  --bg: #f7f3ef;
  --surface: #ffffff;
  --text: #2a1a1f;
  --muted: #7d6b70;
  --line: #e8ddd8;
  --wine: #6b1530;
  --wine-dark: #3b0a19;
  --gold: #c9a24a;
  --ok: #2f7d4a;
  --danger: #b3261e;
  --radius: 14px;
  --tabbar-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #150a0e;
    --surface: #221318;
    --text: #f3e9ec;
    --muted: #a8939a;
    --line: #3a252c;
    --wine: #c2456b;
    --gold: #d9b55a;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
}

a { color: var(--wine); text-decoration: none; }
h1 { font-size: 1.6rem; margin: .2em 0 .6em; line-height: 1.2; }
h2 { font-size: 1.1rem; margin: 1.6em 0 .6em; display: flex; gap: .5em; align-items: center; }
h3 { font-size: 1rem; margin: 1em 0 .3em; }
.muted { color: var(--muted); font-weight: normal; }
.small { font-size: .85rem; }
[hidden] { display: none !important; }

/* --- Kopfzeile ---------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 1rem;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px;
  background: var(--wine-dark); color: #fff;
}
.brand { display: flex; align-items: center; gap: .5rem; color: #fff; font-weight: 600; font-size: 1.1rem; }
.topnav { display: none; margin-left: auto; gap: .25rem; align-items: center; }
.topnav a { color: #f1dde3; padding: .4rem .7rem; border-radius: 8px; }
.topnav a.active, .topnav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.user-chip { border: 1px solid rgba(255,255,255,.3); }
.offline-badge { margin-left: auto; background: var(--gold); color: var(--wine-dark); font-size: .75rem; font-weight: 700; padding: .15rem .5rem; border-radius: 99px; }

.container {
  max-width: 960px; margin: 0 auto; padding: 16px;
  /* iPhone quer: Platz für Notch / Dynamic Island */
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

/* --- Untere Navigationsleiste (Handy) ----------------------------------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: space-around; align-items: center;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .72rem; color: var(--muted); }
.tabbar a.active { color: var(--wine); }
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar .tab-add { flex: 0 0 auto; width: 52px; height: 52px; border-radius: 50%; background: var(--wine); color: #fff; justify-content: center; margin-top: -18px; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.tabbar .tab-add svg { stroke-width: 2.5; }

/* Obere Navigation nur mit Maus (Computer). iPhone & iPad behalten die untere Leiste. */
@media (min-width: 800px) and (pointer: fine) {
  .topnav { display: flex; }
  .tabbar { display: none; }
  body { padding-bottom: 32px; }
  .offline-badge { margin-left: 0; }
}

/* --- Bausteine ---------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.empty { text-align: center; padding: 32px 16px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.back { display: inline-block; font-size: .9rem; margin-bottom: .2rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 42px; padding: .5rem 1rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn-primary { background: var(--wine); border-color: var(--wine); color: #fff; }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.flash { padding: .75rem 1rem; border-radius: 10px; margin-bottom: 1rem; border: 1px solid; }
.flash-success { background: color-mix(in srgb, var(--ok) 12%, transparent); border-color: var(--ok); }
.flash-error { background: color-mix(in srgb, var(--danger) 12%, transparent); border-color: var(--danger); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 10px; text-align: center; }
.stat strong { display: block; font-size: 1.4rem; color: var(--wine); }
.stat span { font-size: .8rem; color: var(--muted); }

.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line);
  background: none; color: var(--text); font: inherit; text-align: left;
}
.list-item:last-child { border-bottom: 0; }
.list-item > div { flex: 1; min-width: 0; }
.list-item strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item small { color: var(--muted); }
a.list-item:active, button.list-item:active { background: var(--bg); }
.list-item.inactive { opacity: .55; }
.menu .list-item { justify-content: space-between; cursor: pointer; }
.list-divider { padding: 6px 14px; font-size: .8rem; font-weight: 700; color: var(--muted); background: var(--bg); text-transform: uppercase; letter-spacing: .04em; }

.badge { flex: none; min-width: 2.2em; padding: .15rem .55rem; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); font-weight: 700; font-size: .9rem; text-align: center; }
.badge-in { color: var(--ok); }
.badge-out { color: var(--danger); }

.meter { height: 5px; background: var(--line); border-radius: 99px; margin-top: 6px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--gold); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: .35rem .8rem; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: .9rem; }

/* Kategorie-Farben (Platzhalter-Vorschaubilder) */
.thumb { flex: none; width: 44px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--line); }
.cat-champagner { background: #e6cf8b; }
.cat-schaumwein { background: #efe2b0; }
.cat-rot { background: #7a1f35; }
.cat-weiss { background: #f0e6b8; }
.cat-rose { background: #f2b8c0; }
.cat-suesswein { background: #d99a3a; }
.cat-likoerwein { background: #8a4b2a; }
.cat-sonstiges { background: var(--line); }
.chip[class*="cat-"] { background: var(--surface); border-left: 6px solid; }
.chip.cat-champagner { border-left-color: #e6cf8b; }
.chip.cat-schaumwein { border-left-color: #efe2b0; }
.chip.cat-rot { border-left-color: #7a1f35; }
.chip.cat-weiss { border-left-color: #f0e6b8; }
.chip.cat-rose { border-left-color: #f2b8c0; }
.chip.cat-suesswein { border-left-color: #d99a3a; }
.chip.cat-likoerwein { border-left-color: #8a4b2a; }

/* --- Formulare ---------------------------------------------------------- */
.form label { display: block; margin-bottom: 12px; font-size: .9rem; font-weight: 600; }
.form label.check, label.check { display: flex; align-items: center; gap: .5rem; font-weight: normal; }
input, select, textarea {
  display: block; width: 100%; margin-top: 4px;
  min-height: 44px; padding: .55rem .7rem;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text);
  font: inherit; font-weight: normal;
  font-size: 16px; /* unter 16px zoomt iOS beim Antippen automatisch in das Feld */
}
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; margin: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--wine); outline-offset: 1px; }
fieldset { border: 0; border-top: 1px solid var(--line); margin: 16px 0 0; padding: 12px 0 0; }
legend { font-weight: 700; color: var(--wine); padding-right: .5rem; }
.field-error { color: var(--danger); font-weight: normal; font-size: .85rem; margin: 4px 0 0; }

.grid-2, .grid-3 { display: grid; gap: 0 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr 1fr; }
}

.filters { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; margin-bottom: 12px; }
.filters input[type="search"] { grid-column: 1 / -1; }
.filters input, .filters select { margin: 0; }
.filters .check { grid-column: 1 / -1; font-size: .9rem; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.form .segmented label { margin: 0; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: block; text-align: center; padding: .6rem; cursor: pointer; }
.segmented input:checked + span { background: var(--wine); color: #fff; }

/* --- Detailseiten ------------------------------------------------------- */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.notes { white-space: normal; margin: 0; }
.wine-detail { display: grid; gap: 16px; }
.label-photo { width: 100%; max-height: 360px; object-fit: contain; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
@media (min-width: 700px) {
  .wine-detail:has(.label-photo) { grid-template-columns: 260px 1fr; align-items: start; }
}
.booking summary { font-weight: 700; cursor: pointer; padding: 2px 0; }
.booking[open] summary { margin-bottom: 12px; }
.booking { margin-top: 16px; }
.current-image { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.current-image img { width: 80px; height: 100px; object-fit: cover; border-radius: 8px; }
.danger-zone { margin-top: 32px; text-align: center; }
.logout { margin-top: 16px; }

/* --- Wein vs. Champagner ------------------------------------------------ */
.tabs { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; }
.tabs a { padding: .45rem .9rem; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--text); white-space: nowrap; font-size: .9rem; }
.tabs a.active { background: var(--wine); border-color: var(--wine); color: #fff; }

.producer { font-size: .8rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--gold); }
.list-item small.producer { display: block; }

.key-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 8px; margin-bottom: 16px; }
.key { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; text-align: center; }
.key b { display: block; font-size: 1.15rem; }
.key span { font-size: .75rem; color: var(--muted); }
.key-disgorge { border-color: var(--gold); }
.key-disgorge.missing b { color: var(--muted); }
.key-ready b { color: var(--ok); }
.key-late b { color: var(--danger); }
.key-wait b { color: var(--gold); }

.form .highlight { padding: 10px; border: 1px dashed var(--gold); border-radius: 10px; }
.form .highlight small { display: block; font-weight: normal; margin-top: 4px; }
.nv-check { align-self: end; min-height: 44px; }
.type-switch span { font-size: .9rem; }
.grape-chips { margin: -4px 0 12px; }
.grape-chips .chip { cursor: pointer; font: inherit; font-size: .85rem; }
.more summary { cursor: pointer; color: var(--wine); font-weight: 600; margin-bottom: 8px; }
.form .current-image { font-weight: normal; margin: 6px 0; }

.tasting { align-items: flex-start; }
.tasting .notes { margin: 4px 0; font-size: .95rem; }
.tasting strong { white-space: normal; }
.list-item .grow { flex: 1; min-width: 0; color: var(--text); }
.list-item .grow small { display: block; }
.btn-small { min-height: 32px; padding: .25rem .7rem; font-size: .85rem; }
.icon-btn { border: 0; background: none; color: var(--muted); font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 2px 6px; }

/* --- Scannen ------------------------------------------------------------ */
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.topbar-scan { margin-left: auto; color: #fff; display: flex; padding: 6px; border-radius: 8px; }
.topbar-scan.active, .topbar-scan:hover { background: rgba(255,255,255,.12); }
.topbar .offline-badge:not([hidden]) + .topbar-scan { margin-left: 0; }
@media (min-width: 800px) and (pointer: fine) { .topbar-scan { margin-left: 0; } }

.input-with-btn { display: flex; gap: 8px; align-items: stretch; }
.input-with-btn input { flex: 1; min-width: 0; }
.input-with-btn .btn { margin-top: 4px; }
form.input-with-btn input, form.input-with-btn .btn { margin-top: 0; }

.btn-large { min-height: 56px; font-size: 1.1rem; margin-bottom: 12px; }
.scan-start .input-with-btn { margin-top: 12px; }

body.scanning { overflow: hidden; }
.scanner { position: fixed; inset: 0; z-index: 100; background: #000; display: flex; flex-direction: column; }
.scanner video { flex: 1; width: 100%; min-height: 0; object-fit: cover; }
.scanner-frame {
  position: absolute; left: 50%; top: 38%; width: min(75vw, 340px); height: min(45vw, 200px);
  transform: translate(-50%, -50%); border: 3px solid var(--gold); border-radius: 16px;
  box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); pointer-events: none;
}
.scanner-error .scanner-frame { display: none; }
.scanner-ui { background: var(--surface); color: var(--text); padding: 16px 16px calc(16px + var(--safe-bottom)); display: grid; gap: 10px; }
.scanner-hint { margin: 0; text-align: center; }
.scanner-error .scanner-hint { color: var(--danger); }
.scanner-manual { display: flex; gap: 8px; }
.scanner-manual input { margin: 0; flex: 1; }

.head-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
a.list-divider { display: block; color: var(--muted); }

/* QR-Etiketten */
.label-controls textarea { font-family: inherit; }
.labels { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-top: 16px; }
.qr-label { background: #fff; color: #000; border: 1px dashed #bbb; border-radius: 8px; padding: 10px; text-align: center; break-inside: avoid; }
.qr-label svg { width: 100%; height: auto; display: block; }
.qr-label b { display: block; font-size: 1rem; margin-top: 4px; }
.qr-label small { color: #555; }
@media print {
  .topbar, .tabbar, .page-head .btn, .label-controls, .back, .flash { display: none !important; }
  body { background: #fff; padding: 0; }
  .container { max-width: none; padding: 0; }
  .labels { grid-template-columns: repeat(4, 1fr); gap: 6mm; }
  .qr-label { border-color: #999; }
}

/* --- Anmeldung ---------------------------------------------------------- */
.auth-card { max-width: 400px; margin: 6vh auto 0; text-align: center; }
.auth-card .form { text-align: left; margin-top: 1.5rem; }

/* ======================================================================
   iPhone & iPad
   ====================================================================== */

/* Kein grauer Tipp-Schatten, kein Doppeltipp-Zoom, keine Lupe/Kontextmenü auf Bedienelementen */
a, button, input, select, textarea, label, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.tabbar, .topbar, .btn, .chip, .tabs, .segmented, .list-item { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* Gummiband-Effekt oben in Weinrot statt weiß (Statusleiste ist transparent) */
html { background: var(--wine-dark); }
body { min-height: 100vh; min-height: 100dvh; overscroll-behavior-y: none; }

.topbar {
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}
.tabbar {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
}
.tabbar a:active { opacity: .6; }

/* Tastatur offen → untere Leiste ausblenden (springt auf iOS sonst über die Tastatur) */
body.keyboard-open .tabbar { display: none; }
body.keyboard-open { padding-bottom: 16px; }

/* Scanner nutzt die echte Bildschirmhöhe (Safari-Leisten) */
.scanner { height: 100dvh; padding-top: env(safe-area-inset-top); }

/* Ziehen zum Aktualisieren (Home-Bildschirm-App hat keinen Neu-laden-Knopf) */
.ptr {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 56px); z-index: 20;
  width: 36px; height: 36px; margin-left: -18px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 2px 10px rgba(0,0,0,.2);
  display: flex; align-items: center; justify-content: center;
  transform: translateY(var(--ptr-y, -80px)) rotate(var(--ptr-r, 0deg)); transition: transform .2s, opacity .2s;
  pointer-events: none; opacity: 0; /* im Ruhezustand unsichtbar (lag sonst an der Dynamic Island) */
}
.ptr.pulling, .ptr.loading { opacity: 1; }
.ptr.pulling { transition: none; }
.ptr svg { width: 20px; height: 20px; fill: none; stroke: var(--wine); stroke-width: 2.5; stroke-linecap: round; }
.ptr.loading svg { animation: ptr-spin .8s linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }

/* Hinweis „Zum Home-Bildschirm“ (nur in Safari, nicht in der installierten App) */
.ios-install { display: flex; gap: 12px; align-items: flex-start; }
.ios-install svg { flex: none; width: 28px; height: 28px; fill: none; stroke: var(--wine); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ios-install p { margin: 0; }
.ios-install .icon-btn { margin-left: auto; }
.share-glyph { display: inline-block; width: 1.1em; height: 1.1em; vertical-align: -0.15em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* --- iPad ---------------------------------------------------------------- */
@media (min-width: 740px) {
  .container { max-width: 1100px; padding-top: 24px; }
  .stats .stat strong { font-size: 1.8rem; }
  .filters { grid-template-columns: 2fr 1fr 1fr; align-items: center; }
  .filters input[type="search"] { grid-column: auto; }
  .filters .check { grid-column: 1 / -1; }
}
@media (min-width: 740px) and (pointer: coarse) {
  :root { --tabbar-h: 60px; }
  /* Untere Leiste als schwebende „Pille“ wie bei iPadOS-Apps */
  .tabbar {
    left: 50%; right: auto; width: min(560px, 90vw); transform: translateX(-50%);
    bottom: calc(var(--safe-bottom) + 12px); height: var(--tabbar-h); padding: 0;
    border: 1px solid var(--line); border-radius: 99px; box-shadow: 0 6px 24px rgba(0,0,0,.15);
  }
  .tabbar a { flex-direction: row; gap: 6px; font-size: .85rem; }
  .tabbar .tab-add { width: 44px; height: 44px; margin-top: 0; box-shadow: none; }
  body { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 32px); }
}

/* Breites iPad (quer): Listen zweispaltig, Übersicht in zwei Spalten */
@media (min-width: 1000px) {
  .list.cols-2 { display: grid; grid-template-columns: 1fr 1fr; }
  .list.cols-2 > .list-item:nth-child(odd) { border-right: 1px solid var(--line); }
  .list.cols-2 > .list-item:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
  .dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; align-items: start; }
  .wine-detail:has(.label-photo) { grid-template-columns: 320px 1fr; }
}

/* ======================================================================
   Offline-Buchungen, Hinweise (Toasts)
   ====================================================================== */
.sync-badge {
  display: flex; align-items: center; gap: 4px; margin-left: auto;
  background: var(--gold); color: var(--wine-dark); border: 0; border-radius: 99px;
  padding: 4px 10px 4px 6px; font: inherit; font-size: .85rem; font-weight: 700;
}
.sync-badge .icon { width: 18px; height: 18px; }
.sync-badge:not([hidden]) ~ .topbar-scan { margin-left: 0; }

.toast {
  position: fixed; left: 50%; z-index: 300; max-width: min(92vw, 480px);
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
  transform: translate(-50%, 20px); opacity: 0; transition: all .25s;
  padding: 12px 16px; border-radius: 14px; box-shadow: 0 6px 24px rgba(0,0,0,.25);
  background: var(--text); color: var(--surface); font-size: .95rem; text-align: center;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast-success { background: var(--ok); color: #fff; }
.toast-error { background: var(--danger); color: #fff; }
.toast-warn { background: var(--gold); color: var(--wine-dark); }
@media (min-width: 740px) and (pointer: coarse) {
  .toast { bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 28px); }
}

/* Schnell entnehmen */
.quick-take { display: grid; gap: 8px; margin-bottom: 16px; }
.quick-take .btn-primary { min-height: 52px; font-size: 1.05rem; }
.quick-take select { margin: 0; }
.take-btn { flex: none; min-height: 36px; padding: .25rem .6rem; }

/* Kellerplan */
.cellar-grid {
  display: grid; grid-template-columns: 22px repeat(var(--cols), minmax(0, 1fr)); gap: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px;
  overflow-x: auto;
}
.grid-head { font-size: .75rem; font-weight: 700; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.grid-cell {
  aspect-ratio: 1; min-width: 36px; border-radius: 8px; border: 1px dashed var(--line); background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--text);
}
.grid-cell.filled { border-style: solid; background: color-mix(in srgb, var(--gold) 14%, var(--surface)); }
.grid-cell.current { outline: 2px solid var(--wine); outline-offset: 1px; }
.grid-cell b { font-size: .9rem; line-height: 1; }
.dots { display: flex; gap: 2px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; display: block; }

/* Hinweise */
.hints { display: grid; gap: 6px; margin-bottom: 16px; justify-items: start; }
.hint { display: block; padding: 8px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-size: .92rem; }
.hints .hint { width: 100%; }
.hint-warn { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, var(--surface)); }
.hint-late { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.hint-card { display: grid; gap: 6px; padding: 10px; }
.wish-item form { flex: none; }
.wish-item.prio-1 { border-left: 4px solid var(--wine); }
.list-item .notes { display: block; font-style: italic; }

/* Statistik */
.stats-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 560px) { .stats-4 { grid-template-columns: repeat(4, 1fr); } }
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 8px; align-items: center; font-size: .9rem; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 10px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--wine); border-radius: 99px; }
.bar-value { font-weight: 700; white-space: nowrap; }
.bar-value small { font-weight: normal; color: var(--muted); }
.month-chart { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; align-items: end; height: 140px; }
.month { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.month-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.month-bars i { width: 40%; max-width: 12px; border-radius: 3px 3px 0 0; min-height: 1px; }
.month small { font-size: .65rem; color: var(--muted); }
i.in { background: var(--gold); }
i.out { background: var(--wine); }
.legend { display: flex; gap: 8px; align-items: center; color: var(--muted); margin: 10px 0 0; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* Fehlerprotokoll */
.log-list { display: grid; gap: 8px; }
.log-entry { margin: 0; padding: 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: .75rem; white-space: pre-wrap; word-break: break-word; }
code { font-size: .85em; background: var(--bg); padding: 1px 4px; border-radius: 4px; }

/* KI */
.ai-btn { margin-bottom: 8px; border-color: var(--gold); }
.ai-filled { background: color-mix(in srgb, var(--gold) 18%, var(--bg)) !important; border-color: var(--gold) !important; }
.ai-status { margin-top: 0; }

/* Weinkarte */
.winelist-controls .checks { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; }
.winelist-controls h3 { margin-top: 20px; }
.winelist {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 22px; max-width: 760px; margin: 0 auto;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}
.winelist header { text-align: center; margin-bottom: 18px; }
.winelist header h1 { margin: 8px 0 4px; font-size: 2rem; letter-spacing: .02em; }
.winelist h2 {
  justify-content: center; font-size: 1rem; text-transform: uppercase; letter-spacing: .18em;
  color: var(--wine); margin: 26px 0 10px; border-bottom: 1px solid var(--gold); padding-bottom: 6px;
}
.wl-item { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dotted var(--line); break-inside: avoid; }
.wl-main { display: flex; flex-direction: column; }
.wl-producer { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.wl-name { font-size: 1.1rem; font-weight: 600; }
.wl-details { font-size: .85rem; color: var(--muted); font-style: italic; }
.wl-notes { font-size: .85rem; margin-top: 2px; }
.wl-side { text-align: right; display: flex; flex-direction: column; flex: none; }
.wl-vintage { font-size: 1.1rem; font-weight: 600; color: var(--wine); }
.winelist footer { text-align: center; margin-top: 24px; }
body.public-page { padding-bottom: 24px; }
@media print {
  .winelist-controls, .ios-install { display: none !important; }
  .winelist { border: 0; padding: 0; max-width: none; color: #000; background: #fff; }
  .winelist h2 { color: #5a1028; }
}

/* Was trinken wir heute? */
.suggest-item .rank { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--wine); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem; }
.suggest-item small:last-child { white-space: normal; }
.suggest-cta { display: flex; align-items: center; gap: 12px; margin: 16px 0; padding: 14px 16px; border-radius: var(--radius); background: linear-gradient(135deg, var(--wine-dark), var(--wine)); color: #fff; }
.suggest-cta b { display: block; font-size: 1.05rem; }
.suggest-cta span { font-size: .85rem; opacity: .85; }
.suggest-cta .arrow { margin-left: auto; font-size: 1.4rem; }

/* Genuss-Tagebuch */
.review-facts { margin: 14px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.journal-entry { padding: 0; overflow: hidden; }
.journal-photo { width: 100%; max-height: 320px; object-fit: cover; display: block; }
.journal-head { display: flex; gap: 12px; align-items: center; padding: 12px 14px 0; }
.journal-head .grow { display: flex; flex-direction: column; min-width: 0; }
.journal-entry .notes { padding: 6px 14px 14px; margin: 0; }
.journal-entry .journal-head:last-child { padding-bottom: 14px; }
.tasting .thumb { width: 52px; height: 52px; }

/* Bier */
.segmented-3 { grid-template-columns: 1fr 1fr 1fr; }
.cat-bier { background: #d9a23a; }
.chip.cat-bier { border-left-color: #d9a23a; }
.key-mhd b { color: var(--gold); }
.key-mhd.late b { color: var(--danger); }
.hint-ok { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 8%, var(--surface)); }
.pack-select { width: auto; flex: 0 0 auto; margin-top: 4px; }

/* Ratgeber */
.lead { margin-top: -8px; }
.guide-top { display: grid; gap: 12px; }
@media (min-width: 740px) { .guide-top { grid-template-columns: 2fr 1fr; } }
.guide-top .card { margin: 0; }
.guide-top p { margin: 6px 0 0; }
.season-card { background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 18%, var(--surface)), var(--surface)); border-color: var(--gold); }
.food-card ul, .guide ul, .guide ol { padding-left: 20px; margin: 8px 0; display: grid; gap: 4px; }
.food-card h3 { margin-top: 0; }
.suggest-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.suggest-card .list-item { border-bottom: 0; }
.suggest-card .dishes { margin: 0; padding: 0 14px 10px 14px; font-size: .88rem; line-height: 1.4; }
.serve { border-top: 1px dashed var(--line); padding: 8px 14px; }
.serve summary { cursor: pointer; font-size: .88rem; color: var(--wine); list-style: none; }
.serve summary::-webkit-details-marker { display: none; }
.serve[open] summary { margin-bottom: 8px; }
.serve-facts { font-size: .88rem; }
.guide-nav { margin-bottom: 12px; }
.guide details > summary { font-weight: 700; font-size: 1.05rem; cursor: pointer; }
.guide details[open] > summary { margin-bottom: 10px; }
.guide h3 { margin: 16px 0 6px; font-size: .95rem; color: var(--wine); }
.guide-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.guide-table td, .guide-table th { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.guide-table th { font-size: .8rem; color: var(--muted); }
.pairing-grid { display: grid; gap: 10px; }
@media (min-width: 740px) { .pairing-grid { grid-template-columns: 1fr 1fr; } }
.pairing-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.pairing-item ul { font-size: .88rem; margin: 4px 0 0; }
.amount-calc { margin-bottom: 8px; }
.amount-result .stat strong { font-size: 1.4rem; }
.serving-card h3 { margin-top: 0; }
.pairs-with { margin-top: 10px; }

/* Bewertungen */
.key-quality { color: var(--text); border-color: var(--gold); }
.key-quality b { color: var(--gold); }
.rating-line { margin: -8px 0 16px; font-size: .9rem; color: var(--muted); }
.rating-score { flex: none; min-width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: var(--wine-dark); background: color-mix(in srgb, var(--gold) 35%, var(--surface)); font-size: .95rem; }
.ratings-list .grow small { display: block; }
.weights-table input { width: 80px; margin: 0; min-height: 36px; text-align: center; }
.weights-table td { vertical-align: middle; }
.list-quality { color: var(--gold); font-weight: 700; }
.wine-item small.list-quality { display: block; }
.rank-small { flex: none; width: 22px; text-align: center; font-weight: 700; color: var(--muted); }
.wl-ratings { font-size: .8rem; color: var(--gold); font-weight: 600; }

/* Bewertungen online suchen */
.rating-search { margin-bottom: 12px; }
.rating-results { margin-top: 8px; }
.rating-results .actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.rating-hit { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line, rgba(0,0,0,.08)); font-weight: normal; }
.rating-hit:last-child { border-bottom: 0; }
.rating-hit input { margin-top: 4px; flex: none; width: 20px; height: 20px; }
.rating-hit.unverified { opacity: .8; }
.rating-hit .warn { color: var(--danger); font-style: normal; font-size: .85rem; }
