:root {
  --bg: #F6F2EA; --card: #FFFFFF; --ink: #1E1A16; --muted: #786F64; --line: #E6DED2; --soft: #EFE8DC;
  --accent: #A3422A; --accent-ink: #FFFFFF; --accent-soft: #F4E4DC; --ok: #3F6B4E; --danger: #B3261E;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r: 14px; --tab: 64px;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14120F; --card: #1E1B17; --ink: #F1EBE2; --muted: #A1978B; --line: #332E28; --soft: #27231E;
    --accent: #E0805F; --accent-ink: #1A0E09; --accent-soft: #3A251D; --ok: #7FB08F; --danger: #F2827A; color-scheme: dark; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--sans); min-height: 100vh; overscroll-behavior-y: none; }
#app { max-width: 720px; margin: 0 auto; padding: calc(var(--sat) + 12px) 16px calc(var(--tab) + var(--sab) + 24px); }
#app.bare { padding-bottom: 32px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 30px; line-height: 1.15; }
h2 { font-size: 21px; margin: 26px 0 10px; }
h3 { font-size: 17px; }
p { margin: 6px 0; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.between { justify-content: space-between; }
.stack > * + * { margin-top: 10px; }
.hidden { display: none !important; }
svg.i { width: 1em; height: 1em; vertical-align: -0.15em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Kopf */
.top { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-bottom: 10px; }
.top h1 { flex: 1; }
.back { border: 0; background: none; color: var(--ink); font-size: 26px; padding: 6px 8px 6px 0; margin-left: -4px; cursor: pointer; display: flex; }
.iconbtn { border: 1px solid var(--line); background: var(--card); color: var(--ink); width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; cursor: pointer; }

/* Knöpfe & Felder */
.btn { appearance: none; border: 1px solid transparent; background: var(--accent); color: var(--accent-ink); font: 600 16px var(--sans); padding: 12px 18px;
  border-radius: 12px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; text-decoration: none; }
.btn.ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn.quiet { background: none; color: var(--accent); padding: 8px 4px; min-height: 0; }
.btn.danger { background: none; color: var(--danger); border-color: var(--line); }
.btn.block { width: 100%; }
.btn.sm { font-size: 14px; padding: 7px 12px; min-height: 36px; border-radius: 10px; }
.btn:disabled { opacity: .55; }
label.f { display: block; font-size: 14px; font-weight: 600; margin: 14px 0 6px; }
input[type=text], input[type=password], input[type=search], input[type=date], input[type=number], input:not([type]), textarea, select {
  width: 100%; font: 16px var(--sans); color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { min-height: 84px; resize: vertical; }
input[type=date] { min-height: 48px; -webkit-appearance: none; }
.search { position: relative; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 18px; }
.search input { padding-left: 40px; }

/* Karten */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.list { display: grid; gap: 10px; }
.rcard { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; cursor: pointer;
  text-decoration: none; color: inherit; }
.rcard .pic { width: 64px; height: 64px; border-radius: 10px; background: var(--soft) center/cover; flex: none; display: grid; place-items: center; color: var(--muted); font-size: 26px; }
.rcard .t { font-weight: 600; font-size: 16.5px; line-height: 1.25; }
.rcard .m { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.score { font-family: var(--serif); font-weight: 600; font-size: 20px; min-width: 44px; text-align: right; }
.score small { display: block; font: 12px var(--sans); color: var(--muted); }
.rank { font-family: var(--serif); font-size: 24px; width: 30px; text-align: center; color: var(--accent); flex: none; }

/* Chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 7px 13px; font: 500 14px var(--sans); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .n { color: var(--muted); font-size: 12.5px; }
.chip.on .n { color: inherit; opacity: .7; }
.tag { display: inline-block; font-size: 12.5px; padding: 2px 8px; border-radius: 999px; background: var(--soft); color: var(--muted); margin: 2px 4px 0 0; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--soft); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: none; font: 500 14px var(--sans); color: var(--muted); padding: 9px 4px; border-radius: 9px; cursor: pointer; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* Sterne */
.stars { display: inline-flex; gap: 3px; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.star { position: relative; width: var(--s, 30px); height: var(--s, 30px); cursor: pointer; }
.star svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.star .o { fill: none; stroke: var(--line); stroke-width: 1.6; }
.star .fw { position: absolute; inset: 0; overflow: hidden; width: 0; }
.star .fw svg { width: var(--s, 30px); height: var(--s, 30px); fill: var(--accent); stroke: var(--accent); stroke-width: 1.6; }
.stars.ro .star { cursor: default; }
.stars.sm { --s: 15px; gap: 1px; }
.rateline { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; gap: 10px; }
.rateline span { font-size: 15px; }
.rateline .val { width: 28px; text-align: right; font-size: 13px; color: var(--muted); }

/* Balken */
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: 110px 1fr 32px; align-items: center; gap: 10px; font-size: 14px; }
.bar .tr { height: 6px; border-radius: 3px; background: var(--soft); overflow: hidden; }
.bar .tr i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.bar b { font-weight: 600; text-align: right; }

/* Detail */
.hero { margin: 0 -16px 14px; height: 210px; background: var(--soft) center/cover; position: relative; }
.hero .credit { position: absolute; right: 8px; bottom: 6px; font-size: 11px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.bigscore { font-family: var(--serif); font-size: 44px; line-height: 1; font-weight: 600; }
.kv { display: grid; grid-template-columns: 22px 1fr; gap: 8px 10px; font-size: 15px; align-items: start; }
.kv svg { color: var(--muted); margin-top: 3px; }
.kv a { color: var(--ink); }
.hours { font-size: 14px; color: var(--muted); margin: 4px 0 0; padding: 0; list-style: none; }
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
.ate { border-left: 3px solid var(--accent); padding: 4px 0 4px 12px; margin: 10px 0; }
.ate .who { font-weight: 600; }
.dish { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.dish:first-child { border-top: 0; }
.dish .nm { font-weight: 500; }
.price { color: var(--muted); font-size: 14px; white-space: nowrap; }
.thumbs { display: flex; gap: 6px; overflow-x: auto; margin-top: 8px; }
.thumbs img, .thumbs .ph { width: 76px; height: 76px; border-radius: 10px; object-fit: cover; flex: none; background: var(--soft); }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.gallery .ph { position: relative; aspect-ratio: 1; border-radius: 10px; background: var(--soft) center/cover; }
.gallery .ph button { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; cursor: pointer; }
.addph { aspect-ratio: 1; border-radius: 10px; border: 1.5px dashed var(--line); display: grid; place-items: center; color: var(--muted); cursor: pointer; font-size: 26px; background: none; }

/* Besuch-Formular */
.pcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-top: 12px; }
.pcard h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.eat { border-top: 1px solid var(--line); padding: 10px 0 4px; }
.eat .row { align-items: flex-start; }
.eat input { padding: 9px 12px; font-size: 15px; }
.x { border: 0; background: none; color: var(--muted); font-size: 20px; padding: 4px; cursor: pointer; display: grid; place-items: center; }
.sugg { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sugg .chip { font-size: 13.5px; padding: 6px 11px; }

/* Leere Zustände */
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty svg { font-size: 40px; margin-bottom: 8px; color: var(--line); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }

/* Tableiste */
#tabbar { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tab) + var(--sab)); padding-bottom: var(--sab); background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-top: 1px solid var(--line); display: flex; justify-content: center; z-index: 20; }
#tabbar.hidden { display: none; }
#tabbar .in { display: grid; grid-template-columns: repeat(5, 1fr); width: 100%; max-width: 720px; }
#tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 500; }
#tabbar a svg { font-size: 24px; }
#tabbar a.on { color: var(--accent); }
.fab { position: fixed; right: 18px; bottom: calc(var(--tab) + var(--sab) + 16px); width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-size: 26px; box-shadow: 0 6px 18px rgba(0,0,0,.18); cursor: pointer; z-index: 15; }
@media (min-width: 760px) { .fab { right: calc(50% - 360px + 18px); } }

/* Blatt (Bottom-Sheet) */
#veil { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40; opacity: 0; transition: opacity .18s; }
#veil.on { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow: auto; background: var(--bg); border-radius: 18px 18px 0 0; z-index: 41;
  padding: 10px 16px calc(var(--sab) + 20px); transform: translateY(100%); transition: transform .22s ease; max-width: 720px; margin: 0 auto; }
.sheet.on { transform: none; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.sheet h2 { margin-top: 4px; }

#toast { position: fixed; left: 50%; bottom: calc(var(--tab) + var(--sab) + 18px); transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg);
  padding: 11px 16px; border-radius: 12px; font-size: 15px; opacity: 0; pointer-events: none; transition: all .2s; z-index: 60; max-width: calc(100% - 32px); }
#toast.on { opacity: 1; transform: translateX(-50%); }

/* Anmeldung */
.auth { max-width: 420px; margin: 8vh auto 0; }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.brand .logo { width: 48px; height: 48px; border-radius: 13px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 28px; }
.brand h1 { font-size: 34px; }
.sep { text-align: center; color: var(--muted); font-size: 13px; margin: 16px 0; }
.err { color: var(--danger); font-size: 14px; margin-top: 8px; min-height: 1em; }
.spin { width: 22px; height: 22px; border: 2.5px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: sp .8s linear infinite; margin: 30px auto; }
@keyframes sp { to { transform: rotate(360deg); } }
.sk { background: var(--soft); border-radius: var(--r); height: 86px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.section { margin-top: 22px; }
.linklist a, .linklist button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 4px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--ink);
  font: 16px var(--sans); text-align: left; cursor: pointer; text-decoration: none; }
.linklist > :first-child { border-top: 0; }
.linklist .grow { flex: 1; }
.linklist .chev { color: var(--muted); }
.copybox { display: flex; gap: 8px; }
.copybox input { font-size: 14px; }
