/* Frostbox – kühles, ruhiges iPhone-Layout. Einziger „Hingucker“: der Schrank als Bauteil-Ansicht. */

:root {
  color-scheme: light;
  --bg: #EDF2F6;
  --surface: #FFFFFF;
  --surface-2: #F3F7FA;
  --ink: #13202A;
  --muted: #5B6977;
  --line: #D8E1E8;
  --frost: #1F6FB2;
  --frost-ink: #FFFFFF;
  --frost-soft: #DCEAF6;
  --warn: #B9620F;
  --danger: #C0352B;
  --cabinet: #D3DEE6;
  --cabinet-edge: #BFCCD6;
  --shelf: #E9F1F7;
  --glass: #A9C9E3;
  --handle: #9FB0BE;
  --wire: rgba(31, 111, 178, 0.18);
  --toast-bg: #13202A;
  --toast-ink: #F1F6FA;
  --toast-action: #8CC6F2;
  --shadow: 0 1px 2px rgba(19, 32, 42, 0.06), 0 6px 18px rgba(19, 32, 42, 0.06);

  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --font-round: ui-rounded, "SF Pro Rounded", -apple-system, system-ui, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 58px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0D141A;
    --surface: #17212A;
    --surface-2: #1E2A34;
    --ink: #E5EDF3;
    --muted: #93A3B1;
    --line: #2A3946;
    --frost: #5AA8E8;
    --frost-ink: #06121C;
    --frost-soft: #1B3347;
    --warn: #F0A050;
    --danger: #FF6B5E;
    --cabinet: #1C2832;
    --cabinet-edge: #2B3B48;
    --shelf: #1F3140;
    --glass: #3C6A8F;
    --handle: #4E6273;
    --wire: rgba(90, 168, 232, 0.16);
    --toast-bg: #E5EDF3;
    --toast-ink: #0D141A;
    --toast-action: #1F6FB2;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.35 var(--font);
  -webkit-tap-highlight-color: transparent;
}

body.has-sheet { overflow: hidden; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--frost) 55%, transparent); outline-offset: 2px; }

svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.muted { color: var(--muted); }

.boot {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  font-size: 44px;
  color: var(--frost);
}

/* ───────── Screens: Login, Fehler, Einrichtung ───────── */

.screen {
  max-width: 640px;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 24px) 16px calc(var(--safe-bottom) + 24px);
}

.screen--center {
  min-height: 100dvh;
  display: grid;
  place-items: center;
}

.login { width: 100%; max-width: 360px; text-align: center; }
.login h1, .setup-head h1 {
  font: 700 30px/1.15 var(--font-round);
  margin: 12px 0 6px;
  letter-spacing: -0.01em;
}
.login p { margin: 0 0 24px; }

.login-mark {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--frost);
  color: var(--frost-ink);
}
.login-mark svg { width: 36px; height: 36px; stroke-width: 1.7; }
.login-mark--muted { background: var(--surface); color: var(--muted); }

.login-form { display: grid; gap: 12px; text-align: left; }

.field { display: grid; gap: 6px; }
.field span { font-size: 14px; color: var(--muted); padding-left: 4px; }
.field input {
  height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 17px;
}

.form-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
  color: var(--danger);
  font-size: 15px;
}

.setup { padding-bottom: calc(var(--safe-bottom) + 100px); }
.setup-head { text-align: center; margin-bottom: 20px; }
.setup-head p { margin: 0 auto; max-width: 34em; }

.setup-grid { display: grid; gap: 4px; }
@media (min-width: 620px) {
  .setup-grid { grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
}

.bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 16px calc(var(--safe-bottom) + 12px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.bottom-bar .btn { max-width: 608px; margin: 0 auto; display: flex; }

/* ───────── App-Rahmen ───────── */

.shell { min-height: 100dvh; padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom)); }

.view {
  max-width: 640px;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 10px) 16px 28px;
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding-bottom: var(--safe-bottom);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-top: 1px solid var(--line);
}

