/* Outdoor Kitchen — schlichtes, outdoor-taugliches Design.
   Mobile-first, hoher Kontrast, grosse Touch-Ziele. Hell + dunkel. */

:root {
  --bg: #f3f1ea;
  --surface: #ffffff;
  --surface-2: #eceadf;
  --ink: #1b241f;
  --ink-soft: #566056;
  --line: #d9d6c8;
  --green: #2f5d45;
  --green-ink: #ffffff;
  --topbar: #2f5d45;
  --accent: #6f9a1f;         /* Hero-Lime (aus hero.png ~#82a834), auf Hell etwas dunkler für Kontrast */
  --accent-strong: #557d16;
  --accent-ink: #16220b;     /* dunkle Schrift auf Lime-Flächen */
  --amber: #c9781f;
  --amber-soft: #f5e6cf;
  --danger: #b23b2e;
  --radius: 16px;
  --tabbar-h: 64px;
  --shadow: 0 2px 10px rgba(20, 37, 29, .08);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* Premium-Dark — Default der App; „auto" folgt dem System (kein data-theme) */
:root[data-theme="dark"],
:root:not([data-theme]) {
  --bg: #0e1310;
  --surface: #161d18;
  --surface-2: #202a23;
  --ink: #eef2ee;
  --ink-soft: #9daaa0;
  --line: #29352e;
  --green: #3d7a5b;
  --topbar: #0c120f;
  --accent: #9ccf4a;         /* Hero-Lime, auf Dunkel voll leuchtend (wie im Hero-Bild) */
  --accent-strong: #b6e068;
  --accent-ink: #16220b;
  --amber: #e8a13a;
  --amber-soft: #33291a;
  --shadow: 0 2px 16px rgba(0, 0, 0, .5);
}
/* „auto" ohne System-Dark -> Hell zurücksetzen */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: #f3f1ea; --surface: #ffffff; --surface-2: #eceadf; --ink: #1b241f;
    --ink-soft: #566056; --line: #d9d6c8; --topbar: #2f5d45; --accent: #6f9a1f;
    --accent-strong: #557d16; --amber: #c9781f; --amber-soft: #f5e6cf;
    --shadow: 0 2px 10px rgba(20, 37, 29, .08);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}

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

h1, h2, h3 { line-height: 1.2; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

/* ---- Topbar ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--topbar);
  color: var(--green-ink);
  padding-top: env(safe-area-inset-top, 0px);
  box-shadow: var(--shadow);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
}
.brand {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: .2px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-mark { width: 40px; height: auto; display: inline-block; flex: 0 0 auto; }
.brand .wordmark { font-weight: 800; letter-spacing: -.01em; }
.brand .gift { color: #9ccf4a; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.install-btn {
  background: rgba(255, 255, 255, .16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: .9rem;
  font-weight: 600;
}
.acct-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .3);
  font-size: 1.1rem;
  text-decoration: none;
}

/* ---- View ---- */
.view {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px 24px;
}

/* ---- Suche + Filter ---- */
.searchbar { position: relative; margin-bottom: 12px; }
.searchbar input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-size: 1rem;
}
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 10px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: .9rem;
  font-weight: 600;
  white-space: nowrap;
}
.chip[aria-pressed="true"] {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

/* ---- Rezept-Karten ---- */
.card-list { display: grid; gap: 12px; }
.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.card:active { transform: scale(.995); }
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.card h3 { margin: 0 0 4px; font-size: 1.12rem; }
.card .summary { margin: 0; color: var(--ink-soft); font-size: .95rem; }
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 10px;
  font-size: .82rem;
  color: var(--ink-soft);
}
.card-meta .m { display: inline-flex; align-items: center; gap: 4px; }

.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge {
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-soft);
  white-space: nowrap;
}
.badge.veg { background: var(--amber-soft); color: var(--amber); }
.badge.own { background: var(--green); color: #fff; }
.badge.cat { background: var(--surface-2); color: var(--ink-soft); }

/* ---- Rezept-Detail ---- */
.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-weight: 600;
  margin-bottom: 10px;
  padding: 6px 0;
}
.detail h2 { margin: 0 0 4px; font-size: 1.5rem; }
.detail .lead { color: var(--ink-soft); margin: 0 0 16px; }

.dry-box {
  background: var(--amber-soft);
  border: 1px solid color-mix(in srgb, var(--amber) 35%, transparent);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 18px;
}
.dry-box h3 {
  margin: 0 0 10px;
  font-size: .95rem;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.dry-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.dry-grid .kv { display: flex; flex-direction: column; }
.dry-grid .k { font-size: .78rem; color: var(--ink-soft); }
.dry-grid .v { font-size: 1.15rem; font-weight: 700; }

section.block { margin-bottom: 22px; }
section.block > h3 {
  font-size: 1.05rem;
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--line);
}

