/* Wildkammer – Stylesheet */
:root {
  --bg: #f4f1ea;
  --surface: #fffdf8;
  --surface-2: #efeadf;
  --text: #22261f;
  --muted: #6b6f63;
  --line: #ddd6c6;
  --brand: #2f4a32;
  --brand-ink: #f6f1e4;
  --brand-soft: #dfe8d9;
  --accent: #9a5b2a;
  --ok: #2e6b3a;
  --ok-soft: #dcefdc;
  --warn: #8a5a00;
  --warn-soft: #f8ead0;
  --danger: #a3332b;
  --danger-soft: #f7dcd8;
  --info-soft: #dde8f2;
  --in: #4f7f52;
  --out: #b46a35;
  --c1: #4f7f52; --c2: #b46a35; --c3: #6d8fb3; --c4: #c2a14a;
  --c5: #8a5d8f; --c6: #5aa39a; --c7: #a8584f; --c8: #7f7a6d;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(40, 35, 20, .06), 0 4px 14px rgba(40, 35, 20, .05);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161a15;
    --surface: #1f241d;
    --surface-2: #283025;
    --text: #e9e6dc;
    --muted: #a3a796;
    --line: #353d31;
    --brand: #8fb98f;
    --brand-ink: #10160f;
    --brand-soft: #2b3a2a;
    --accent: #d99a62;
    --ok: #8fd09a;
    --ok-soft: #22382a;
    --warn: #e8bd6a;
    --warn-soft: #3a3020;
    --danger: #f08a80;
    --danger-soft: #42231f;
    --info-soft: #20303d;
    --in: #7fb383;
    --out: #d9925a;
    --c1: #7fb383; --c2: #d9925a; --c3: #8fb1d6; --c4: #d8bd68;
    --c5: #b58ab9; --c6: #74c2b8; --c7: #d27f75; --c8: #a9a493;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #161a15; --surface: #1f241d; --surface-2: #283025; --text: #e9e6dc; --muted: #a3a796;
  --line: #353d31; --brand: #8fb98f; --brand-ink: #10160f; --brand-soft: #2b3a2a; --accent: #d99a62;
  --ok: #8fd09a; --ok-soft: #22382a; --warn: #e8bd6a; --warn-soft: #3a3020; --danger: #f08a80;
  --danger-soft: #42231f; --info-soft: #20303d; --in: #7fb383; --out: #d9925a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
a { color: var(--brand); }
h1 { font-size: 1.6rem; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 1.25rem 0 .5rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.inline { display: inline; }
[hidden] { display: none !important; }

/* Kopfzeile */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .6rem 1.25rem;
  background: var(--brand); color: var(--brand-ink);
}
.brand { display: flex; align-items: center; gap: .5rem; color: inherit; text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.brand img { border-radius: 7px; box-shadow: 0 0 0 1px rgba(255,255,255,.25); }
.mainnav { display: flex; gap: .25rem; flex: 1; overflow-x: auto; scrollbar-width: none; }
.mainnav a {
  color: inherit; text-decoration: none; padding: .4rem .75rem; border-radius: 8px; white-space: nowrap; opacity: .85;
}
.mainnav a:hover { opacity: 1; background: rgba(255,255,255,.1); }
.mainnav a.active { opacity: 1; background: rgba(255,255,255,.18); font-weight: 600; }
.usermenu { display: flex; align-items: center; gap: .75rem; font-size: .9rem; }
.usermenu .linkbtn { color: inherit; }
.who { white-space: nowrap; }
.role { font-size: .72rem; padding: .1rem .45rem; border-radius: 99px; background: rgba(255,255,255,.18); margin-left: .25rem; }
.card .role, td .role { background: var(--brand-soft); color: var(--text); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .topbar { background: #22301f; color: var(--text); }
}
:root[data-theme="dark"] .topbar { background: #22301f; color: var(--text); }

/* Layout */
.page { max-width: 1180px; margin: 0 auto; padding: 1.25rem 1.25rem 5rem; }
.page.narrow { max-width: 440px; padding-top: 10vh; }
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: .25rem 0 1rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.25rem; box-shadow: var(--shadow); margin-bottom: 1rem; min-width: 0;
}
.grid2 > .card { margin-bottom: 0; }
.card.center { text-align: center; padding: 2.5rem 1.25rem; }
.narrow-card { max-width: 640px; }

/* Kennzahlen */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: .9rem 1.1rem; display: flex; flex-direction: column; gap: .1rem;
}
.kpi-label { color: var(--muted); font-size: .85rem; }
.kpi-value { font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi-value small { font-size: .9rem; font-weight: 500; color: var(--muted); }
.kpi-sub { color: var(--muted); font-size: .8rem; }
.kpi-warn { border-color: var(--warn); background: var(--warn-soft); }

/* Balkenlisten */
.barlist { list-style: none; margin: 0; padding: 0; display: grid; gap: .65rem; }
.barlist li { display: grid; grid-template-columns: 1fr auto; gap: .1rem .75rem; }
.barlist-label { font-weight: 500; text-decoration: none; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.barlist-label:hover { color: var(--brand); text-decoration: underline; }
.barlist-value { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar { grid-column: 1 / -1; height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; width: var(--w); background: var(--brand); border-radius: 99px; }

/* Listen */
.itemlist { list-style: none; margin: 0; padding: 0; }
.itemlist li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .55rem 0; border-top: 1px solid var(--line); }
.itemlist li:first-child { border-top: 0; }
.itemlist a { display: flex; flex-direction: column; text-decoration: none; color: var(--text); min-width: 0; }
.itemlist a:hover strong, .itemlist a:hover { color: var(--brand); }
.tag { display: inline-block; font-size: .75rem; padding: .1rem .5rem; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-weight: 500; white-space: nowrap; vertical-align: middle; }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.mv { display: inline-block; font-size: .72rem; font-weight: 600; padding: .05rem .45rem; border-radius: 6px; margin-right: .3rem; }
.mv-IN { background: var(--ok-soft); color: var(--ok); }
.mv-OUT { background: var(--warn-soft); color: var(--accent); }
.mv-CORRECTION { background: var(--info-soft); color: var(--text); }

/* Formulare */
label { display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; font-weight: 500; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: .55rem .7rem; min-height: 2.6rem; width: 100%; min-width: 0;
}
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
input[type="checkbox"] { width: 1.15rem; height: 1.15rem; min-height: 0; accent-color: var(--brand); }
.stack { display: grid; gap: .9rem; }
.formgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1rem; }
.formgrid .span2 { grid-column: 1 / -1; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  font: inherit; font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer;
  padding: .55rem 1rem; min-height: 2.6rem; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
}
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.big { width: 100%; padding: .8rem; font-size: 1.05rem; }
.btn.small { padding: .3rem .65rem; min-height: 2rem; font-size: .85rem; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.inline-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: 1rem; }
td .inline-form { margin: 0; }
.inline-form select, .inline-form input { width: auto; }
.checkline { flex-direction: row; align-items: center; gap: .35rem; font-weight: 400; white-space: nowrap; }

/* Filter */
.filters { display: grid; grid-template-columns: 2fr repeat(4, minmax(0, 1fr)) auto; gap: .75rem; align-items: end; }
.filter-buttons { display: flex; gap: .75rem; align-items: center; white-space: nowrap; min-height: 2.6rem; }
.filters.dates { grid-template-columns: repeat(2, minmax(0, 13rem)) auto; justify-content: start; }
.summary { margin: 0 0 .75rem; color: var(--muted); }
.summary strong { color: var(--text); }

/* Bestand */
.unit-head { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; flex-wrap: wrap; }
.compartment { border-top: 1px solid var(--line); }
.compartment summary {
  display: flex; justify-content: space-between; gap: .75rem; cursor: pointer; padding: .6rem 0; font-weight: 600; list-style: none;
}
.compartment summary::-webkit-details-marker { display: none; }
.compartment summary::before { content: "▸"; color: var(--muted); margin-right: .4rem; transition: transform .15s; }
.compartment[open] summary::before { transform: rotate(90deg); }
.compartment summary > span:first-child { flex: 1; }
.tablewrap { overflow-x: auto; }
table.items { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.items th { text-align: left; font-weight: 600; color: var(--muted); font-size: .8rem; padding: .4rem .5rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.items td { padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.items tr:last-child td { border-bottom: 0; }
table.items tbody tr:hover { background: var(--surface-2); }
table.items .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.items .check { width: 2.25rem; }
table.items tr.removed td { color: var(--muted); }
table.items.compact { margin-top: .75rem; }
table.items a { text-decoration: none; font-weight: 500; }
table.items a:hover { text-decoration: underline; }
.rowactions { display: flex; gap: .4rem; flex-wrap: wrap; }

.bookout-bar {
  position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 20;
  display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; justify-content: center;
  background: var(--surface); border: 1px solid var(--brand); border-radius: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.18);
  padding: .65rem .85rem; width: min(680px, calc(100% - 2rem));
}
.bookout-bar select, .bookout-bar input { width: auto; flex: 1 1 8rem; }

/* Detail */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.timeline li { padding-left: .75rem; border-left: 3px solid var(--line); }
details.card > summary { cursor: pointer; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card[open] > summary { margin-bottom: 1rem; }
.inline-h { display: inline; margin: 0; }

/* Meldungen */
.flash { border-radius: 10px; padding: .7rem 1rem; margin-bottom: 1rem; border: 1px solid transparent; }
.flash ul { margin: .25rem 0 0; padding-left: 1.2rem; }
.flash p { margin: .2rem 0; }
.flash-success { background: var(--ok-soft); border-color: var(--ok); }
.flash-error { background: var(--danger-soft); border-color: var(--danger); }
.flash-info { background: var(--info-soft); }
.secret { display: inline-block; font-size: 1.2rem; padding: .3rem .6rem; background: var(--surface); border-radius: 6px; border: 1px dashed var(--ok); user-select: all; letter-spacing: .03em; }

/* Login */
.login { padding: 2rem 1.75rem; }
.login-head { text-align: center; margin-bottom: 1.25rem; }
.login-head img { border-radius: 14px; }
.login-head h1 { margin-top: .5rem; }
.login-head p { margin: .25rem 0 0; }

/* Admin */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; overflow-x: auto; }
.tabs a { padding: .55rem .9rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.active { color: var(--text); border-bottom-color: var(--brand); font-weight: 600; }
.masterunit { border: 1px solid var(--line); border-radius: 10px; padding: .75rem; margin-bottom: .75rem; }
.masterunit.inactive, li.inactive { opacity: .6; }
.rowform { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.rowform input[name="name"] { flex: 1 1 14rem; width: auto; }
.rowform select { width: auto; }
.sortinput { width: 5.5rem !important; flex: 0 0 auto; }
.compartments { list-style: none; margin: .6rem 0 0; padding: 0 0 0 1rem; display: grid; gap: .45rem; border-left: 2px solid var(--line); }
.downloads { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.downloads li { display: flex; flex-direction: column; align-items: flex-start; gap: .2rem; }

/* Diagramme */
.chartbox { position: relative; height: 220px; }
.chartbox.tall { height: 300px; }
.tabledetails { margin-top: .75rem; }
.tabledetails summary { cursor: pointer; color: var(--muted); font-size: .9rem; }

/* Mittlere Breiten: Menü kompakter */
@media (max-width: 1150px) {
  .mainnav a { padding: .4rem .5rem; font-size: .92rem; }
  .who .role { display: none; }
}

/* Mobil */
@media (max-width: 900px) {
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters:not(.dates) label:first-child { grid-column: 1 / -1; }
  .filters.dates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-buttons { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .topbar { padding: .5rem 1rem; gap: .4rem .75rem; }
  .mainnav { order: 3; flex-basis: 100%; margin: 0 -.25rem; }
  .usermenu { margin-left: auto; }
  .who .role { display: none; }
  .page { padding: 1rem 1rem 6rem; }
  .grid2, .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  .grid2 { grid-template-columns: 1fr; }
  .kpi-value { font-size: 1.35rem; }
  .formgrid { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  h1 { font-size: 1.35rem; }
  .card { padding: 1rem; }
}
@media (max-width: 420px) {
  .who { display: none; }
}

/* Vorratsansicht */
.pantry-hero {
  display: grid; grid-template-columns: 1fr minmax(0, 460px); gap: 1rem 2rem; align-items: center;
  background: linear-gradient(135deg, var(--brand-soft), var(--surface));
  border: 1px solid var(--line); border-radius: 18px; padding: 1.4rem 1.5rem; margin-bottom: 1.25rem;
}
.pantry-hero h1 { font-size: 1.7rem; }
.pantry-hero p { margin: .3rem 0 0; }
.pantry-search { display: flex; gap: .5rem; }
.pantry-search input { font-size: 1.05rem; min-height: 3rem; border-radius: 12px; }
.pantry-search .btn { min-height: 3rem; border-radius: 12px; }
.tilesection { margin-bottom: 1.1rem; }
.tilesection h2 { font-size: .95rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .55rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: .65rem; }
.tile {
  display: flex; flex-direction: column; align-items: center; gap: .2rem; text-align: center;
  padding: .7rem .4rem .6rem; border-radius: 16px; text-decoration: none; color: var(--text);
  background: var(--surface); border: 2px solid var(--line); box-shadow: var(--shadow);
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.tile img { width: 72px; height: 72px; transition: transform .2s ease; }
.tile:hover { transform: translateY(-2px); border-color: var(--brand); }
.tile:hover img { transform: rotate(-6deg) scale(1.06); }
.tile:active { transform: translateY(0) scale(.97); }
.tile.active { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
.tile.empty { opacity: .4; cursor: default; filter: grayscale(.7); }
.tile.empty:hover { transform: none; border-color: var(--line); }
.tile.empty:hover img { transform: none; }
.tile-label { font-weight: 650; font-size: .92rem; line-height: 1.2; }
.tile-count { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.resulthead { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin: 1.4rem 0 .7rem; }
.resulthead h2 { margin: 0; }
.pantry-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .75rem; align-items: start; }
.pantry-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.pantry-card summary { display: flex; align-items: center; gap: .8rem; padding: .75rem .9rem; cursor: pointer; list-style: none; }
.pantry-card summary::-webkit-details-marker { display: none; }
.pantry-card[open] summary { border-bottom: 1px solid var(--line); background: var(--surface-2); }
.pantry-pics { position: relative; flex: 0 0 auto; width: 60px; height: 60px; }
.pic-main { width: 56px; height: 56px; }
.pic-badge { position: absolute; right: -4px; bottom: -4px; width: 30px; height: 30px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface); }
.pantry-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pantry-title { font-weight: 650; font-size: 1.02rem; overflow: hidden; text-overflow: ellipsis; }
.pantry-amount { display: flex; flex-direction: column; align-items: flex-end; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pantry-items { list-style: none; margin: 0; padding: .3rem .9rem .6rem; }
.pantry-items li { display: grid; grid-template-columns: 4.6rem 1fr auto; gap: .1rem .6rem; padding: .45rem 0; border-top: 1px dashed var(--line); align-items: baseline; }
.pantry-items li:first-child { border-top: 0; }
.pi-weight { font-weight: 600; font-variant-numeric: tabular-nums; }
.pi-place { font-size: .9rem; }
.pi-date { grid-column: 2; }
.pi-open { grid-column: 3; grid-row: 1 / span 2; align-self: center; }
.pantry-empty img { margin-bottom: .25rem; }
@media (max-width: 760px) {
  .pantry-hero { grid-template-columns: 1fr; padding: 1.1rem; }
  .pantry-hero h1 { font-size: 1.35rem; }
  .tiles { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px 8px; margin: 0 -2px; scrollbar-width: thin; }
  .tile { flex: 0 0 96px; scroll-snap-align: start; padding: .55rem .3rem .5rem; }
  .tile img { width: 58px; height: 58px; }
  .pantry-grid { grid-template-columns: 1fr; }
}

/* Lagerorte */
.storage-unit { border: 1px solid var(--line); border-radius: 14px; padding: .9rem 1rem; margin-bottom: .9rem; background: var(--surface); }
.storage-unit-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; margin-bottom: .4rem; }
.storage-unit-head h2 { margin: 0; display: flex; align-items: center; gap: .5rem; }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); background: var(--surface); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.renameform { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; flex: 1 1 22rem; }
.renameform input[name="name"] { flex: 1 1 12rem; width: auto; }
.renameform select { width: auto; }
.storage-compartments { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .45rem; }
.storage-compartments li { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; padding: .45rem .6rem; border-radius: 10px; background: var(--surface-2); }
.storage-compartments .count { min-width: 6.5rem; text-align: right; }
.storage-compartments .count a { text-decoration: none; }

/* Zähler, Status */
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 1.3rem; height: 1.3rem; padding: 0 .35rem; border-radius: 99px; background: #d9534f; color: #fff; font-size: .72rem; font-weight: 700; line-height: 1; vertical-align: middle; }
.status { display: inline-block; font-size: .78rem; font-weight: 600; padding: .15rem .55rem; border-radius: 99px; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.status-submitted { background: var(--warn-soft); color: var(--warn); }
.status-in_progress { background: var(--info-soft); color: var(--text); }
.status-done, .status-w-done { background: var(--ok-soft); color: var(--ok); }
.status-cancelled, .status-w-declined, .status-w-withdrawn { background: var(--surface-2); color: var(--muted); }
.status-w-open { background: var(--warn-soft); color: var(--warn); }
.tag-res { background: var(--info-soft); color: var(--text); text-decoration: none; }
.inbox-banner { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; background: var(--warn-soft); border: 1px solid var(--warn); border-radius: 12px; padding: .7rem 1rem; margin-bottom: 1rem; }
.contact-hint { background: var(--surface-2); border-radius: 10px; padding: .55rem .8rem; font-size: .92rem; margin: .75rem 0; }

/* Warenkorb-Buttons in der Vorratsansicht */
.pantry-items.shop li { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; }
.pantry-items.shop .pi-weight { flex: 0 0 4rem; }
.pantry-items.shop .pi-date { flex: 1 1 7rem; }
.cartform { flex: 1 0 auto; margin: 0; text-align: right; }
.cartbtn {
  font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; white-space: nowrap;
  padding: .4rem .7rem; min-height: 2.3rem; border-radius: 99px;
  border: 1.5px solid var(--brand); background: var(--surface); color: var(--brand);
}
.cartbtn .when-on { display: none; }
.cartbtn.added { background: var(--brand); color: var(--brand-ink); }
.cartbtn.added .when-on { display: inline; }
.cartbtn.added .when-off { display: none; }
.cartbtn:disabled { opacity: .6; cursor: wait; }
.cartfab {
  position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 20;
  background: var(--brand); color: var(--brand-ink); text-decoration: none; font-weight: 700;
  padding: .75rem 1.2rem; border-radius: 99px; box-shadow: 0 8px 24px rgba(0,0,0,.25); white-space: nowrap;
}
.wish-cta { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: 1.25rem 0 4rem; padding: 1rem 1.2rem; border: 2px dashed var(--line); border-radius: 16px; background: var(--surface); }
.wish-cta div { flex: 1 1 16rem; }
.wish-cta p { margin: .2rem 0 0; }

/* Warenkorb */
.cartlist { list-style: none; margin: 0; padding: 0; }
.cartlist li { display: flex; align-items: center; gap: .7rem; padding: .55rem 0; border-top: 1px solid var(--line); }
.cartlist li:first-child { border-top: 0; }
.cl-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.cl-weight { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sendform { margin-top: 1rem; }
.summary-table .sum-species td { font-weight: 700; background: var(--surface-2); }
.summary-table .sum-cut td:first-child { padding-left: 1.4rem; }
.summary-table tfoot td { font-weight: 800; border-top: 2px solid var(--text); padding: .5rem; }
table.items tfoot td { padding: .45rem .5rem; }

/* Bestellungen */
.order-card > summary { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; }
.order-card > summary::-webkit-details-marker { display: none; }
.order-card[open] > summary { margin-bottom: .75rem; }
.order-card .actions { margin-top: .9rem; }
.orders-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
.order-row { display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem; text-decoration: none; color: var(--text); margin-bottom: .6rem; }
.order-row:hover { border-color: var(--brand); }
.or-main { display: flex; flex-direction: column; }
.or-sum { font-variant-numeric: tabular-nums; }
.or-cuts { grid-column: 1 / -1; }
.orderfilters { grid-template-columns: repeat(2, minmax(0, 14rem)); justify-content: start; }
.packlist { list-style: none; margin: 0 0 1rem; padding: 0; }
.pl-place { font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: .8rem 0 .3rem; }
.pl-line { display: flex; align-items: center; gap: .7rem; padding: .55rem .6rem; border-radius: 10px; background: var(--surface-2); margin-bottom: .35rem; }
.pl-line input[type="checkbox"] { width: 1.4rem; height: 1.4rem; flex: 0 0 auto; }
.pl-text { flex: 1; display: flex; flex-direction: column; font-weight: 400; gap: 0; }
.pl-weight { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pl-mark { width: 1.4rem; text-align: center; font-weight: 700; color: var(--ok); }
.pl-released { opacity: .55; }
.pl-swap { margin: -.2rem 0 .5rem 2.6rem; }
.pl-swap select { width: auto; max-width: 100%; }

/* Wünsche */
.wishform h2 { font-size: .95rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 1rem 0 .55rem; }
.wishform h2:first-of-type { margin-top: 0; }
.picktiles .tile { cursor: pointer; position: relative; }
.picktiles .tile input { position: absolute; opacity: 0; pointer-events: none; }
.picktiles .tile:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
.picktiles .tile:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.qtyrow { display: grid; grid-template-columns: 1fr 7rem; gap: .6rem; }
.wishlist { list-style: none; margin: 0; padding: 0; }
.wishlist li { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; padding: .6rem 0; border-top: 1px solid var(--line); }
.wishlist li:first-child { border-top: 0; }
.wishlist li.closed { opacity: .7; }
.wl-main { display: flex; flex-direction: column; flex: 1 1 16rem; min-width: 0; }
.wl-note { font-style: italic; margin-top: .15rem; }
.demand-table .demand-detail td { border-top: 0; padding-top: 0; }
.demand-table tbody tr.demand-row td { border-bottom: 0; }
.small-pics { width: 42px; height: 42px; display: inline-block; }
.small-pics .pic-main { width: 40px; height: 40px; }
.small-pics .pic-badge { width: 22px; height: 22px; }

/* Nachrichten */
.chat { max-width: 760px; }
.thread { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: .6rem; max-height: 60vh; overflow-y: auto; }
.msg { display: flex; flex-direction: column; max-width: 82%; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg.theirs { align-self: flex-start; }
.bubble { padding: .55rem .8rem; border-radius: 14px; background: var(--surface-2); overflow-wrap: anywhere; }
.msg-body { white-space: pre-wrap; }
.msg.mine .bubble { background: var(--brand); color: var(--brand-ink); border-bottom-right-radius: 4px; }
.msg.theirs .bubble { border-bottom-left-radius: 4px; }
.msg-ref { display: block; opacity: .8; font-weight: 600; }
.msg-meta { margin-top: .15rem; }
.chatform { display: grid; gap: .6rem; }
.center-text { text-align: center; }

@media (max-width: 760px) {
  .orders-grid { grid-template-columns: 1fr; }
  .orderfilters { grid-template-columns: 1fr 1fr; }
  .pl-swap { margin-left: 0; }
  .msg { max-width: 92%; }
  .cartbtn { padding: .4rem .55rem; }
}

/* Einbuchen (handytauglich) */
.bookin .card h2 { font-size: .95rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .65rem; }
.smalltiles { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.smalltiles .tile img { width: 52px; height: 52px; }
.smalltiles .tile-label { font-size: .82rem; }
.cutchips { display: none; flex-wrap: wrap; gap: .45rem; margin: .8rem 0 .2rem; }
.cutchips.show { display: flex; }
.chip {
  font: inherit; font-size: .95rem; font-weight: 600; cursor: pointer; color: var(--text);
  padding: .55rem .9rem; min-height: 2.75rem; border-radius: 99px; border: 1.5px solid var(--line); background: var(--surface-2);
}
.chip.active, .radiochip:has(input:checked) { border-color: var(--brand); background: var(--brand); color: var(--brand-ink); }
.radiochip { display: inline-flex; align-items: center; flex-direction: row; position: relative; }
.radiochip input { position: absolute; opacity: 0; pointer-events: none; }
.radiochip:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.cutfield { margin-top: .8rem; }
.placegroup { border: 0; padding: 0; margin: 0 0 .9rem; }
.placegroup legend { font-weight: 700; margin-bottom: .45rem; padding: 0; }
.chiprow { display: flex; flex-wrap: wrap; gap: .45rem; }
.weightrow { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.weightinput { display: flex; align-items: center; gap: .4rem; }
.weightinput input { font-size: 1.6rem; font-weight: 700; min-height: 3.4rem; text-align: right; font-variant-numeric: tabular-nums; }
.weightinput .unit { font-size: 1.3rem; font-weight: 700; color: var(--muted); }
.stepper { display: flex; align-items: center; gap: .4rem; }
.stepper .btn { min-width: 3.2rem; min-height: 3.4rem; font-size: 1.4rem; }
.stepper input { font-size: 1.6rem; font-weight: 700; min-height: 3.4rem; text-align: center; max-width: 5rem; }
.moredetails { margin-top: 1rem; }
.moredetails summary { cursor: pointer; color: var(--muted); }
.moredetails[open] summary { margin-bottom: .7rem; }
.submitbar { position: sticky; bottom: 0; padding: .75rem 0 1rem; background: linear-gradient(to top, var(--bg) 70%, transparent); z-index: 5; }
.progressbar { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .7rem 1rem; margin-bottom: 1rem; }
.progressbar .bar { flex-basis: 100%; }
.pl-line .btn.small { flex: 0 0 auto; }
.ok-text { color: var(--ok); }
.closeform { margin-top: 1rem; }
.closeform p { margin: .4rem 0 0; }
.bookout-bar input[data-recipient] { flex: 1 1 10rem; width: auto; }
@media (max-width: 760px) {
  .weightrow { grid-template-columns: 1fr; }
  .pl-line { flex-wrap: wrap; }
  .pl-line .pl-text { flex: 1 1 60%; }
}
@media (max-width: 760px) {
  /* Beim Einbuchen und bei Wünschen alle Kacheln auf einen Blick (Raster statt Wischen) */
  .bookin .tiles, .wishform .tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; gap: .45rem; padding: 0; margin: 0; }
  .bookin .smalltiles, .wishform .tiles.smalltiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .bookin .tile, .wishform .tile { padding: .45rem .2rem .4rem; border-radius: 12px; }
  .bookin .tile img, .wishform .tile img { width: 50px; height: 50px; }
  .bookin .smalltiles .tile img { width: 40px; height: 40px; }
  .bookin .smalltiles .tile-label { font-size: .72rem; }
  .bookin .card { padding: .85rem; }
}

.pick-hint { color: var(--brand); font-weight: 600; }
.pantry-card[open] .pick-hint { visibility: hidden; }
