/* kellerWERK24 v3 */
:root {
  --bg: #f5f3ee; --surface: #fffdf9; --surface-2: #eeede6; --input: #fbfaf6;
  --ink: #18231d; --muted: #5f6963; --line: #e3e3db;
  --fill: #173d2a; --on-fill: #ffffff; --acc: #2f6b4b; --acc-soft: #e2ece4;
  --red: #b3372d; --red-soft: #fbe5e2; --amber: #95580a; --amber-soft: #fbefd9;
  --strip: #173d2a; --side: #173d2a; --side-ink: #e9f1eb;
  --shadow: 0 1px 2px rgba(23, 40, 30, .05), 0 6px 18px rgba(23, 40, 30, .06);
  --r: 18px; --tabh: 64px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  box-sizing: border-box;
}
:root.dark {
  --bg: #0e1511; --surface: #172019; --surface-2: #222c25; --input: #121a15;
  --ink: #e8eee9; --muted: #a2ada5; --line: rgba(255, 255, 255, .1);
  --fill: #2f6b4b; --on-fill: #ffffff; --acc: #8fcc9f; --acc-soft: #1f3327;
  --red: #ff8f85; --red-soft: #3a1f1c; --amber: #e8b45e; --amber-soft: #382d18;
  --strip: #0a100c; --side: #0f1912; --side-ink: #dfe9e2;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: inherit; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 12px); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.45 var(--font); padding-top: env(safe-area-inset-top, 0px); -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; opacity: .45; }
:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
img { display: block; }
code { font-size: .92em; background: var(--surface-2); padding: 1px 5px; border-radius: 6px; }
.muted { color: var(--muted); } .red { color: var(--red); } .amber { color: var(--amber); } .center { text-align: center; }
.ic { width: 22px; height: 22px; flex: none; }
.ic.sm { width: 15px; height: 15px; vertical-align: -2px; }
.ic.xl { width: 44px; height: 44px; color: var(--acc); }
.ic.rot90 { transform: rotate(90deg); }

.topstrip { position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top, 0px); background: var(--strip); z-index: 60; }

/* ---------- Grundaufbau ---------- */
.side { display: none; }
.main { max-width: 760px; margin: 0 auto; padding: 0 16px calc(var(--tabh) + 96px + env(safe-area-inset-bottom, 0px)); }
#view:focus { outline: none; }

.apphead { display: flex; align-items: center; gap: 12px; padding: 18px 0 14px; }
.logo { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: var(--fill); color: var(--on-fill); flex: none; }
.logo .ic { width: 24px; height: 24px; }
.logo.sm { width: 34px; height: 34px; border-radius: 10px; }
.apphead-t { flex: 1; min-width: 0; }
.apphead-t b, .side-brand b { display: block; font-size: 21px; line-height: 1.1; letter-spacing: -.3px; font-weight: 800; }
.apphead-t small, .side-brand small { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .9px; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.offline { font-size: 12.5px; font-weight: 700; color: var(--amber); background: var(--amber-soft); border-radius: 999px; padding: 4px 10px; }

.iconbtn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: var(--ink); position: relative; flex: none; }
.iconbtn:hover { background: var(--surface-2); }
.iconbtn.big { width: 50px; height: 50px; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); }
.iconbtn.sm { width: 34px; height: 34px; border-radius: 10px; }
.iconbtn.danger { color: var(--red); }
.iconbtn.dot::after { content: ""; position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.iconbtn.light { color: #fff; }
.iconbtn.on { background: var(--fill); color: var(--on-fill); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 16px; border-radius: 13px; font-weight: 650; background: var(--surface); border: 1px solid var(--line); color: var(--ink); white-space: nowrap; }
.btn .ic { width: 19px; height: 19px; }
.btn.primary { background: var(--fill); color: var(--on-fill); border-color: var(--fill); font-weight: 750; }
.btn.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, transparent); background: var(--surface); }
.btn.wide { width: 100%; }
.actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }
.actions.left { justify-content: flex-start; }
.row-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }

/* ---------- Suche & Filter ---------- */
.searchrow { display: flex; gap: 10px; align-items: center; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--bg); padding: 8px 0; }
.search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); color: var(--muted); }
.search:focus-within { border-color: var(--acc); }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 16px; color: var(--ink); }
.search input::-webkit-search-cancel-button { opacity: .6; }
kbd { font: 600 12px var(--font); color: var(--muted); border: 1px solid var(--line); border-radius: 7px; padding: 3px 6px; background: var(--surface-2); }
@media (hover: none), (max-width: 700px) { kbd { display: none; } }

.chiprow { display: flex; align-items: center; gap: 6px; margin: 6px 0 4px; }
.chips { display: flex; gap: 8px; overflow-x: auto; flex: 1; padding: 2px 0; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip { flex: none; min-height: 36px; padding: 0 15px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 14.5px; font-weight: 600; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--fill); border-color: var(--fill); color: var(--on-fill); }
.fchips { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 2px; }
.fchip { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 0 10px; border-radius: 999px; background: var(--acc-soft); color: var(--acc); font-size: 13px; font-weight: 700; }

