/* Einkaufsliste
 * Kuehles Papierweiss, Petrol fuer Aktionen. Preisschild-Gelb (--tag) ist fuer
 * Angebote reserviert (Stufe 2). Schrift: Lexend, gebaut fuer muehelose
 * Lesbarkeit – auch beim schnellen Blick im Ladengang. */

@font-face {
  font-family: 'Lexend';
  src: url('/fonts/lexend-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Lexend';
  src: url('/fonts/lexend-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --paper: #F4F6F3;
  --surface: #FFFFFF;
  --ink: #17302B;
  --muted: #5C6D67;
  --line: #D7DED9;
  --accent: #0E6B5C;
  --accent-ink: #FFFFFF;
  --accent-soft: #E0EEEA;
  --warn-soft: #FBF0D2;
  --danger: #B3261E;
  --tag: #FFD23F;
  --scrim: rgb(10 22 19 / 0.45);
  --toast-action: #8FE0C9;
  --bar-h: 60px;
  --max: 640px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0F1B19;
    --surface: #162622;
    --ink: #E6EEEB;
    --muted: #9BAEA8;
    --line: #2A3C37;
    --accent: #55C2A8;
    --accent-ink: #08201B;
    --accent-soft: #1C3832;
    --warn-soft: #3A3218;
    --danger: #FF8A80;
    --scrim: rgb(0 0 0 / 0.6);
    --toast-action: #0E6B5C;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.45 'Lexend', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.app { max-width: var(--max); margin: 0 auto; min-height: 100dvh; }

/* ---------- Kopfzeile ---------- */
.bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 4px;
  height: var(--bar-h);
  padding: 0 4px;
  background: var(--paper);
}
.bar .title { grid-column: 2; }
.bar:has(> .title:only-child) { grid-template-columns: 1fr; padding: 0 16px; }
.bar:has(> .title:only-child) .title { grid-column: 1; }

.title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body[data-view="lists"] .title { font-size: 30px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 24px;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
}
.icon-btn:active { background: var(--accent-soft); }
.icon-btn svg circle { fill: currentColor; stroke: none; }

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 16px;
  background: var(--accent-soft);
  font-size: 14px;
}
.status-offline { background: var(--warn-soft); }
.status svg { width: 18px; height: 18px; flex: none; }

/* ---------- Uebersicht der Listen ---------- */
.lists { padding: 4px 0 24px; }
.list-index { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.list-link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}
.list-link:active { background: var(--surface); }
.list-name { font-size: 24px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.list-count {
  flex: none;
  min-width: 36px;
  padding: 2px 10px;
  border-radius: 14px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  text-align: center;
}
.list-count.is-empty { background: transparent; color: var(--muted); font-weight: 400; }

.new-list { margin: 16px 8px 0; }


/* ---------- Laden-Filter ---------- */
.chips {
  position: sticky;
  top: var(--bar-h);
  z-index: 4;
  display: flex;
  gap: 8px;
  padding: 4px 16px 12px;
  overflow-x: auto;
  background: var(--paper);
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  height: 38px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 19px;
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  white-space: nowrap;
}
.chip.is-quiet { color: var(--muted); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--paper); font-weight: 700; }
.chip-n { opacity: 0.75; font-weight: 400; }

/* ---------- Eintraege ---------- */
.list-body { padding: 0 0 calc(var(--dock-h, 70px) + 48px); }
.list-body-plain { padding-bottom: 48px; }
.contents { display: contents; }

.group-title {
  margin: 0;
  padding: 20px 16px 6px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.items { list-style: none; margin: 0; padding: 0; }

.item {
  display: flex;
  align-items: center;
  min-height: 60px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.group .items { border-top: 1px solid var(--line); }

.item-main {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  min-height: 60px;
  padding: 10px 8px 10px 16px;
  border: 0;
  background: transparent;
  text-align: left;
}

.tick {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid var(--muted);
  border-radius: 50%;
  transition: background-color 160ms, border-color 160ms;
}
.tick svg { width: 18px; height: 18px; stroke: var(--accent-ink); stroke-width: 3; opacity: 0; }
.is-done .tick { background: var(--accent); border-color: var(--accent); }
.is-done .tick svg { opacity: 1; }

.item-text { min-width: 0; font-size: 18px; line-height: 1.3; overflow-wrap: anywhere; }

/* Der Abhak-Strich: wie mit dem Stift ueber den Zettel, pro Zeile */
.t {
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 58%;
  background-size: 0 2px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.is-done .item-text { color: var(--muted); }
.is-done .t { background-size: 100% 2px; }
.is-animating .t { animation: strike 320ms cubic-bezier(.3, .7, .3, 1) both; }
@keyframes strike { from { background-size: 0 2px; } to { background-size: 100% 2px; } }

.item-meta { display: block; margin-top: 2px; color: var(--muted); font-size: 14px; }

.thumb {
  flex: none;
  width: 52px;
  height: 52px;
  margin: 4px 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.is-done .thumb { opacity: 0.55; }
.is-pending .thumb { border-style: dashed; }
.is-pending .thumb img { opacity: 0.6; }

.item-edit {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 56px;
  border: 0;
  background: transparent;
  color: var(--muted);
}
.item-edit svg { width: 20px; height: 20px; }

.group-done .item { background: transparent; }

.empty { padding: 48px 24px; color: var(--muted); }
.empty p { margin: 0 0 8px; max-width: 34ch; }
.empty-title { color: var(--ink); font-size: 20px; font-weight: 700; }

.done-link { margin: 0; padding: 24px 16px; }
.subtitle { margin: 0; padding: 0 16px 8px; color: var(--muted); }
.hint { margin: 0; color: var(--muted); font-size: 14px; }
.list-body > .hint { padding: 4px 16px 16px; }
.loading { padding: 32px 16px; color: var(--muted); }

/* ---------- Eingabezeile ---------- */
.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  max-width: var(--max);
  margin: 0 auto;
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.addbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
}
.addbar input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 18px;
  border: 1.5px solid var(--line);
  border-radius: 24px;
  background: var(--paper);
  font-size: 17px;
}
.addbar input:focus { outline: none; border-color: var(--accent); }
.addbar-add { background: var(--accent); color: var(--accent-ink); }
.addbar-add:active { background: var(--accent); filter: brightness(0.9); }
.addbar-photo { color: var(--muted); }

/* ---------- Formulare & Knoepfe ---------- */
.stack { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field > span, .field > legend { padding: 0; color: var(--muted); font-size: 14px; font-weight: 700; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  font-size: 17px;
}
.field textarea { padding: 12px 14px; resize: vertical; line-height: 1.4; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.row { display: grid; grid-template-columns: 1fr 1.5fr; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border: 1.5px solid transparent;
  border-radius: 24px;
  background: transparent;
  font-size: 17px;
  font-weight: 700;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-danger { border-color: var(--line); color: var(--danger); }
.btn-outline { border-color: var(--line); color: var(--ink); }
.btn-ghost { color: var(--accent); }
.btn svg { width: 22px; height: 22px; }
.link { padding: 8px 0; border: 0; background: none; color: var(--accent); text-decoration: underline; }
.form-error { margin: 0; color: var(--danger); }

.choice { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Unteres Blatt (Bearbeiten) ---------- */
.sheet {
  width: 100%;
  max-width: var(--max);
  max-height: 92dvh;
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: 20px 20px 0 0;
  background: var(--surface);
  color: var(--ink);
  overflow-y: auto;
}
.sheet::backdrop { background: var(--scrim); }
.sheet[open] { animation: sheet-in 200ms cubic-bezier(.2, .8, .2, 1); }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }
.sheet > form, .sheet > .stack { padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
.sheet-title { margin: 0; font-size: 20px; }
.sheet-actions { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sheet-actions .btn-primary { margin-left: auto; }

/* ---------- Teilen ---------- */
.share { padding: 8px 16px 32px; }
.share-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.share-images img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }

/* ---------- Anmeldung ---------- */
.login { max-width: 360px; margin: 0 auto; padding: 15vh 24px 48px; }
.login-icon { display: block; border-radius: 16px; margin-bottom: 16px; }
.login h1 { margin: 0 0 12px; font-size: 30px; }

/* ---------- Bildansicht & Meldungen ---------- */
/* Eigener Dialog: liegt damit auch ueber dem Bearbeiten-Blatt */
.viewer {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  border: 0;
  padding: 16px;
  background: rgb(0 0 0 / 0.92);
}
.viewer[open] { display: grid; place-items: center; }
.viewer::backdrop { background: transparent; }
.viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-close {
  position: absolute;
  top: calc(8px + env(safe-area-inset-top));
  right: 8px;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 24px;
  background: rgb(255 255 255 / 0.12);
  color: #fff;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--dock-h, 70px) + 12px);
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 16px;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 12px 8px 12px 16px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--paper);
  font-size: 15px;
  transform: translateX(-50%);
}
.toast-action { padding: 6px 10px; border: 0; background: none; color: var(--toast-action); font-weight: 700; }
body:not([data-view="list"]) .toast { bottom: calc(24px + env(safe-area-inset-bottom)); }

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

@media (min-width: 700px) {
  .item, .list-index, .group .items { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}

/* ---------- Kopfzeile der Uebersicht ---------- */
.bar-home { grid-template-columns: 1fr 48px; padding: 0 4px 0 16px; }
.bar-home .title { grid-column: 1; }

/* ---------- Nachfrage-Feld ueber der Eingabe ---------- */
.tray { border-bottom: 1px solid var(--line); }
.tray > .enter { animation: tray-in 180ms cubic-bezier(.2, .8, .2, 1); }
@keyframes tray-in { from { opacity: 0; transform: translateY(8px); } }

.ask { padding: 12px 0 10px; }
.ask-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px 6px;
}
.ask-title {
  margin: 0;
  min-width: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ask-done {
  flex: none;
  min-height: 40px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 16px;
  font-weight: 700;
}
.ask-row { display: flex; align-items: center; gap: 4px; padding: 4px 0; }
.ask-label {
  flex: none;
  width: 84px;
  padding-left: 16px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}
.ask-chips, .tray-chips {
  display: flex;
  gap: 8px;
  padding: 2px 16px 2px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.ask-chips::-webkit-scrollbar, .tray-chips::-webkit-scrollbar { display: none; }
.ask .chip { height: 42px; min-width: 42px; padding: 0 14px; font-size: 16px; }
.ask-input {
  flex: none;
  width: 150px;
  height: 42px;
  padding: 0 14px;
  border: 1.5px solid var(--accent);
  border-radius: 21px;
  background: var(--paper);
  font-size: 16px;
}
.ask-input:focus { outline: none; }

.tray-panel { padding: 10px 0 8px; }
.tray-panel .tray-chips { padding-left: 16px; }
.tray-label { margin: 0; padding: 0 16px 8px; color: var(--muted); font-size: 14px; }
.sug {
  flex: none;
  display: grid;
  align-content: center;
  min-height: 48px;
  padding: 4px 16px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  line-height: 1.2;
}
.sug span { font-size: 16px; font-weight: 700; }
.sug small { color: var(--muted); font-size: 13px; }
.sug.is-on-list { opacity: 0.6; }
.sug:active { border-color: var(--accent); }

/* Gerade angelegter / gefragter Eintrag */
.item.is-flash { animation: flash 1600ms ease-out both; }
@keyframes flash { from { background-color: var(--accent-soft); } to { background-color: var(--surface); } }
.item.is-asking { box-shadow: inset 4px 0 0 var(--accent); }

/* ---------- Einstellungen ---------- */
.settings { padding: 0 0 48px; }
.set-section { padding: 20px 16px 8px; }
.set-section + .set-section { border-top: 1px solid var(--line); margin-top: 12px; }
.set-title { margin: 0 0 4px; font-size: 20px; }
.set-section > .hint { margin-bottom: 12px; }
.set-list { list-style: none; margin: 0 -16px 12px; padding: 0; border-top: 1px solid var(--line); }
.set-row {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 60px;
  padding: 0 8px 0 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.set-name {
  flex: 1;
  min-width: 0;
  display: grid;
  min-height: 60px;
  align-content: center;
  padding: 8px 8px 8px 16px;
  border: 0;
  background: none;
  font-size: 18px;
  text-align: left;
  overflow-wrap: anywhere;
}
.set-name small { color: var(--muted); font-size: 14px; }
.set-name.is-static { cursor: default; }
.icon-btn.small { width: 44px; height: 44px; color: var(--muted); }
.icon-btn.small svg { width: 20px; height: 20px; }
.icon-btn:disabled { opacity: 0.3; }
.btn-small { min-height: 40px; padding: 0 14px; font-size: 15px; border-color: var(--line); }
.set-add { display: flex; gap: 8px; margin-bottom: 12px; }
.set-add input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 17px;
}
.set-add input:focus { outline: none; border-color: var(--accent); }
.memory summary { padding: 8px 0; color: var(--accent); font-weight: 700; cursor: pointer; }
.memory-list { margin: 16px 0 8px; color: var(--muted); font-size: 15px; }
.chip-forget { height: 36px; font-size: 14px; }

/* ---------- Anmeldelink ---------- */
.link-sheet { justify-items: stretch; }
.qr {
  justify-self: center;
  width: min(240px, 70vw);
  padding: 12px;
  border-radius: 16px;
  background: #fff;
}
.qr svg { display: block; width: 100%; height: auto; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; }
.link-url {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--muted);
  font-size: 14px;
}
.login-text { margin: 0 0 20px; color: var(--muted); max-width: 34ch; }
.login .btn { width: 100%; }
.login .btn + .btn { margin-top: 8px; }

/* ---------- Wischen zum Abhaken ---------- */
.items { overflow-x: clip; }
.item { position: relative; touch-action: pan-y; }
/* Gruene Streifen links und rechts am Eintrag, sichtbar beim Wischen */
.item::before, .item::after {
  content: 'Erledigt';
  position: absolute;
  top: 0;
  bottom: -1px;
  width: 100vw;
  display: flex;
  align-items: center;
  background: #3E7F70;
  color: #fff;
  font-weight: 700;
  transition: background-color 120ms;
}
.item::before { right: 100%; justify-content: flex-end; padding-right: 20px; }
.item::after { left: 100%; padding-left: 20px; }
.item.is-done::before, .item.is-done::after { content: 'Wieder offen'; background: #5C6D67; }
.item.is-past::before, .item.is-past::after { background: #0E6B5C; }
.item.is-done.is-past::before, .item.is-done.is-past::after { background: #17302B; }
.item.is-snapping { transition: transform 200ms cubic-bezier(.2, .8, .2, 1); }
.item.is-swiping .item-main, .item.is-swiping .item-edit { pointer-events: none; }

/* Hinweis an der Gruppe, wenn nach gelerntem Laufweg sortiert ist */
.route-note { margin-left: 8px; font-weight: 400; font-size: 13px; color: var(--accent); }
.route-note::before { content: '· '; color: var(--muted); }
.set-add-inline { margin: 10px 0 0; }

/* ---------- Einkauf fertig ---------- */
.group-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-right: 8px; }
.group-action {
  min-height: 44px;
  padding: 12px 8px 6px;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
}
.empty .btn-primary { margin: 8px 0 10px; }

/* ---------- Schalter in den Einstellungen ---------- */
.switch {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin: 8px 0 14px;
  cursor: pointer;
}
.switch input {
  flex: none;
  width: 24px;
  height: 24px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}
.switch small { color: var(--muted); }

/* ---------- Angebote ---------- */
/* Preisschild-Gelb: nur fuer Angebote */
.bar-home { grid-template-columns: 1fr 48px 48px; }
.bar-home.has-offers { grid-template-columns: 1fr 48px 48px 48px; }
.offers-btn { position: relative; }
.offers-count {
  position: absolute;
  top: 5px;
  right: 3px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--tag);
  color: #17302B;
  font-size: 12px;
  font-weight: 700;
  line-height: 19px;
  text-align: center;
}
.offer-tag {
  display: inline-block;
  margin-top: 5px;
  padding: 1px 8px;
  border-radius: 6px;
  background: var(--tag);
  color: #17302B;
  font-size: 13px;
  font-weight: 700;
}
.is-done .offer-tag { display: none; }
.offers { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.offer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.offer-price {
  flex: none;
  min-width: 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--tag);
  color: #17302B;
  font-weight: 700;
  text-align: center;
}
.offer-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.offer-title { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.offer-brand { color: var(--muted); font-weight: 400; }
.offer-meta { color: var(--muted); font-size: 13px; }
.offer { align-items: flex-start; }
.offer-actions { margin-top: 6px; }
.offers-page { padding: 0 16px 48px; }
.offers-status { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 4px 0 8px; color: var(--muted); font-size: 14px; }
.offers-error { color: var(--danger); }

/* Speicher (Einstellungen) */
.disk { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--accent-soft); margin: 4px 0 8px; }
.disk-app { background: var(--accent); }
.disk-other { background: var(--muted); opacity: .45; }
.disk.is-low { outline: 2px solid var(--danger); outline-offset: 2px; }
.disk-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .85rem; color: var(--muted); margin: 0 0 12px; }
.disk-legend span:last-child { margin-left: auto; color: var(--ink); font-weight: 700; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.dot-app { background: var(--accent); }
.dot-other { background: var(--muted); opacity: .45; }
.usage { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0 0 10px; font-size: .92rem; }
.usage dt { color: var(--muted); }
.usage dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.set-section code { font-size: .85em; background: var(--accent-soft); padding: 1px 5px; border-radius: 4px; }
.offer-section .group-title { padding-left: 0; }
.offer-item { margin: 0 0 18px; }
.offer-for { margin: 0 0 8px; font-size: 18px; font-weight: 700; }
.offer-for small { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }
.offers-source { margin-top: 24px; }

/* Angebot mit Produktbild */
.offer { align-items: flex-start; }
.offer-img {
  flex: none;
  width: 76px;
  height: 76px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.offer-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.offer.no-img .offer-img { display: none; }
.offer-top { display: flex; align-items: baseline; gap: 8px; }
.offer-top s { color: var(--muted); font-size: 13px; }
.offer-price { display: inline-block; padding: 3px 9px; }
.offer-desc { color: var(--ink); font-size: 14px; line-height: 1.35; }
.offer.is-picked { border: 2px solid var(--accent); }
.btn-picked { border-color: var(--accent); color: var(--accent); }
.btn-picked svg { width: 18px; height: 18px; }
.picked-line { display: inline-block; margin-top: 2px; color: var(--ink); font-size: 14px; font-weight: 700; }
.viewer { grid-template-rows: 1fr auto; }
.viewer img { background: #fff; border-radius: 8px; }
.viewer-caption { margin: 12px 0 0; color: #fff; text-align: center; font-size: 15px; }
.viewer-caption:empty { display: none; }

/* ---------- Coupons ----------
   Gestrichelter Rand wie die Abrisskante eines Coupons; Farbe: Akzent (Gelb bleibt fuer Angebote) */
.coupons-count { background: var(--accent); color: var(--accent-ink); }
.coupon-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  padding: 0 8px 0 6px;
  border: 1.5px dashed var(--accent);
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  line-height: 20px;
  text-decoration: none;
  vertical-align: middle;
}
.coupon-tag svg { width: 15px; height: 15px; flex: none; }
.group-title .coupon-tag { margin: 0 0 0 8px; }
.is-done .coupon-tag { display: none; }

.coupons-page { padding: 4px 16px 48px; }
.coupons { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.coupon {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}
.coupon-stub {
  flex: none;
  display: grid;
  place-items: center;
  width: 92px;
  padding: 10px 8px;
  border-right: 2px dashed var(--line);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  overflow-wrap: anywhere;
}
.coupon-body { flex: 1; min-width: 0; display: grid; align-content: start; gap: 3px; padding: 10px 12px; }
.coupon-title { font-size: 17px; font-weight: 700; overflow-wrap: anywhere; }
.coupon-meta { color: var(--muted); font-size: 14px; }
.coupon.is-soon .coupon-meta { color: var(--danger); font-weight: 700; }
.coupon-cond { font-size: 14px; }
.coupon-onlist { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-size: 13px; font-weight: 700; }
.coupon-onlist svg { width: 16px; height: 16px; }
.coupon-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.coupon-thumb {
  flex: none;
  width: 72px;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  background: #fff;
}
.coupon-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.coupon.is-old { opacity: .62; }
.coupon.is-old .coupon-stub { color: var(--muted); background: transparent; }
.coupon-add-btn { width: 100%; margin: 16px 0 10px; gap: 8px; }
.coupons-old { margin-top: 16px; }
.coupons-old .coupons { margin-top: 8px; }
.coupon-pic { display: grid; justify-items: start; gap: 8px; }
.coupon-pic img { max-width: 100%; max-height: 180px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.coupon-pic .btn { gap: 6px; }
.coupon-pic .btn svg { width: 20px; height: 20px; }
.row-even { grid-template-columns: 1fr 1fr; }
.sheet .coupons { margin: 2px 0 6px; }

/* Angebot ablehnen */
.offer-top { flex-wrap: wrap; }
.offer-reject {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  min-height: 32px;
  padding: 0 8px 0 4px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}
.offer-reject svg { width: 16px; height: 16px; }
.offer-reject:active { background: var(--accent-soft); }
.offer-confirm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 8px;
  border-radius: 10px;
  background: var(--warn-soft);
  font-size: 14px;
}
.offer-confirm > span { width: 100%; font-weight: 700; }
.set-row > .btn-small:last-child { flex: none; margin-right: 8px; }
.field input[type="date"] { min-width: 0; width: 100%; }

/* Coupon-Artikel: steht wegen eines Coupons auf der Liste */
.item.is-coupon { box-shadow: inset 5px 0 0 var(--accent); background: linear-gradient(90deg, var(--accent-soft), var(--surface) 70%); }
.item.is-free { box-shadow: inset 5px 0 0 var(--accent), inset 0 0 0 2px var(--accent); }
.coupon-tag.is-strong { border-style: solid; border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.coupon-tag.is-gone { border-color: var(--line); background: transparent; color: var(--muted); text-decoration: line-through; }
.coupon-linked { display: flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 700; }
.coupon-linked svg { width: 18px; height: 18px; flex: none; }
