/* Holz-Erfassung
   Leitmotiv: das gelbe Nummernplättchen an der Stirnseite eines Stamms.
   Es trägt die Los-Nr. und ist das einzige laute Element; alles andere bleibt ruhig. */

@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url(fonts/Barlow-400.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url(fonts/Barlow-500.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url(fonts/Barlow-600.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 500; font-display: swap; src: url(fonts/BarlowCondensed-500.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url(fonts/BarlowCondensed-600.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url(fonts/BarlowCondensed-700.woff2) format("woff2"); }

:root {
  /* Farben */
  --lichen: #E6EBE4;      /* Hintergrund: Flechte */
  --surface: #F6F8F5;     /* ruhige Flächen */
  --spruce: #17352A;      /* Schrift, Hauptaktion: Fichte */
  --moss: #56705F;        /* Nebentext */
  --rule: #C7D2C9;        /* Trennlinien */
  --rule-strong: #93A89B; /* leere Sterne, Rahmen */
  --tag: #F5C518;         /* Nummernplättchen */
  --tag-ink: #1E1A06;
  --tag-edge: #C99D00;
  --danger: #B3261E;
  --ok: #2F8A4E;
  --wait: #B7791F;
  --on-primary: #FFFFFF;
  --primary: var(--spruce);

  /* Schrift */
  --sans: "Barlow", -apple-system, system-ui, sans-serif;
  --cond: "Barlow Condensed", "Arial Narrow", -apple-system, system-ui, sans-serif;

  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
  --gutter: 16px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --lichen: #0E1A14;
    --surface: #15251D;
    --spruce: #E3ECE5;
    --moss: #95AA9C;
    --rule: #26382E;
    --rule-strong: #4E6557;
    --primary: #CFE3D6;
    --on-primary: #0E1A14;
    --danger: #FF8A80;
    --ok: #5CC285;
    --wait: #E0A94A;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--lichen);
  color: var(--spruce);
  font: 400 17px/1.4 var(--sans);
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--tag-edge); outline-offset: 2px; }
svg { width: 1em; height: 1em; fill: currentColor; flex: none; }

.hidden { display: none !important; }
.small { font-size: 15px; }

/* --- Ansichten ----------------------------------------------------------- */
.view {
  display: none;
  position: fixed;
  inset: 0;
  flex-direction: column;
  padding-top: var(--safe-top);
}
.view.active { display: flex; }

.scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px var(--gutter) calc(32px + var(--safe-bottom));
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 50px;
  padding: 0 6px;
  border-bottom: 1px solid var(--rule);
}
.topbar h2 { margin: 0; font: 600 21px/1 var(--cond); letter-spacing: 0.01em; }
.topbar > :first-child { justify-self: start; }
.topbar > :last-child { justify-self: end; }

.text-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  background: none;
  font: 500 17px/1 var(--sans);
  color: var(--spruce);
  white-space: nowrap;
}
.text-btn.back::before {
  content: "";
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-left: 2.5px solid currentColor;
  border-bottom: 2.5px solid currentColor;
  transform: rotate(45deg);
}
.text-btn.light { color: #fff; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--spruce);
  font-size: 22px;
}
.icon-btn:disabled svg { animation: spin 1s linear infinite; opacity: 0.6; }
@keyframes spin { to { transform: rotate(360deg); } }

.primary-btn {
  min-height: 56px;
  padding: 0 24px;
  border: 0;
  border-radius: 12px;
  background: var(--primary);
  color: var(--on-primary);
  font: 600 22px/1 var(--cond);
  letter-spacing: 0.02em;
}
.primary-btn:active { transform: translateY(1px); }
.primary-btn:disabled { opacity: 0.5; }

/* --- Nummernplättchen ------------------------------------------------------ */
.plate {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px 0 26px;
  border-radius: 7px;
  background: var(--tag);
  color: var(--tag-ink);
  font: 700 22px/1 var(--cond);
  font-variant-numeric: tabular-nums;
  /* gegossene Kunststoffkante */
  box-shadow: inset 0 -3px 0 var(--tag-edge), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
/* Nagelloch */
.plate::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--lichen);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.45);
}
.plate-sm { height: 30px; font-size: 20px; padding: 0 10px 0 21px; border-radius: 5px; }
.plate-sm::before { left: 7px; width: 6px; height: 6px; margin-top: -4px; }
.plate-xl {
  min-width: 190px;
  height: 108px;
  padding: 0 28px 0 50px;
  border-radius: 12px;
  font-size: 84px;
  box-shadow: inset 0 -6px 0 var(--tag-edge), inset 0 2px 0 rgba(255, 255, 255, 0.55),
              0 10px 24px -12px rgba(23, 53, 42, 0.45);
}
.plate-xl::before { left: 17px; width: 15px; height: 15px; margin-top: -9px; }