/* Portionsrechner */
.portion {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 14px;
}
.portion .lbl { font-weight: 600; }
.stepper { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.stepper button {
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 1.3rem;
  font-weight: 700;
}
.stepper .count { min-width: 2ch; text-align: center; font-weight: 700; font-size: 1.15rem; }

/* Zutaten */
.ing-section h4 {
  margin: 14px 0 6px;
  font-size: .9rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: .4px;
}
ul.ings { list-style: none; margin: 0; padding: 0; }
ul.ings li {
  display: flex;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
ul.ings li:last-child { border-bottom: none; }
ul.ings .amt { flex: 0 0 auto; min-width: 5.5ch; font-weight: 700; font-variant-numeric: tabular-nums; }
ul.ings .nm { flex: 1; }
ul.ings .prep { color: var(--ink-soft); font-size: .88rem; }
ul.ings .opt { color: var(--amber); font-size: .8rem; font-weight: 600; }

/* Schritte / Phasen */
.phase { margin-bottom: 16px; }
.phase-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1rem;
  margin: 0 0 8px;
}
.phase-pill {
  font-size: .72rem;
  padding: 3px 9px;
  border-radius: 999px;
  color: #fff;
}
.phase-pill.zuhause { background: #4a6fb0; }
.phase-pill.doerren { background: var(--amber); }
.phase-pill.trail { background: var(--green); }
ol.steps { margin: 0; padding-left: 0; list-style: none; counter-reset: s; }
ol.steps li {
  position: relative;
  padding: 4px 0 12px 40px;
  counter-increment: s;
}
ol.steps li::before {
  content: counter(s);
  position: absolute;
  left: 0; top: 2px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem;
}
ol.steps .dur { color: var(--ink-soft); font-size: .82rem; margin-top: 2px; }

.note {
  background: var(--surface);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 8px;
  font-size: .92rem;
  color: var(--ink-soft);
}

/* ---- Buttons / Formulare ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.amber { background: var(--amber); color: #fff; border-color: var(--amber); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 12px; font-size: .9rem; }
.btn:disabled { opacity: .5; }

.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-weight: 600; margin-bottom: 5px; font-size: .95rem; }
.form-row input, .form-row textarea, .form-row select {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 1rem;
}
.form-row textarea { min-height: 84px; resize: vertical; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; }
.check input { width: 22px; height: 22px; }

.dyn-row { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px; }
.dyn-row input, .dyn-row select {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: 1rem;
}
.dyn-row .rm {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--danger);
  font-size: 1.2rem;
}

/* ---- Katalog-Zeile ---- */
.cat-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.cat-row .info { flex: 1; min-width: 0; }
.cat-row h3 { margin: 0 0 2px; font-size: 1.02rem; }
.cat-row .sub { margin: 0; color: var(--ink-soft); font-size: .85rem; }

/* ---- Diverses ---- */
.section-title {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 4px 0 12px;
}
.section-title h2 { margin: 0; font-size: 1.3rem; }
.count-pill { color: var(--ink-soft); font-size: .9rem; }

.empty {
  text-align: center;
  color: var(--ink-soft);
  padding: 48px 20px;
}
.empty .big { font-size: 2.4rem; margin-bottom: 8px; }
.empty .big .ic { width: 46px; height: 46px; color: var(--ink-soft); stroke-width: 1.6; }
.empty p { margin: 6px 0 16px; }

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
}
.stat .n { font-size: 1.5rem; font-weight: 800; color: var(--accent); }
.stat .l { font-size: .78rem; color: var(--ink-soft); }

/* ---- Sync-Bar (Katalog) ---- */
.sync-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 10px;
}
.sync-info { flex: 1; font-size: .9rem; line-height: 1.35; }
.sync-sub { color: var(--ink-soft); font-size: .82rem; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.dot.on { background: var(--accent); }
.dot.off { background: #b9603a; }

/* ---- Ausrüstung ---- */
.gear-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 12px 4px;
  margin-bottom: 12px;
}
.gear-form .dyn-row { margin-bottom: 8px; }
.gear-form input, .gear-form select {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  font-size: 1rem;
  min-width: 0;
}

.prov-add {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.prov-add summary { font-weight: 600; cursor: pointer; }
.prov-add select, .prov-add input {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  font-size: 1rem;
  min-width: 0;
}

.gear-cat { margin-bottom: 16px; }
.gear-cat-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  color: var(--ink-soft);
  padding: 0 4px 6px;
  border-bottom: 2px solid var(--line);
  margin-bottom: 8px;
}
.gear-cat-sum { font-variant-numeric: tabular-nums; }
.cat-bar { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 0 4px 10px; }
.cat-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; min-width: 2px; }

/* ---- Einstellungen (Sprache/Theme) ---- */
.settings-card { display: grid; gap: 12px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.settings-row select {
  flex: 0 0 auto; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--bg); color: var(--ink); font-size: 1rem;
}

