:root {
  --bg: #F2EEF5;          /* light lavender canvas */
  --surface: #FBF6F1;     /* cream card */
  --surface-2: #F3ECE5;   /* slightly deeper cream */
  --border: #E4DAD2;
  --fg: #3E2F50;          /* deep aubergine */
  --muted: #8B7A96;
  --accent: #7D6B8C;      /* dusky purple */
  --accent-dark: #6A5877;
  --red-pill: #E9C9C7;    --red-fg: #8E3A3A;
  --yellow-pill: #E9DCC7; --yellow-fg: #8A6A2F;
  --green-pill: #D8CEE3;  --green-fg: #4E4066;
  --shadow: 0 6px 24px rgba(62, 47, 80, 0.07);
}

* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  -webkit-font-smoothing: antialiased;
}

.app { max-width: 520px; margin: 0 auto; padding: 20px 18px 120px; }

/* ---- header ---- */
.eyebrow {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 2px;
}
h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400; font-size: 34px; letter-spacing: -0.01em;
  margin: 0 0 18px;
}
h2.group {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted);
  display: flex; justify-content: space-between; align-items: center;
  margin: 26px 0 8px; padding: 0 4px;
}
h2.group .count { color: var(--muted); font-weight: 400; }

/* ---- summary card ---- */
.summary {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 18px 18px 14px;
  box-shadow: var(--shadow);
}
.summary .eyebrow { margin-bottom: 8px; }
.summary .lead { display: flex; align-items: baseline; gap: 12px; }
.summary .num {
  font-family: Georgia, serif; font-size: 56px; font-weight: 300; line-height: 1;
}
.summary .text { color: var(--fg); font-size: 14px; flex: 1; }