/* --- Start --------------------------------------------------------------- */
#view-home { padding: calc(var(--safe-top) + 10px) var(--gutter) calc(var(--safe-bottom) + 16px); }

.home-head { display: grid; gap: 2px; }
.wordmark { margin: 0; font: 700 34px/1.05 var(--cond); letter-spacing: -0.005em; }
.sync-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: -10px;
  font-size: 15px;
  color: var(--moss);
}
.sync-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--rule-strong); }
.dot.ok { background: var(--ok); }
.dot.pending { background: var(--wait); }
.dot.error { background: var(--danger); }
.dot.busy { background: var(--spruce); animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

/* Startbild: nimmt den freien Platz und schrumpft auf kleinen Geräten */
.home-art {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  height: auto;
  margin: 10px 0 4px;
  object-fit: contain;
}

.home-los {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 6px 0 18px;
}
#home-los-current { display: flex; flex-direction: column; align-items: center; }
.home-los-line { display: flex; align-items: center; gap: 14px; }
.home-los-caption { font: 500 17px/1 var(--sans); color: var(--moss); }
.plate-lg {
  min-width: 110px;
  height: 62px;
  padding: 0 18px 0 34px;
  border-radius: 9px;
  font-size: 46px;
  box-shadow: inset 0 -4px 0 var(--tag-edge), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.plate-lg::before { left: 12px; width: 11px; height: 11px; margin-top: -7px; }
.home-los-count { margin: 10px 0 0; font-size: 17px; color: var(--moss); }
.home-los-count strong { color: var(--spruce); font-weight: 600; }
.home-los-empty { margin: 0; max-width: 28ch; font-size: 17px; line-height: 1.5; color: var(--moss); }

.home-actions { display: grid; gap: 10px; }

.capture-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 76px;
  border: 0;
  border-radius: 16px;
  background: var(--primary);
  color: var(--on-primary);
  font: 600 27px/1 var(--cond);
  letter-spacing: 0.01em;
}
.capture-btn svg { font-size: 32px; fill: none; }
.capture-btn:active { transform: translateY(1px); }

.list-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 0 18px;
  border: 1.5px solid var(--rule-strong);
  border-radius: 14px;
  background: transparent;
  font: 600 22px/1 var(--cond);
}
.home-secondary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.list-btn svg { font-size: 24px; }
.list-count {
  min-width: 34px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--surface);
  font: 600 17px/1 var(--sans);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

