/* Einkaufsplaner – Optik angelehnt an das Haus-Panel (schwarz, dunkle iOS-Karten, große fette Titel, Pillen-Tabs),
   eigene Ideen: der Esstisch als Bild oben, Gerichte leuchten in ihrer Farbe, Einkauf als Regler-Spur. */
:root {
  --bg: #000; --card: #1c1c1e; --card-2: #2c2c2e; --card-3: #3a3a3c;
  --fg: #fff; --mute: rgba(235,235,245,.62); --faint: rgba(235,235,245,.32); --line: rgba(255,255,255,.08);
  --ok: #30d158; --alert: #ff453a; --offer: #ffd60a; --r: 22px;
  --nina: #ff6b8b; --helge: #64d2ff; --henri: #ff9f0a; --jonah: #30d158; --malte: #bf5af2; --levi: #ffd60a;
  --aldi: #3d7bfd; --edeka: #f5c400; --hoffmann: #ff453a; --sonst: #8e8e93;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body { font: 16px/1.35 -apple-system, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums; overscroll-behavior-y: none; -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: var(--fg); }
svg { display: block; }
.hidden { display: none !important; }

/* ───────── Gerüst ───────── */
#app { min-height: 100vh; padding: calc(var(--safe-t) + 10px) 16px calc(var(--safe-b) + 96px); max-width: 720px; margin: 0 auto; }
.head { display: flex; align-items: flex-end; gap: 12px; padding: 6px 2px 14px; }
.head__t { flex: 1; min-width: 0; }
.head__kicker { font-size: 13px; font-weight: 600; color: var(--mute); text-transform: uppercase; letter-spacing: .06em; }
.head__title { font-size: 34px; font-weight: 800; letter-spacing: -.8px; line-height: 1.05; }
.me { width: 38px; height: 38px; border-radius: 50%; font-weight: 700; font-size: 15px; color: #000; display: grid; place-items: center; flex-shrink: 0; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 8px 10px calc(var(--safe-b) + 8px);
  background: rgba(0,0,0,.82); -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6); border-top: 1px solid var(--line); }
.tabbar__in { display: flex; max-width: 520px; margin: 0 auto; background: var(--card); border-radius: 26px; padding: 4px; }
.tb { flex: 1; height: 50px; border-radius: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--mute); font-size: 11px; font-weight: 600; transition: background-color .2s, color .2s; position: relative; }
.tb svg { width: 22px; height: 22px; }
.tb.is-active { background: var(--card-3); color: var(--fg); }
.tb__dot { position: absolute; top: 6px; right: calc(50% - 18px); min-width: 16px; height: 16px; border-radius: 8px; background: var(--alert);
  color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }

/* ───────── Bausteine ───────── */
.card { background: var(--card); border-radius: var(--r); padding: 16px; margin-bottom: 12px; position: relative; overflow: hidden; }
.card--flat { padding: 0; }
.sect { font-size: 13px; font-weight: 700; color: var(--mute); text-transform: uppercase; letter-spacing: .06em; margin: 22px 4px 8px; display: flex; align-items: center; gap: 8px; }
.sect__r { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 600; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); min-height: 56px; }
.row:first-child { border-top: 0; }
.row__main { flex: 1; min-width: 0; }
.row__t { font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; }
.row__s { font-size: 13px; color: var(--mute); margin-top: 1px; }
.row__r { text-align: right; font-size: 15px; font-weight: 600; white-space: nowrap; }
.by { font-size: 10.5px; color: var(--faint); margin-top: 2px; letter-spacing: .01em; }
.by b { font-weight: 600; }
.muted { color: var(--mute); }
.tiny { font-size: 12px; color: var(--mute); }
.empty { text-align: center; color: var(--mute); padding: 26px 16px; font-size: 15px; }

.btn { height: 46px; padding: 0 18px; border-radius: 23px; background: var(--card-2); font-weight: 650; font-size: 16px; display: inline-flex;
  align-items: center; justify-content: center; gap: 8px; transition: transform .12s, background-color .2s; white-space: nowrap; }