.gear-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  margin-bottom: 8px;
}
.gear-row.unpacked { opacity: .55; }
.gear-check input { width: 24px; height: 24px; }
.gear-main { flex: 1; min-width: 0; }
.gear-name { font-weight: 600; }
.gear-sub { color: var(--ink-soft); font-size: .85rem; font-variant-numeric: tabular-nums; }
.gear-actions { display: flex; align-items: center; gap: 2px; }
.gear-actions button {
  width: 34px; height: 34px;
  border: none;
  background: transparent;
  color: var(--ink);
  font-size: 1.05rem;
  border-radius: 8px;
}
.gear-actions .qn { min-width: 1.6ch; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---- Ausrüstungs-Katalog ---- */
.art-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.art-head { display: flex; gap: 12px; align-items: flex-start; }
.art-head .info { flex: 1; min-width: 0; }
.art-head h3 { margin: 0 0 2px; font-size: 1.02rem; }
.art-head .sub { margin: 0; color: var(--ink-soft); font-size: .85rem; }
.art-card .badge { background: var(--amber-soft); color: var(--amber); }

.offers { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.offers summary { font-size: .88rem; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.offer-list { margin-top: 8px; display: grid; gap: 6px; }
.offer {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .9rem;
}
.offer .oshop { flex: 1; min-width: 0; }
.offer .oprice { font-weight: 700; font-variant-numeric: tabular-nums; }
.offer .oos { color: var(--danger); font-size: .8rem; }
.offer .btn { flex: 0 0 auto; }

/* ---- Trip-Foto-Header ---- */
.trip-hero {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  margin: 4px 0 14px;
  min-height: 150px;
  background: linear-gradient(135deg, var(--green), #0c120f);
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow);
}
.trip-hero.has-photo { min-height: 200px; }
.trip-hero-grad {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
  background: linear-gradient(180deg, rgba(0,0,0,.05) 0%, rgba(0,0,0,.18) 42%, rgba(0,0,0,.72) 100%);
}
.trip-hero-txt h2 { margin: 0; color: #fff; font-size: 1.6rem; text-shadow: 0 1px 8px rgba(0,0,0,.55); }
.trip-hero-txt p { margin: 3px 0 0; color: #e7ece1; font-size: .95rem; text-shadow: 0 1px 6px rgba(0,0,0,.55); }
.trip-hero-cam, .trip-hero-rm {
  position: absolute;
  top: 12px;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(0,0,0,.42);
  color: #fff;
  border: 1px solid rgba(255,255,255,.4);
  display: inline-flex; align-items: center; justify-content: center;
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.trip-hero-cam { right: 12px; }
.trip-hero-rm { right: 58px; font-size: 1.4rem; line-height: 1; }
.trip-hero .ic { width: 20px; height: 20px; }

/* Trip-Karten in der Liste (mit Foto/Verlauf-Header) */
.trip-card { padding: 0; overflow: hidden; }
.trip-card-hero {
  position: relative;
  min-height: 118px;
  background: linear-gradient(135deg, var(--green), #0c120f);
  background-size: cover;
  background-position: center;
}
.trip-card-grad {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.15) 45%, rgba(0,0,0,.68));
}
.trip-card-grad h3 { margin: 0; color: #fff; font-size: 1.15rem; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.trip-card-grad p { margin: 2px 0 0; color: #e7ece1; font-size: .85rem; text-shadow: 0 1px 5px rgba(0,0,0,.5); }
.trip-card-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 10px 14px; font-size: .85rem; color: var(--ink-soft); }
.trip-card-meta .m { display: inline-flex; align-items: center; gap: 4px; }
.trip-card-meta .ic { width: 15px; height: 15px; vertical-align: -0.15em; }

/* ---- Tabbar ---- */
.tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 30;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--ink-soft);
  font-size: .72rem;
  font-weight: 600;
}
.tab-ico { width: 24px; height: 24px; line-height: 1; }
.tab[aria-current="page"] { color: var(--accent-strong); }
.tab[aria-current="page"] .tab-ico { transform: translateY(-1px); }

/* ---- SVG-Outline-Icons ---- */
.ic { width: 1.15em; height: 1.15em; display: inline-block; vertical-align: -0.18em; flex: 0 0 auto; }
.gear-actions .ic { width: 19px; height: 19px; vertical-align: middle; }
.card-meta .ic, .cat-row .ic { width: 15px; height: 15px; vertical-align: -0.15em; }
.dry-box h3 .ic, section.block > h3 .ic { width: 18px; height: 18px; vertical-align: -0.2em; }

/* ---- Toast ---- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px);
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 11px 18px;
  border-radius: 999px;
  font-size: .92rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  z-index: 50;
  max-width: 90vw;
}

@media (min-width: 720px) {
  .dry-grid { grid-template-columns: repeat(4, 1fr); }
}
