/* Selbst gehostete Schriften (SIL Open Font License) – keine Verbindung zu Google beim Seitenaufruf */
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/atkinson-hyperlegible-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/atkinson-hyperlegible-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/bricolage-grotesque-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/bricolage-grotesque-latin-700-normal.woff2) format("woff2"); }

:root {
  --ink: #17313a;
  --ink-2: #4d6670;
  --paper: #eef3f2;
  --card: #fff;
  --line: #d3dedc;
  --add: #1f7a5a;
  --use: #2f64a3;
  --list: #a8641a;
  --late: #b83a32;
  --soon: #d18c12;
  --ok: #2c9a6f;
  --r: 14px;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --brand: var(--ink);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 17px/1.45 var(--body);
  padding-bottom: calc(84px + var(--safe-b));
}
a { color: var(--use); }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: 1.9rem; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.25rem; font-weight: 700; margin-top: 1.8rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
small, .muted { color: var(--ink-2); }
:focus-visible { outline: 3px solid var(--use); outline-offset: 2px; }

.top {
  display: flex; align-items: baseline; gap: .75rem;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 18px 12px;
  background: var(--brand); color: #fff;
}
.brand { font-family: var(--display); font-weight: 700; font-size: 1.25rem; color: #fff; text-decoration: none; }
.hh { color: #a9c3c9; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wrap { max-width: 720px; margin: 0 auto; padding: 18px 16px 24px; }

.notice { background: #fff; border-left: 4px solid var(--add); padding: .7rem .9rem; border-radius: 6px; }
.error { background: #fff; border-left: 4px solid var(--late); padding: .7rem .9rem; border-radius: 6px; }

/* Drei Handgriffe – das Herz der Startseite */
.modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 8px; }
.mode {
  display: flex; flex-direction: column; justify-content: flex-end; gap: 2px;
  min-height: 108px; padding: 12px; border-radius: var(--r); color: #fff; text-decoration: none;
  font-family: var(--display); font-weight: 700; font-size: clamp(.85rem, 3.8vw, 1.1rem); line-height: 1.1;
  hyphens: auto; -webkit-hyphens: auto;
}
.mode small { font-family: var(--body); font-weight: 400; font-size: .8rem; color: rgba(255,255,255,.82); }
.mode svg { width: 28px; height: 28px; margin-bottom: auto; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.m-add { background: var(--add); } .m-consume { background: var(--use); } .m-list { background: var(--list); }

/* Bestandszeilen mit Frische-Balken */
.items { display: flex; flex-direction: column; gap: 6px; }
.item {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: baseline;
  width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 12px;
  position: relative; overflow: hidden;
}
.item-main { min-width: 0; }
.item-name { font-weight: 700; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.item-brand { color: var(--ink-2); font-size: .88rem; }
.item-when { font-size: .92rem; font-weight: 700; white-space: nowrap; }
.item-meta { grid-column: 1 / -1; color: var(--ink-2); font-size: .85rem; }
.bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: #e6eceb; }
.bar i { display: block; height: 100%; background: var(--ok); }
.f-soon .bar i { background: var(--soon); } .f-soon .item-when { color: #9a6508; }
.f-late .bar i { background: var(--late); } .f-late .item-when { color: var(--late); }
.f-none .bar i { background: #b9c7c5; }

.group-title { display: flex; justify-content: space-between; align-items: baseline; }
.group-title a { font-size: .95rem; }
.empty { background: var(--card); border: 1px dashed var(--line); border-radius: 10px; padding: 16px; color: var(--ink-2); }

.places { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.place {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px;
  text-decoration: none; color: var(--ink); display: flex; flex-direction: column;
}
.place b { font-family: var(--display); font-size: 1.05rem; }
.place span { color: var(--ink-2); font-size: .88rem; }
.place.k-fridge { border-top: 4px solid #6aa6c9; } .place.k-freezer { border-top: 4px solid #9bc3dd; }
.place.k-cabinet { border-top: 4px solid #b89a6e; } .place.k-cellar { border-top: 4px solid #7d7a70; }
.place.k-other { border-top: 4px solid #aab; }

.waste { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.waste-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: #e6eceb; margin: 8px 0; }
.waste-bar i { background: var(--ok); } .waste-bar em { background: var(--late); }

/* Formulare & Knöpfe */
label { display: block; font-weight: 700; margin: 12px 0 4px; font-size: .95rem; }
label.check { display: flex; gap: 10px; align-items: center; font-weight: 400; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 12px; min-height: 48px;
}
input[type=checkbox] { width: 24px; height: 24px; min-height: 0; accent-color: var(--add); flex: none; }
input:focus, select:focus { border-color: var(--use); outline: none; }
.hint { color: var(--ink-2); font-size: .85rem; margin-top: 4px; font-weight: 400; }
.row { display: flex; gap: 8px; align-items: flex-end; }
.row > * { flex: 1; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 0 18px; border-radius: 10px; border: 0; cursor: pointer;
  font: 700 1rem var(--body); background: var(--ink); color: #fff; text-decoration: none;
}
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn.add { background: var(--add); } .btn.use { background: var(--use); } .btn.list { background: var(--list); }
.btn.danger { background: var(--late); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: .9rem; }
.btn.block { width: 100%; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.btns .btn { flex: 1 1 140px; }

.qty { display: flex; align-items: center; gap: 8px; }
.qty button { width: 48px; height: 48px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; font-size: 1.4rem; cursor: pointer; }
.qty input { text-align: center; width: 80px; flex: none; }

/* Bottom Sheet */
.sheet {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px;
  border-radius: 18px 18px 0 0; background: var(--paper); color: var(--ink);
  max-height: 92vh;
}
.sheet::backdrop { background: rgba(10, 25, 30, .45); }
.sheet[open] { animation: up .18s ease-out; }
@keyframes up { from { transform: translateY(30px); opacity: .6; } }
.sheet-in { padding: 18px 18px calc(18px + var(--safe-b)); }
.sheet-head { display: flex; gap: 12px; align-items: center; margin-bottom: 4px; }
.sheet-head img { width: 56px; height: 56px; object-fit: contain; background: #fff; border-radius: 8px; border: 1px solid var(--line); }
.sheet-head h3 { margin: 0; font-size: 1.2rem; }
.sheet-close { margin-left: auto; background: none; border: 0; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--ink-2); padding: 8px; }
.src { font-size: .85rem; color: var(--ink-2); margin-top: 4px; }
.src.code { color: var(--add); font-weight: 700; }

/* Bottom-Navigation */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: #fff; border-top: 1px solid var(--line); padding-bottom: var(--safe-b);
}
.tabs a {
  display: flex; flex-direction: column; align-items: center; gap: 2px; position: relative;
  padding: 6px 0 8px; font-size: .75rem; white-space: nowrap; color: var(--ink-2); text-decoration: none;
}
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a.on { color: var(--ink); font-weight: 700; }
.tabs .scan-tab { color: var(--ink); }
.tabs .scan-tab svg { background: var(--brand); stroke: #fff; border-radius: 14px; width: 52px; height: 34px; padding: 6px 14px; margin-top: -4px; box-sizing: border-box; }
.badge { position: absolute; top: 4px; left: calc(50% + 6px); background: var(--list); color: #fff; font-size: .7rem; border-radius: 9px; padding: 1px 6px; }

/* Toast */
#toast {
  position: fixed; left: 12px; right: 12px; bottom: calc(80px + var(--safe-b)); z-index: 50;
  max-width: 560px; margin: 0 auto; display: none;
  background: var(--ink); color: #fff; border-radius: 12px; padding: 12px 14px;
  align-items: center; gap: 12px; box-shadow: 0 8px 24px rgba(10,25,30,.25);
}
#toast.show { display: flex; }
#toast.bad { background: var(--late); }
#toast span { flex: 1; }
#toast button { background: none; border: 1.5px solid rgba(255,255,255,.5); color: #fff; border-radius: 8px; padding: 6px 10px; font: 700 .9rem var(--body); cursor: pointer; }

/* Scanner */
.scan-modes { display: grid; grid-template-columns: repeat(3, 1fr); border-radius: var(--r); overflow: hidden; margin-bottom: 10px; }
.scan-modes button {
  border: 0; padding: 14px 4px; font: 700 1rem var(--display); cursor: pointer;
  background: #dfe7e6; color: var(--ink-2);
}
.scan-modes button[aria-pressed=true] { color: #fff; }
.scan-modes [data-mode=add][aria-pressed=true] { background: var(--add); }
.scan-modes [data-mode=consume][aria-pressed=true] { background: var(--use); }
.scan-modes [data-mode=list][aria-pressed=true] { background: var(--list); }
.viewport {
  position: relative; border-radius: var(--r); overflow: hidden; background: #0f2228;
  aspect-ratio: 4 / 3; display: grid; place-items: center; color: #cfe0e3;
  border: 5px solid var(--mode-c, var(--add));
  transition: border-color .15s;
}
.viewport #reader { position: absolute; inset: 0; }
.viewport #reader video { width: 100% !important; height: 100% !important; object-fit: cover; display: block; }
.cam-tools { position: absolute; right: 10px; bottom: 10px; z-index: 3; display: flex; gap: 8px; }
.cam-tool { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(0,0,0,.45); color: #fff; font: 700 .95rem var(--body); display: grid; place-items: center; cursor: pointer; }
.cam-tool svg { width: 22px; height: 22px; fill: currentColor; }
.cam-tool[aria-pressed="true"] { background: #fff; color: var(--ink); }
/* Eigener Zielrahmen, immer mittig – der eingebaute der Bibliothek sitzt bei object-fit: cover falsch */
.viewport #reader #qr-shaded-region, .viewport #reader img[alt="Info icon"] { display: none !important; }
.aim { position: absolute; inset: 22% 10%; pointer-events: none; display: none; z-index: 2; }
.viewport.cam-on .aim { display: block; }
.aim i { position: absolute; width: 28px; height: 28px; border: 4px solid #fff; border-radius: 3px; filter: drop-shadow(0 0 2px rgba(0,0,0,.5)); }
.aim i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.aim i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.aim i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.aim i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.viewport .cam-off { text-align: center; padding: 20px; position: relative; z-index: 1; }
.cam-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.cam-off .btn.ghost { color: #fff; border-color: rgba(255,255,255,.55); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cam-diag { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-top: 10px; color: var(--ink); }
.cam-diag summary { font-weight: 700; cursor: pointer; }
.cam-diag ul { list-style: none; padding: 0; margin: 8px 0; }
.cam-diag li { padding: 3px 0; } .cam-diag li.y { color: var(--ok); } .cam-diag li.n { color: var(--late); font-weight: 700; } .cam-diag li.w { color: #9a6508; }
body.m-add .cam-diag .hint, body.m-consume .cam-diag .hint, body.m-list .cam-diag .hint { color: var(--ink-2); word-break: break-all; }
.viewport.hit { animation: hit .35s; }
@keyframes hit { 50% { border-color: #fff; } }
body.m-add .hint, body.m-consume .hint, body.m-list .hint { color: rgba(255,255,255,.85); } body.m-add .hint a, body.m-consume .hint a, body.m-list .hint a { color: #fff; }
body.m-add { --mode-c: var(--add); } body.m-consume { --mode-c: var(--use); } body.m-list { --mode-c: var(--list); }
.scan-bar { display: flex; gap: 8px; margin-top: 10px; }
.scan-bar select { flex: 1; }
.scan-input { display: flex; gap: 8px; margin-top: 8px; }
.scan-input input { flex: 1; }
.scan-last { margin-top: 12px; }
.kiosk .viewport { display: none; }
.kiosk .scan-input input { font-size: 1.4rem; min-height: 64px; }

/* Einkaufsliste */
.shop { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.shop li { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px 8px 12px; }
.shop li.done { opacity: .55; }
.shop li.done .s-name { text-decoration: line-through; }
.shop li { gap: 10px; }
.shop li.s-cat { background: none; border: 0; padding: 10px 2px 0; font-size: .85rem; font-weight: 700; color: var(--ink-2); }
.shop li.s-cat:first-child { padding-top: 0; }
.s-ico { position: relative; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: none; overflow: hidden; }
.s-ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.s-ico img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.s-ico.s-photo { border: 1px solid var(--line); }
.shop li.done .s-ico { filter: grayscale(1); opacity: .8; }
.shop .s-name { flex: 1; }
.shop .s-qty { color: var(--ink-2); }
.shop .s-auto { font-size: .75rem; color: var(--list); display: block; }
.shop .x { background: none; border: 0; font-size: 1.3rem; color: var(--ink-2); cursor: pointer; padding: 6px 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1.5px dashed var(--list); background: #fff; color: var(--list); border-radius: 18px; padding: 6px 12px; font: 700 .9rem var(--body); cursor: pointer; }

/* Was kann ich kochen? */
.cook { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 6px; }
.cook label.check { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 52px; cursor: pointer; }
.cook .c-name { flex: 1; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.cook .c-name small { display: block; font-weight: 400; }
.cook .c-when { font-size: .88rem; color: var(--ink-2); white-space: nowrap; }
.cook .st-late .c-when { color: var(--late); font-weight: 700; }
.cook .st-soon .c-when, .cook .st-idle .c-when { color: #9a6508; font-weight: 700; }
.cook input:checked + .c-name { color: var(--add); }
.cook-go { position: sticky; bottom: calc(70px + var(--safe-b)); background: var(--paper); padding: 8px 0 4px; }
.btn.off { opacity: .45; pointer-events: none; }
.menu a.locked { color: var(--ink-2); }
.menu a.locked::after { content: "Passwort"; font-size: .8rem; color: var(--ink-2); border: 1px solid var(--line); border-radius: 8px; padding: 1px 6px; align-self: center; }

.push-hint { margin-top: 14px; border-left: 4px solid var(--list); }
.push-hint p { margin: 0 0 8px; }
.box h3 + .hint { margin-top: 0; }

/* Rezepte */
.recipes { display: flex; flex-direction: column; gap: 8px; }
.recipe { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 2px; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px 14px; color: var(--ink); text-decoration: none; }
.recipe b { font-family: var(--display); font-size: 1.1rem; }
.recipe small { color: var(--ink-2); }
.r-ok { color: var(--add); font-weight: 700; }
.r-miss { color: #9a6508; font-weight: 700; }
.r-use { color: var(--ink-2); font-size: .9rem; }
.recipe .bar i { background: var(--add); }
.r-status { font-size: 1.05rem; }
.crumb { margin: 0 0 6px; font-size: .95rem; }
.ings { list-style: none; padding: 0; margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.ings li { display: grid; grid-template-columns: 24px 1fr auto; gap: 8px; align-items: baseline; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.ings li:last-child { border-bottom: 0; }
.ings small { display: block; color: var(--ink-2); font-size: .82rem; }
.i-amt { color: var(--ink-2); }
.i-mark { font-weight: 700; text-align: center; }
.i-state { font-size: .85rem; color: var(--ink-2); white-space: nowrap; }
.i-have .i-mark, .i-have .i-state { color: var(--add); }
.i-missing .i-mark, .i-missing .i-state { color: var(--late); font-weight: 700; }
.i-optional { color: var(--ink-2); }
.steps { padding-left: 1.3rem; margin: 0; }
.steps li { margin: 0 0 .7em; padding-left: .2rem; line-height: 1.5; max-width: 38em; }
.cook-own { margin-bottom: 18px; }
.btns.stack .btn { flex-basis: 100%; }

/* Plattform & Superadmin */
.banner { background: var(--list); color: #fff; padding: 8px 16px; font-size: .92rem; text-align: center; }
.foot { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; margin: 28px 0 8px; font-size: .9rem; }
.foot a { color: var(--ink-2); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.legal { max-width: 40em; }
.legal h2 { font-size: 1.1rem; }
.legal p { line-height: 1.6; }
.ad { display: flex; gap: 12px; align-items: center; position: relative; background: #fffaf2; border: 1px solid #eadbc4; border-radius: 12px;
  padding: 12px; margin: 14px 0; color: var(--ink); text-decoration: none; }
.ad-g { display: block; padding: 22px 8px 8px; min-height: 120px; background: var(--card); border-color: var(--line); }
.ad-g:has(ins[data-ad-status="unfilled"]) { display: none; }
.ad img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; flex: none; }
.ad-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ad-text span { color: var(--ink-2); font-size: .92rem; }
.ad-text em { font-style: normal; font-weight: 700; color: var(--list); font-size: .92rem; }
.ad-label { position: absolute; top: 6px; right: 8px; font-size: .7rem; color: var(--ink-2); }
.menu a.super-link { background: var(--ink); color: #fff; border-color: var(--ink); }
.menu a.super-link span { color: #a9c3c9; }
.subnav a .count { background: var(--list); color: #fff; border-radius: 9px; padding: 0 6px; font-size: .75rem; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; }
.kpi span { font-size: .85rem; color: var(--ink-2); }
.kpi b { font: 700 1.7rem/1.1 var(--display); margin: 2px 0; }
.kpi small { color: var(--ink-2); font-size: .8rem; }
.chart { display: flex; align-items: flex-end; gap: 2px; height: 110px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 8px 6px; }
.chart span { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.chart i { display: block; width: 100%; background: var(--use); border-radius: 2px 2px 0 0; }
.c-reg i { background: var(--add); }
.rows { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.rows li { display: flex; gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.rows li > a { flex: 1; min-width: 0; color: var(--ink); text-decoration: none; display: flex; flex-direction: column; }
.rows li .muted { font-size: .88rem; overflow-wrap: anywhere; }
.rows li small { color: var(--ink-2); white-space: nowrap; font-size: .8rem; }
.rows.sys li { justify-content: space-between; }
.rows.sys small { white-space: normal; text-align: right; }
.rows.sys small.warn { color: #9a6508; font-weight: 700; }
.st { display: inline-block; font: 700 .72rem var(--body); padding: 2px 7px; border-radius: 8px; vertical-align: middle; background: #e6eceb; color: var(--ink-2); }
.st-new, .st-open { background: #fdf0dd; color: #9a6508; } .st-done { background: #e1f1ea; color: var(--add); }
.st-spam { background: #f6e1df; color: var(--late); } .st-super { background: var(--ink); color: #fff; }
.chips.filter { margin-bottom: 12px; } .chip.on { background: var(--ink); color: #fff; border-style: solid; border-color: var(--ink); }
a.chip { text-decoration: none; }
.inbox { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.inbox li { display: flex; gap: 10px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.inbox li.unread { border-left: 4px solid var(--list); }
.inbox li > a { flex: 1; min-width: 0; color: var(--ink); text-decoration: none; display: flex; flex-direction: column; }
.inbox .snip { color: var(--ink-2); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox small { color: var(--ink-2); white-space: nowrap; font-size: .8rem; }
.inbox li.unread b { color: var(--list); }
.msg-body { white-space: normal; line-height: 1.55; overflow-wrap: anywhere; }
.msg.reply { background: #f4f8f7; border-left: 4px solid var(--add); }
.hbars { list-style: none; padding: 0; margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.hbars li { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.hbars li:last-child { border-bottom: 0; }
.hb-name { min-width: 0; overflow-wrap: anywhere; font-size: .95rem; }
.hb-name small { display: block; color: var(--ink-2); font-size: .78rem; }
.hb-bar { height: 8px; background: #e6eceb; border-radius: 4px; overflow: hidden; }
.hb-bar i { display: block; height: 100%; background: var(--use); }
.hb-bar i.late { background: var(--late); }
.hbars b { font-size: .95rem; }
.subnav.mini { margin: 0; padding: 0; }
.subnav.mini a { padding: 4px 10px; font-size: .82rem; }
.faqpick { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: 8px 0; }
.fp-head, .fp-row { display: grid; grid-template-columns: 1fr 44px 44px; gap: 4px; align-items: start; padding: 8px 10px; }
.fp-head { background: #f1f5f4; font-size: .8rem; font-weight: 700; color: var(--ink-2); }
.fp-head span:not(:first-child) { text-align: center; }
.fp-topic { padding: 10px 10px 2px; font-size: .8rem; font-weight: 700; color: var(--ink-2); border-top: 1px solid var(--line); }
.fp-row { border-top: 1px solid #edf1f0; }
.fp-row input { justify-self: center; margin-top: 2px; }
.fp-row summary { cursor: pointer; font-size: .95rem; }
.fp-row details p { margin: 6px 0 0; font-size: .88rem; color: var(--ink-2); }
.adplace { border-top: 1px solid var(--line); padding: 10px 0 2px; }
.adplace b { font-size: .95rem; }
.adplace .row { margin-top: 4px; }
.danger-zone { border-color: #eac9c5; }
textarea.mono { font: .9rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.wrap-any { overflow-wrap: anywhere; font-size: .85rem; }
@media (min-width: 720px) { .kpis { grid-template-columns: repeat(3, 1fr); } }

/* Logo & Name im Kopf – je nach Einstellung für Handy (bm-) und Desktop (bd-) */
.brand { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.brand-logo { height: 30px; width: auto; max-width: 160px; object-fit: contain; display: block; }
.b-plate .brand-logo { background: #fff; border-radius: 7px; padding: 3px 6px; box-sizing: content-box; }
.bm-logo .brand-name, .bm-name .brand-logo { display: none; }
@media (min-width: 720px) {
  .bm-logo .brand-name { display: inline; } .bm-name .brand-logo { display: block; }
  .bd-logo .brand-name { display: none; } .bd-name .brand-logo { display: none; }
  .brand-logo { height: 36px; max-width: 220px; }
}
.hero-logo { max-height: 72px; max-width: 70%; object-fit: contain; display: block; margin-bottom: 14px; }
.b-plate .hero-logo { background: #fff; border-radius: 12px; padding: 8px 12px; }
.brand-preview { display: grid; gap: 10px; }
.bp { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--paper); }
.bp .top { position: static; padding: 12px 14px; }
.bp small { display: block; padding: 6px 12px; color: var(--ink-2); font-size: .8rem; }
.bp-d .top { padding: 14px 20px; }
.icon-prev { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.icon-prev figure { margin: 0; text-align: center; font-size: .75rem; color: var(--ink-2); }
.icon-prev img { display: block; margin: 0 auto 4px; border-radius: 22%; box-shadow: 0 1px 4px rgba(0,0,0,.15); }

/* Startseite: Zahlen, Schritte, Fragen */
.stats { margin: 0 0 16px; }
.stats h2 { margin-top: 0; }
.stat b { font-variant-numeric: tabular-nums; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.stat b { font: 700 clamp(1.7rem, 8vw, 2.3rem)/1.05 var(--display); color: var(--add); letter-spacing: -.01em; }
.stat span { color: var(--ink-2); font-size: .92rem; line-height: 1.3; }
.steps-home { list-style: none; counter-reset: s; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.steps-home li { counter-increment: s; position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 12px 52px; }
.steps-home li::before { content: counter(s); position: absolute; left: 14px; top: 12px; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; font: 700 .9rem/26px var(--display); text-align: center; }
.steps-home b { display: block; font-family: var(--display); }
.steps-home span { color: var(--ink-2); font-size: .95rem; }
.install-hint { border-left: 4px solid var(--use); }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 6px; }
.faq summary { font-weight: 700; cursor: pointer; }
.faq p { margin: 8px 0 0; color: var(--ink-2); }
.statcfg .sc { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.statcfg .sc input:not([type=checkbox]) { margin-top: 4px; }

/* Startseite für Besucher */
.hero { background: var(--brand); color: #fff; margin: -18px -16px 18px; padding: 26px 18px 22px; }
.hero h1 { font-size: clamp(2rem, 9vw, 2.8rem); margin-bottom: .35em; }
.hero p { color: #d3e2e5; max-width: 34em; }
.hero .hint { color: #a9c3c9; margin: 8px 0 0; }
.perks { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 8px; }
.perks li { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.perks b { display: block; font-family: var(--display); font-size: 1.05rem; }
.perks span { color: var(--ink-2); font-size: .95rem; }
@media (min-width: 720px) { .perks { grid-template-columns: repeat(3, 1fr); } .hero { border-radius: 0 0 18px 18px; } }

/* Verwaltung */
.subnav { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 16px; padding: 0 16px 4px; }
.subnav a { white-space: nowrap; padding: 8px 12px; border-radius: 18px; background: #fff; border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: .92rem; }
.subnav a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.box { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.box h3 { margin-bottom: .3em; }
.tbl { width: 100%; border-collapse: collapse; font-size: .93rem; }
.tbl th, .tbl td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font-weight: 700; color: var(--ink-2); }
.menu a { display: flex; justify-content: space-between; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; color: var(--ink); text-decoration: none; }
.menu a span { color: var(--ink-2); font-size: .9rem; }
.pair-qr { display: grid; place-items: center; background: #fff; padding: 16px; border-radius: 12px; }
.code-big { font: 700 2rem var(--display); letter-spacing: .12em; text-align: center; }
.filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.filters input { grid-column: 1 / -1; } .filters select { min-width: 0; }

@media (min-width: 720px) {
  .tabs { padding-left: calc(50% - 360px); padding-right: calc(50% - 360px); }
  .sheet { margin: auto; border-radius: 18px; }
  .mode { min-height: 130px; font-size: 1.3rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
@media print {
  .top, .tabs, .no-print { display: none !important; }
  body { background: #fff; padding: 0; }
}

/* Aktiver Modus hebt sich vom gleichfarbigen Hintergrund ab */
body.m-add .scan-modes, body.m-consume .scan-modes, body.m-list .scan-modes { box-shadow: 0 0 0 2px rgba(255,255,255,.7); }
.scan-modes button[aria-pressed=true] { box-shadow: inset 0 -4px 0 #fff; }