/* --- Kamera -------------------------------------------------------------- */
.camera-view { background: #000; padding-top: 0; }
#camera-video { flex: 1; width: 100%; min-height: 0; object-fit: cover; background: #000; }
.camera-los { position: absolute; top: calc(var(--safe-top) + 14px); left: 14px; }
.camera-los::before { background: #000; }
.camera-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 18px 8px calc(18px + var(--safe-bottom));
  background: #000;
}
.camera-bar > :first-child { justify-self: start; }
.camera-bar > :last-child { justify-self: end; }
.shutter {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: #fff;
  box-shadow: inset 0 0 0 4px #000;
}
.shutter:active { transform: scale(0.93); }
.shutter:disabled { opacity: 0.35; }
.camera-error {
  position: absolute;
  inset: 0 0 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px;
  color: #fff;
  text-align: center;
}
.camera-error .capture-btn { margin-top: 12px; padding: 0 24px; min-height: 60px; font-size: 22px; background: #fff; color: #000; }

/* --- Bewertung (alles auf einer Bildschirmseite) ---------------------------- */
.form-layout {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 12px var(--gutter) calc(12px + var(--safe-bottom));
  overflow-y: auto; /* nur Notfall, z. B. bei offener Tastatur auf sehr kleinen Geräten */
}

.photo-wrap {
  position: relative;
  flex: 1 1 0;
  min-height: 96px;
  margin: 0;
}
.photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
  background: var(--surface);
}
.geo-chip {
  position: absolute;
  left: 10px;
  bottom: 10px;
  max-width: calc(100% - 20px);
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px 6px 8px;
  border-radius: 999px;
  background: rgba(14, 26, 20, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff;
  font: 500 14px/1 var(--sans);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.geo-chip::before {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 22s-7-6.3-7-11.5a7 7 0 0 1 14 0C19 15.7 12 22 12 22zm0-9a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 22s-7-6.3-7-11.5a7 7 0 0 1 14 0C19 15.7 12 22 12 22zm0-9a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.geo-chip.ok::before { color: var(--tag); background: var(--tag); }
.geo-chip.waiting::before { animation: blink 1.2s ease-in-out infinite; }

.form-rows { flex: none; margin-top: 4px; }
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  border-bottom: 1px solid var(--rule);
}
.row-label { font: 600 21px/1 var(--cond); white-space: nowrap; }

.stars { display: flex; margin-right: -8px; }
.stars button {
  display: grid;
  place-items: center;
  width: 52px;
  height: 46px;
  padding: 0;
  border: 0;
  background: none;
}
.stars svg {
  width: 32px;
  height: 32px;
  fill: transparent;
  stroke: var(--rule-strong);
  stroke-width: 1.6;
  stroke-linejoin: round;
  transition: transform 0.12s ease-out;
}
.stars button.on svg { fill: var(--tag); stroke: var(--tag-edge); }
.stars button:active svg { transform: scale(0.85); }

/* Holzsorte: Tipp-Felder statt Auswahlliste (schneller, auch mit Handschuhen) */
.row-wood { flex-direction: column; align-items: stretch; gap: 7px; padding: 9px 0 10px; }
.wood-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.wood-grid label { grid-column: span 2; position: relative; }
.wood-grid label.wide { grid-column: span 4; }
.wood-grid input { position: absolute; opacity: 0; pointer-events: none; }
.wood-grid span {
  display: grid;
  place-items: center;
  height: 42px;
  border: 1.5px solid var(--rule-strong);
  border-radius: 10px;
  font: 600 19px/1 var(--cond);
  letter-spacing: 0.01em;
}
.wood-grid input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.wood-grid input:focus-visible + span { outline: 3px solid var(--tag-edge); outline-offset: 2px; }

/* Wer den Stapel nimmt: freiwillig, erneutes Antippen hebt die Auswahl auf */
.row-taker { padding: 8px 0; border-bottom: 0; }
.taker-grid { display: grid; grid-template-columns: repeat(3, auto); gap: 6px; }
.taker-grid button {
  height: 40px;
  padding: 0 13px;
  border: 1.5px solid var(--rule-strong);
  border-radius: 10px;
  background: none;
  font: 600 19px/1 var(--cond);
  letter-spacing: 0.01em;
}
.taker-grid button[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

/* Fehlermeldung liegt über dem Foto und kostet keine eigene Zeile */
.form-error {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 10px;
  margin: 0;
  padding: 9px 12px;
  border-radius: 10px;
  background: #B3261E;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.form-actions {
  flex: none;
  display: grid;
  grid-template-columns: 44% 1fr;
  gap: 10px;
  margin-top: 12px;
}
.form-actions .primary-btn { min-height: 64px; }

/* Los-Nr. als beschreibbares Plättchen */
.plate-input {
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 2px;
  height: 64px;
  padding: 0 12px 2px 30px;
  cursor: text;
}
.plate-input::before { left: 11px; }
.plate-caption { font: 600 13px/1 var(--sans); opacity: 0.75; }
.plate-input input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--tag-ink);
  font: 700 34px/1 var(--cond);
  font-variant-numeric: tabular-nums;
  caret-color: var(--tag-ink);
}
.plate-input input::placeholder { color: rgba(30, 26, 6, 0.35); }
.plate-input input:focus { outline: none; }
.plate-input:focus-within { outline: 3px solid var(--primary); outline-offset: 2px; }
.plate-input.invalid { box-shadow: inset 0 -3px 0 var(--tag-edge), 0 0 0 3px var(--danger); }

/* --- Liste --------------------------------------------------------------- */
/* Filter: drei Auswahlfelder, ein gesetzter Filter wird dunkel hinterlegt */
.filter-bar {
  flex: none;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  padding: 10px var(--gutter);
  border-bottom: 1px solid var(--rule);
}
.filter {
  grid-column: span 2;
  position: relative;
  display: grid;
  gap: 3px;
  padding: 6px 26px 7px 10px;
  border: 1.5px solid var(--rule-strong);
  border-radius: 10px;
  min-width: 0;
}
.filter::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}
.filter.half { grid-column: span 3; }
.filter span { font: 500 13px/1 var(--sans); color: var(--moss); }
.filter select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: 600 19px/1.1 var(--cond);
  text-overflow: ellipsis;
}
.filter select:focus { outline: none; }
.filter:focus-within { outline: 3px solid var(--tag-edge); outline-offset: 2px; }
.filter.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.filter.active span { color: inherit; opacity: 0.75; }