.pills { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 14px; }
.pill {
  border-radius: 12px; padding: 8px 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  display: flex; flex-direction: column; gap: 2px;
}
.pill b { font-size: 17px; font-family: Georgia, serif; font-weight: 400; }
.pill.red    { background: var(--red-pill);    color: var(--red-fg);    border-color: #d9b3b1; }
.pill.yellow { background: var(--yellow-pill); color: var(--yellow-fg); border-color: #d9c9a8; }
.pill.green  { background: var(--green-pill);  color: var(--green-fg);  border-color: #c8b9d9; }
.pill .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 4px; }

/* ---- inventory list: rows, not cards ---- */
.items { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.item:last-child { border-bottom: none; }
.item .bar { width: 3px; align-self: stretch; border-radius: 2px; background: var(--border); flex-shrink: 0; }
.item.red    .bar { background: var(--red-fg); }
.item.yellow .bar { background: #C9A04B; }
.item.green  .bar { background: var(--accent); }
.item.grey   .bar { background: var(--border); }

.item .info { flex: 1; min-width: 0; }
.item .name { font-family: Georgia, serif; font-size: 17px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .meta { display: flex; gap: 8px; align-items: center; margin-top: 2px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.item .qty { color: var(--muted); }

.badge {
  display: inline-block; font-size: 11px; padding: 2px 8px;
  border-radius: 999px;
}
.badge.red    { background: var(--red-pill);    color: var(--red-fg); }
.badge.yellow { background: var(--yellow-pill); color: var(--yellow-fg); }
.badge.green  { background: var(--green-pill);  color: var(--green-fg); }
.badge.grey   { background: #EAE4DC;            color: var(--muted); }

.item .actions, .card .actions { display: flex; gap: 6px; flex-shrink: 0; }
.btn-circle {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--accent-dark); font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
}
.btn-circle:active { transform: scale(0.94); }

/* ---- bottom nav with center scan FAB ---- */
nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(251, 246, 241, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: grid; grid-template-columns: repeat(5, 1fr);
  align-items: end;
  padding: 6px 0 calc(10px + env(safe-area-inset-bottom));
  max-width: 520px; margin: 0 auto;
}
nav a {
  color: var(--muted); text-decoration: none;
  font-size: 10px; letter-spacing: 0.02em;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 4px 0;
}
nav a .icon { font-size: 19px; line-height: 1; }
nav a .icon .ico { width: 22px; height: 22px; vertical-align: 0; }
nav a.fab .icon .ico { width: 26px; height: 26px; }
nav a.active { color: var(--accent-dark); font-weight: 500; }
nav a.fab {
  position: relative; margin-top: -22px;
}
nav a.fab .icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent-dark); color: #F7EBE8;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  box-shadow: 0 8px 20px rgba(106, 88, 119, 0.35);
}

/* ---- forms ---- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 14px 16px; margin-bottom: 12px;
  box-shadow: var(--shadow);
}
label { display: block; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 14px 2px 6px; }
input, select {
  width: 100%; background: var(--surface); color: var(--fg);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; font-size: 16px; margin-bottom: 4px;
  font-family: inherit;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }

button, a.small, label.small {
  background: var(--surface); color: var(--fg);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 16px; font-size: 14px; cursor: pointer;
  font-family: inherit;
}
button.primary {
  background: var(--accent-dark); border-color: var(--accent-dark); color: #F7EBE8;
  font-weight: 500; padding: 14px 24px; border-radius: 12px;
  display: block; width: 100%; font-size: 15px;
}
button.small, a.small, label.small { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
button:active { opacity: 0.85; }
/* A link or a file picker label next to a button.small looks like one. */
a.small, label.small {
  display: inline-block; margin: 0; line-height: normal;
  letter-spacing: normal; text-transform: none; text-decoration: none;
}

.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }

.error { color: var(--red-fg); background: var(--red-pill); padding: 8px 12px; border-radius: 8px; font-size: 13px; margin: 10px 0; }
.hint { color: var(--muted); font-size: 13px; }
.legal { margin-top: 28px; }
.legal a { color: inherit; }

.feed-item {
  padding: 12px 4px; border-bottom: 1px solid var(--border);
  font-size: 14px; color: var(--muted);
}
.feed-item b { color: var(--fg); font-weight: 500; }

.empty {
  text-align: center; padding: 40px 20px;
  color: var(--muted); font-family: Georgia, serif; font-style: italic;
}

/* ---- offline banner ---- */
.offline-banner {
  background: var(--yellow-pill); color: var(--yellow-fg);
  font-size: 13px; padding: 8px 12px; border-radius: 10px;
  margin-bottom: 14px; text-align: center;
}

/* ---- inline SVG icons (src/icons.rs) ---- */
.ico { display: inline-block; width: 1.2em; height: 1.2em; vertical-align: -0.25em; }
.ico svg { display: block; width: 100%; height: 100%; }

/* ---- undo bar after -1 / discard (screens/mod.rs) ---- */
.undo-bar {
  position: fixed; left: 16px; right: 16px; max-width: 488px; margin: 0 auto;
  bottom: calc(96px + env(safe-area-inset-bottom));
  background: var(--fg); color: var(--surface);
  border-radius: 14px; padding: 8px 8px 8px 16px; box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 14px;
}
.undo-bar button { background: var(--surface); color: var(--fg); white-space: nowrap; }

/* ---- number field with - / + (screens/add.rs) ---- */
.stepper { display: flex; gap: 6px; margin-bottom: 4px; }
.stepper input { margin-bottom: 0; text-align: center; min-width: 0; }
.stepper button { width: 46px; flex-shrink: 0; padding: 0; font-size: 18px; }

/* ---- shopping list row with its "+" (screens/shopping.rs) ---- */
.card.buy { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
a.btn-circle { color: var(--fg); text-decoration: none; flex-shrink: 0; }

/* ---- admin bar, site admins only (main.rs) ---- */
.admin-bar {
  font-size: 11px; color: var(--muted); line-height: 1.5;
  border: 1px dashed var(--border); border-radius: 10px;
  padding: 6px 10px; margin-bottom: 12px;
}
.admin-bar b { color: var(--accent-dark); font-weight: 500; margin-right: 6px; }

/* ---- scan and mic buttons beside the barcode field (screens/add.rs) ---- */
.row > .icon-btn { flex: 0 0 auto; padding: 0 14px; }
.icon-btn.listening { background: var(--red-pill); color: var(--red-fg); border-color: var(--red-fg); }

/* ---- "Was ist neu" (screens/news.rs) ---- */
.news .group-label { margin-top: 10px; }
.news ul { margin: 4px 0 0; padding-left: 18px; }
.news li { font-size: 14px; line-height: 1.45; margin: 4px 0; }
