:root {
  --yellow: #F7C600;
  --yellow-soft: #FFF4C2;
  --black: #1B1B1B;
  --ink: #232220;
  --muted: #6E6A63;
  --line: #E7E1D3;
  --bg: #F6F3EA;
  --card: #FFFFFF;
  --red: #E4003A;
  --green: #1E8E4E;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 14px rgba(0,0,0,.05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.wrap { max-width: 680px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 440px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; margin: 0; }
a { color: inherit; }
small, .small { font-size: .85em; }
.muted { color: var(--muted); }
.center { text-align: center; }
code { background: #f1ede3; padding: .1em .35em; border-radius: 5px; }

/* Kopf */
.top { background: var(--card); border-bottom: 4px solid var(--yellow); position: sticky; top: 0; z-index: 5; }
.top-in { display: flex; align-items: center; gap: 12px; padding-top: 8px; padding-bottom: 8px; }
.brand img { display: block; height: 52px; width: auto; }
.brand-txt { display: flex; flex-direction: column; }
.brand-txt strong { font-size: 1.15rem; letter-spacing: .01em; }
.brand-txt span { color: var(--muted); font-size: .9rem; }

main { padding-top: 16px; padding-bottom: 32px; }
.card { background: var(--card); border-radius: var(--radius); padding: 18px; margin: 0 0 16px; box-shadow: var(--shadow); }

/* Status */
.status { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); margin: 0 0 16px; background: var(--card); box-shadow: var(--shadow); }
.status strong { display: block; }
.status span { color: var(--muted); font-size: .92rem; }
.status em { font-style: normal; font-weight: 600; color: var(--ink); }
.status .dot { flex: none; width: 12px; height: 12px; border-radius: 50%; margin-top: 5px; }
.status.open .dot { background: var(--green); box-shadow: 0 0 0 4px rgba(30,142,78,.15); }
.status.closed { background: #FFF0F3; }
.status.closed .dot { background: var(--red); }
.card .status { box-shadow: none; border: 1px solid var(--line); }

/* Meldungen */
.msg { padding: 10px 14px; border-radius: 10px; margin: 0 0 16px; }
.msg.ok { background: var(--yellow-soft); }
.msg.err { background: #FFE3EA; color: #8A0024; }

/* Formulare */
.stack { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .95rem; }
label small, legend small { font-weight: 400; color: var(--muted); }
input, select, textarea {
  font: inherit; color: inherit; width: 100%; padding: 11px 12px; border-radius: 10px;
  border: 1.5px solid var(--line); background: #fff; font-weight: 400;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--black); box-shadow: 0 0 0 3px var(--yellow-soft); }
textarea { resize: vertical; font-size: .92rem; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 600; font-size: .95rem; margin-bottom: 8px; padding: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .row2 { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  font: inherit; font-weight: 600; padding: 10px 16px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--black); background: #fff; color: var(--black); text-decoration: none;
}
.btn.primary { background: var(--yellow); border-color: var(--yellow); }
.btn.primary:hover { filter: brightness(.96); }
.btn.big { min-height: 52px; font-size: 1.05rem; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.btn.wa { background: #25D366; border-color: #25D366; color: #08361A; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn-row form { margin: 0; }
.link { background: none; border: 0; padding: 4px; font: inherit; cursor: pointer; text-decoration: underline; }
.link.danger { color: var(--red); }

/* Chips für Sonderwünsche */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; font-weight: 500; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span {
  padding: 9px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; cursor: pointer;
  user-select: none; font-size: .95rem; min-height: 40px; display: inline-flex; align-items: center;
}
.chip input:checked + span { background: var(--black); border-color: var(--black); color: var(--yellow); }
.chip.neg input:checked + span { background: var(--red); border-color: var(--red); color: #fff; }
.chip input:focus-visible + span { box-shadow: 0 0 0 3px var(--yellow); }

.qty { display: flex; align-items: stretch; }
.qty button { width: 46px; font-size: 1.3rem; border: 1.5px solid var(--line); background: #fff; cursor: pointer; }
.qty button:first-child { border-radius: 10px 0 0 10px; }
.qty button:last-child { border-radius: 0 10px 10px 0; }
.qty input { border-radius: 0; text-align: center; border-left: 0; border-right: 0; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Gericht hinzufügen */
.add { position: relative; border: 2px solid var(--yellow); scroll-margin-top: 90px; }
.add .close { position: absolute; right: 10px; top: 6px; font-size: 1.8rem; text-decoration: none; color: var(--muted); padding: 4px 10px; }
.eyebrow { margin: 0 0 4px; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* Listen */
.lines { list-style: none; padding: 0; margin: 0; }
.lines > li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.lines > li > div:first-child { display: flex; flex-direction: column; }
.lines .right { display: flex; flex-direction: column; align-items: flex-end; text-align: right; white-space: nowrap; }
.lines.summary > li { padding: 8px 0; }
.total { display: flex; justify-content: space-between; font-size: 1.1rem; margin: 12px 0 6px; }
#meine, #karte, #sammel, #abrechnung, #einstellungen { scroll-margin-top: 90px; }

/* Speisekarte */
.search { position: sticky; top: 76px; z-index: 4; padding: 0 0 12px; background: linear-gradient(var(--bg) 80%, transparent); }
.search input { border-radius: 999px; padding-left: 16px; background: #fff; }
.cat { background: var(--card); border-radius: var(--radius); margin: 0 0 10px; box-shadow: var(--shadow); overflow: hidden; }
.cat > summary, .open-cat > h3 { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; cursor: pointer; list-style: none; }
.cat > summary::-webkit-details-marker { display: none; }
.cat > summary::after { content: "▾"; color: var(--muted); margin-left: 8px; }
.cat[open] > summary::after { content: "▴"; }
.cat > summary h3 { flex: 1; }
.open-cat > h3 { background: var(--yellow); }
.cat-note { margin: -6px 18px 6px; }
.items { display: flex; flex-direction: column; }
.item { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); text-decoration: none; }
.item:hover, .item:focus-visible { background: var(--yellow-soft); outline: none; }
.item .no { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.item .nm { display: flex; flex-direction: column; }
.item .nm small { color: var(--muted); }
.item .pr { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.searching .cat { display: block; }
.searching .cat > summary { pointer-events: none; }
.hide { display: none !important; }

.people { list-style: none; padding: 0; margin: 0; }
.people li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; }
.badge { display: inline-block; min-width: 1.6em; padding: 0 .45em; border-radius: 999px; background: var(--yellow); font-size: .8em; text-align: center; vertical-align: middle; }

/* Leiter-Bereich */
.head-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.head-row h1 { margin: 0; font-size: 1.35rem; }
.inline select { width: auto; padding: 8px 10px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stats div { background: var(--bg); border-radius: 10px; padding: 10px; text-align: center; }
.stats strong { display: block; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.stats span { color: var(--muted); font-size: .85rem; }
.persons { list-style: none; padding: 0; margin: 0; }
.persons > li { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.persons > li.paid { background: #F2FAF5; border-color: #CDE8D8; }
.p-head { display: flex; align-items: center; gap: 10px; }
.p-head strong { flex: 1; }
.p-head > span { white-space: nowrap; font-variant-numeric: tabular-nums; }
.p-head form { margin: 0; }
.persons ul { list-style: none; padding: 6px 0 0; margin: 0; font-size: .92rem; }
.persons ul li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; }
.persons ul .right { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.persons ul form { margin: 0; }
.pill { border: 0; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; min-height: 34px; }
.pill.no { background: #FFE3EA; color: #8A0024; }
.pill.yes { background: #D3F0DE; color: #0F5A2F; }
.copyline { display: flex; gap: 8px; margin-bottom: 16px; }
.copyline input { font-size: .9rem; }

/* Fuß */
.foot { padding: 24px 0 40px; color: var(--muted); font-size: .88rem; text-align: center; }
.foot img { height: 56px; width: auto; margin-bottom: 8px; }
.foot p { margin: 6px 0; }

.gate main { padding-top: 32px; }

.sub { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 2px; }
.who { display: inline-block; margin-left: 6px; padding: 1px 9px; border-radius: 999px; background: var(--yellow); font-size: .85em; }
fieldset[hidden] { display: none; }