.btn:active { transform: scale(.96); }
.btn--pri { background: #fff; color: #000; }
.btn--warn { color: var(--alert); }
.btn--sm { height: 34px; padding: 0 14px; font-size: 14px; border-radius: 17px; }
.btn--block { display: flex; width: 100%; }
.btn svg { width: 18px; height: 18px; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; background: var(--card-2); display: grid; place-items: center; flex-shrink: 0; }
.icon-btn svg { width: 18px; height: 18px; }

.pills { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 4px; }
.pills::-webkit-scrollbar { display: none; }
.pill { height: 34px; padding: 0 14px; border-radius: 17px; background: var(--card); color: var(--mute); font-size: 14px; font-weight: 600;
  white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; transition: background-color .2s, color .2s; }
.pill.is-on { background: var(--card-3); color: var(--fg); }
.pill i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.av { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 750; color: #000; flex-shrink: 0; }
.avs { display: flex; }
.avs .av { width: 22px; height: 22px; font-size: 10.5px; margin-left: -5px; box-shadow: 0 0 0 2px var(--card); }
.avs .av:first-child { margin-left: 0; }
.store-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex-shrink: 0; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--offer); color: #000; vertical-align: 1px; }
.badge--wish { background: rgba(255,159,10,.18); color: var(--henri); }
.badge--soft { background: var(--card-3); color: var(--mute); }

/* Eingaben */
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 13px; color: var(--mute); font-weight: 600; margin: 0 4px 6px; }
.inp { width: 100%; height: 48px; border-radius: 14px; border: 0; background: var(--card-2); padding: 0 14px; font-size: 17px; outline: none; -webkit-appearance: none; appearance: none; }
textarea.inp { height: auto; min-height: 90px; padding: 12px 14px; resize: none; line-height: 1.4; }
.inp:focus { box-shadow: 0 0 0 2px rgba(255,255,255,.5); }
.inp--sm { height: 40px; font-size: 16px; border-radius: 12px; }
select.inp { background-image: linear-gradient(45deg, transparent 50%, var(--mute) 50%), linear-gradient(135deg, var(--mute) 50%, transparent 50%);
  background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stepper { display: inline-flex; align-items: center; background: var(--card-2); border-radius: 20px; height: 40px; }
.stepper button { width: 40px; height: 40px; font-size: 22px; font-weight: 500; }
.stepper b { min-width: 30px; text-align: center; font-size: 17px; }

/* ───────── Woche ───────── */
.weeknav { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.weeknav__t { flex: 1; text-align: center; font-weight: 700; font-size: 15px; }
.weeknav__t small { display: block; color: var(--mute); font-weight: 500; font-size: 12px; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-bottom: 14px; }
.day { height: 64px; border-radius: 18px; background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; transition: background-color .2s, transform .12s; position: relative; }
.day:active { transform: scale(.94); }
.day__w { font-size: 11px; color: var(--mute); font-weight: 600; }
.day__d { font-size: 19px; font-weight: 750; }
.day__dots { display: flex; gap: 2px; height: 6px; margin-top: 2px; }
.day__dots i { width: 6px; height: 6px; border-radius: 50%; }
.day.is-sel { background: #fff; color: #000; }
.day.is-sel .day__w { color: rgba(0,0,0,.55); }
.day.is-today::after { content: ''; position: absolute; top: 6px; right: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--alert); }

/* Der Esstisch */
.table-card { background: radial-gradient(120% 90% at 50% 0%, #26262a 0%, var(--card) 60%); padding: 14px 10px 10px; }
.table-card__h { display: flex; align-items: baseline; padding: 0 8px 4px; }
.table-card__h b { font-size: 22px; font-weight: 800; letter-spacing: -.3px; }
.table-card__h span { margin-left: auto; font-size: 13px; color: var(--mute); }
.esstisch { width: 100%; height: auto; }
.esstisch .chair { cursor: pointer; transition: opacity .2s; }
.esstisch .chair rect { transition: fill .25s, stroke .25s; }
.esstisch text { font-family: -apple-system, "SF Pro Text", Helvetica, Arial, sans-serif; }
.slotbar { display: flex; gap: 6px; justify-content: center; margin-top: 4px; flex-wrap: wrap; }
.hint { text-align: center; font-size: 12px; color: var(--faint); margin-top: 6px; }

/* Gericht-Karten (leuchten in ihrer Farbe – wie die Lampenkarten im Panel) */
.dcard { position: relative; border-radius: var(--r); overflow: hidden; background: var(--card); color: #fff; display: flex; min-height: 92px; margin-bottom: 10px; transition: transform .14s; }
.dcard:active { transform: scale(.98); }
.dcard__glow { position: absolute; inset: 0; opacity: .9; }
.dcard__img { width: 92px; flex-shrink: 0; background: var(--card-2) center/cover no-repeat; position: relative; }
.dcard__body { position: relative; flex: 1; min-width: 0; padding: 12px 14px; display: flex; flex-direction: column; }
.dcard__k { font-size: 12px; font-weight: 700; opacity: .7; text-transform: uppercase; letter-spacing: .05em; }
.dcard__n { font-size: 18px; font-weight: 750; letter-spacing: -.2px; line-height: 1.2; margin-top: 1px; }
.dcard__f { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 8px; }
.dcard .by { color: rgba(255,255,255,.55); }
.dcard.is-light { color: #111; }
.dcard.is-light .by { color: rgba(0,0,0,.5); }
.dcard.is-light .avs .av { box-shadow: 0 0 0 2px rgba(255,255,255,.6); }
.dgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dtile { position: relative; border-radius: var(--r); overflow: hidden; height: 170px; background: var(--card); display: flex; flex-direction: column; justify-content: flex-end; padding: 12px; color: #fff; transition: transform .14s; text-align: left; }
.dtile:active { transform: scale(.97); }
.dtile__bg { position: absolute; inset: 0; background: center/cover no-repeat; }
.dtile__shade { position: absolute; inset: 0; }
.dtile__n { position: relative; font-size: 17px; font-weight: 750; line-height: 1.15; letter-spacing: -.2px; }
.dtile__m { position: relative; display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; opacity: .85; }
.dtile__likes { position: absolute; top: 10px; left: 10px; display: flex; gap: 3px; }
.dtile__likes .av { width: 20px; height: 20px; font-size: 10px; }
.dtile__likes .av.no { background: rgba(0,0,0,.55) !important; color: #fff; box-shadow: 0 0 0 2px #ff453a; }

.dayblock { margin-bottom: 16px; }
.dayblock__h { display: flex; align-items: baseline; gap: 8px; margin: 0 4px 8px; }
.dayblock__h b { font-size: 20px; font-weight: 800; letter-spacing: -.3px; }
.dayblock__h span { color: var(--mute); font-size: 14px; }
.dayblock__h .sp { flex: 1; }
.addrow { display: flex; gap: 8px; }
.addbtn { flex: 1; height: 48px; border-radius: 16px; border: 1.5px dashed rgba(255,255,255,.16); color: var(--mute); font-weight: 600; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.addbtn svg { width: 16px; height: 16px; }

/* ───────── Einkauf ───────── */
.track { position: relative; height: 54px; border-radius: 18px; background: rgba(255,255,255,.09); overflow: hidden; margin-bottom: 12px; }
.track__fill { position: absolute; top: 0; bottom: 0; left: 0; background: rgba(255,255,255,.9); border-radius: 0; transition: width .5s cubic-bezier(.3,.7,.4,1); }
.track__l { position: absolute; left: 16px; top: 0; line-height: 54px; font-weight: 700; font-size: 16px; mix-blend-mode: difference; color: #fff; }
.track__r { position: absolute; right: 16px; top: 0; line-height: 54px; font-weight: 700; font-size: 16px; mix-blend-mode: difference; color: #fff; }
.stores { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; margin-bottom: 4px; }
.scard { border-radius: 18px; padding: 12px 14px; background: var(--card); position: relative; overflow: hidden; text-align: left; transition: transform .14s; }
.scard:active { transform: scale(.97); }
.scard::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.scard.is-on { background: var(--c); color: #000; }
.scard.is-on::before { display: none; }
.scard__n { font-size: 13px; font-weight: 700; opacity: .75; }
.scard__v { font-size: 21px; font-weight: 800; letter-spacing: -.4px; margin-top: 2px; }
.scard__s { font-size: 11.5px; opacity: .65; }
.check { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--card-3); display: grid; place-items: center; flex-shrink: 0; transition: background-color .2s, border-color .2s, transform .12s; }
.check:active { transform: scale(.85); }
.check svg { width: 16px; height: 16px; opacity: 0; color: #000; }
.check.is-on { background: var(--ok); border-color: var(--ok); }
.check.is-on svg { opacity: 1; }
.li.is-done .row__t { color: var(--faint); text-decoration: line-through; }
.li.is-done .row__r { color: var(--faint); }
.price { font-size: 15px; font-weight: 650; }
.stand { font-size: 10.5px; color: var(--faint); font-weight: 500; }
.thumb { width: 44px; height: 44px; border-radius: 12px; background: #fff center/contain no-repeat; flex-shrink: 0; }
.thumb--dark { background-color: var(--card-2); background-size: cover; }

/* ───────── Brett ───────── */
.composer { background: var(--card); border-radius: var(--r); padding: 12px; margin-bottom: 14px; }
.composer textarea { width: 100%; border: 0; outline: none; background: transparent; resize: none; font-size: 17px; min-height: 52px; padding: 4px 4px 8px; }
.composer__f { display: flex; align-items: center; gap: 8px; }
.seg { display: inline-flex; background: var(--card-2); border-radius: 18px; padding: 3px; }
.seg button { height: 30px; padding: 0 12px; border-radius: 15px; font-size: 14px; font-weight: 600; color: var(--mute); }
.seg button.is-on { background: var(--card-3); color: var(--fg); }
.notes { columns: 2; column-gap: 10px; }
.note { break-inside: avoid; border-radius: 20px; padding: 14px 14px 12px; margin-bottom: 10px; position: relative; background: var(--card);
  border-top: 4px solid var(--c); display: block; }
.note__k { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--c); }
.note__t { font-size: 16px; font-weight: 550; margin: 4px 0 8px; white-space: pre-wrap; word-break: break-word; line-height: 1.3; }
.note__a { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.note.is-done { opacity: .45; }

/* ───────── Sheets ───────── */
.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; animation: fade .18s ease-out; }
.sheet__p { width: 100%; max-width: 720px; margin: 0 auto; max-height: calc(100vh - var(--safe-t) - 18px); background: #161618; border-radius: 28px 28px 0 0;
  display: flex; flex-direction: column; animation: rise .28s cubic-bezier(.2,.8,.3,1); padding-bottom: var(--safe-b); }
.sheet--full .sheet__p { height: calc(100vh - var(--safe-t) - 10px); }
.sheet__h { display: flex; align-items: center; gap: 10px; padding: 16px 16px 10px; }
.sheet__h b { flex: 1; font-size: 20px; font-weight: 800; letter-spacing: -.3px; }
.sheet__b { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 16px 18px; flex: 1; overscroll-behavior: contain; }
.sheet__f { padding: 10px 16px 14px; border-top: 1px solid var(--line); display: flex; gap: 8px; }
.sheet__f .btn { flex: 1; }
.grab { width: 38px; height: 5px; border-radius: 3px; background: var(--card-3); margin: 8px auto 0; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { transform: translateY(60px); opacity: 0; } to { transform: none; opacity: 1; } }

.toast { position: fixed; left: 50%; bottom: calc(var(--safe-b) + 92px); transform: translateX(-50%); background: #fff; color: #000; font-weight: 650;
  padding: 11px 18px; border-radius: 22px; z-index: 90; font-size: 15px; animation: rise .25s; max-width: 90vw; text-align: center; }
.toast.is-err { background: var(--alert); color: #fff; }

/* ───────── Anmeldung ───────── */
.login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: calc(var(--safe-t) + 20px) 22px calc(var(--safe-b) + 30px); max-width: 480px; margin: 0 auto; }
.login h1 { font-size: 38px; font-weight: 850; letter-spacing: -1px; margin: 18px 0 6px; line-height: 1.05; }
.login p { color: var(--mute); margin: 0 0 22px; font-size: 16px; }
.people { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.person { height: 108px; border-radius: 24px; background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-weight: 700; transition: transform .14s, background-color .2s; }
.person:active { transform: scale(.95); }
.person .av { width: 46px; height: 46px; font-size: 20px; }
.person.is-on { background: var(--c); color: #000; }
.person.is-on .av { background: #000 !important; color: var(--c); }
.keyinp { text-align: center; letter-spacing: .18em; font-size: 26px; font-weight: 700; height: 64px; text-transform: uppercase; font-family: ui-monospace, Menlo, monospace; }

/* ───────── Assistent ───────── */
.wiz-q { font-size: 28px; font-weight: 850; letter-spacing: -.6px; line-height: 1.1; margin: 6px 2px 4px; }
.wiz-s { color: var(--mute); margin: 0 2px 16px; font-size: 15px; }
.wiz-steps { display: flex; gap: 4px; padding: 0 16px; }
.wiz-steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--card-3); transition: background-color .3s; }
.wiz-steps i.on { background: #fff; }
.sugg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.sugg .dtile { height: 120px; }
.sugg .dtile.is-on { box-shadow: 0 0 0 3px #fff inset; }
.chairs { display: flex; gap: 6px; flex-wrap: wrap; }
.chairbtn { height: 40px; padding: 0 12px 0 6px; border-radius: 20px; background: var(--card-2); display: inline-flex; align-items: center; gap: 7px; font-weight: 650; font-size: 15px; transition: background-color .2s, color .2s; }
.chairbtn .av { width: 28px; height: 28px; }
.chairbtn.is-on { background: var(--c); color: #000; }
.chairbtn.is-on .av { background: #000 !important; color: var(--c); }

/* Kosten */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 10px; }
.bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; min-width: 0; }
.bar__v { width: 100%; border-radius: 8px 8px 4px 4px; background: rgba(255,255,255,.85); min-height: 3px; position: relative; }
.bar__v--est { background: rgba(255,255,255,.22); }
.bar__l { font-size: 10.5px; color: var(--mute); white-space: nowrap; }
.bar__n { font-size: 10.5px; font-weight: 700; white-space: nowrap; }

.mailframe { width: 100%; height: 60vh; border: 0; border-radius: 16px; background: #f2f2f7; }
.coupon-bc { background: #fff; border-radius: 12px; padding: 10px; margin-top: 8px; }
.coupon-bc img { width: 100%; height: 70px; object-fit: contain; image-rendering: pixelated; }
