/* Einkauf – Design: hell, cremefarben mit braunen Akzenten */
:root {
  --page: #f5efe3;
  --panel: #fffbf3;
  --panel2: #fdf4e4;
  --line: #eadcc2;
  --line2: #f2e8d6;
  --ink: #1f2b4d;
  --ink2: #4a5272;
  --muted: #8b8577;
  --brown: #a8692c;
  --brown2: #c78f4c;
  --brown-d: #7f4c19;
  --cream: #fbe9cf;
  --zebra: #edf4fc;
  --ok: #2e8b45;
  --bad: #c0392b;
  --warn: #b7791f;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(80, 55, 20, .08), 0 6px 18px rgba(80, 55, 20, .07);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); color: var(--ink); background: var(--page);
  font-size: 15px; line-height: 1.35; -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
a { color: var(--brown); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.hidden { display: none !important; }
.boot { padding: 40px; text-align: center; color: var(--muted); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* ---------- Buttons & Eingaben */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 10px; padding: 8px 14px; cursor: pointer; min-height: 38px;
  text-decoration: none; transition: background .15s, transform .05s, opacity .15s; user-select: none;
}
.btn:hover { background: var(--panel2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary {
  background: linear-gradient(180deg, var(--brown2), var(--brown)); border-color: var(--brown-d); color: #fff; font-weight: 600;
  box-shadow: 0 2px 6px rgba(127, 76, 25, .25);
}
.btn-primary:hover { background: linear-gradient(180deg, #d09a58, #9d6026); }
.btn-danger { color: var(--bad); border-color: #efc9c3; }
.btn-danger:hover { background: #fff1ef; }
.btn-big { min-height: 48px; font-size: 16.5px; padding: 10px 18px; width: 100%; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: rgba(168, 105, 44, .08); }
.btn-sm { min-height: 30px; padding: 4px 10px; font-size: 13.5px; border-radius: 8px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: #fff;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; flex: none;
}
.icon-btn:hover { background: var(--panel2); }
.icon-btn.on { background: var(--brown); border-color: var(--brown-d); color: #fff; }
.icon-btn svg, .btn svg { width: 20px; height: 20px; flex: none; }

input[type=text], input[type=search], input[type=number], input[type=password], input[type=date], input:not([type]), select, textarea {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 8px 10px; min-height: 38px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--brown2); box-shadow: 0 0 0 3px rgba(199, 143, 76, .2); }
textarea { min-height: 64px; resize: vertical; }
label { display: block; margin: 10px 0; font-size: 13.5px; color: var(--ink2); }
label > input, label > select, label > textarea { margin-top: 4px; font-size: 15px; color: var(--ink); }
label.check { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 15px; }
label.check svg { width: 18px; height: 18px; color: #d69e2e; flex: none; }
label.check input { width: 20px; height: 20px; accent-color: var(--brown); margin: 0; }
input[type=checkbox] { accent-color: var(--brown); }

.msg { padding: 10px 12px; border-radius: 10px; margin: 10px 0; font-size: 14px; }
.msg-err { background: #fdecea; color: #8e2a1f; border: 1px solid #f5c6c0; }
.msg-ok { background: #eaf6ec; color: #1f6b33; border: 1px solid #c5e6cc; }
.msg-warn { background: #fff6e0; color: #7a5410; border: 1px solid #f1dca8; }

/* ---------- Login / Einrichtung */
.page-login { display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 40px; min-height: 100%;
  background: radial-gradient(ellipse at top, #fff8ea, var(--page)); }
.login-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 26px; box-shadow: var(--shadow); }
.install-card { max-width: 520px; }
.login-card h1 { margin: 6px 0 14px; text-align: center; font-size: 28px; }
.login-card h2 { font-size: 17px; margin: 20px 0 6px; }
.login-logo { text-align: center; }
.login-logo img { width: 76px; height: 76px; border-radius: 18px; box-shadow: var(--shadow); }
.reqs { list-style: none; padding: 0; margin: 0; }
.reqs li { padding: 3px 0; }
.reqs .ok { color: var(--ok); } .reqs .bad { color: var(--bad); font-weight: 600; }
.skip-form { margin-top: 10px; }
.skip-form .btn { width: 100%; }
details { margin: 10px 0; } summary { cursor: pointer; color: var(--brown); }

/* ---------- Grundgerüst Desktop */
.app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 8px 16px; background: linear-gradient(180deg, #fffaf0, #f9f0df);
  border-bottom: 1px solid var(--line); min-height: 54px; flex: none;
}
.topbar h1 { font-size: 22px; margin: 0; font-weight: 700; letter-spacing: -.2px; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.topbar h1 img { width: 30px; height: 30px; border-radius: 8px; }
.topbar .spacer { flex: 1; }
.where {
  display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 20px;
  padding: 4px 6px 4px 12px; font-size: 13.5px; color: var(--ink2); max-width: 46vw;
}
.where .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.where span.t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.where button { border: 0; background: transparent; cursor: pointer; color: var(--muted); padding: 2px 6px; border-radius: 10px; }
.where button:hover { background: var(--panel2); }

.seg { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 2px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 10px; border-radius: 8px; cursor: pointer; font-size: 13.5px; color: var(--ink2); white-space: nowrap; }
.seg button.on { background: var(--brown); color: #fff; font-weight: 600; }

.main { flex: 1; min-height: 0; display: grid; grid-template-columns: 300px minmax(0, 1fr) 280px; gap: 10px; padding: 10px; }
.main.single { grid-template-columns: minmax(0, 1fr); }
.main.two { grid-template-columns: 340px minmax(0, 1fr); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 8px; }
.panel-head h2 { margin: 0; font-size: 21px; white-space: nowrap; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.panel-head h2 svg { width: 26px; height: 26px; color: var(--brown); }
.panel-head .spacer { flex: 1; }
.panel-body { flex: 1; overflow: auto; min-height: 0; -webkit-overflow-scrolling: touch; }
.panel-pad { padding: 0 12px 12px; }
.panel.fav { background: #f6fbf3; border-color: #dbe9d2; }

/* Produktsuche */
.search { position: relative; margin: 0 12px 8px; }
.search input { padding-left: 36px; background: #f4efe6; border-color: #e8dcc6; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.search .clear { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; cursor: pointer; color: var(--muted); padding: 6px 8px; font-size: 16px; }
.letters { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; padding: 0 12px 8px; }
.letters button { border: 1px solid #f0dcb8; background: #fdf0da; color: var(--ink); border-radius: 6px; height: 30px; cursor: pointer; font-size: 14px; padding: 0; }
.letters button:hover { background: #fbe4bf; }
.letters button.on { background: var(--brown); color: #fff; border-color: var(--brown-d); }
.letters button.all { grid-column: span 3; background: linear-gradient(180deg, var(--brown2), var(--brown)); color: #fff; border-color: var(--brown-d); font-weight: 600; letter-spacing: .5px; }
.letters button.all.off { background: #fdf0da; color: var(--ink); border-color: #f0dcb8; font-weight: 400; }
.letters button.tagbtn { grid-column: span 3; }
.filters { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 12px 8px; }
.mchip { border: 1px solid transparent; border-radius: 7px; padding: 3px 8px; font-size: 12.5px; cursor: pointer; background: var(--bg, #fbe9cf); color: var(--fg, #8a5a1c); font-weight: 600; opacity: .8; }
.mchip.on { opacity: 1; box-shadow: inset 0 0 0 2px var(--fg); }
.tchip { display: inline-flex; align-items: center; gap: 4px; border-radius: 12px; padding: 2px 9px; font-size: 12.5px; background: #fff; border: 1px solid var(--tc, #b07a3c); color: var(--tc, #b07a3c); cursor: pointer; }
.tchip.on { background: var(--tc, #b07a3c); color: #fff; }

.plist { list-style: none; margin: 0; padding: 0 8px 10px; }
.plist li {
  display: flex; align-items: center; gap: 10px; padding: 6px 6px; border-bottom: 1px solid var(--line2); cursor: pointer; border-radius: 8px; min-height: 50px;
}
.plist li:hover { background: #fff3df; }
.plist li.sel { background: #fde8c6; }
.plist .pinfo { flex: 1; min-width: 0; }
.plist .pname { font-weight: 500; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.plist .psub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plist .chev { color: #b9ae99; flex: none; }
.panel.fav .inlist { font-size: 0; padding: 0; width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.panel.fav .inlist::after { content: '✓'; font-size: 11px; }
.plist .inlist { font-size: 11px; background: var(--ok); color: #fff; border-radius: 9px; padding: 1px 7px; flex: none; }
.plist .letterhead { min-height: 0; padding: 8px 6px 2px; font-weight: 700; color: var(--brown); border: 0; cursor: default; font-size: 13px; }
.plist .letterhead:hover { background: none; }
.thumb { width: 40px; height: 40px; border-radius: 9px; object-fit: contain; background: #fff; border: 1px solid var(--line2); flex: none; }
.thumb.ph { display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; font-size: 17px; border: 0; }
.thumb.big { width: 64px; height: 64px; border-radius: 12px; }
.thumb.xl { width: 120px; height: 120px; border-radius: 16px; }
.empty { padding: 26px 16px; color: var(--muted); text-align: center; }
.empty svg.big { width: 54px; height: 54px; color: var(--brown2); }

/* Marktreiter */
.chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 7px; padding: 10px 12px 4px; }
.chip {
  border: 0; border-radius: 10px; padding: 8px 6px 7px; cursor: pointer; background: var(--bg); color: var(--fg); text-align: center;
  transition: opacity .2s, transform .05s; min-height: 58px; position: relative;
}
.chip b { display: block; font-size: 15.5px; }
.chip small { display: block; font-size: 12px; opacity: .85; margin-top: 2px; font-variant-numeric: tabular-nums; }
.chip.off { opacity: .32; }
.chip .cnt { position: absolute; top: 4px; right: 6px; font-size: 11px; font-weight: 700; }
.chip:active { transform: translateY(1px); }

/* Einkaufsliste (Tabelle) */
.listtools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.listtools { flex-wrap: nowrap; }
.listtools .listsearch { width: 170px; min-height: 34px; padding: 5px 10px; }
table.elist { width: 100%; border-collapse: separate; border-spacing: 0; }
.elist th {
  position: sticky; top: 0; z-index: 2; background: #8d6236; color: #fff; font-size: 13px; letter-spacing: .2px; font-weight: 600; padding: 8px 6px; text-align: left;
  border-bottom: 1px solid #6f4a24;
}
.elist td { padding: 5px 6px; border-bottom: 1px solid #e3ecf5; vertical-align: middle; }
.elist tr.row:nth-child(even of .row) td { background: var(--zebra); }
.elist tr.row:hover td { background: #fff5e4; }
.elist tr.grp td { background: var(--bg) !important; color: var(--fg); font-weight: 700; padding: 7px 10px; border-bottom: 0; position: sticky; top: 33px; z-index: 1; }
.elist tr.grp td .sub { float: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.elist tr.secthead td { background: #f3ede2 !important; color: var(--ink2); font-weight: 600; padding: 7px 10px; }
.elist tr.done td { color: var(--muted); }
.elist tr.done .iname { text-decoration: line-through; text-decoration-color: rgba(0,0,0,.25); }
.elist tr.dim td { opacity: .55; }
.elist tr.calc td { background: #fff1c9 !important; }
.iname { font-weight: 500; cursor: pointer; white-space: pre-line; }
.isub { font-size: 12px; color: var(--muted); }
.inote { font-size: 12.5px; color: var(--bad); white-space: pre-line; }
.offer { color: var(--bad); font-weight: 700; }
.strike { text-decoration: line-through; color: var(--muted); font-size: 12px; margin-right: 4px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; background: #fff; overflow: hidden; }
.qty button { border: 0; background: transparent; width: 28px; height: 32px; cursor: pointer; font-size: 18px; color: var(--brown); padding: 0; }
.qty button:hover { background: var(--panel2); }
.qty span { white-space: nowrap; min-width: 34px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; font-size: 14px; cursor: pointer; }
.mtag { display: inline-block; padding: 2px 8px; border-radius: 7px; background: var(--bg); color: var(--fg); font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; border: 0; }
.mtag-sm { font-size: 11.5px; padding: 1px 7px; margin: 2px 0; }
.cheaper { font-size: 11.5px; color: var(--ok); white-space: nowrap; cursor: help; }
.acts { display: flex; gap: 4px; justify-content: flex-end; }
.acts .icon-btn { width: 32px; height: 32px; }
.acts .icon-btn svg { width: 18px; height: 18px; }
.ck { border-color: #9fd0aa; color: var(--ok); background: #f3fbf4; }
.ck:hover { background: #e2f4e6; }
.ck.on { background: var(--ok); border-color: #1f6d33; color: #fff; }
.zb.on { background: #e9a23b; border-color: #b8761d; color: #fff; }
.rb.on { background: #f4c84a; border-color: #c99a14; color: #5a4300; }
.deferinfo { font-size: 11.5px; color: var(--warn); white-space: nowrap; }
.deferinfo svg { width: 12px; height: 12px; vertical-align: -2px; }

.bottombar { display: flex; gap: 8px; padding: 8px 10px 10px; flex: none; align-items: stretch; }
.tool {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: var(--cream); border: 1px solid #f0d9b4; border-radius: 10px; padding: 7px 4px; cursor: pointer; color: var(--ink); font-size: 13px;
}
.tool:hover { background: #f9dfb8; }
.tool svg { width: 24px; height: 24px; color: var(--brown-d); }
.tool span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tool.on { background: #f4cf98; }
.totalbar {
  display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; padding: 9px 14px; border-top: 1px solid var(--line); background: var(--panel2); font-size: 14px;
}
.totalbar b { font-variant-numeric: tabular-nums; }
.totalbar .spacer { flex: 1; }
.calcbox { background: #fff1c9; border: 1px solid #ecd27e; border-radius: 9px; padding: 3px 4px 3px 10px; display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Dialoge (ohne dunklen Schleier: heller Hintergrund + Unschärfe) */
.overlay {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(250, 244, 232, .55); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
  animation: fadein .15s ease;
}
@keyframes fadein { from { opacity: 0; } }
.dialog {
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 20px 60px rgba(80, 55, 20, .25);
  width: 100%; max-width: 460px; max-height: calc(100dvh - 32px); display: flex; flex-direction: column; animation: pop .16s ease;
}
.dialog.wide { max-width: 760px; }
.dialog.xwide { max-width: 1000px; }
@keyframes pop { from { transform: scale(.97) translateY(6px); opacity: .5; } }
.dialog-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 6px; }
.dialog-head h3 { margin: 0; font-size: 19px; flex: 1; }
.dialog-body { padding: 4px 16px 10px; overflow: auto; -webkit-overflow-scrolling: touch; }
.dialog-foot { display: flex; gap: 8px; padding: 10px 16px 14px; justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--line2); }
.dialog-foot .btn { min-width: 96px; }
.dialog-foot .left { margin-right: auto; }
.dialog p { margin: 6px 0 10px; }
.x { border: 0; background: transparent; font-size: 24px; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; border-radius: 8px; }
.x:hover { background: var(--panel2); }

.choice { display: flex; flex-direction: column; gap: 6px; }
.choice button, .choice label.opt {
  display: flex; align-items: center; gap: 10px; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 11px; padding: 10px 12px; cursor: pointer; margin: 0; color: var(--ink);
}
.choice .opt.on, .choice button.on { border-color: var(--brown); box-shadow: 0 0 0 2px rgba(168, 105, 44, .25); background: #fff8ec; }
.choice .opt input { display: none; }
.choice .mname { font-weight: 700; padding: 3px 9px; border-radius: 7px; background: var(--bg); color: var(--fg); min-width: 86px; text-align: center; }
.choice .grow { flex: 1; }
.choice .best { font-size: 11.5px; color: #fff; background: var(--ok); border-radius: 8px; padding: 1px 7px; margin-left: 6px; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 24px; cursor: pointer; color: var(--brown); }
.stepper input { text-align: center; font-size: 20px; font-weight: 600; max-width: 120px; min-height: 46px; }
.stepper .unit { color: var(--muted); }
.stepper.plain input { max-width: 180px; text-align: right; padding-right: 12px; }
.stepper.plain .unit { font-size: 18px; font-weight: 600; color: var(--ink2); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 12px; }
.row-flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hr { height: 1px; background: var(--line2); margin: 12px 0; }
.sect-title { font-weight: 700; font-size: 14px; color: var(--brown-d); margin: 14px 0 4px; text-transform: uppercase; letter-spacing: .4px; }

/* Toast */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + var(--safe-b)); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #fffaf2; border: 1px solid var(--line); color: var(--ink); padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow); font-size: 14.5px; animation: pop .2s ease; max-width: 90vw; }
.toast.err { border-color: #f1b8b0; color: #8e2a1f; background: #fff4f2; }

/* Popover-Menü */
.menu { position: fixed; z-index: 150; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 34px rgba(80, 55, 20, .2); padding: 6px; min-width: 220px; animation: pop .12s ease; }
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; border: 0; background: transparent; padding: 9px 10px; border-radius: 8px; cursor: pointer; text-align: left; color: var(--ink); }
.menu button:hover { background: var(--panel2); }
.menu button svg { width: 18px; height: 18px; color: var(--brown); }
.menu .sep { height: 1px; background: var(--line2); margin: 4px 0; }
.menu .mh { font-size: 12px; color: var(--muted); padding: 6px 10px 2px; }

/* ---------- Produkte verwalten */
.editor { padding: 6px 18px 18px; }
.editor-top { display: flex; gap: 16px; align-items: flex-start; }
.editor-top .imgbox { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.ptable { width: 100%; border-collapse: collapse; font-size: 14px; }
.ptable th { text-align: left; font-size: 12.5px; color: var(--ink2); font-weight: 600; padding: 4px 4px; border-bottom: 1px solid var(--line); }
.ptable td { padding: 3px 4px; border-bottom: 1px solid var(--line2); }
.ptable input { min-height: 34px; padding: 5px 8px; }
.ptable tr.inactive td { opacity: .5; }
.ptable tr.best td { background: #eef8ef; }
.ptable .upr { font-size: 12.5px; color: var(--ink2); white-space: nowrap; }
.tags-edit { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tags-edit input { width: 150px; min-height: 30px; padding: 4px 8px; }

/* Vergangene Einkäufe */
.hist { width: 100%; border-collapse: collapse; font-size: 14px; }
.hist th { position: sticky; top: 0; background: #8d6236; color: #fff; text-align: right; padding: 7px 8px; font-size: 12.5px; z-index: 1; }
.hist th:first-child { text-align: left; }
.hist td { padding: 6px 8px; border-bottom: 1px solid #e6edf4; text-align: right; font-variant-numeric: tabular-nums; }
.hist td:first-child { text-align: left; }
.hist tr.month td { background: var(--cream); font-weight: 700; color: var(--brown-d); }
.hist tr.prow { cursor: pointer; }
.hist tr.prow:hover td { background: #fff5e4; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding: 10px 14px 0; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; height: 100%; justify-content: flex-end; cursor: default; }
.bars .bar i { display: block; width: 100%; max-width: 46px; background: linear-gradient(180deg, var(--brown2), var(--brown)); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.bars .bar span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.bars .bar em { font-size: 10.5px; font-style: normal; color: var(--ink2); white-space: nowrap; }
.receipt { width: 100%; border-collapse: collapse; font-size: 14px; }
.receipt td { padding: 4px 6px; border-bottom: 1px solid var(--line2); }
.receipt tr.mh td { font-weight: 700; padding-top: 12px; color: var(--fg); }
.receipt tr.sum td { font-weight: 700; border-bottom: 2px double var(--ink2); }
.listimg { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

/* Essensplan */
.plan { width: 100%; border-collapse: collapse; }
.plan th { position: sticky; top: 0; background: #8d6236; color: #fff; padding: 7px 8px; text-align: left; font-size: 13px; z-index: 1; }
.plan td { padding: 4px 6px; border-bottom: 1px solid #e6edf4; }
.plan tr.we td { background: #fff8ec; }
.plan tr.today td { background: #fdebc8; }
.plan .day { white-space: nowrap; font-variant-numeric: tabular-nums; }
.plan .slot { display: flex; gap: 4px; align-items: center; }
.plan select { min-height: 34px; padding: 4px 6px; }
.plan .icon-btn { width: 34px; height: 34px; }

/* Märkte */
.mrow { display: grid; grid-template-columns: 34px 1fr 44px 44px 80px auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line2); }
.mrow input[type=color] { width: 40px; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: #fff; }
.mprev { border-radius: 8px; padding: 6px 8px; text-align: center; font-weight: 700; font-size: 13px; }

/* Bildzuschnitt */
.cropwrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.crop { width: 280px; height: 280px; border-radius: 16px; overflow: hidden; position: relative; touch-action: none; cursor: grab;
  background: repeating-conic-gradient(#f3ece0 0 25%, #fff 0 50%) 0 0 / 20px 20px; border: 2px solid var(--brown2); }
.crop img { position: absolute; left: 0; top: 0; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; pointer-events: none; max-width: none; }
.crop input[type=range] { width: 260px; }

/* ---------- Handy */
.m-app { min-height: 100dvh; display: flex; flex-direction: column; background: var(--page); }
.m-top {
  position: sticky; top: 0; z-index: 20; background: linear-gradient(180deg, #fffaf0, #f9f0df); border-bottom: 1px solid var(--line);
  padding: calc(6px + var(--safe-t)) 10px 6px; display: flex; align-items: center; gap: 8px;
}
.m-market { border: 0; border-radius: 11px; padding: 8px 12px; font-size: 18px; font-weight: 800; background: var(--bg, #fbe9cf); color: var(--fg, #7f4c19); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; max-width: 58vw; }
.m-market span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-top .spacer { flex: 1; }
.m-where { font-size: 12.5px; color: var(--ink2); padding: 5px 12px; background: #f3fbef; border-bottom: 1px solid #dcebd3; display: flex; align-items: center; gap: 6px; }
.m-where .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.m-tabs { display: flex; gap: 6px; padding: 8px 10px 4px; position: sticky; top: calc(55px + var(--safe-t)); z-index: 15; background: var(--page); }
.m-tabs button { flex: 1; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 4px; font-weight: 600; color: var(--ink2); cursor: pointer; font-size: 14.5px; }
.m-tabs button.on { background: var(--brown); color: #fff; border-color: var(--brown-d); }
.m-tabs button small { font-weight: 500; opacity: .8; }
.m-body { flex: 1; padding: 6px 10px calc(150px + var(--safe-b)); }
.m-card {
  display: flex; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px; margin: 7px 0; box-shadow: 0 1px 2px rgba(80, 55, 20, .05);
  transition: opacity .25s;
}
.m-card.done { opacity: .5; }
.m-card.calc { background: #fff6d8; }
.m-card .mi { flex: 1; min-width: 0; }
.m-card .mn { font-weight: 600; font-size: 16px; white-space: pre-line; }
.m-card.done .mn { text-decoration: line-through; }
.m-card .ms { font-size: 12.5px; color: var(--muted); }
.m-card .mrow2 { display: flex; align-items: center; gap: 8px; margin-top: 5px; flex-wrap: wrap; }
.m-card .mp { font-weight: 700; font-variant-numeric: tabular-nums; margin-left: auto; font-size: 15px; }
.m-card .qty button { width: 34px; height: 34px; }
.m-check {
  width: 54px; height: 54px; border-radius: 16px; border: 2px solid #cfe5d3; background: #f3fbf4; color: #9cc8a5; flex: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.m-check svg { width: 30px; height: 30px; }
.m-check.on { background: var(--ok); border-color: #1f6d33; color: #fff; }
.m-sect { font-size: 13px; font-weight: 700; color: var(--ink2); margin: 14px 4px 2px; text-transform: uppercase; letter-spacing: .4px; display: flex; justify-content: space-between; }
.m-sect.mk { color: var(--fg); background: var(--bg); padding: 6px 10px; border-radius: 9px; text-transform: none; font-size: 15px; letter-spacing: 0; }
.m-mini { display: flex; align-items: center; gap: 8px; padding: 8px 6px; border-bottom: 1px solid var(--line2); }
.m-mini .mn { flex: 1; min-width: 0; white-space: pre-line; }
.m-mini .mn svg { width: 18px; height: 18px; vertical-align: -3px; color: var(--brown); }
.m-mini .tiny { font-size: 11.5px; padding: 2px 7px; border-radius: 7px; }
.m-mini.done .mn { text-decoration: line-through; color: var(--muted); }
.m-bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(255, 250, 241, .96); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line); padding: 6px 8px calc(8px + var(--safe-b));
}
.m-total { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 6px 6px; font-size: 14px; }
.m-total b { font-size: 18px; font-variant-numeric: tabular-nums; }
.m-actions { display: flex; gap: 6px; }
.m-actions button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 1px solid #f0d9b4; background: var(--cream); border-radius: 12px; padding: 7px 2px; font-size: 12px; cursor: pointer; color: var(--ink); }
.m-actions button svg { width: 24px; height: 24px; color: var(--brown-d); }
.m-start { padding: 16px 12px calc(30px + var(--safe-b)); }
.m-start h2 { text-align: center; margin: 8px 0 14px; font-size: 22px; }
.m-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.m-grid button {
  border: 0; border-radius: 16px; min-height: 92px; background: var(--bg); color: var(--fg); font-size: 21px; font-weight: 800; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; box-shadow: 0 2px 6px rgba(80, 55, 20, .08);
}
.m-grid button small { font-size: 13px; font-weight: 600; opacity: .85; }
.m-grid button.zero { opacity: .45; }
.m-kasse { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-top: 8px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 14px; }
.m-kasse .kl { display: flex; gap: 8px; padding: 3px 0; }
.m-kasse .kl .kn { flex: 1; min-width: 0; }
.m-kasse .kl.sum { border-top: 2px dashed var(--line); margin-top: 8px; padding-top: 8px; font-weight: 700; font-size: 16px; }
.sheet .dialog { max-width: 560px; }

@media (max-width: 1400px) {
  .main { grid-template-columns: 265px minmax(0, 1fr) 235px; }
  .panel-head h2 { font-size: 19px; }
  .listtools .listsearch { width: 130px; }
  .elist .thumb { width: 34px; height: 34px; }
}
@media (max-width: 1250px) {
  .main { grid-template-columns: 250px minmax(0, 1fr) 215px; }
  .tool { font-size: 12px; }
}
@media (max-width: 1080px) {
  .main { grid-template-columns: 260px minmax(0, 1fr); }
  .main .panel.fav { display: none; }
}
@media (max-width: 700px) {
  .overlay { align-items: flex-end; padding: 0; }
  .dialog { max-width: none !important; border-radius: 18px 18px 0 0; max-height: 92dvh; padding-bottom: var(--safe-b); }
  .grid3 { grid-template-columns: 1fr 1fr; }
  .editor { padding: 6px 12px 16px; }
  .ptable .hide-s { display: none; }
  .mrow { grid-template-columns: 30px 1fr 40px 40px; }
  .mrow .mprev { display: none; }
  input, select, textarea { font-size: 16px !important; } /* verhindert Zoom auf dem iPhone */
  .bars { height: 130px; gap: 8px; }
  .bars .bar span { font-size: 10.5px; }
}
@media print {
  .topbar, .bottombar, .panel:not(.printme) { display: none !important; }
}

/* Warte-Kreisel */
.spin { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brown); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Lange drücken: kein iOS-Textmenü, leichte Rückmeldung beim Halten */
.m-card, .m-mini, .elist tr.row { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.m-card.pressing, .m-mini.pressing { transform: scale(.98); opacity: .8; transition: transform .4s, opacity .4s; }
.elist tr.row.pressing td { background: #fde8c6 !important; }

/* Ziehgriff (Reihenfolge im Markt) */
.dgrip { display: flex; align-items: center; justify-content: center; color: #b9ae99; touch-action: none; cursor: grab; flex: none; user-select: none; -webkit-user-select: none; }
.dgrip:hover { color: var(--brown); }
.dgrip svg { width: 22px; height: 22px; pointer-events: none; }
.m-grip { width: 30px; align-self: stretch; margin: -8px -6px -8px -4px; }
.mini-grip { width: 28px; height: 34px; margin-right: -4px; }
.mini-grip-sp { width: 24px; flex: none; }
.t-grip { width: 24px; height: 32px; }
.t-grip svg { width: 18px; height: 18px; }
.t-grip-sp { width: 24px; flex: none; }
.qcell { display: flex; align-items: center; gap: 2px; }
.dragging { position: relative; z-index: 5; background: #fffdf8 !important; box-shadow: 0 10px 28px rgba(80, 55, 20, .22); transform: scale(1.02); }
tr.dragging td { background: #fffaf0 !important; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.learnlist { margin: 8px 0 10px; padding-left: 18px; }
.learnlist li { margin: 3px 0; }
/* Gewicht: eintippen statt −/+ */
.qty.wt { padding: 0 8px 0 2px; cursor: text; }
.qty.wt input { width: 52px; border: 0; background: transparent; text-align: right; font: inherit; font-weight: 600; font-size: 16px; font-variant-numeric: tabular-nums; color: var(--ink); padding: 0 3px; margin: 0; line-height: 30px; outline: none; box-shadow: none; min-height: 0; height: 30px; }
.qty.wt span { min-width: 0; font-weight: 500; color: var(--muted); cursor: text; font-size: 13.5px; }
.qty.wt:focus-within { border-color: var(--brown2); box-shadow: 0 0 0 3px rgba(199, 143, 76, .18); }

/* Auswahlliste im App-Stil */
.selmenu { overflow-y: auto; padding: 5px; min-width: 160px; border-radius: 12px; }
.selmenu button { padding: 7px 10px 7px 6px; gap: 6px; font-size: 14.5px; white-space: nowrap; }
.selmenu button .ck { width: 18px; display: inline-flex; flex: none; }
.selmenu button .ck svg { width: 16px; height: 16px; color: var(--brown); }
.selmenu button.act { background: var(--panel2); }
.selmenu button.sel { font-weight: 600; color: var(--brown); }
.selmenu button:disabled { opacity: .45; cursor: default; }

/* ---------- Alle Einkäufe: Marktspalten */
.hyear { width: auto; min-width: 130px; font-weight: 600; }
.hfix { display: flex; gap: 14px; align-items: center; justify-content: space-between; line-height: 1.5; }
.hfix .btn { flex: none; }
.histwrap { overflow-x: auto; border-radius: 10px; }
.hist2 th { text-align: right; white-space: nowrap; }
.hist2 th .mtag { font-size: 12px; }
.hist2 td { white-space: nowrap; padding: 4px 8px; }
.hist2 tr.prow { cursor: default; }
.hist2 tfoot td { position: sticky; bottom: 0; background: #f3e4c8; font-weight: 700; color: var(--brown-d); border-top: 2px solid #e2cba0; padding: 8px; }
.hdate { border: 0; background: transparent; padding: 4px 6px; margin-left: -6px; border-radius: 7px; cursor: pointer; font: inherit; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }
.hdate:hover { background: #fff1d9; color: var(--brown-d); }
.hdate .hic { width: 15px; height: 15px; color: var(--muted); }
.bonbtn { border: 1px solid transparent; background: color-mix(in srgb, var(--bg) 55%, #fff); color: var(--ink); border-radius: 8px; padding: 4px 9px; cursor: pointer; font: inherit; font-variant-numeric: tabular-nums; white-space: nowrap; transition: transform .08s ease, box-shadow .12s ease; }
.bonbtn:hover { border-color: var(--fg); box-shadow: 0 3px 10px rgba(80, 55, 20, .14); transform: translateY(-1px); }
.bonbtn b { color: var(--fg); font-weight: 700; }
.bonbtn.sm { font-size: 13.5px; padding: 4px 8px; }
.hmonth { display: flex; justify-content: space-between; font-weight: 700; color: var(--brown-d); background: var(--cream); border-radius: 8px; padding: 7px 10px; margin: 12px 0 6px; }
.hcard { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 8px; padding: 8px 2px 10px; border-bottom: 1px solid var(--line2); }
.hcard .htot { font-variant-numeric: tabular-nums; }
.hbons { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Kassenbon */
.bondlg { max-width: 470px; }
.bondlg .dialog-body { background: linear-gradient(180deg, #efe5d2, #e8dcc5); padding: 16px 10px 22px; }
.bonswitch { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--ink2); margin: 0 6px 14px; }
.bonnav { display: flex; align-items: center; justify-content: center; gap: 6px; }
.bonnav > .icon-btn { flex: none; background: rgba(255, 255, 255, .6); }
.bonnav > .icon-btn:disabled { opacity: .3; cursor: default; }
.bon { --paper: #fffefb; flex: 1; max-width: 340px; filter: drop-shadow(0 6px 14px rgba(70, 50, 20, .22)); }
.bon-in {
  background: var(--paper); color: #1d1d1b; padding: 26px 20px 30px;
  font-family: "Courier Prime", "Courier New", ui-monospace, Menlo, Consolas, monospace; font-size: 13.5px; line-height: 1.45;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 14px 51% repeat-x, conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / 14px 51% repeat-x;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 14px 51% repeat-x, conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / 14px 51% repeat-x;
}
.bon-head { text-align: center; margin-bottom: 14px; }
.bon-head img { max-height: 64px; max-width: 58%; object-fit: contain; }
.bon-name { display: inline-block; font-family: system-ui, sans-serif; font-weight: 800; font-size: 26px; letter-spacing: .5px; padding: 4px 14px; border-radius: 6px; background: var(--bg); color: var(--fg); }
.bon-line { display: flex; justify-content: space-between; gap: 12px; }
.bon-line span:first-child { min-width: 0; overflow-wrap: anywhere; }
.bon-line span:last-child { flex: none; font-variant-numeric: tabular-nums; }
.bon-colhead { font-weight: 700; margin-bottom: 4px; }
.bon-sub { padding-left: 2ch; color: #3b3b38; }
.bon-rab { color: #3b3b38; }
.bon-sep { margin: 8px 0; height: 0; }
.bon-sep-dash { border-top: 1.5px dashed #2b2b29; }
.bon-sep-dbl { border-top: 3px double #2b2b29; }
.bon-sum { font-weight: 700; font-size: 1.5em; line-height: 1.3; letter-spacing: .5px; }
.bon-small { font-size: 12.5px; margin-top: 4px; }
.bon-thanks { text-align: center; margin-top: 16px; font-weight: 700; }
.bon-foot { text-align: center; margin-top: 12px; font-size: 10.5px; color: #8a8478; font-family: system-ui, sans-serif; }
.bon-none { color: #55524b; font-style: italic; margin: 6px 0 4px; }
/* Ketten-Eigenheiten */
.bon-aldi .bon-sum { font-size: 1.65em; }
.bon-aldi .bon-colhead span:last-child, .bon-lidl .bon-colhead span:last-child { letter-spacing: 1px; }
.bon-lidl .bon-sum { text-transform: none; }
.bon-lidl .bon-in { font-weight: 600; }
.bon-rewe .bon-sum, .bon-famila .bon-sum { font-size: 1.6em; }
.bon-rewe .bon-thanks { letter-spacing: 1px; }
.bon-edeka .bon-colhead { border-bottom: 1px solid #2b2b29; padding-bottom: 2px; }
.bon-rossmann .bon-thanks, .bon-apotheke .bon-thanks { font-weight: 400; font-style: italic; }
.bon-apotheke .bon-in { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 13.5px; }
@media (max-width: 520px) { .bonnav > .icon-btn { display: none; } .bondlg .dialog-body { padding: 14px 6px 20px; } .bon-in { padding: 24px 14px 28px; font-size: 13px; } }

/* Tag-Auswahl (Fenster, 5 Spalten) */
.tagdlg { max-width: 940px; }
.tp-all { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 14px; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; text-align: left; margin-bottom: 12px; }
.tp-all span { font-weight: 400; color: var(--muted); }
.tp-all:hover, .tp-all.on { border-color: var(--brown2); background: #fff7ea; }
.tp-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.tp { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; border: 1.5px solid var(--tc, #b07a3c); background: #fff; color: var(--tc, #b07a3c); border-radius: 11px; padding: 8px 10px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-align: left; transition: background .1s ease, color .1s ease; }
.tp .tp-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp .tp-n { flex: none; font-size: 11.5px; font-weight: 600; opacity: .75; }
.tp:hover { background: color-mix(in srgb, var(--tc, #b07a3c) 12%, #fff); }
.tp.on { background: var(--tc, #b07a3c); color: #fff; }
@media (max-width: 820px) { .tp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 480px) { .tp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* allgemeine Menüs dürfen nie aus dem Bild laufen */
.menu { max-height: calc(100dvh - 16px); overflow-y: auto; overscroll-behavior: contain; }

/* Standardeinkauf */
.bk-list { display: flex; flex-direction: column; gap: 8px; }
.bk { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 12px; }
.bk.ok { border-color: #bfe0c6; background: #f6fcf7; }
.bk-main { flex: 1; min-width: 0; }
.bk-sum { margin-top: 2px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bk-done { color: #1f6b33; font-weight: 600; margin-top: 3px; display: flex; align-items: center; gap: 4px; }
.bk-done:empty { display: none; }
.bk-done svg { width: 15px; height: 15px; }
.bk .btn { flex: none; }
.bk-items { display: flex; flex-direction: column; border: 1px solid var(--line2); border-radius: 12px; background: #fff; max-height: 46vh; overflow: auto; }
.bk-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-bottom: 1px solid var(--line2); }
.bk-row:last-child { border-bottom: 0; }
.bk-n { flex: 1; min-width: 0; }
.bk-n b { font-weight: 600; }
.bk-q { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 0 8px 0 2px; margin: 0; flex: none; }
.bk-q input { width: 54px; border: 0 !important; box-shadow: none !important; background: transparent; text-align: right; padding: 0 4px; min-height: 32px; height: 32px; margin: 0; font-weight: 600; font-size: 15px; }
.bk-q span { color: var(--muted); font-size: 13px; }
.bk-q:focus-within { border-color: var(--brown2); box-shadow: 0 0 0 3px rgba(199, 143, 76, .18); }
.bk-row select { width: 150px; flex: none; min-height: 34px; padding: 4px 8px; }
@media (max-width: 600px) {
  .bk { flex-wrap: wrap; }
  .bk-main { flex-basis: calc(100% - 50px); }
  .bk .btn { margin-left: auto; }
  .bk-row { flex-wrap: wrap; }
  .bk-n { flex-basis: calc(100% - 60px); }
  .bk-row select { flex: 1; width: auto; }
}

/* Auf den Startbildschirm */
.in-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 10px; }
.in-head img { width: 54px; height: 54px; border-radius: 13px; box-shadow: 0 3px 10px rgba(80, 55, 20, .18); }
.in-head b { font-size: 17px; }
.in-steps { list-style: none; padding: 0; margin: 10px 0 12px; display: flex; flex-direction: column; gap: 10px; }
.in-steps li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.55; }
.in-n { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--brown); color: #fff; font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }
.in-key { display: inline-flex; align-items: center; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 7px; padding: 0 7px; font-weight: 600; white-space: nowrap; }
.in-key svg { width: 16px; height: 16px; color: #2f7bf6; }
.in-tip { display: flex; align-items: center; gap: 10px; margin-top: 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 8px 10px 12px; }
.in-tip img { width: 40px; height: 40px; border-radius: 10px; }
.in-tip .grow { flex: 1; min-width: 0; }

/* ---------- Einstellungen (Karten, zwei Spalten) */
.sgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.sgrid .s3 { grid-column: 1 / -1; }
@media (min-width: 1600px) { .sgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .sgrid .s3 { grid-column: auto; } }
.scol { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.scard { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px 16px; box-shadow: 0 1px 2px rgba(80, 55, 20, .04); min-width: 0; }
.scard > h3 { display: flex; align-items: center; gap: 9px; margin: 0 0 8px; font-size: 16.5px; color: var(--ink); }
.scard > h3 svg { width: 20px; height: 20px; color: var(--brown); }
.scard > h3 .muted { font-weight: 500; font-size: 14px; }
.scard.maint { background: #fffcf6; border-style: dashed; }
.scard p { margin: 4px 0 8px; }
.srow { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 0; border-top: 1px solid var(--line2); margin: 0; }
.scard > h3 + .srow, .scard > p + .srow { border-top: 0; }
.srow.col { flex-direction: column; align-items: stretch; gap: 8px; }
.srow > div:first-child { min-width: 0; }
.srow:not(.col) > div:first-child { flex: 1 1 180px; }
.srow b { font-weight: 600; }
.srow .btn { flex: none; }
label.srow { cursor: pointer; font-size: inherit; color: inherit; }
.snum { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px 0 4px; margin: 0; flex: none; background: #fff; }
.snum input { width: 52px; border: 0 !important; box-shadow: none !important; text-align: right; font-weight: 700; font-size: 16px; min-height: 36px; height: 36px; padding: 0 4px; margin: 0; background: transparent; }
.snum span { order: -1; color: var(--muted); font-size: 13px; padding-left: 6px; }
.snum:focus-within { border-color: var(--brown2); box-shadow: 0 0 0 3px rgba(199, 143, 76, .18); }
.toggle { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; border-radius: 14px; background: #ddd3c2; position: relative; cursor: pointer; flex: none; transition: background .15s ease; margin: 0; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .15s ease; }
.toggle:checked { background: var(--brown); }
.toggle:checked::after { transform: translateX(18px); }
.toggle:focus-visible { outline: 2px solid var(--brown2); outline-offset: 2px; }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.day { margin: 0; cursor: pointer; }
.day input { position: absolute; opacity: 0; pointer-events: none; }
.day span { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-weight: 600; color: var(--ink2); transition: all .12s ease; }
.day input:checked + span { background: var(--brown); border-color: var(--brown-d); color: #fff; }
.day input:focus-visible + span { outline: 2px solid var(--brown2); outline-offset: 2px; }
.stags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.stag { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--tc, #b07a3c); color: var(--tc, #b07a3c); background: #fff; border-radius: 14px; padding: 3px 4px 3px 10px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.stag i { font-style: normal; font-size: 11px; min-width: 20px; text-align: center; border-radius: 9px; padding: 1px 5px; background: color-mix(in srgb, var(--tc, #b07a3c) 14%, #fff); }
.stag:hover { background: var(--tc, #b07a3c); color: #fff; }
.stag:hover i { background: rgba(255, 255, 255, .25); }
.susers { display: flex; flex-direction: column; }
.suser { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line2); }
.suser:last-child { border-bottom: 0; }
.suser .av { width: 32px; height: 32px; border-radius: 50%; background: var(--cream); color: var(--brown-d); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.suser .grow { flex: 1; min-width: 0; }
.skey { display: flex; gap: 8px; align-items: center; }
.skey input { flex: 1; min-width: 0; margin: 0; }
.sok { display: inline-flex; align-items: center; gap: 4px; color: #1f6b33; font-weight: 600; }
.sok svg { width: 15px; height: 15px; }
.sadv { margin-top: 6px; }
.sadv summary { cursor: pointer; color: var(--muted); font-size: 13.5px; padding: 4px 0; }
.sadv label { margin-top: 6px; }
.ssaved { display: inline-flex; align-items: center; gap: 5px; transition: color .2s ease; }
.ssaved svg { width: 15px; height: 15px; }
.ssaved.on { color: #1f6b33; font-weight: 600; }
.sver { text-align: center; margin: 18px 0 6px; }
@media (max-width: 900px) { .sgrid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) {
  .scard { padding: 12px 14px 14px; }
  .srow:not(.col) { flex-wrap: wrap; gap: 10px 12px; }
  .srow:not(.col) > .btn { margin-left: auto; }
  .skey { flex-wrap: wrap; }
  .skey input { flex-basis: 100%; }
  .ssaved { display: none; }
}
.srow.col > .seg { align-self: flex-start; flex-wrap: wrap; }
.suser .icon-sp { width: 36px; flex: none; }

/* Standort / Anwesenheit */
.where .t { border: 0; background: transparent; font: inherit; color: inherit; cursor: pointer; padding: 0; text-align: left; }
.where .wt, .m-where .wt { color: var(--muted); font-weight: 500; }
.where .dot.off, .m-where .dot.off { background: #c9b99c; box-shadow: none; animation: none; }
.m-where { border: 0; font: inherit; width: 100%; text-align: left; cursor: pointer; }
.wlog { min-width: 250px; white-space: normal; text-align: left; cursor: default; }
.wlog ul { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.wlog li { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.wlog li svg { width: 15px; height: 15px; color: var(--brown); }
.wlog .wt { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 40px; }
.wlog .lv { color: var(--muted); width: 15px; text-align: center; }
.mkpl { gap: 3px; padding: 4px 8px; min-width: 40px; }
.mkpl svg { width: 16px; height: 16px; }
.plrows { display: flex; flex-direction: column; border: 1px solid var(--line2); border-radius: 12px; background: #fff; }
.plrow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--line2); }
.plrow:last-child { border-bottom: 0; }
.plrow > svg { width: 20px; height: 20px; color: var(--brown); flex: none; }
.plrow .grow { flex: 1; min-width: 0; }
.plrow .grow b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.plrow select { width: 90px; flex: none; min-height: 34px; padding: 4px 6px; margin: 0; }
.plres { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.plhit { display: flex; align-items: flex-start; gap: 8px; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 13.5px; cursor: pointer; }
.plhit:hover { border-color: var(--brown2); background: #fff7ea; }
.plhit svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--brown); }
#geostat svg { width: 13px; height: 13px; vertical-align: -2px; }