.filter-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 -10px 0 0;
  font-size: 15px;
  font-weight: 500;
}
.filter-result .text-btn { font-size: 15px; text-decoration: underline; text-underline-offset: 4px; }
.entry-taker { margin-top: 2px; font-size: 15px; color: var(--moss); }
.entry-taker strong { color: var(--spruce); font-weight: 600; }
.list-sync { margin: 4px 0 8px; font-size: 14px; color: var(--moss); }
.list-empty { display: grid; justify-items: center; gap: 16px; margin-top: 64px; color: var(--moss); }
.list-empty p { margin: 0; font-size: 17px; }

.los-group { margin-top: 18px; }
.los-head {
  position: sticky;
  top: -8px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  background: var(--lichen);
}
.los-meta { font-size: 15px; color: var(--moss); }

.entries { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.entry {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}
.entry img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 10px;
  background: var(--surface);
}
.entry-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.entry-title { font: 600 22px/1.1 var(--cond); }
.entry-date { font-size: 14px; color: var(--moss); white-space: nowrap; font-variant-numeric: tabular-nums; }
.entry-ratings { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; margin-top: 4px; font-size: 15px; color: var(--moss); }
.mini-stars { display: flex; align-items: center; gap: 1px; }
.mini-stars svg { width: 15px; height: 15px; fill: transparent; stroke: var(--rule-strong); stroke-width: 2; }
.mini-stars svg.on { fill: var(--tag); stroke: var(--tag-edge); }
.entry-geo { margin-top: 2px; font-size: 14px; color: var(--moss); font-variant-numeric: tabular-nums; }