.tab {
  height: var(--tabbar-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.tab svg { width: 25px; height: 25px; }
.tab.is-active { color: var(--frost); }

/* ───────── Seitenkopf ───────── */

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0 12px;
}

.page-head h1 {
  margin: 0;
  font: 700 32px/1.1 var(--font-round);
  letter-spacing: -0.015em;
}

.page-head--sub {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  row-gap: 2px;
}
.page-head--sub .back { grid-column: 1 / -1; justify-self: start; }
.page-head--sub h1 { grid-column: 1; font-size: 28px; overflow-wrap: anywhere; }
.page-head--sub .page-kicker { grid-column: 1; margin: 0; font-size: 14px; color: var(--muted); }
.page-head--sub .page-add { grid-column: 2; grid-row: 2 / span 2; align-self: center; }

.head-actions { display: flex; gap: 10px; }

.back {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: -8px;
  padding: 6px 8px 6px 2px;
  border: 0;
  background: none;
  color: var(--frost);
  font-size: 17px;
}
.back svg { width: 24px; height: 24px; stroke-width: 2.2; }

.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--frost);
  box-shadow: var(--shadow);
}
.icon-btn--primary { background: var(--frost); color: var(--frost-ink); }
.icon-btn--primary svg { stroke-width: 2.4; }
.icon-btn select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  font-size: 16px;
}

.text-btn {
  border: 0;
  background: none;
  color: var(--frost);
  font-size: 17px;
  padding: 8px 4px;
}
.text-btn--strong { font-weight: 600; }
.text-btn:disabled { opacity: 0.35; }

/* ───────── Buttons ───────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  font-weight: 600;
  font-size: 17px;
  text-decoration: none;
}
.btn--primary { background: var(--frost); color: var(--frost-ink); }
.btn--soft { background: var(--frost-soft); color: var(--frost); }
.btn--soft-danger { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, var(--surface)); }
.btn--danger { background: color-mix(in srgb, var(--danger) 10%, var(--surface)); color: var(--danger); }
.btn--block { width: 100%; }
.btn--small { min-height: 38px; padding: 0 12px; font-size: 15px; border-radius: 10px; }
.btn:disabled { opacity: 0.45; }
.btn:active:not(:disabled), .icon-btn:active, .take:active { transform: scale(0.96); }

/* ───────── Suche & Filterleiste ───────── */

.tools {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: 0 -16px;
  padding: calc(var(--safe-top) + 4px) 16px 2px;
  background: var(--bg);
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line);
}
.search svg { width: 19px; height: 19px; }
.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 17px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.search input::placeholder { color: var(--muted); }
.search:focus-within { box-shadow: inset 0 0 0 2px var(--frost); }

.chipbar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 -16px;
  padding: 10px 16px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chipbar::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
}
.chip svg { width: 15px; height: 15px; stroke-width: 2.3; }
.chip.is-on { background: var(--frost); color: var(--frost-ink); box-shadow: none; }
.chip--warn.is-on { background: var(--warn); color: #fff; }
.chip--suggest { background: var(--frost-soft); color: var(--frost); box-shadow: none; }
.chip-sep { flex: none; width: 1px; margin: 6px 2px; background: var(--line); }

.summary { margin: 6px 4px 8px; font-size: 13px; color: var(--muted); min-height: 1em; }

/* ───────── Produktliste ───────── */

.list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.item { display: flex; align-items: center; }
.item + .item { border-top: 1px solid var(--line); }

.item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 6px 10px 12px;
  border: 0;
  background: none;
  text-align: left;
}
.item-main:active { background: var(--surface-2); }

.thumb {
  flex: none;
  width: 54px;
  height: 54px;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--surface-2);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb--emoji { font-size: 27px; background: color-mix(in srgb, var(--cat) 16%, var(--surface)); }

