:root {
  --bg: #f6f7f8; --card: #fff; --fg: #1a1d21; --muted: #6b7280; --line: #e5e7eb;
  --accent: #0f766e; --accent-fg: #fff; --warn: #b45309; --warn-bg: #fef3c7;
  --danger: #b91c1c; --ok: #15803d; --radius: 12px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1113; --card: #1a1d21; --fg: #e8eaed; --muted: #9aa0a6; --line: #2c3036;
          --accent: #14b8a6; --accent-fg: #062b28; --warn: #fbbf24; --warn-bg: #3a2c08; --danger: #f87171; --ok: #4ade80; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  padding-bottom: calc(72px + var(--safe-b)); }
a { color: var(--accent); text-decoration: none; }
h2 { font-size: 1.35rem; margin: .4rem 0 .6rem; }
h3 { font-size: 1.05rem; margin: 1.2rem 0 .5rem; }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); }

header { position: sticky; top: 0; z-index: 10; background: var(--card); border-bottom: 1px solid var(--line);
  padding: calc(10px + var(--safe-t)) 16px 10px; }
.brand { font-weight: 700; color: var(--fg); }
main { max-width: 720px; margin: 0 auto; padding: 12px 16px; }

.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: flex; background: var(--card);
  border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 8px 0 6px; color: var(--muted); font-size: .75rem; }
.tabs a .ic { font-size: 1.3rem; line-height: 1.2; }
.tabs a.active { color: var(--accent); font-weight: 600; }
body.nologin .tabs { display: none; }

.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; margin-bottom: 10px; color: var(--fg); }
.card.center { text-align: center; padding: 24px; }
.card.error { border-color: var(--danger); color: var(--danger); }
.narrow { max-width: 380px; margin: 10vh auto; }

.row { display: flex; align-items: center; }
.row.between { justify-content: space-between; gap: 8px; }
.row.gap { gap: 8px; }
.row.wrap { flex-wrap: wrap; gap: 6px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--fg);
  font: inherit; font-weight: 600; cursor: pointer; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: .9rem; }
.btn.big { flex: 1; min-height: 56px; font-size: 1.05rem; }
.btn.block { width: 100%; margin-top: 12px; }
.btn:disabled { opacity: .5; }
.btn.done { color: var(--ok); border-color: var(--ok); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; margin: 12px 0; }
.ph { position: relative; }
.ph img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; background: var(--line); }
.ph select { width: 100%; margin-top: 4px; font-size: 16px; padding: 4px; }
.ph .x { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0;
  background: rgba(0,0,0,.6); color: #fff; font-size: 14px; }
.mini { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; background: var(--line); }

.list { display: flex; flex-direction: column; }
.card.item { display: flex; gap: 12px; padding: 8px; }
.thumb { flex: 0 0 76px; height: 76px; }
.thumb img { width: 76px; height: 76px; object-fit: cover; border-radius: 8px; }
.noimg { display: flex; width: 76px; height: 76px; align-items: center; justify-content: center; background: var(--line); border-radius: 8px; }
.info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.info b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info .price { margin-left: auto; }

.badge { display: inline-block; font-size: .75rem; padding: 2px 8px; border-radius: 99px; background: var(--line); color: var(--fg); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.pkg { background: var(--accent); color: var(--accent-fg); }
.badge.s-vorbereitet { background: #dbeafe; color: #1e40af; }
.badge.s-eingestellt { background: #dcfce7; color: #166534; }
.badge.s-verkauft { background: #e5e7eb; color: #374151; text-decoration: line-through; }

.seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 8px; }
.seg button { flex: 1; min-height: 40px; border: 0; background: var(--card); color: var(--fg); font: inherit; font-size: .85rem; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent); color: var(--accent-fg); font-weight: 600; }

section { margin-bottom: 8px; }
.copy { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; }
.copy .val { font-weight: 600; margin-top: 4px; }
.copy pre { white-space: pre-wrap; word-break: break-word; font: inherit; margin: 6px 0 0; }
.lbl { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.prices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.prices > div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px;
  display: flex; flex-direction: column; gap: 4px; }
.prices b { font-size: 1.3rem; }

.form { display: flex; flex-direction: column; gap: 10px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); }
/* 16px verhindert Auto-Zoom auf iOS */
input, select, textarea { font: inherit; font-size: 16px; color: var(--fg); background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px; width: 100%; }
.qrow { margin-top: 10px; }
.qrow label { display: block; margin-bottom: 4px; }
.qrow input { flex: 1; }
.card.q > a { color: var(--fg); }

.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; margin-bottom: 10px; }
.filters select { padding: 8px; }
details summary { cursor: pointer; padding: 4px 0; }
.sugg { border-top: 1px solid var(--line); padding: 10px 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

.spinner { width: 32px; height: 32px; margin: 0 auto 10px; border: 3px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 1s linear infinite; }
.spinner.sm { width: 16px; height: 16px; margin: 0; border-width: 2px; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

#toast { position: fixed; left: 50%; bottom: calc(84px + var(--safe-b)); transform: translateX(-50%) translateY(20px);
  background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none;
  transition: .2s; z-index: 20; max-width: 90vw; }
#toast.show { opacity: 1; transform: translateX(-50%); }