.status { display: inline-block; margin-top: 6px; padding: 3px 9px; border-radius: 6px; font-size: 13px; font-weight: 600; }
.status.pending { border: 1.5px dashed var(--wait); color: var(--wait); }
.status.error { background: var(--danger); color: #fff; }

.entry-actions { display: flex; gap: 4px; margin: 6px 0 -6px -10px; }
.entry-actions a, .entry-actions button {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  background: none;
  color: var(--spruce);
  font: 600 15px/1 var(--sans);
  text-decoration: underline;
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 4px;
}
.entry-actions .delete { margin-left: auto; color: var(--danger); text-decoration-color: currentColor; }

/* --- Karte --------------------------------------------------------------- */
.print-bar, .print-head, .print-table { display: none; }

.map-page { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.map-frame { position: relative; flex: 1; min-height: 0; }
.map-scaler, #map { width: 100%; height: 100%; }
#map { background: var(--surface); font: inherit; z-index: 0; }

/* Stecknadel: Nummernplättchen mit Spitze, die auf den Standort zeigt */
.los-pin { width: 0 !important; height: 0 !important; }
.los-pin .plate {
  position: absolute;
  left: 0;
  bottom: 9px;
  transform: translateX(-50%);
  white-space: nowrap;
  box-shadow: inset 0 -3px 0 var(--tag-edge), 0 3px 8px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}
.los-pin .plate::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -9px;
  margin-left: -7px;
  border: 7px solid transparent;
  border-top: 9px solid var(--tag-edge);
  border-bottom: 0;
}
.los-pin.selected .plate { outline: 3px solid #17352A; outline-offset: 1px; z-index: 1; }
.los-pin .plate::before { background: #6b6b63; }

.map-note {
  position: absolute;
  left: 50%;
  top: 12px;
  z-index: 1100;
  transform: translateX(-50%);
  max-width: calc(100% - 24px);
  margin: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--spruce);
  color: var(--lichen);
  font-size: 15px;
  font-weight: 500;
  text-align: center;
}

.los-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1100;
  max-height: 58%;
  display: flex;
  flex-direction: column;
  padding: 6px var(--gutter) calc(8px + var(--safe-bottom));
  border-radius: 18px 18px 0 0;
  background: var(--lichen);
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.28);
}
.los-sheet-head { flex: none; display: flex; align-items: center; gap: 10px; }
.los-sheet-head .icon-btn { margin-left: auto; margin-right: -10px; }
.sheet-entries {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.sheet-entry {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}
.sheet-entry img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; background: var(--surface); }
.sheet-entry .entry-title { font-size: 20px; }
.sheet-link { flex: none; align-self: flex-start; margin-left: -10px; text-decoration: underline; text-underline-offset: 4px; font-size: 15px; }

.leaflet-container a { color: var(--spruce); }
.leaflet-control-attribution { font: 400 11px/1.4 var(--sans); }

/* Druckansicht: eigene Seite mit Karte in fester Größe (passt auf A4) und Tabelle aller Lose */
body.print-mode #view-map {
  --lichen: #fff;
  --surface: #f3f3f0;
  --spruce: #111;
  --moss: #444;
  --rule: #bbb;
  --rule-strong: #888;
  --primary: #17352A;
  --on-primary: #fff;
  display: block;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px calc(24px + var(--safe-bottom));
  background: #fff;
  color: #111;
}
body.print-mode .screen-only,
body.print-mode .los-sheet,
body.print-mode .map-note,
body.print-mode .leaflet-control-zoom { display: none !important; }
body.print-mode .print-bar {
  position: sticky;
  top: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 -16px;
  padding: calc(var(--safe-top) + 6px) 12px 8px 6px;
  border-bottom: 1px solid var(--rule);
  background: #fff;
}
body.print-mode .print-bar .primary-btn { min-height: 46px; padding: 0 16px; font-size: 20px; white-space: nowrap; }
/* Die Seite ist immer 680 Punkte breit (wie auf A4) und wird für den Bildschirm nur verkleinert:
   die Vorschau zeigt genau das, was gedruckt wird. */