/* ---------- Kennzahlen ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.stats.four { grid-template-columns: repeat(2, 1fr); }
.stat { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 84px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); text-align: center; padding: 10px 6px; }
.stat b { font-size: 26px; line-height: 1.1; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); font-weight: 550; }
.stat.alert b { color: var(--red); }

.remind { display: flex; align-items: center; gap: 8px; background: var(--amber-soft); color: var(--amber); border-radius: 14px; padding: 6px 6px 6px 14px; margin: 0 0 12px; font-size: 14px; font-weight: 600; line-height: 1.35; }
.remind span { flex: 1; }
.remind button:not(.iconbtn) { font-weight: 800; color: inherit; padding: 8px 6px; }
.remind .iconbtn { color: inherit; }

.sechead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 18px 0 10px; }
.sechead h2 { margin: 0; font-size: 18px; letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sechead .btn { padding: 0 13px; min-height: 42px; font-size: 15px; }
.sechead-r { display: flex; gap: 6px; align-items: center; }
.quick { display: flex; align-items: center; gap: 4px; background: var(--surface); border: 1px dashed color-mix(in srgb, var(--acc) 45%, var(--line)); border-radius: 14px; padding: 3px 3px 3px 14px; }
.quick input { flex: 1; min-width: 0; border: 0; background: none; outline: none; height: 42px; font-size: 15.5px; }
.quickhint { font-size: 12.5px; color: var(--muted); margin: 6px 4px 12px; }

/* ---------- Liste ---------- */
.items { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.item { display: flex; align-items: center; gap: 10px; padding: 12px; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item.picked, tr.picked td { background: var(--acc-soft); }
.item.current, tr.current td { background: color-mix(in srgb, var(--acc-soft) 60%, transparent); }
.itemmain { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-align: left; }
.thumb { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 13px; background: var(--surface-2); overflow: hidden; flex: none; color: var(--acc); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb b { font-size: 22px; font-weight: 800; }
.thumb.sm { width: 38px; height: 38px; border-radius: 9px; } .thumb.sm b { font-size: 16px; }
.thumb.lg { width: 64px; height: 64px; }
.itemtxt { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.itemtxt b { font-size: 15.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.itemtxt small { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.itemtxt small.red, .itemtxt small.amber { font-weight: 650; }
.itemtxt small.red { color: var(--red); } .itemtxt small.amber { color: var(--amber); }
.tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; }
.tags:empty { display: none; }
.tag { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 7px; background: var(--acc-soft); color: var(--acc); white-space: nowrap; }
.tag.low { background: var(--red-soft); color: var(--red); }
.tag.mhd { background: var(--amber-soft); color: var(--amber); }
td .tag.low { margin-left: 8px; }
.cb { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--line); color: transparent; flex: none; }
.cb .ic { width: 16px; height: 16px; stroke-width: 2.6; }
.cb.on { background: var(--fill); border-color: var(--fill); color: var(--on-fill); }

.step { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--input); flex: none; overflow: hidden; }
.step button { display: grid; place-items: center; width: 38px; height: 40px; color: var(--ink); }
.step button:active { background: var(--surface-2); }
.step .ic { width: 18px; height: 18px; }
.stepv { min-width: 30px; text-align: center; font-weight: 750; font-variant-numeric: tabular-nums; }
.step.big button { width: 46px; height: 46px; }
.step.big input { width: 64px; height: 46px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 0; text-align: center; font-weight: 750; background: none; -moz-appearance: textfield; }
.step.big input::-webkit-inner-spin-button { -webkit-appearance: none; }

.empty { text-align: center; padding: 36px 20px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.empty strong { display: block; color: var(--ink); font-size: 19px; margin: 8px 0 4px; }
.empty p { margin: 0 auto; max-width: 42ch; }

/* ---------- Tabelle (Desktop) ---------- */
.tablewrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: left; font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 12px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.tbl .c-img { width: 54px; } .tbl .c-cb { width: 44px; } .tbl .c-act { width: 60px; text-align: right; }
.tbl .c-num { text-align: center; white-space: nowrap; }
.tbl td.warn { color: var(--red); font-weight: 650; white-space: nowrap; }
.tbl .step button { width: 32px; height: 34px; }

/* ---------- Seitenköpfe ---------- */
.pagehead { display: flex; align-items: center; gap: 8px; padding: 18px 0 10px; }
.pagehead h1 { margin: 0; font-size: 25px; letter-spacing: -.4px; }
.note { color: var(--muted); font-size: 14.5px; margin: 0 0 12px; }

/* ---------- Nachkaufen ---------- */
.seg { display: flex; gap: 6px; background: var(--surface-2); padding: 4px; border-radius: 14px; margin-bottom: 12px; }
.seg button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; border-radius: 11px; font-weight: 700; font-size: 14.5px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--fill); color: var(--on-fill); }
.cnt { display: inline-grid; place-items: center; min-width: 21px; height: 21px; padding: 0 6px; border-radius: 999px; font-size: 12px; font-weight: 800; color: #fff; }
.cnt.red { background: #d0473b; } .cnt.amber { background: #d1912a; }
.banner { border-radius: 14px; padding: 12px 14px; font-size: 14.5px; font-weight: 550; margin: 0 0 12px; }
.banner.red { background: var(--red-soft); color: var(--red); }
.banner.amber { background: var(--amber-soft); color: var(--amber); }
.shop .item { flex-wrap: wrap; row-gap: 8px; }
.shopact { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding-left: 76px; }
.cartbtn { display: grid; place-items: center; width: 48px; height: 44px; border-radius: 13px; background: var(--fill); color: var(--on-fill); }
.cartbtn.on { background: var(--acc-soft); color: var(--acc); box-shadow: inset 0 0 0 2px var(--acc); }
.shopfoot { position: sticky; bottom: calc(var(--tabh) + env(safe-area-inset-bottom, 0px) + 10px); margin-top: 16px; z-index: 5; }
.shopfoot .btn { min-height: 54px; font-size: 16.5px; border-radius: 16px; box-shadow: 0 6px 20px rgba(23, 61, 42, .25); }
.shopfoot p { margin: 6px 0 0; font-size: 13px; background: var(--bg); }
.buylist { display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow: auto; }
.buyrow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.buyrow span { flex: 1; min-width: 0; } .buyrow small { display: block; color: var(--muted); }
.buyrow input { width: 76px; height: 42px; text-align: center; border: 1px solid var(--line); border-radius: 11px; background: var(--input); font-weight: 700; }

/* ---------- Statistik ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; margin: 12px 0; }
.card h2 { display: flex; align-items: center; gap: 6px; margin: 0 0 12px; font-size: 16.5px; }
.card p { margin: 0 0 8px; }
.cols2 { display: grid; gap: 0 12px; }
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar { display: grid; grid-template-columns: minmax(80px, 34%) 1fr auto; align-items: center; gap: 10px; font-size: 14px; }
.bl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.bt { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bt span { display: block; height: 100%; border-radius: 99px; background: var(--acc); }
.bn { font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; } .bn small { color: var(--muted); font-weight: 500; }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 90px; padding-top: 6px; }
.spark span { flex: 1; background: var(--acc); border-radius: 3px 3px 1px 1px; opacity: .85; min-height: 2px; }
.hist { list-style: none; margin: 12px 0 0; padding: 0; }
.hist li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.hist li:last-child { border-bottom: 0; }
.hist li > button, .hist li > span { flex: 1; min-width: 0; text-align: left; display: flex; flex-direction: column; }
.hist b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist small { color: var(--muted); font-size: 13px; }
.hist time { font-size: 12.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.hist.small li { padding: 7px 0; }
.card .chips.wrap { margin-bottom: 4px; }

/* ---------- Einstellungen ---------- */
.grp { font-size: 18px; margin: 22px 0 8px; letter-spacing: -.2px; }
.setlist { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.setrow { display: flex; align-items: center; gap: 13px; width: 100%; min-height: 56px; padding: 11px 16px; text-align: left; border-bottom: 1px solid var(--line); color: var(--ink); }
.setrow:last-child { border-bottom: 0; }
.setrow > .ic { color: var(--muted); }
.setrow .sl { flex: 1; min-width: 0; font-weight: 600; font-size: 15.5px; }
.setrow .sl small { display: block; font-weight: 450; font-size: 13px; color: var(--muted); margin-top: 1px; }
.setrow .sv { color: var(--muted); font-size: 14.5px; white-space: nowrap; }
.setrow .chev { width: 17px; height: 17px; color: var(--muted); }
.setrow.static { cursor: default; }
.setrow.danger, .setrow.danger > .ic { color: var(--red); }
.sw { width: 46px; height: 28px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); position: relative; flex: none; transition: background .15s; }
.sw span { position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.sw.on { background: var(--fill); border-color: var(--fill); } .sw.on span { transform: translateX(18px); }
.mrow { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--line); }
.mrow:last-child { border-bottom: 0; }
.mrow input { flex: 1; min-width: 0; height: 40px; border: 1px solid transparent; border-radius: 10px; padding: 0 8px; background: none; font-weight: 600; }
.mrow input:focus { border-color: var(--line); background: var(--input); }
.mrow .muted { font-size: 13px; min-width: 24px; text-align: right; }
.addrow { display: flex; gap: 8px; margin-top: 12px; }
.addrow input { flex: 1; min-width: 0; height: 46px; padding: 0 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); font-size: 16px; }
.keybox { font: 600 16px/1.6 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .5px; word-break: break-all; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }

/* ---------- Detail / Bearbeiten ---------- */
.detail { position: fixed; inset: 0; z-index: 40; background: var(--bg); overflow-y: auto; -webkit-overflow-scrolling: touch; padding-top: env(safe-area-inset-top, 0px); }
.detail[hidden] { display: none; }
.dhead { position: sticky; top: 0; z-index: 3; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 6px; padding: 8px 10px; background: var(--bg); }
.dhead b { text-align: center; font-size: 16.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dbody { max-width: 640px; margin: 0 auto; padding: 0 14px 120px; }
.hero { border-radius: var(--r); overflow: hidden; background: var(--surface-2); }
.hero img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.photoadd { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 100%; min-height: 130px; border-radius: var(--r); border: 1.5px dashed var(--line); background: var(--surface); color: var(--ink); }
.photoadd .ic { width: 30px; height: 30px; }
.photoadd small { color: var(--muted); }
.dcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 16px; margin-top: 12px; }
.dcard h3 { display: flex; align-items: center; gap: 6px; font-size: 15px; margin: 0 0 4px; }
.titlein { width: 100%; font-size: 23px; font-weight: 800; letter-spacing: -.3px; border: 0; border-bottom: 1px solid transparent; background: none; padding: 2px 0 4px; outline: none; }
.titlein:focus { border-bottom-color: var(--acc); }
#dTags { margin: 2px 0 6px; }
.f > span:first-child { display: block; font-size: 13.5px; font-weight: 650; color: var(--muted); }
.f input, .f select, .f textarea, .pair input, .pair select { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--input); font-size: 16px; }
.f textarea { resize: vertical; min-height: 76px; }
.f select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pair:has(.iconbtn) { grid-template-columns: 1fr auto; }
.pair .iconbtn { width: 46px; height: 46px; border: 1px solid var(--line); background: var(--input); }
.form.stack .f { display: block; margin-top: 14px; }
.form.stack .f > span:first-child { margin-bottom: 6px; }
.form.rows .f { display: grid; grid-template-columns: 112px 1fr; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.form.rows .f:last-child { border-bottom: 0; }
.form.rows .step.big { justify-self: start; }
.photos { display: flex; flex-wrap: wrap; gap: 8px; }
.ph { position: relative; width: 76px; height: 76px; border-radius: 13px; overflow: visible; }
.ph > button:first-child { width: 100%; height: 100%; border-radius: 13px; overflow: hidden; }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph.cover > button:first-child { box-shadow: 0 0 0 2px var(--acc); }
.ph.add { display: grid; place-items: center; border: 1.5px dashed var(--line); background: var(--input); color: var(--muted); }
.phx { position: absolute; top: -7px; right: -7px; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; }
.phx .ic { width: 14px; height: 14px; stroke-width: 2.4; }
.dfoot { position: sticky; bottom: 0; z-index: 3; display: flex; gap: 8px; align-items: center; padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px)); background: color-mix(in srgb, var(--surface) 94%, transparent); border-top: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.dfoot .spacer { flex: 1; }
.dfoot .btn.primary { min-width: 116px; }
@media (max-width: 520px) { .dfoot .spacer { display: none; } .dfoot .btn { flex: 1 1 0; min-width: 0; padding: 0 8px; } .dfoot .btn.primary { min-width: 0; flex-grow: 1.3; } }

/* ---------- Untere Navigation ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr); background: color-mix(in srgb, var(--surface) 96%, transparent); border-top: 1px solid var(--line); padding: 6px 4px env(safe-area-inset-bottom, 0px); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.tab.on { color: var(--acc); font-weight: 800; }
.navi { position: relative; display: grid; place-items: center; width: 52px; height: 30px; border-radius: 99px; }
.tab.on .navi { background: var(--acc-soft); }
.badge { position: absolute; top: -3px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: #d0473b; color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--surface); }
body.has-detail .tabbar { display: none; }

/* ---------- Mehrfachauswahl ---------- */
.bulkbar { position: fixed; left: 8px; right: 8px; bottom: calc(var(--tabh) + env(safe-area-inset-bottom, 0px) + 8px); z-index: 31; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; background: var(--fill); color: var(--on-fill); border-radius: 16px; padding: 8px 8px 8px 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.bulkbar[hidden] { display: none; }
.bulkn { font-weight: 800; white-space: nowrap; font-size: 14px; }
.bulkbtns { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1 1 100%; min-width: 0; }
.bulkbtns > :first-child { margin-left: auto; }
@media (max-width: 700px) { .bulkbtns { margin: 0 -4px; flex-wrap: wrap; overflow: visible; justify-content: flex-start; } .bulkbtns > :first-child { margin-left: 0; } .bulkbtns .done { margin-left: auto; } body.bulk .main { padding-bottom: calc(var(--tabh) + 190px); } body.bulk #toasts { bottom: calc(var(--tabh) + env(safe-area-inset-bottom, 0px) + 150px); } }
@media (min-width: 701px) { .bulkbar { flex-wrap: nowrap; } .bulkbtns { flex: 1 1 auto; } }
.bulkbtns::-webkit-scrollbar { display: none; }
.bulkbtns button { display: inline-flex; align-items: center; gap: 5px; min-height: 40px; padding: 0 10px; border-radius: 11px; font-weight: 700; font-size: 13.5px; white-space: nowrap; color: inherit; }
.bulkbtns button:hover:not(:disabled) { background: rgba(255, 255, 255, .12); }
.bulkbtns .ic { width: 17px; height: 17px; }
.bulkbtns .danger { color: #ffb3ab; }
.bulkbtns .done { background: rgba(255, 255, 255, .16); }
body.bulk .main { padding-bottom: calc(var(--tabh) + 150px); }

/* ---------- Bögen, Scanner, Meldungen ---------- */
dialog { border: 0; padding: 0; color: var(--ink); background: var(--surface); }
dialog::backdrop { background: rgba(8, 14, 10, .55); }
#sheet { width: 100%; max-width: 560px; margin: auto auto 0; border-radius: 22px 22px 0 0; max-height: 88vh; }
.sheet { padding: 8px 16px calc(18px + env(safe-area-inset-bottom, 0px)); }
.sheethead { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0 8px; }
.sheethead b { font-size: 18px; }
.fgroup h3 { font-size: 14px; color: var(--muted); margin: 14px 0 8px; }
.choices { display: flex; flex-direction: column; }
.choice { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: left; font-weight: 600; }
.choice:last-child { border-bottom: 0; }
.choice small { display: block; font-weight: 450; color: var(--muted); font-size: 13px; }
.choice.on { color: var(--acc); }
.scan { width: 100%; height: 100%; max-width: 100%; max-height: 100%; margin: 0; background: #000; color: #fff; }
.scanwrap { display: flex; flex-direction: column; height: 100%; padding: calc(env(safe-area-inset-top, 0px) + 8px) 14px calc(env(safe-area-inset-bottom, 0px) + 14px); }
.scanhead { display: flex; align-items: center; justify-content: space-between; }
.scanview { position: relative; flex: 1; margin: 10px 0; border-radius: 18px; overflow: hidden; background: #111; }
.scanview video { width: 100%; height: 100%; object-fit: cover; }
.scanframe { position: absolute; left: 10%; right: 10%; top: 20%; bottom: 20%; border: 3px solid rgba(255, 255, 255, .9); border-radius: 16px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .35); }
.scanmsg { text-align: center; margin: 0 0 10px; min-height: 2.9em; }
.scanfoot { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.scanfoot .btn { background: rgba(255, 255, 255, .14); color: #fff; border-color: transparent; }
#toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--tabh) + env(safe-area-inset-bottom, 0px) + 14px); z-index: 100; display: flex; justify-content: center; pointer-events: none; padding: 0 12px; }
body.tab-nachkaufen:not(.has-detail) #toasts { bottom: auto; top: calc(env(safe-area-inset-top, 0px) + 12px); }
body.desk.tab-nachkaufen:not(.has-detail) #toasts { top: 20px; }
body.bulk #toasts { bottom: calc(var(--tabh) + env(safe-area-inset-bottom, 0px) + 112px); }
body.has-detail #toasts { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; max-width: 520px; background: var(--ink); color: var(--bg); padding: 11px 14px 11px 16px; border-radius: 14px; font-size: 14.5px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.toast button { color: var(--bg); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; padding: 4px; white-space: nowrap; }
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: tin .2s ease-out; }
  @keyframes tin { from { opacity: 0; transform: translateY(8px); } }
  #sheet[open] { animation: sin .22s ease-out; }
  @keyframes sin { from { transform: translateY(30px); opacity: .6; } }
}

/* ---------- mittlere Breite ---------- */
@media (min-width: 640px) {
  .stats.four { grid-template-columns: repeat(4, 1fr); }
  .cols2 { grid-template-columns: 1fr 1fr; }
  .cols2 .card { margin: 12px 0 0; }
  #sheet { margin: auto; border-radius: 22px; }
}
@media (max-width: 380px) {
  .form.rows .f { grid-template-columns: 1fr; gap: 6px; }
  .shopact { padding-left: 0; }
  .sechead .btn { padding: 0 12px; }
}

/* ---------- Desktop ---------- */
body.desk { padding-top: 0; }
body.desk .topstrip, body.desk .tabbar, body.desk .apphead { display: none; }
body.desk .layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
body.desk.has-detail.split .layout { grid-template-columns: 248px minmax(0, 1fr) 440px; }
body.desk .side { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; background: var(--side); color: var(--side-ink); padding: 22px 14px; }
.side-brand { display: flex; align-items: center; gap: 12px; padding: 0 6px 22px; }
.side-brand .logo { background: rgba(255, 255, 255, .12); }
.side-brand small { color: rgba(233, 241, 235, .65); }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.snav { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 12px; border-radius: 12px; font-weight: 650; color: inherit; text-align: left; }
.snav .navi { width: auto; height: auto; }
.snav .badge { position: static; margin-left: auto; border: 0; }
.snav .navi { display: flex; }
.snav:hover { background: rgba(255, 255, 255, .07); }
.snav.on { background: rgba(255, 255, 255, .13); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; padding: 0 8px; }
.side-foot .muted { color: rgba(233, 241, 235, .6); }
body.desk .main { max-width: none; width: 100%; padding: 22px 32px 48px; }
body.desk .main > #view { max-width: 1240px; margin: 0 auto; }
body.desk .searchrow { position: static; padding-top: 0; }
body.desk .stats { grid-template-columns: repeat(3, minmax(0, 220px)); }
body.desk .stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
body.desk .shopfoot { bottom: 16px; }
body.desk .bulkbar { left: 50%; right: auto; transform: translateX(-50%); bottom: 20px; max-width: 760px; width: calc(100% - 300px); }
body.desk.bulk .main { padding-bottom: 120px; }
body.desk #toasts { bottom: 24px; }
body.desk.bulk #toasts { bottom: 92px; }
body.desk .detail { inset: 5vh auto auto 50%; transform: translateX(-50%); width: min(620px, 92vw); max-height: 90vh; border-radius: 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); padding-top: 0; }
body.desk.has-detail:not(.split)::after { content: ""; position: fixed; inset: 0; background: rgba(8, 14, 10, .5); z-index: 39; }
body.desk.has-detail.split .tbl .c-opt { display: none; }
body.desk.split .detail { position: sticky; top: 0; inset: auto; transform: none; width: auto; height: 100vh; max-height: none; border-radius: 0; box-shadow: none; border-left: 1px solid var(--line); background: var(--bg); }
body.desk .dbody { padding-bottom: 24px; }
body.desk .dfoot { padding-bottom: 12px; }
body.desk .tbl .step { background: transparent; }
@media (max-width: 389px) { .sechead h2 { font-size: 16.5px; } .sechead .btn { padding: 0 10px; font-size: 14px; gap: 4px; } .sechead .btn .ic { width: 17px; height: 17px; } }

/* ================= v4 ================= */
.acc { color: var(--acc); }
.cnt-muted { font-size: 14px; color: var(--muted); font-weight: 600; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 11px; }
.btn.sm .ic { width: 16px; height: 16px; }
.row-btns.tight { margin-top: 8px; }
.note.small { font-size: 12.5px; }
.note.pad, .chk.pad { display: block; margin: 12px 0; }
.chk { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); cursor: pointer; }
.chk input { width: 18px; height: 18px; accent-color: var(--fill); }
.linkbtn { display: inline-flex; align-items: center; gap: 4px; color: var(--acc); font-weight: 700; font-size: 14px; padding: 6px 0; }
.hint { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; }
.tag.soft { background: var(--surface-2); color: var(--muted); }
.chip.sm { min-height: 32px; padding: 0 11px; font-size: 13.5px; }
.tree-l { margin-right: -2px; }

.locbanner { display: flex; align-items: center; gap: 8px; background: var(--acc-soft); color: var(--acc); border-radius: 14px; padding: 6px 6px 6px 12px; margin: 8px 0 0; }
.locbanner .lb-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.locbanner b { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.locbanner small { font-size: 12.5px; }
.locbanner .iconbtn { color: var(--acc); }
.cleanup { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 8px 8px 8px 14px; margin: 0 0 12px; font-size: 14px; }
.cleanup span { flex: 1; }
.cleanup button { font-weight: 800; color: var(--acc); padding: 8px 6px; }
.cleanlist { display: flex; flex-direction: column; max-height: 60vh; overflow: auto; }
.cleanrow { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cleanrow span { flex: 1; min-width: 0; } .cleanrow small { display: block; color: var(--muted); font-size: 12.5px; }

/* Einkaufsliste */
.seg3 button { font-size: 13.5px; gap: 5px; padding: 0 4px; }
.cnt.green { background: var(--acc); color: var(--on-fill); }
:root.dark .cnt.green { color: #0e1511; }
.cb.big { width: 30px; height: 30px; border-radius: 9px; }
.shoprow .itemtxt { flex: 1; }
.shoprow.done .itemtxt b { text-decoration: line-through; color: var(--muted); }
.shoprow.done { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.buyrow { align-items: flex-start; }
.buyrow input[type="date"] { margin-top: 6px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--input); padding: 0 8px; font-size: 14px; max-width: 100%; }
.buyrow .chk { margin-top: 6px; }

/* Inventur */
.invhead { display: grid; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 12px; box-shadow: var(--shadow); }
.invhead b { font-size: 17px; }
.progress { height: 9px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--amber); border-radius: 99px; transition: width .2s; }
.progress.ok span, .invhead .progress span { background: var(--acc); }
.inv .item { flex-wrap: wrap; row-gap: 8px; }
.inv .itemtxt { flex: 1 1 100%; }
.inv .item .step { margin-left: auto; }
.inv .item.checked { background: color-mix(in srgb, var(--acc-soft) 70%, transparent); }
.soll { color: var(--muted) !important; }
.okbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--acc); color: var(--acc); font-weight: 800; }
.okbtn.on { background: var(--fill); border-color: var(--fill); color: var(--on-fill); }
.okbtn .ic { width: 18px; height: 18px; }

/* Bearbeiten: Menge, MHD, Chargen, Zusatz */
.qtyro { min-height: 46px; display: flex; align-items: center; gap: 8px; }
.qtyro b { font-size: 20px; }
.mhdchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mhdopts { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: 8px; }
.lots { display: flex; flex-direction: column; gap: 6px; }
.lot { display: grid; grid-template-columns: 72px auto 1fr auto; align-items: center; gap: 6px; }
.lot input { min-height: 42px !important; padding: 8px !important; }
.lot input[type="number"] { text-align: center; font-weight: 700; }
.lot .muted { font-size: 13px; }
.duphint { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; background: var(--amber-soft); color: var(--amber); border-radius: 12px; padding: 8px 12px; margin-top: 8px; font-size: 13.5px; }
.duphint span { flex: 1 1 200px; color: var(--ink); }
.duphint .linkbtn { color: var(--amber); }
details.more { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 4px; }
details.more summary { cursor: pointer; list-style: none; font-weight: 700; padding: 10px 0; display: flex; align-items: baseline; gap: 8px; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "›"; display: inline-block; transition: transform .15s; color: var(--muted); font-size: 18px; line-height: 1; }
details.more[open] summary::before { transform: rotate(90deg); }
details.more summary small { color: var(--muted); font-weight: 450; font-size: 13px; }
.card.more { padding-top: 6px; padding-bottom: 10px; }
.card.more summary { border: 0; }
.form.rows .f[hidden] { display: none; }

/* Notvorrat */
.nvhead { display: grid; gap: 10px; }
.nvrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-weight: 600; }
.nvrow .chips { flex: 0 1 auto; }
.nvsum { margin: 4px 0 0 !important; font-size: 15.5px; }
.nvsum small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.nvg { padding: 10px 0; border-bottom: 1px solid var(--line); display: grid; gap: 5px; }
.nvg:last-of-type { border-bottom: 0; }
.nvg-t { display: flex; justify-content: space-between; gap: 10px; font-size: 14.5px; }
.nvg-t span { white-space: nowrap; font-weight: 700; font-variant-numeric: tabular-nums; }
.nvtargets { display: grid; gap: 8px; padding: 6px 0 4px; }
.nvt { display: grid; grid-template-columns: 1fr 86px 24px; align-items: center; gap: 8px; font-size: 14px; }
.nvt input { height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--input); text-align: right; padding: 0 10px; }

/* Scanner-Zusätze */
.scanhead-r { display: flex; gap: 4px; }
#scanTorch.on { background: #f2c94c; color: #222; }
.scanserial { display: flex; align-items: center; justify-content: center; gap: 8px; color: rgba(255, 255, 255, .85); font-size: 14px; margin: 0 0 10px; }
.scanserial input { width: 18px; height: 18px; accent-color: #8fcc9f; }
.keyqr { background: #fff; border-radius: 16px; padding: 14px; width: min(300px, 100%); margin: 0 auto 12px; }
.keyqr svg { width: 100%; height: auto; display: block; }

/* Druck */
#print { display: none; }
@media print {
  @page { size: A4; margin: 8mm; }
  body.printing > *:not(#print) { display: none !important; }
  body.printing { background: #fff !important; color: #000 !important; padding: 0 !important; }
  body.printing #print { display: block !important; }
  body.printing #print.labels { display: grid !important; }
  #print, #print * { color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .labels { display: grid; align-content: start; }
  .lbl { box-sizing: border-box; border: 0.3mm dashed #999; display: flex; align-items: center; gap: 3mm; padding: 3mm; overflow: hidden; break-inside: avoid; page-break-inside: avoid; font-family: system-ui, Arial, sans-serif; }
  .lbl .qr { flex: none; }
  .lbl .qr rect { fill: #000 !important; }
  .lbl-t { min-width: 0; display: flex; flex-direction: column; gap: .6mm; }
  .lbl-t small { font-size: 6.5pt; letter-spacing: .6pt; color: #555 !important; font-weight: 700; }
  .lbl-t b { font-size: 12pt; line-height: 1.15; }
  .lbl-t span { font-size: 8pt; color: #333 !important; }
  .lbl-t em { font-size: 6pt; color: #777 !important; font-style: normal; margin-top: auto; }
  .lbl-c { margin: 1mm 0 0; padding-left: 3.5mm; font-size: 7.5pt; line-height: 1.25; }
  .lbl-s .labels, .labels.lbl-s { grid-template-columns: repeat(3, 63mm); grid-auto-rows: 38mm; }
  .labels.lbl-s .qr { width: 26mm; height: 26mm; }
  .labels.lbl-s .lbl-t b { font-size: 10pt; }
  .labels.lbl-m { grid-template-columns: repeat(2, 95mm); grid-auto-rows: 67mm; }
  .labels.lbl-m .qr { width: 42mm; height: 42mm; }
  .labels.lbl-m .lbl-t b { font-size: 15pt; }
  .labels.lbl-l { grid-template-columns: 190mm; grid-auto-rows: 90mm; }
  .labels.lbl-l .qr { width: 72mm; height: 72mm; }
  .labels.lbl-l .lbl-t b { font-size: 26pt; }
  .labels.lbl-l .lbl-t span { font-size: 12pt; }
  .labels.lbl-l .lbl-c { font-size: 11pt; }
  .plist { font-family: system-ui, Arial, sans-serif; font-size: 9.5pt; }
  .plist h1 { font-size: 16pt; margin: 0 0 1mm; }
  .plist .pmeta { margin: 0 0 4mm; color: #444 !important; }
  .plist h2 { font-size: 11.5pt; margin: 5mm 0 1.5mm; break-after: avoid; }
  .plist table { width: 100%; border-collapse: collapse; }
  .plist th, .plist td { border-bottom: 0.2mm solid #bbb; padding: 1.2mm 1.5mm; text-align: left; }
  .plist th { font-size: 8pt; color: #444 !important; }
  .plist .n { text-align: right; }
  .plist tr { break-inside: avoid; }
}
.addrow select { height: 46px; min-width: 0; max-width: 45%; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); padding: 0 10px; font-size: 15px; }
@media (max-width: 600px) {
  .addrow:has(select) { flex-wrap: wrap; }
  .addrow:has(select) input { flex: 1 1 100%; }
  .addrow:has(select) select { flex: 1 1 auto; max-width: none; }
  .mrow { gap: 2px; }
  .mrow .iconbtn.sm { width: 32px; height: 32px; }
  .mrow input { padding: 0 4px; }
}

.form.rows .f.f-mhd { grid-template-columns: 1fr; gap: 6px; }
.lot { grid-template-columns: 76px 1fr auto; }
.lot .muted { display: none; }
@media (max-width: 600px) { .cnt-muted { display: none; } }
.buyrow > span { display: flex; flex-direction: column; }
.buyrow .bmhd { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.buyrow .bmhd input { margin-top: 0 !important; flex: 1; min-width: 0; }
.nvrow { flex-wrap: wrap; }
.nvrow .chips { flex-wrap: wrap; overflow: visible; }
.pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.pair:has(.iconbtn) { grid-template-columns: minmax(0, 1fr) auto; }
.f select, .pair select, .f input, .f textarea { min-width: 0; max-width: 100%; }
.f { grid-template-columns: minmax(0, 1fr); }
.form { grid-template-columns: minmax(0, 1fr); }
.form.rows .f { grid-template-columns: 112px minmax(0, 1fr); }
.form.rows .f.f-mhd { grid-template-columns: minmax(0, 1fr); }
#fSizeRow .pair { grid-template-columns: minmax(0, 1fr) 84px; }
@media (max-width: 380px) { .form.rows .f { grid-template-columns: minmax(0, 1fr); } }
select, input, textarea, button { box-sizing: border-box; }
.phload { display: grid; place-items: center; width: 100%; height: 100%; min-height: 120px; color: var(--muted); font-size: 13px; background: var(--surface-2); }
.phload.sm { min-height: 0; font-size: 16px; }
.keybox.small { font-size: 12.5px; word-break: break-all; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.dhead h2.dtitle { margin: 0; text-align: center; font-size: 16.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag.soft { color: var(--ink); }
/* v4.3: Schlagworte, Verleihen, Belege, Versicherungsliste */
.tag.kw { background: var(--kwbg, var(--surface-2)); color: var(--kwfg, var(--ink)); }
.tag.kw0 { --kwbg: #e3eefb; --kwfg: #1d4a7a; } .tag.kw1 { --kwbg: #f6e6f1; --kwfg: #7a2660; } .tag.kw2 { --kwbg: #fbefd9; --kwfg: #6e4a07; }
.tag.kw3 { --kwbg: #e2f2ee; --kwfg: #145244; } .tag.kw4 { --kwbg: #ece8f8; --kwfg: #45358a; } .tag.kw5 { --kwbg: #f8e5e2; --kwfg: #7c2a1f; }
:root.dark .tag.kw0 { --kwbg: #1d3149; --kwfg: #b7d3f3; } :root.dark .tag.kw1 { --kwbg: #3d2236; --kwfg: #efbde0; } :root.dark .tag.kw2 { --kwbg: #3d3018; --kwfg: #f0d59e; }
:root.dark .tag.kw3 { --kwbg: #17352e; --kwfg: #a9e2d3; } :root.dark .tag.kw4 { --kwbg: #2a2546; --kwfg: #cdc3f5; } :root.dark .tag.kw5 { --kwbg: #3e211d; --kwfg: #f2bfb6; }
.tag.loan { background: var(--acc-soft); color: var(--acc); }
.kwrow { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.kwrow .tag { min-height: 32px; padding: 0 10px; font-size: 13px; cursor: pointer; border: 0; }
.kwrow .tag.sugg { background: transparent; border: 1px dashed var(--line); color: var(--muted); }
.kwrow .tag .ic { width: 13px; height: 13px; margin-left: 4px; }
.kwin { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 12px; background: var(--input); padding: 0 12px; font-size: 15px; }
.docrow, .loanrow { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.docrow > span, .loanrow > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.docrow small, .loanrow small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loanrow { flex-wrap: wrap; }
.loanrow > span { flex: 1 1 160px; }
.loanrow.late b, .loanrow.late small { color: var(--red); }
.muted.small { font-size: 13.5px; margin: 4px 0; }
@media print {
  .plist.ins { font-size: 8.5pt; }
  .plist.ins td small { font-size: 7.5pt; color: #444 !important; }
  .plist .pbreak { break-before: page; }
  .insph { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4mm; }
  .insph figure { margin: 0; break-inside: avoid; }
  .insph img { width: 100%; height: 45mm; object-fit: contain; border: 0.2mm solid #ccc; }
  .insph figcaption { font-size: 8pt; margin-top: 1mm; }
}
.form.rows .f.f-wide { grid-template-columns: minmax(0, 1fr); gap: 6px; }
/* v4.4: Kisten, Mehrfach-Erfassung, Sicherung, Selbsttest */
.areahint { display: flex; align-items: center; gap: 8px; width: 100%; margin: 6px 0 0; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 14px; color: var(--acc); font-weight: 700; font-size: 14px; text-align: left; }
.areastrip { display: grid; gap: 8px; margin: 8px 0 0; }
.areaph { display: flex; gap: 6px; overflow-x: auto; }
.areaph button { flex: none; width: 74px; height: 74px; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.areaph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.areacont { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.areacont b { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.areacont span { font-size: 14px; }
.areahits { display: grid; gap: 6px; margin: 0 0 12px; padding: 10px; border-radius: 14px; background: var(--acc-soft); }
.areahits > b { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--acc); }
.areahits button { display: flex; flex-direction: column; align-items: flex-start; text-align: left; background: var(--surface); border-radius: 11px; padding: 8px 10px; }
.areahits small { color: var(--muted); font-size: 12.5px; }
.bigph { background: #000; border-radius: 14px; overflow: hidden; }
.bigph img { width: 100%; max-height: 70vh; object-fit: contain; display: block; }
.banner.green { background: var(--acc-soft); color: var(--acc); }
.test-ok > .ic { color: var(--acc); } .test-warn > .ic { color: var(--amber); } .test-bad > .ic { color: var(--red); }
.quick .iconbtn + .iconbtn { margin-left: -4px; }
.empty.small { padding: 16px; } .empty.small p { margin: 0; }
.card.legal h2 { font-size: 15px; margin: 14px 0 4px; }
.card.legal h2:first-child { margin-top: 0; }
.card.legal p { margin: 0 0 6px; line-height: 1.5; }
.todo { background: var(--amber-soft); color: var(--amber); border-radius: 6px; padding: 0 4px; font-weight: 700; }
/* v4.6: Abo (nur Android-App) */
.abo-banner { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 10px; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin: 8px 0 0; }
.abo-banner span:first-child { display: flex; flex-direction: column; }
.abo-banner small { color: var(--muted); font-size: 12.5px; }
.abo-cta { color: var(--acc); font-weight: 800; font-size: 14px; }
.abo-banner .progress { grid-column: 1 / -1; }
.abo-list { display: grid; gap: 12px; margin: 4px 0 16px; }
.abo-li { display: flex; gap: 12px; align-items: flex-start; }
.abo-li > .ic { color: var(--acc); width: 24px; height: 24px; flex: none; margin-top: 2px; }
.abo-li span { display: flex; flex-direction: column; }
.abo-li small { color: var(--muted); font-size: 13px; }
/* v4.6.1: Hinweise und Einkauf getrennt */
.seg2 { display: grid; grid-template-columns: 1fr 1fr; }
.seg2 button { font-size: 13.5px; gap: 5px; padding: 0 4px; }
.badge.soft { background: var(--acc); }
.suggest { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: var(--amber-soft); border-radius: 14px; padding: 10px 12px; margin: 0 0 12px; }
.suggest > .ic { color: var(--amber); flex: none; }
.suggest span:not(.suggest-cta) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.suggest small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-cta { color: var(--amber); font-weight: 800; font-size: 14px; }
/* Handy-Leiste: vier Reiter (Statistik über Startseite/Einstellungen) */
.tabbar { grid-template-columns: repeat(4, minmax(0, 1fr)); }
body.desk .mobile-only { display: none !important; }
.tabbar .tab span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
@media (max-width: 380px) { .tabbar .tab span:last-child { font-size: 10.5px; letter-spacing: -.1px; } }
@media (max-width: 340px) { .tabbar { padding-left: 2px; padding-right: 2px; } .tabbar .tab span:last-child { font-size: 10px; letter-spacing: -.2px; } }

/* ===================== Design-Paket (kellerWERK24_COMPLETE_DESIGN_PACKAGE) ===================== */
/* Tokens aus specs/design-tokens.css; Grau und Warnfarbe je eine Stufe dunkler für ausreichenden Kontrast (WCAG AA) */
:root {
  --bg: #F5F3EE; --surface: #FFFDF9; --surface-2: #EDEBE4; --input: #FFFDF9;
  --ink: #18231D; --muted: #646C66; --fill: #173D2A; --acc: #2F6B4B;
  --amber: #975C07; --red: #B33B31;
  --r: 22px; --rc: 14px;
  --shadow: 0 12px 30px rgba(23, 61, 42, .08);
}
:root.dark {
  --bg: #111713; --surface: #1B241E; --surface-2: #243029; --input: #161e19;
  --ink: #EDF3ED; --muted: #AAB5AD; --side: #0d140f;
  --shadow: 0 12px 30px rgba(0, 0, 0, .35);
}
/* Kopf mit „K“-Kachel */
.logo-k { font-size: 24px; font-weight: 800; line-height: 1; letter-spacing: -.5px; border-radius: var(--rc); }
.logo.sm.logo-k { font-size: 18px; }
.apphead { padding: 20px 0 6px; }
.subline { margin: 0 0 14px; color: var(--muted); font-size: 15px; }
.subline:empty { display: none; }
/* Suche */
.search { height: 58px; border-radius: var(--r); padding: 0 18px; box-shadow: none; }
.iconbtn.big { width: 58px; height: 58px; border-radius: var(--r); box-shadow: none; }
/* Kategorie-Pillen */
.chip { min-height: 42px; padding: 0 20px; font-weight: 700; background: var(--surface); }
.chip[aria-pressed="true"] { background: var(--fill); border-color: var(--fill); color: #fff; }
/* „Alles im Blick“ */
.stats.hero { display: block; background: var(--fill); color: #fff; border-radius: var(--r); padding: 18px 20px 20px; margin: 16px 0 6px; box-shadow: var(--shadow); }
:root.dark .stats.hero { background: #1f4a33; }
.stats.hero[hidden] { display: none; }
.hero-k { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 12.5px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: #bfe0c9; }
.hero-k .dot { width: 8px; height: 8px; border-radius: 50%; background: #8fcc9f; }
.hero-n { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats.hero .stat { min-height: 0; background: transparent; border: 0; box-shadow: none; padding: 4px 8px; align-items: flex-start; text-align: left; color: #fff; border-radius: var(--rc); }
.stats.hero .stat:hover { background: rgba(255, 255, 255, .07); }
.stats.hero .stat b { font-size: 34px; color: #fff; }
.stats.hero .stat span { color: #d8e8dd; font-size: 13.5px; }
.stats.hero .stat.alert b { color: #ffd38a; }
/* Abschnittskopf */
.sechead { margin: 22px 0 12px; align-items: flex-end; }
.sechead-l { min-width: 0; }
.kicker { display: block; font-size: 12px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.sechead h2 { font-size: 24px; letter-spacing: -.4px; }
.sechead .btn.primary { border-radius: var(--rc); min-height: 46px; padding: 0 18px; font-weight: 800; }
/* Gegenstände als einzelne Karten */
.items { background: transparent; border: 0; box-shadow: none; overflow: visible; display: grid; gap: 10px; }
.items .item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; box-shadow: 0 2px 8px rgba(23, 61, 42, .04); }
.items .item:last-child { border-bottom: 1px solid var(--line); }
.items .item.picked { border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc-soft); }
.thumb { width: 60px; height: 60px; border-radius: 16px; background: var(--surface-2); }
.thumb b { font-size: 22px; }
.item .step { gap: 6px; background: transparent; border: 0; }
.item .step button { width: 38px; height: 38px; border-radius: 12px; background: var(--surface-2); }
.item .step .stepv { min-width: 30px; text-align: center; font-weight: 800; font-size: 17px; }
.quick { border-radius: var(--r); }
/* Formulare: Beschriftung über dem Feld, weiße Felder, große Überschrift */
.form.stack .f > span:first-child { font-size: 13px; font-weight: 700; color: var(--muted); }
.f input:not([type=checkbox]):not([type=radio]), .f select, .f textarea, .titlein {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--rc); min-height: 50px; }
.titlein { font-size: 26px; font-weight: 800; letter-spacing: -.4px; min-height: 56px; padding: 0 14px; width: 100%; margin-bottom: 4px; }
.dcard { border-radius: var(--r); }
.dfoot { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dfoot .btn { min-height: 52px; border-radius: var(--rc); font-weight: 800; }
.dfoot .btn:not(.primary) { background: var(--surface-2); border-color: var(--surface-2); }
/* Einstellungen: jede Zeile als eigene Fläche */
.setlist { background: transparent; border: 0; box-shadow: none; overflow: visible; display: grid; gap: 8px; }
.setlist > .setrow, .setlist > .mrow { background: var(--surface); border: 1px solid var(--line); border-radius: var(--rc); }
.grp { font-size: 13px; letter-spacing: .4px; }
.card, .invhead { border-radius: var(--r); }
/* Desktop: Seitenleiste dunkelgrün mit „K“, Kartenzeilen breit */
body.desk .side-brand .logo-k { background: transparent; color: #fff; font-size: 30px; width: 34px; }
body.desk .items .item { padding: 14px 18px; }
/* Design-Paket: schmale Bildschirme – nichts darf über den Rand */
.items { grid-template-columns: minmax(0, 1fr); }
.items .item { min-width: 0; }
.item .itemmain { min-width: 0; flex: 1 1 auto; }
.setlist { grid-template-columns: minmax(0, 1fr); }
.actions { flex-wrap: wrap; }
.actions .btn, .card .btn { white-space: normal; max-width: 100%; text-align: center; }
@media (max-width: 420px) {
  .thumb { width: 52px; height: 52px; border-radius: 14px; }
  .item .step button { width: 34px; height: 34px; }
  .item .step .stepv { min-width: 24px; font-size: 16px; }
  .items .item { padding: 10px; gap: 8px; }
}
@media (max-width: 420px) {
  .sechead h2 { font-size: 20px; }
  .sechead .btn.primary { padding: 0 14px; min-height: 44px; }
}
@media (max-width: 420px) {
  .sechead .btn.primary { font-size: 14px; padding: 0 12px; gap: 4px; min-height: 42px; }
  .sechead .btn.primary .ic { width: 16px; height: 16px; }
  .sechead h2 { font-size: 19.5px; }
}
@media (max-width: 600px) {
  .sechead h2 { font-size: clamp(17px, 5vw, 24px); }
  .sechead .btn.primary { font-size: 14px; padding: 0 12px; gap: 4px; min-height: 42px; flex: none; }
  .sechead .btn.primary .ic { width: 16px; height: 16px; }
}
@media (max-width: 600px) {
  .sechead h2 { font-size: clamp(16px, 4.7vw, 24px); white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.15; }
  .sechead { gap: 8px; }
}
/* Abo-Hinweis in „Alles im Blick“ (nur Android-App) */
.hero-free { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; width: 100%; margin-top: 14px; padding: 12px 8px 2px; border-top: 1px solid rgba(255, 255, 255, .15); background: none; color: #d8e8dd; text-align: left; border-radius: 0; }
.hero-free .hf-t { font-size: 13.5px; font-weight: 700; }
.hero-free .hf-c { font-size: 13.5px; font-weight: 800; color: #fff; }
.hero-free .hf-bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .18); overflow: hidden; }
.hero-free .hf-bar span { display: block; height: 100%; background: #8fcc9f; }
.hero-free.full .hf-t { color: #ffd38a; }
.hero-free.full .hf-bar span { background: #ffd38a; }

/* ===================== Mockup „homepage_assets_HQ“ ===================== */
/* Logo: Haus mit Regal und Blatt auf grüner Kachel */
.logo-hs { background: var(--fill); border-radius: var(--rc); display: grid; place-items: center; padding: 0; }
.logo-hs svg { width: 82%; height: 82%; }
body.desk .side-brand .logo-hs { background: transparent; width: 40px; height: 40px; }
/* Kennzahlen: drei weiße Kacheln */
.stats.tiles { display: block; background: none; padding: 0; margin: 14px 0 4px; box-shadow: none; }
.stats.tiles[hidden] { display: none; }
.stats.tiles .hero-n { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stats.tiles .stat { min-height: 84px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 2px 10px rgba(23, 61, 42, .05); color: var(--ink); text-align: center; padding: 10px 6px; }
.stats.tiles .stat:hover { background: var(--surface); border-color: var(--acc); }
.stats.tiles .stat b { font-size: 27px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.stats.tiles .stat span { font-size: 13.5px; color: var(--muted); }
.stats.tiles .stat.alert b { color: var(--red); }
/* Abo-Zeile (Android) unter den Kacheln, dezent */
.stats.tiles .hero-free { margin-top: 10px; padding: 8px 2px 0; border-top: 0; color: var(--muted); }
.stats.tiles .hero-free .hf-c { color: var(--acc); }
.stats.tiles .hero-free .hf-bar { background: var(--surface-2); }
.stats.tiles .hero-free .hf-bar span { background: var(--acc); }
.stats.tiles .hero-free.full .hf-t { color: var(--amber); }
.stats.tiles .hero-free.full .hf-bar span { background: var(--amber); }
/* Kategorie-Schildchen in Farbe */
.tag.c-green { background: #E3EFE6; color: #24563A; }
.tag.c-sand  { background: #F6E9D4; color: #7A5414; }
.tag.c-grey  { background: #E8E9E6; color: #4A524C; }
.tag.c-blue  { background: #E1EAF3; color: #2E4E6E; }
.tag.c-leaf  { background: #E8F1DC; color: #42612A; }
:root.dark .tag.c-green { background: #23402F; color: #BFE0C9; }
:root.dark .tag.c-sand  { background: #44351F; color: #F0D6A8; }
:root.dark .tag.c-grey  { background: #2C332E; color: #CDD5CF; }
:root.dark .tag.c-blue  { background: #233547; color: #C3D6EA; }
:root.dark .tag.c-leaf  { background: #2D3B22; color: #CFE3B5; }
/* Zeile: MHD-Warnung rot oben rechts, Mengenfeld mit Rahmen */
.rowside { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.mhdwarn { display: inline-flex; align-items: center; gap: 4px; color: var(--red); font-size: 13px; font-weight: 700; white-space: nowrap; }
.mhdwarn .ic { width: 15px; height: 15px; }
.item .step, .shopact .step { gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 2px; }
.item .step button, .shopact .step button { width: 34px; height: 34px; border-radius: 10px; background: transparent; }
.item .step button:hover, .shopact .step button:hover { background: var(--surface-2); }
.thumb img { object-fit: cover; }
/* Detail: Beschriftung links, drei Knöpfe unten */
.dfoot.three { grid-template-columns: 1fr 1fr 1.2fr; }
.btn.del { background: #FBE4E1; border-color: #FBE4E1; color: var(--red); }
:root.dark .btn.del { background: #4A2522; border-color: #4A2522; color: #F2B8B1; }
/* Nachkaufen wie im Mockup: Pillen-Umschalter, grüner Warenkorb-Knopf */
.seg2 { background: transparent; gap: 8px; padding: 0; }
.seg2 button { border-radius: 999px; border: 1px solid var(--line); background: var(--surface); min-height: 40px; }
.seg2 button[aria-pressed="true"] { background: var(--fill); border-color: var(--fill); color: #fff; }
.cartbtn { width: 46px; height: 46px; border-radius: 12px; background: var(--fill); color: #fff; border: 0; display: grid; place-items: center; }
.cartbtn.on { background: var(--acc-soft); color: var(--acc); }
.shopfoot .btn.primary.wide { min-height: 54px; border-radius: 14px; font-size: 16px; }
/* Name im Detail wie im Mockup als reiner Text – Rahmen erst beim Bearbeiten */
.titlein { border-color: transparent; background: transparent; padding-left: 2px; }
.titlein:hover { border-color: var(--line); }
.titlein:focus { border-color: var(--acc); background: var(--surface); }
/* Nachkaufen: drei Umschalter in einer Reihe, bei Bedarf umbrechend */
.seg2 { display: flex; flex-wrap: wrap; }
.seg2 button { flex: 1 1 auto; padding: 0 12px; }
/* Nachkaufen: Einkaufsliste als Knopf rechts im Kopf, zwei Umschalter wie im Mockup */
.seg2 { flex-wrap: nowrap; }
.pagehead .listbtn { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; font-size: 14px; }
.pagehead .listbtn .ic { width: 18px; height: 18px; color: var(--acc); }
.pagehead .listbtn .cnt { background: var(--acc); color: #fff; border-radius: 999px; min-width: 20px; height: 20px; display: inline-grid; place-items: center; font-size: 12px; padding: 0 5px; }
.pagehead .listbtn[aria-pressed="true"] { background: var(--fill); border-color: var(--fill); color: #fff; }
.pagehead .listbtn[aria-pressed="true"] .ic { color: #fff; }
.pagehead .listbtn[aria-pressed="true"] .cnt { background: #fff; color: var(--fill); }
/* Logo (Haus mit Regal und Blatt) auf cremefarbener Kachel */
.logo-img { background: #F5F2EA; border: 1px solid var(--line); overflow: hidden; padding: 0; display: grid; place-items: center; border-radius: var(--rc); }
.logo-img img { width: 100%; height: 100%; object-fit: contain; }
body.desk .side-brand .logo-img { width: 42px; height: 42px; border-color: transparent; }
/* Kauf-Seite: drei Preisoptionen */
.abo-opts { display: grid; gap: 8px; margin: 4px 0 12px; }
.abo-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); }
.abo-opt[aria-pressed="true"] { border-color: var(--acc); background: var(--acc-soft); }
.abo-opt .ao-l, .abo-opt .ao-p { display: flex; flex-direction: column; }
.abo-opt .ao-p { align-items: flex-end; font-weight: 800; }
.abo-opt small { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.abo-opt .ao-tip { color: var(--acc); }
/* Schmale Handys: nichts darf in andere Elemente hineinragen */
.itemtxt { min-width: 0; }
.itemtxt .tags { flex-wrap: wrap; min-width: 0; max-width: 100%; }
.itemtxt .tags .tag { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pagehead { flex-wrap: wrap; row-gap: 8px; }
.pagehead .listbtn { flex: none; }
.seg2 button { white-space: nowrap; padding: 0 10px; font-size: 14px; }
.seg2 button .cnt { flex: none; }
@media (max-width: 380px) {
  .seg2 { gap: 6px; }
  .seg2 button { font-size: 13px; padding: 0 8px; gap: 5px; }
  .seg2 button .cnt { min-width: 18px; height: 18px; font-size: 11px; }
}
@media (max-width: 340px) {
  .seg2 { flex-wrap: wrap; }
  .seg2 button { flex: 1 1 100%; }
}
/* Sehr schmale Handys (≤ 340 px): Mengenfeld unter den Text, damit Name und Schildchen Platz haben */
@media (max-width: 340px) {
  .items .item { flex-wrap: wrap; }
  .items .item .itemmain { flex: 1 1 calc(100% - 4px); }
  .items .item .rowside { flex: 1 1 100%; flex-direction: row; justify-content: space-between; align-items: center; padding-left: 60px; }
}
@media (max-width: 340px) { .items .item .rowside { box-sizing: border-box; min-width: 0; max-width: 100%; } }
@media (max-width: 340px) { .items .item .rowside { flex-wrap: wrap; justify-content: flex-start; gap: 6px 10px; } }
/* Haushalt-Umschalter (nur bei mehreren Haushalten) */
.homechip { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 10px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; font-size: 14px; }
.homerow { gap: 8px; }
.homerow .sr-t { flex: 1; }
.homechip { max-width: 100%; min-width: 0; }
.homechip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.homerow { min-width: 0; }
.homerow .sr-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.homerow .btn, .homerow .iconbtn { flex: none; }
.homerow .sr-t { white-space: normal; overflow-wrap: anywhere; text-overflow: clip; }
.homerow .sr-t small { display: block; color: var(--acc); font-weight: 700; }
.homerow { flex-wrap: wrap; row-gap: 6px; }
.homerow .sr-t { flex: 1 1 calc(100% - 44px); overflow-wrap: break-word; }
.homerow .btn { margin-left: auto; }
.homerow .btn { margin-left: 0; }
.homerow .sr-t + * { margin-left: auto; }
/* Logo wie im Mockup: dunkelgrüne Kachel mit hellem Symbol */
.logo-img { background: #0F4A2C; border-color: transparent; }
/* Austausch mit kochWERK24: Vorschau-Liste */
.w24list { display: grid; gap: 6px; margin: 8px 0 14px; max-height: 55vh; overflow: auto; }
.w24row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.w24row input { margin-top: 3px; width: 20px; height: 20px; flex: none; }
.w24row span { display: flex; flex-direction: column; min-width: 0; }
.w24row small { color: var(--muted); }
/* .w24row.off: siehe unten (ohne Transparenz) */
/* Seite „kochWERK24 verbinden“ */
h2.sect { font-size: 17px; margin: 22px 0 6px; }
ol.steps { margin: 4px 0 10px; padding-left: 22px; color: var(--muted); }
ol.steps li { margin: 2px 0; }
/* NestWERK24: Zuordnung je Rolle */
.card.nwrole { display: grid; gap: 6px; margin: 8px 0; }
.card.nwrole select { width: 100%; }
/* Baby-Notvorrat und Hausapotheke */
.card.baby .setlist { margin: 0 0 8px; }
.card.baby h2 { margin-top: 14px; }
.nvg.apo select { width: 100%; margin-top: 6px; }
/* Baby-Karte: lange deutsche Bezeichnungen umbrechen statt überstehen (320 px) */
.card.baby .nvg-t { flex-wrap: wrap; gap: 2px 8px; min-width: 0; }
.card.baby .nvg-t b { min-width: 0; overflow-wrap: anywhere; }
.card.baby .nvg small { display: block; overflow-wrap: anywhere; }
.card.baby label.nvt { flex-wrap: wrap; gap: 4px 8px; min-width: 0; }
.card.baby label.nvt > span:first-child { flex: 1 1 100%; }
.card.baby label.nvt input { max-width: 110px; }
/* Checklisten aus NestWERK24 */
.nlrow > span { width: 100%; }
.nlrow small { display: block; overflow-wrap: anywhere; }
.nlrow select { width: 100%; margin-top: 6px; }
.nlbtns { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
/* Abgeschwächte Zeilen (nicht zugeordnet, erledigt …) ohne Transparenz – sonst zu wenig Kontrast (WCAG 1.4.3) */
.w24row.off { opacity: 1; border-style: dashed; background: transparent; }
.nlrow.off b { text-decoration: line-through; }
/* Babykleidung nach Größen */
.bgrow > span { width: 100%; }
.bgrow small { display: block; overflow-wrap: anywhere; }
/* Marktplatz-Vorschau (4.22) */
.mkfotos { display: flex; flex-wrap: wrap; gap: 10px; }
.mkfoto { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; font-size: 14px; }
.mkfoto img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.mkfoto input { width: 22px; height: 22px; }
/* Kellerplan, Gefriertruhe, Aussortieren (4.23) */
.plancard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r, 16px); padding: 10px; margin: 12px 0; box-shadow: var(--shadow); }
.planhead { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 4px 10px; text-align: left; background: none; border: 0; flex-wrap: wrap; }
.planhead b { font-size: 17px; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.plangrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.ptile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 84px; padding: 10px; text-align: left; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); min-width: 0; }
.ptile.leer { background: var(--surface); border-style: dashed; }
.ptile small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.ptn { font-weight: 700; display: flex; gap: 4px; align-items: center; overflow-wrap: anywhere; min-width: 0; }
.pcnt { font-size: 22px; font-weight: 800; line-height: 1.1; }
.planhead .pcnt { font-size: 14px; font-weight: 650; color: var(--muted); }
.pmks { display: flex; gap: 4px; flex-wrap: wrap; margin-top: auto; }
.pmk { display: inline-flex; align-items: center; gap: 2px; font-size: 12.5px; font-weight: 750; padding: 1px 6px; border-radius: 999px; }
.pmk.red { background: var(--red-soft); color: var(--red); } .pmk.amber { background: var(--amber-soft); color: var(--amber); }
.pmk .ic { width: 13px; height: 13px; }
.frlist { display: grid; gap: 8px; }
.frrow.over { border-color: color-mix(in srgb, var(--red) 55%, transparent); }
.frrow.over .frinfo { color: var(--red); font-weight: 650; } .frrow.soon .frinfo { color: var(--amber); font-weight: 650; }
.frinfo .ic { width: 14px; height: 14px; vertical-align: -2px; margin-right: 3px; }
.setrow[disabled] { opacity: 1; cursor: default; }
#btnSpeak.on { animation: kwpuls 1.2s ease-in-out infinite; }
@keyframes kwpuls { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--fill) 25%, transparent); } }
@media (prefers-reduced-motion: reduce) { #btnSpeak.on { animation: none; } }
.frorte { margin-top: 18px; } .frorte > summary { cursor: pointer; list-style: revert; } .frorte > summary h2.sect { display: inline; }
/* Kellerplan bearbeiten, Sprachsuche (4.24) */
.planbar { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.planbar .note { margin: 0; flex: 1 1 auto; min-width: 0; }
.planbar .btn { flex: none; }
.planadd { margin: 14px 0; }
#btnSpeakSearch.on, #btnSpeakBulk.on { animation: kwpuls 1.2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { #btnSpeakSearch.on, #btnSpeakBulk.on { animation: none; } }
#btnSpeakBulk { align-self: flex-start; margin: 2px 0 6px; }
.mslist { display: grid; gap: 8px; }
.msrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.msrow input, .msrow select { min-width: 0; width: 100%; }
@media (max-width: 380px) { .msrow { grid-template-columns: minmax(0, 1fr) auto; } .msrow select { grid-column: 1; grid-row: 2; } .msrow .iconbtn { grid-row: 1 / span 2; grid-column: 2; } }
/* Kellerplan aufklappbar (4.25) */
.ptile { padding: 0; gap: 0; }
.ptmain { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; flex: 1 1 auto; padding: 10px; text-align: left; background: none; border: 0; border-radius: inherit; color: inherit; min-width: 0; }
.ptsub { display: flex; align-items: center; gap: 4px; width: 100%; min-height: 40px; padding: 6px 10px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--muted); font-size: 13px; font-weight: 700; text-align: left; border-radius: 0 0 12px 12px; }
.ptsub .ic { transition: transform .15s; }
.ptsub[aria-expanded="true"] { color: var(--ink, inherit); }
.ptsub[aria-expanded="true"] .ic { transform: rotate(90deg); }
.ptile.auf { outline: 2px solid var(--fill); outline-offset: -1px; }
.plansub { margin-top: 10px; padding: 8px 0 2px 10px; border-left: 3px solid var(--fill); }
.plansubt { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--muted); overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) { .ptsub .ic { transition: none; } }
@media print { .lbl-f { font-size: 8.5pt; } .lbl-f b { font-size: 10pt; } .labels.lbl-s .lbl-f { font-size: 7.5pt; } .labels.lbl-s .lbl-f b { font-size: 8.5pt; } }
.msrow input, .msrow select { min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 16px; color: inherit; }
.msrow select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.msrow { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
/* Heute-Übersicht, Einstellungssuche, Hilfe (4.26) */
.htiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px; margin: 6px 0 4px; }
.htile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.htile b { font-size: 22px; line-height: 1.1; } .htile span { font-size: 13px; color: var(--muted); font-weight: 650; }
.htile.red { border-color: color-mix(in srgb, var(--red) 45%, transparent); } .htile.red b { color: var(--red); }
.htile.amber { border-color: color-mix(in srgb, var(--amber) 45%, transparent); } .htile.amber b { color: var(--amber); }
.hrow.over { border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.hgrund { font-weight: 650; } .hgrund.exp, .hgrund.frost, .hgrund.loan, .hgrund.low { color: var(--red); } .hgrund.warr { color: var(--amber); }
.hweek { display: grid; gap: 6px; }
.hday { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.hday.leer { background: transparent; }
.hdh { display: grid; grid-template-columns: minmax(0, 9.5em) 1fr auto; gap: 10px; align-items: center; }
.hdh b { font-size: 14px; overflow-wrap: anywhere; }
.hbar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; } .hbar span { display: block; height: 100%; background: var(--fill); border-radius: inherit; }
.hcnt { font-weight: 800; min-width: 1.4em; text-align: right; }
.hday ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 2px; }
.hday li button { background: none; border: 0; padding: 6px 0; text-align: left; width: 100%; color: inherit; min-height: 32px; }
.hday li small { color: var(--muted); }
.hist li.weg b { text-decoration: line-through; text-decoration-thickness: 1px; }
.setsearch { margin: 0 0 6px; } .setsearch input { flex: 1; min-width: 0; }
.empty.small { padding: 18px 10px; }
.hgreet { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 16px 16px 16px 4px; padding: 12px 14px; margin: 4px 0 12px; }
.hgreet p { margin: 0; } .hgreet .ic { flex: none; color: var(--acc); }
.hsearch { margin-bottom: 8px; } .hsearch input { flex: 1; min-width: 0; }
.hchips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 10px; }
.hchips.col { flex-direction: column; align-items: stretch; }
.hlabel { width: 100%; font-size: 13px; font-weight: 700; color: var(--muted); }
.hq-chip { height: auto; min-height: 40px; padding: 8px 12px; white-space: normal; text-align: left; line-height: 1.3; }
.hans { background: var(--surface); border: 1px solid var(--fill); border-radius: 14px; padding: 12px 14px; margin: 4px 0 14px; outline: none; }
.hans:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--fill) 35%, transparent); }
.hans .hq { font-weight: 800; margin: 0 0 6px; } .hans p { margin: 0 0 10px; }
.hbook { margin: 4px 0 6px; justify-content: center; }
.hthema { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px 12px; margin: 8px 0; }
.hthema > summary { cursor: pointer; padding: 10px 0; font-weight: 750; min-height: 44px; display: flex; align-items: center; gap: 6px; }