.item-text { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.item-name, .item-sub, .item-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-name { font-weight: 600; }
.item-sub { font-size: 14px; color: var(--muted); }
.item-meta { font-size: 13px; color: var(--muted); }
.item-meta.is-overdue { color: var(--warn); }
.i-warn { width: 14px; height: 14px; vertical-align: -2px; margin-right: 3px; stroke-width: 2.2; }

.take {
  flex: none;
  width: 46px;
  height: 46px;
  margin-right: 10px;
  border: 0;
  border-radius: 12px;
  background: var(--frost-soft);
  color: var(--frost);
  font: 700 16px var(--font-round);
}
.take--last { background: color-mix(in srgb, #3E9B4F 14%, var(--surface)); color: #2F8441; }
@media (prefers-color-scheme: dark) { .take--last { color: #7BD08A; } }

.group-title {
  margin: 20px 4px 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-mark { color: var(--glass); margin-bottom: 10px; }
.empty-mark svg { width: 44px; height: 44px; stroke-width: 1.4; }
.empty strong { display: block; color: var(--ink); font: 600 20px var(--font-round); margin-bottom: 6px; }
.empty p { margin: 0 auto 18px; max-width: 26em; }

.hint { font-size: 14px; color: var(--muted); margin: 8px 4px 14px; }
.hint--center { text-align: center; }

/* ───────── Der Schrank ───────── */

.cabinet {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px;
  border-radius: 22px;
  background: var(--cabinet);
  box-shadow: inset 0 0 0 1px var(--cabinet-edge), var(--shadow);
}
.cabinet--loose { gap: 0; }

.slot {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "name warn" "info info" "emojis emojis";
  align-content: center;
  gap: 2px 8px;
  min-height: 78px;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  text-align: left;
  color: var(--ink);
}
button.slot:active { filter: brightness(0.96); transform: scale(0.99); }

.slot-name { grid-area: name; font: 600 17px var(--font-round); }
.slot-info { grid-area: info; font-size: 13px; color: var(--muted); }
.slot-emojis { grid-area: emojis; font-size: 17px; letter-spacing: 1px; min-height: 0; }
.slot-warn {
  grid-area: warn;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 13px;
  font-weight: 700;
  color: var(--warn);
}
.slot-warn .i-warn { margin: 0; }

/* Fach: offene Ablage mit Glasboden */
.slot--fach {
  min-height: 92px;
  background: linear-gradient(180deg, var(--shelf) 0%, var(--surface) 92%);
  box-shadow: inset 0 -4px 0 var(--glass), inset 0 0 0 1px var(--cabinet-edge);
}

/* Schublade: geschlossene Front mit Griffleiste */
.slot--schublade {
  padding-top: 22px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--cabinet-edge), 0 2px 0 var(--cabinet-edge);
}
.slot-handle {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 34%;
  height: 5px;
  transform: translateX(-50%);
  border-radius: 99px;
  background: var(--handle);
}

/* Korb: Drahtgitter */
.slot--korb {
  background:
    repeating-linear-gradient(90deg, var(--wire) 0 1.5px, transparent 1.5px 11px),
    repeating-linear-gradient(0deg, var(--wire) 0 1.5px, transparent 1.5px 11px),
    var(--surface);
  box-shadow: inset 0 0 0 1px var(--cabinet-edge);
}

.cabinet--preview { padding: 8px; gap: 5px; border-radius: 16px; }
.cabinet--preview .slot { min-height: 40px; padding: 8px 12px; }
.cabinet--preview .slot--fach { min-height: 48px; }
.cabinet--preview .slot--schublade { padding-top: 16px; }
.cabinet--preview .slot-handle { top: 6px; height: 4px; }
.cabinet--preview .slot-name { font-size: 15px; }

/* ───────── Gruppen & Zeilen (Formulare, Einstellungen) ───────── */

.group {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
  padding: 6px 14px;
  width: 100%;
  border: 0;
  background: none;
  text-align: left;
}
.row + .row { border-top: 1px solid var(--line); }
.row > span:first-child { flex: none; }
.row--link:active { background: var(--surface-2); }
.row--danger { color: var(--danger); }

.row select,
.row input[type="date"],
.row > input:not([type]) {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font-size: 17px;
  color: var(--frost);
  text-align: right;
  text-align-last: right;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}
.row input[type="date"] { min-height: 36px; }
.row input[type="date"]::-webkit-date-and-time-value { text-align: right; }

.row.row--stack > input {
  flex: 1;
  width: 100%;
  text-align: left;
  text-align-last: left;
  border: 0;
  background: transparent;
  font-size: 19px;
  font-weight: 600;
  padding: 8px 0;
  outline: none;
  color: var(--ink);
}

.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: var(--frost-soft);
  color: var(--frost);
  font-size: 22px;
  line-height: 1;
}
.stepper button:disabled { opacity: 0.35; }
.stepper output { min-width: 34px; text-align: center; font: 600 19px var(--font-round); }

.weight { flex: 1; display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.weight input {
  width: 100%;
  max-width: 110px;
  border: 0;
  background: transparent;
  text-align: right;
  font-size: 17px;
  color: var(--frost);
  outline: none;
}

.seg { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.seg button {
  min-width: 38px;
  padding: 5px 10px;
  border: 0;
  border-radius: 7px;
  background: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}
.seg button.is-on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14); }

.field-note { margin: -10px 6px 14px; font-size: 14px; color: var(--muted); }
.field-note.is-error { color: var(--danger); }

.advice {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  margin: -6px 6px 16px;
  font-size: 14px;
  color: var(--muted);
}
.advice.is-warn { color: var(--warn); }
.advice .i-warn { margin-top: 2px; }

.editor textarea {
  display: block;
  width: 100%;
  min-height: 76px;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  resize: vertical;
  outline: none;
  font-size: 17px;
}

.editor .form-error { margin-bottom: 14px; }

/* Foto */
.photo { margin-bottom: 16px; }
.photo-preview {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-empty { display: grid; justify-items: center; gap: 6px; color: var(--muted); }
.photo-empty span { font-size: 54px; line-height: 1; }
.photo-actions { display: flex; gap: 10px; margin-top: 10px; }
.photo-actions .btn { flex: 1; min-height: 44px; cursor: pointer; white-space: nowrap; }
.photo-actions .btn[hidden] { display: none; }

/* Listen zum Bearbeiten (Einrichtung, Fächer verwalten) */
.edit-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.edit-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 10px;
}
.edit-row + .edit-row { border-top: 1px solid var(--line); }
.edit-row select {
  max-width: 112px;
  height: 36px;
  padding: 0 8px;
  border: 0;
  border-radius: 9px;
  background: var(--surface-2);
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}
.edit-row input {
  min-width: 0;
  height: 40px;
  border: 0;
  background: transparent;
  font-size: 17px;
  outline: none;
}
.edit-row input:focus { box-shadow: inset 0 -2px 0 var(--frost); }
.row-tools { display: flex; gap: 4px; }
.tool {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--muted);
}
.tool svg { width: 18px; height: 18px; }
.tool--danger { color: var(--danger); }
.tool:disabled { opacity: 0.3; }

/* Mehr: Kennzahlen */
.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.stats div {
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.stats strong { display: block; font: 700 26px/1.1 var(--font-round); }
.stats span { font-size: 14px; color: var(--muted); }
.stats .is-warn strong { color: var(--warn); }

/* ───────── Sheets ───────── */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(8, 16, 24, 0);
  transition: background 0.25s ease;
}
.sheet-backdrop.is-open { background: rgba(8, 16, 24, 0.4); }

.sheet {
  width: 100%;
  max-width: 640px;
  max-height: calc(100dvh - var(--safe-top) - 24px);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: 18px 18px 0 0;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.is-open .sheet { transform: none; }
.sheet--full { height: calc(100dvh - var(--safe-top) - 12px); }

.sheet-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
.sheet-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
.sheet-head > div:last-child { justify-self: end; }

.sheet-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 16px calc(var(--safe-bottom) + 24px);
}
.sheet-foot {
  padding: 12px 16px calc(var(--safe-bottom) + 12px);
  border-top: 1px solid var(--line);
}

.sheet-body h3 { margin: 4px 4px 8px; font-size: 15px; font-weight: 600; color: var(--muted); }
.sheet-body h3:not(:first-child) { margin-top: 20px; }

.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.tgrid--single { margin-top: 8px; }
.tchip {
  min-height: 42px;
  padding: 8px 10px;
  border: 0;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
}
.tchip small { color: var(--muted); font-weight: 600; margin-left: 2px; }
.tchip.is-dim { color: var(--muted); }
.tchip.is-on { background: var(--frost); color: var(--frost-ink); box-shadow: none; }
.tchip.is-on small { color: inherit; opacity: 0.8; }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 22px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface);
}
.switch-row span { display: grid; gap: 2px; }
.switch-row small { color: var(--muted); font-size: 13px; }

.switch {
  flex: none;
  position: relative;
  width: 51px;
  height: 31px;
  margin: 0;
  border-radius: 99px;
  background: var(--line);
  -webkit-appearance: none;
  appearance: none;
  transition: background 0.2s;
  cursor: pointer;
}
.switch::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}
.switch:checked { background: var(--frost); }
.switch:checked::before { transform: translateX(20px); }

/* Aktionsblatt (Bestätigungen) */
.sheet-backdrop--action { z-index: 60; }
.action-sheet {
  width: 100%;
  max-width: 480px;
  padding: 0 8px calc(var(--safe-bottom) + 8px);
  transform: translateY(110%);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.is-open .action-sheet { transform: none; }
.action-group { margin-bottom: 8px; border-radius: 14px; overflow: hidden; background: var(--surface); }
.action-head {
  padding: 14px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.action-head strong { display: block; color: var(--ink); font-size: 14px; }
.action-head p { margin: 4px 0 0; }
.action {
  display: block;
  width: 100%;
  min-height: 56px;
  border: 0;
  background: none;
  color: var(--frost);
  font-size: 19px;
}
.action + .action { border-top: 1px solid var(--line); }
.action:active { background: var(--surface-2); }
.action--danger { color: var(--danger); }
.action--cancel { border-radius: 14px; background: var(--surface); font-weight: 600; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 14px);
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 14px;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 11px 16px;
  border-radius: 14px;
  background: var(--toast-bg);
  color: var(--toast-ink);
  font-size: 15px;
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button {
  border: 0;
  background: none;
  padding: 0;
  color: var(--toast-action);
  font-weight: 700;
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