body.print-mode .map-page { display: block; width: 680px; zoom: var(--print-scale, 1); }
body.print-mode .print-head { display: block; margin: 14px 0 10px; }
.print-head h1 { margin: 0; font: 700 26px/1.1 var(--cond); }
.print-head p { margin: 4px 0 0; font-size: 14px; color: var(--moss); }
body.print-mode .map-frame {
  flex: none;
  width: 680px;
  height: 460px;
  overflow: hidden;
  outline: 1px solid var(--rule-strong);
  pointer-events: none;
}
body.print-mode .print-table { display: block; margin-top: 16px; }
.print-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.print-table th, .print-table td { padding: 5px 6px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.print-table th { font-weight: 600; border-bottom: 1.5px solid #111; white-space: nowrap; }
.print-table .los-row td { padding-top: 12px; border-bottom: 0; font: 700 17px/1.2 var(--cond); }
.print-table .los-row .plate { margin-right: 8px; vertical-align: middle; }
.print-table .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.print-table .stars-text { letter-spacing: 1px; white-space: nowrap; }

@media print {
  @page { size: A4 portrait; margin: 12mm; }
  html, body { height: auto; background: #fff; }
  body.print-mode > :not(#view-map) { display: none !important; }
  body.print-mode #view-map { position: static; padding: 0; overflow: visible; }
  body.print-mode .print-bar { display: none !important; }
  body.print-mode .print-head { margin-top: 0; }
  body.print-mode .map-page { zoom: 1; }
  body.print-mode .map-frame { break-inside: avoid; }
  .print-table tr { break-inside: avoid; }
  .print-table thead { display: table-header-group; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* --- Lightbox & Toast ---------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.94);
}
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + var(--safe-bottom));
  z-index: 30;
  transform: translateX(-50%);
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--spruce);
  color: var(--lichen);
  font: 500 16px/1.2 var(--sans);
  white-space: nowrap;
  animation: toast-in 0.18s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

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

/* --- Anmeldung und Konto ----------------------------------------------------- */
#view-login {
  padding: calc(var(--safe-top) + 10px) var(--gutter) calc(var(--safe-bottom) + 16px);
  gap: 10px;
  overflow-y: auto;
}
/* Das Startbild füllt den Platz über dem Formular und schrumpft, wenn die Tastatur aufgeht */
.login-art { flex: 1 1 0; min-height: 90px; width: 100%; object-fit: contain; }

.home-title { display: flex; align-items: center; justify-content: space-between; margin-right: -10px; }

.auth-form { display: grid; gap: 12px; width: 100%; max-width: 460px; margin: 0 auto; }
.auth-intro { margin: 0; color: var(--moss); font-size: 15px; }
.auth-intro:empty { display: none; }
.auth-error {
  margin: 0; padding: 9px 12px; border-radius: 10px;
  background: #B3261E; color: #fff; font-size: 15px; font-weight: 600; line-height: 1.3;
}
.field { display: grid; gap: 4px; }
.field span { font: 500 14px/1.2 var(--sans); color: var(--moss); }
.field input {
  width: 100%; min-height: 50px; padding: 0 14px;
  border: 1.5px solid var(--rule-strong); border-radius: 12px;
  background: var(--surface); font-size: 17px;
}
.field input:focus { outline: 3px solid var(--tag-edge); outline-offset: 1px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.check input { width: 22px; height: 22px; accent-color: var(--primary); }

.account-card { display: grid; gap: 4px; margin-top: 12px; }
.account-name { margin: 0; font: 700 28px/1.1 var(--cond); }
.account-mail { margin: 0 0 12px; color: var(--moss); overflow-wrap: anywhere; }
.account-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.account-actions .list-btn { justify-content: center; }

.section-title { margin: 28px 0 10px; font: 600 21px/1 var(--cond); }
.user-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.user-item { padding: 12px 14px; border: 1.5px solid var(--rule); border-radius: 14px; background: var(--surface); }
.user-item-name { margin: 0; font-weight: 600; }
.user-item-mail { margin: 0; color: var(--moss); font-size: 15px; overflow-wrap: anywhere; }
.user-item-state { margin: 4px 0 0; font-size: 14px; color: var(--wait); }
.user-item-actions { display: flex; flex-wrap: wrap; margin: 6px 0 -6px -10px; }
.user-item-actions .text-btn { font-size: 15px; text-decoration: underline; text-underline-offset: 4px; }
.user-item-actions .danger { color: var(--danger); }
