/* Fraktions-Manager
   Farben aus dem Wappen: Gold und Bronze als Akzent, warmes Schwarz als Grund, Silber für
   Linien und das Grün und Rot der Tricolore für Ein- und Auslagern. Feine Linien mit
   Eck-Markierungen und ein Punktraster im Hintergrund. Es werden nur Systemschriften
   verwendet, damit keine Daten an fremde Server gehen.

   Farbschema: ohne eigene Wahl folgt die Seite dem System. Der Schalter setzt
   data-theme="light" oder "dark" am <html> (und ein Cookie, siehe app.js). */

:root {
  color-scheme: dark;

  --bg: #0b0a08;
  --panel: #14120f;
  --raised: #1e1b16;
  --line: #2b2721;
  --line-strong: #423b31;
  --text: #f4efe6;
  --muted: #a39a8b;
  --faint: #6f675a;

  --accent: #dcaa55;
  --accent-hi: #ecc272;
  --accent-ink: #e4b762;
  --on-accent: #1b1306;
  --accent-soft: rgba(220, 170, 85, 0.12);
  --glow: rgba(220, 170, 85, 0.32);

  --in: #43b873;
  --out: #e5554c;
  --out-soft: rgba(229, 85, 76, 0.1);
  --dot: rgba(255, 236, 205, 0.06);
  --shade: rgba(0, 0, 0, 0.5);

  --green: #1f8f4e;
  --white: #f1efe9;
  --red: #c8302e;

  --plate-bg: #f2efe2;
  --plate-ink: #1d2b5a;

  --tint-1: #43b873;
  --tint-2: #e5736b;
  --tint-3: #c3c7cd;
  --tint-4: #d98a4f;

  --display: "Space Grotesk", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue",
    sans-serif;
  --body: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", "Noto Sans", sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", "Cascadia Code", "SF Mono", Consolas, ui-monospace, monospace;
  --plate-font: "Bahnschrift", "DIN Alternate", "Barlow Condensed", "Arial Narrow", sans-serif;

  --r-s: 3px;
  --r-m: 6px;
}

/* Heller Modus: einmal für die Systemeinstellung, einmal für die eigene Wahl */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f6f3ed;
    --panel: #ffffff;
    --raised: #efe9de;
    --line: #e3dccf;
    --line-strong: #cbc0ae;
    --text: #17130d;
    --muted: #625a4d;
    --faint: #948a7a;
    --accent: #cf9a40;
    --accent-hi: #bd8a33;
    --accent-ink: #8a5a12;
    --on-accent: #1b1306;
    --accent-soft: rgba(207, 154, 64, 0.14);
    --glow: rgba(207, 154, 64, 0.3);
    --in: #1d7d45;
    --out: #c0352d;
    --out-soft: rgba(192, 53, 45, 0.08);
    --dot: rgba(60, 40, 10, 0.09);
    --shade: rgba(40, 28, 10, 0.14);
    --white: #d4cdbf;
    --tint-1: #1d7d45;
    --tint-2: #b8352d;
    --tint-3: #5f6670;
    --tint-4: #a85a24;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f3ed;
  --panel: #ffffff;
  --raised: #efe9de;
  --line: #e3dccf;
  --line-strong: #cbc0ae;
  --text: #17130d;
  --muted: #625a4d;
  --faint: #948a7a;
  --accent: #cf9a40;
  --accent-hi: #bd8a33;
  --accent-ink: #8a5a12;
  --on-accent: #1b1306;
  --accent-soft: rgba(207, 154, 64, 0.14);
  --glow: rgba(207, 154, 64, 0.3);
  --in: #1d7d45;
  --out: #c0352d;
  --out-soft: rgba(192, 53, 45, 0.08);
  --dot: rgba(60, 40, 10, 0.09);
  --shade: rgba(40, 28, 10, 0.14);
  --white: #d4cdbf;
  --tint-1: #1d7d45;
  --tint-2: #b8352d;
  --tint-3: #5f6670;
  --tint-4: #a85a24;
}

/* Eck-Markierungen wie in Zielrahmen: vier kurze Winkel über der Fläche */
:root {
  --tick: var(--line-strong);
  --tricolore: linear-gradient(90deg, var(--green) 0 33.33%, var(--white) 33.33% 66.66%, var(--red) 66.66% 100%);
}
.table-wrap,
.vehicles,
.vcard,
.form-inline,
.stock-in,
.error-box,
.login-features li {
  --c: var(--tick);
  background:
    linear-gradient(var(--c), var(--c)) 0 0 / 10px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) 0 0 / 1px 10px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 0 / 10px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 0 / 1px 10px no-repeat,
    linear-gradient(var(--c), var(--c)) 0 100% / 10px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) 0 100% / 1px 10px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 100% / 10px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 100% / 1px 10px no-repeat,
    var(--panel);
}

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

/* Versteckt bleibt versteckt, auch bei Elementen mit eigener display-Angabe (z. B. .btn) */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px);
  background-size: 22px 22px;
  background-attachment: fixed;
  color: var(--text);
  font: 400 1rem/1.55 var(--body);
  -webkit-text-size-adjust: 100%;
}

h1,
h2 {
  font-family: var(--display);
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin: 0;
  text-wrap: balance;
}
h1 {
  font-size: 2.6rem;
}
h2 {
  font-size: 1.35rem;
  margin: 2.5rem 0 0.9rem;
}
.h-note {
  font: 400 0.9rem var(--body);
  letter-spacing: 0;
  margin-left: 0.5rem;
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--accent-ink);
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
}
a:hover {
  color: var(--text);
}

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

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

code {
  font: 0.88em var(--mono);
  background: var(--raised);
  padding: 0.1em 0.35em;
  border-radius: var(--r-s);
}

.quiet {
  color: var(--muted);
  font-weight: 400;
}
.nowrap {
  white-space: nowrap;
}
.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------- Rahmen ---------- */

body.app {
  display: grid;
  grid-template-columns: 15.5rem minmax(0, 1fr);
  min-height: 100vh;
}

.skip {
  position: absolute;
  left: -999rem;
  top: 0.5rem;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.5rem 0.75rem;
  border-radius: var(--r-s);
  z-index: 10;
}
.skip:focus {
  left: 0.5rem;
}

.side {
  background-color: color-mix(in srgb, var(--panel) 88%, transparent);
  background-image: var(--tricolore);
  background-size: 100% 3px;
  background-repeat: no-repeat;
  backdrop-filter: blur(8px);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 1.4rem 0.9rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0 0.2rem 0 0.75rem;
}
.brand {
  font: 650 1.2rem/1.15 var(--display);
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  text-wrap: balance;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.brand:hover {
  color: var(--text);
}
.brand-logo {
  flex: none;
  width: 2.6rem;
  height: 2.6rem;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px var(--shade));
}

.theme-toggle {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.theme-toggle:hover {
  color: var(--accent-ink);
  border-color: var(--accent-ink);
}

.side nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2rem;
}
.side nav::before {
  content: "Navigation";
  font: 500 0.68rem var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 0 0.75rem 0.6rem;
}
.side nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--r-s);
  border-left: 2px solid transparent;
}
.side nav a:hover {
  color: var(--text);
  background: var(--raised);
}
.side nav a[aria-current] {
  color: var(--text);
  background: var(--accent-soft);
  border-left-color: var(--accent);
}

.me {
  margin-top: auto;
  padding: 1rem 0.75rem 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  align-items: center;
}
.me-text {
  display: grid;
  line-height: 1.25;
  min-width: 0;
}
.me-text strong,
.me-text span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.me-text span {
  color: var(--muted);
  font-size: 0.82rem;
}
.me form {
  grid-column: 1 / -1;
}
.me .btn {
  width: 100%;
}

main {
  padding: 2.75rem clamp(1rem, 4vw, 3.5rem) 4rem;
  max-width: 80rem;
  width: 100%;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem 2rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font: 500 0.75rem var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 0.6rem;
}
.back::before {
  content: "←";
}
.back:hover {
  color: var(--accent-ink);
}
.sub {
  color: var(--muted);
  margin: 0.6rem 0 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.page-head + .sub {
  margin: -0.75rem 0 1.5rem;
}
.note {
  max-width: 44rem;
  border-left: 2px solid var(--accent);
  padding-left: 0.9rem;
  color: var(--muted);
}

.demo-note {
  font: 500 0.72rem var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
  border: 1px dashed var(--accent-ink);
  border-radius: var(--r-s);
  padding: 0.4rem 0.75rem;
  display: inline-block;
  margin-bottom: 1.5rem;
}

/* Bleibt beim Scrollen oben sichtbar, damit man die Rückmeldung auch nach dem Sprung
   zu einem Fahrzeug weiter unten sieht */
.flash {
  position: sticky;
  top: 1rem;
  z-index: 4;
  padding: 0.8rem 1rem;
  border-radius: var(--r-s);
  border: 1px solid var(--line);
  border-left: 3px solid var(--in);
  background: var(--panel);
  box-shadow: 0 8px 24px var(--shade);
  margin: 0 0 1.5rem;
  max-width: 44rem;
  transition: opacity 0.4s, transform 0.4s;
}
.flash.is-leaving {
  opacity: 0;
  transform: translateY(-0.5rem);
}
.login .flash {
  position: static;
  box-shadow: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.flash-error {
  border-left-color: var(--out);
  background: linear-gradient(var(--out-soft), var(--out-soft)), var(--panel);
}

.empty {
  color: var(--muted);
  padding: 1.25rem 1.5rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-m);
  max-width: 44rem;
}

.error-box {
  max-width: 36rem;
  padding: 2.5rem;
  margin: 2rem 0;
}
.error-box h1 {
  margin-bottom: 1rem;
}
body.bare {
  padding: clamp(1.25rem, 6vw, 5rem);
}

/* ---------- Knöpfe ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font: 600 0.9rem/1.1 var(--body);
  letter-spacing: 0.01em;
  padding: 0.72rem 1.15rem;
  border-radius: var(--r-s);
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
  cursor: pointer;
}
.btn:hover {
  background: var(--accent-hi);
  color: var(--on-accent);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 0 24px var(--glow);
}
.btn-quiet {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text);
}
.btn-quiet:hover {
  background: var(--raised);
  color: var(--text);
  box-shadow: none;
}
.btn-danger {
  background: transparent;
  border-color: var(--out);
  color: var(--out);
}
.btn-danger:hover {
  background: var(--out);
  color: #fff;
  box-shadow: none;
}
.btn-small {
  padding: 0.45rem 0.7rem;
  font-size: 0.84rem;
}
.btn-discord {
  font-size: 1rem;
  padding: 0.95rem 1.6rem;
}
.btn-discord::after {
  content: "→";
  font-weight: 400;
}

/* ---------- Formulare ---------- */

label {
  display: grid;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.88rem;
}
input,
select,
textarea {
  font: 400 1rem/1.4 var(--body);
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-s);
  padding: 0.6rem 0.75rem;
  width: 100%;
  min-width: 0;
}
input:hover,
select:hover,
textarea:hover {
  border-color: var(--muted);
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input,
select {
  min-height: 2.75rem;
}
input::placeholder {
  color: var(--faint);
}
input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  min-height: 0;
  padding: 0;
  accent-color: var(--accent);
}
input[type="checkbox"]:focus {
  box-shadow: none;
}
input[type="file"] {
  padding: 0.45rem;
}
input[type="file"]::file-selector-button {
  font: 600 0.84rem var(--body);
  color: var(--text);
  background: var(--raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-s);
  padding: 0.4rem 0.7rem;
  margin-right: 0.75rem;
  cursor: pointer;
}
textarea {
  resize: vertical;
}
.input-plate {
  font: 700 1.1rem var(--plate-font);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  max-width: 12rem;
}
small,
.hint {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.85rem;
  line-height: 1.45;
}
.hint {
  max-width: 44rem;
}

.form {
  display: grid;
  gap: 1.15rem;
  max-width: 34rem;
}
.form h2 {
  margin: 0;
}
.form-wide {
  max-width: 44rem;
}
.form-inline {
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: 1.4rem;
  max-width: 44rem;
  margin-bottom: 2rem;
}
.form + .form,
.item-detail + .form {
  margin-top: 3rem;
}
.form-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.check {
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 0.65rem;
}
.check input {
  margin: 0.2rem 0 0;
}
.check small {
  display: block;
  margin-top: 0.2rem;
}
.preview {
  width: 7rem;
  height: 7rem;
  object-fit: contain;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  padding: 0.4rem;
}

.filter {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.filter label {
  flex: 0 1 16rem;
}

.danger-zone {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem 2rem;
  flex-wrap: wrap;
  margin-top: 3rem;
  padding: 1.25rem;
  border: 1px solid color-mix(in srgb, var(--out) 40%, transparent);
  border-radius: var(--r-m);
  background: var(--out-soft);
  max-width: 44rem;
}
.danger-zone > div {
  flex: 1 1 18rem;
}
.danger-zone h2 {
  font-size: 1.15rem;
  margin: 0 0 0.3rem;
}
.danger-zone p {
  margin: 0;
}

/* ---------- Tabellen ---------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
}
table {
  border-collapse: collapse;
  width: 100%;
}
.list th {
  text-align: left;
  font: 500 0.7rem var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.list th.num {
  text-align: right;
}
.list td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.list tbody tr:hover td {
  background: var(--accent-soft);
}
.list tbody tr:last-child td {
  border-bottom: 0;
}
.list .is-blocked .person,
.list .is-blocked .rank-cell {
  opacity: 0.5;
}
.cell-action {
  text-align: right;
  white-space: nowrap;
}
.count {
  margin-top: 0.6rem;
  font-size: 0.85rem;
}

.person {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.person > div {
  display: grid;
  line-height: 1.3;
}
.person .quiet {
  font-size: 0.84rem;
}
.avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  flex: none;
  background: var(--raised);
  border: 1px solid var(--line);
}
.avatar-none {
  display: grid;
  place-items: center;
  font: 650 1rem var(--display);
  color: var(--accent-ink);
}

.rank {
  display: inline-grid;
  place-items: center;
  min-width: 1.9rem;
  height: 1.9rem;
  padding: 0 0.3rem;
  font: 600 0.9rem/1 var(--mono);
  font-variant-numeric: tabular-nums;
  border-radius: var(--r-s);
  border: 1px solid transparent;
  flex: none;
}
/* Je höher der Rang, desto mehr Grün */
.rank-t0 {
  background: var(--raised);
  color: var(--muted);
}
.rank-t1 {
  border-color: var(--line-strong);
  color: var(--text);
}
.rank-t2 {
  background: var(--accent-soft);
  border-color: var(--accent-ink);
  color: var(--accent-ink);
}
.rank-t3 {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 0 14px var(--glow);
}
.rank-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  white-space: nowrap;
}

.tag {
  display: inline-block;
  font: 500 0.68rem var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.18rem 0.45rem;
  border-radius: var(--r-s);
  border: 1px solid var(--line-strong);
  color: var(--muted);
  margin-left: 0.4rem;
  vertical-align: middle;
}
.tag-warn {
  border-color: var(--out);
  color: var(--out);
}

.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
.tabs a {
  padding: 0.65rem 0.9rem;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tabs a:hover {
  color: var(--text);
}
.tabs a[aria-current] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

/* ---------- Übersicht ---------- */

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1px;
  margin: 0 0 1rem;
  padding: 0;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  overflow: hidden;
}
.facts div {
  display: grid;
  gap: 0.35rem;
  padding: 1.1rem 1.25rem;
  background: var(--panel);
}
.facts dt {
  font: 500 0.7rem var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.facts dd {
  margin: 0;
  font: 650 2.4rem/1 var(--display);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.facts a {
  color: var(--text);
  text-decoration: none;
}
.facts a:hover {
  color: var(--accent-ink);
}

.columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(22rem, 100%), 1fr));
  gap: 0 3rem;
}

.feed {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 52rem;
}
.feed li {
  display: flex;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}
.feed time {
  color: var(--faint);
  font: 0.78rem var(--mono);
  white-space: nowrap;
  padding-top: 0.2rem;
}

.bars {
  list-style: none;
  margin: 0;
  padding: 0;
}
.bars li {
  display: grid;
  grid-template-columns: auto minmax(5rem, 1fr) minmax(3rem, 9rem) 1.5rem;
  gap: 0.7rem;
  align-items: center;
  padding: 0.3rem 0;
}
.bars-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bars-n {
  text-align: right;
  font: 0.85rem var(--mono);
  color: var(--muted);
}
meter {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 0.4rem;
  background: var(--raised);
  border: 0;
  border-radius: 2px;
  overflow: hidden;
}
meter::-webkit-meter-bar {
  background: var(--raised);
  border: 0;
  border-radius: 2px;
  height: 0.4rem;
}
meter::-webkit-meter-optimum-value {
  background: var(--accent);
  border-radius: 2px;
}
meter::-moz-meter-bar {
  background: var(--accent);
  border-radius: 2px;
}

/* ---------- Lager ---------- */

.plate {
  display: inline-block;
  font: 700 0.95rem/1 var(--plate-font);
  letter-spacing: 0.1em;
  background: var(--plate-bg);
  color: var(--plate-ink);
  padding: 0.34rem 0.6rem 0.28rem;
  border-radius: 3px;
  box-shadow: inset 0 0 0 2px var(--plate-bg), inset 0 0 0 3px var(--plate-ink);
  white-space: nowrap;
  vertical-align: middle;
}

.vehicles {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  overflow: hidden;
}
.vehicles li + li {
  border-top: 1px solid var(--line);
}
.vehicle {
  display: grid;
  grid-template-columns: minmax(10rem, 2fr) 8.5rem minmax(8rem, 1.5fr) minmax(11rem, 1.5fr);
  gap: 0.5rem 1.25rem;
  align-items: center;
  padding: 1.1rem 1.35rem;
  color: var(--text);
  text-decoration: none;
}
.vehicle:hover {
  background: var(--accent-soft);
  color: var(--text);
}
.vehicle-name {
  font: 650 1.25rem/1.15 var(--display);
  letter-spacing: -0.02em;
}
.vehicle .plate {
  justify-self: start;
}
.vehicle-load {
  text-align: right;
  color: var(--muted);
}
.vehicle-load strong {
  color: var(--text);
}
.vehicle-meta {
  gap: 0.5rem 1rem;
}

.stock-in {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: 1.1rem;
  margin: 1.5rem 0 0;
}
.stock-in label {
  flex: 1 1 12rem;
}
.stock-in label:nth-of-type(2) {
  flex: 0 1 6.5rem;
}
.stock-in .grow {
  flex: 2 1 14rem;
}

/* Der Bestand als Raster aus Fächern, wie ein Kofferraum im Spiel */
.slots {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.75rem;
}
.slot {
  position: relative;
  display: grid;
  gap: 0.55rem;
  align-content: start;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: 0.6rem;
}
.slot:hover {
  border-color: var(--line-strong);
}
.slot-pic {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  background: var(--bg);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px);
  background-size: 12px 12px;
  border-radius: var(--r-s);
  overflow: hidden;
  text-decoration: none;
}
.slot-pic img,
.item-pic img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 9%;
}
.item-none {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font: 650 3.25rem/1 var(--display);
}
.tint-0 {
  color: var(--accent-ink);
}
.tint-1 {
  color: var(--tint-1);
}
.tint-2 {
  color: var(--tint-2);
}
.tint-3 {
  color: var(--tint-3);
}
.tint-4 {
  color: var(--tint-4);
}
.slot-qty {
  position: absolute;
  top: 0.95rem;
  right: 0.95rem;
  font: 600 1rem/1 var(--mono);
  font-variant-numeric: tabular-nums;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.3rem 0.45rem;
  border-radius: var(--r-s);
}
.slot-name {
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
  color: var(--text);
  text-decoration: none;
}
a.slot-name:hover {
  color: var(--accent-ink);
}
.slot-where {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.3;
}
.slot-move {
  display: grid;
  grid-template-columns: 2.3rem 1fr 2.3rem;
  gap: 0.3rem;
}
.slot-move input {
  text-align: center;
  padding: 0.4rem 0.2rem;
  min-height: 2.35rem;
  font-family: var(--mono);
  appearance: textfield;
  -moz-appearance: textfield;
}
.slot-move input::-webkit-outer-spin-button,
.slot-move input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.move {
  font: 600 1.2rem/1 var(--body);
  height: 2.35rem;
  border-radius: var(--r-s);
  border: 1px solid currentColor;
  background: transparent;
  cursor: pointer;
}
.move-out {
  color: var(--out);
}
.move-in {
  color: var(--in);
}
.move-out:hover {
  background: var(--out);
  color: #fff;
}
.move-in:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.item-detail {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}
.item-detail > div {
  min-width: 0;
}
.item-detail h2 {
  margin-top: 0;
}
.item-pic {
  aspect-ratio: 1;
  background: var(--panel);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px);
  background-size: 14px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.item-pic .item-none {
  font-size: 5rem;
}

/* ---------- Startseite ---------- */

.home-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1.25rem 1.75rem;
  padding-bottom: 1.75rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--line);
}
.home-logo {
  width: clamp(5.5rem, 11vw, 8.5rem);
  height: auto;
  filter: drop-shadow(0 10px 24px var(--shade)) drop-shadow(0 0 22px var(--accent-soft));
}
.home-hero .eyebrow {
  margin-bottom: 0.7rem;
}
.home-hero h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}
.tile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.1rem;
  color: var(--text);
  text-decoration: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  transition: border-color 0.15s, background-color 0.15s, transform 0.15s;
}
.tile:hover {
  color: var(--text);
  border-color: var(--accent-ink);
  background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--panel);
  transform: translateY(-1px);
}
.tile-icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: var(--r-s);
}
.tile-text {
  display: grid;
  min-width: 0;
  line-height: 1.3;
}
.tile-text strong {
  font: 650 1.05rem var(--display);
  letter-spacing: -0.01em;
}
.tile-text span {
  font-size: 0.84rem;
  color: var(--muted);
}
.tile-go {
  color: var(--faint);
  transition: color 0.15s, transform 0.15s;
}
.tile:hover .tile-go {
  color: var(--accent-ink);
  transform: translateX(3px);
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem);
  gap: 2.5rem;
  align-items: start;
}
.home-grid.is-single {
  grid-template-columns: minmax(0, 52rem);
}
.home-side h2 {
  margin-top: 0;
}
.home-side .feed li {
  flex-direction: column;
  gap: 0.15rem;
}
.home-side > p {
  margin-top: 0.9rem;
  font-size: 0.9rem;
}

.news {
  display: grid;
  gap: 1rem;
  scroll-margin-top: 1.5rem;
}
.news-top {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}
.news-top h2 {
  margin: 0;
}
.news-top .quiet {
  font: 500 0.8rem var(--mono);
}
.compose {
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-m);
  background: var(--panel);
}
.compose[open] {
  border-style: solid;
  border-color: var(--accent-ink);
}
.compose summary {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1.1rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.compose summary::-webkit-details-marker {
  display: none;
}
.compose summary:hover {
  color: var(--accent-ink);
}
.compose-plus {
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  font-weight: 500;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 50%;
  transition: transform 0.15s;
}
.compose[open] .compose-plus {
  transform: rotate(45deg);
}
.compose .news-form {
  padding: 0.25rem 1.1rem 1.1rem;
  max-width: none;
}

.news-item {
  position: relative;
  padding: 1.15rem 1.25rem 1.25rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  scroll-margin-top: 5.5rem;
}
.news-item.is-pinned {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: linear-gradient(var(--accent-soft), transparent 5rem), var(--panel);
}
.news-item.is-pinned::before {
  content: "";
  position: absolute;
  inset: -1px auto -1px -1px;
  width: 3px;
  border-radius: var(--r-m) 0 0 var(--r-m);
  background: var(--accent);
}
.news-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
}
.news-head h3 {
  margin: 0;
  font: 650 1.2rem/1.25 var(--display);
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}
.news-pin {
  display: inline-block;
  margin-bottom: 0.4rem;
  font: 600 0.66rem var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.news-pin::before {
  content: "◆ ";
}
.news-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.6rem;
  margin: 0.35rem 0 0;
  font-size: 0.84rem;
  color: var(--muted);
}
.news-meta strong {
  color: var(--text);
  font-weight: 600;
}
.news-meta time {
  font: 0.78rem var(--mono);
  padding-top: 0.1rem;
}
.news-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.news-actions form {
  display: contents;
}
.news-body {
  margin-top: 0.85rem;
  white-space: pre-line;
  overflow-wrap: anywhere;
  line-height: 1.6;
}
@media (hover: hover) {
  .news-actions {
    opacity: 0.35;
    transition: opacity 0.15s;
  }
  .news-item:hover .news-actions,
  .news-actions:focus-within {
    opacity: 1;
  }
}

/* Startseite mit Karte: Inhalt links, Karte als feststehende rechte Spalte */
main.main-wide {
  max-width: none;
}
.home-layout.has-map {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(26rem, 32vw, 46rem);
  column-gap: 2rem;
  align-items: start;
}
.home-layout.has-map > :not(.home-map) {
  grid-column: 1;
}
.home-map {
  grid-column: 2;
  grid-row: 1 / span 5;
  position: sticky;
  top: 1rem;
  /* reicht vom Seitenanfang bis knapp über den unteren Rand; beim Scrollen bleibt sie oben stehen */
  height: calc(100vh - 3.75rem);
  min-height: 28rem;
}
.map-side {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.map-side .map-view {
  flex: 1;
  height: auto;
  min-height: 0;
}
/* Schmalere Bildschirme: Karte in voller Breite unter den Dealer-Kacheln */
@media (max-width: 100rem) {
  .home-layout.has-map {
    display: block;
  }
  .home-map {
    position: static;
    height: min(75vh, 44rem);
    min-height: 0;
    margin-bottom: 2.5rem;
  }
}

/* Bis zu vier Dealer als Kacheln im 2×2-Raster */
.dtiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.dtile {
  display: grid;
  grid-template-columns: clamp(6rem, 9vw, 8.5rem) minmax(0, 1fr);
  min-height: 8.5rem;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.dtile:hover {
  border-color: var(--accent-ink);
}
.dtile.is-selected {
  border-color: var(--accent-ink);
  background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--panel);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.dtile-img,
.dtile-img-btn {
  width: 100%;
  height: 100%;
  min-height: 8.5rem;
}
.dtile-img {
  display: grid;
  place-items: center;
  object-fit: cover;
  background: var(--bg);
  border-right: 1px solid var(--line);
}
.dtile-img-btn {
  border-radius: 0;
}
.dtile-body {
  display: grid;
  align-content: start;
  gap: 0.3rem;
  min-width: 0;
  padding: 0.9rem 1rem;
  font: inherit;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  background: none;
  border: 0;
  cursor: pointer;
}
.dtile-body:hover {
  color: var(--text);
}
.dtile-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}
.dtile-head strong {
  font: 650 1.05rem/1.25 var(--display);
  overflow-wrap: anywhere;
}
.dtile-where {
  font-size: 0.86rem;
  color: var(--accent-ink);
}
.dtile-note {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.84rem;
  color: var(--muted);
}
.dtile-go {
  margin-top: 0.2rem;
  font: 500 0.7rem var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.dtile:hover .dtile-go,
.dtile.is-selected .dtile-go {
  color: var(--accent-ink);
}
@media (max-width: 40rem) {
  .dtiles {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Aktive Dealer auf der Startseite */
.home-dealers {
  margin-bottom: 2.5rem;
}
.home-dealers .news-top {
  margin-bottom: 1rem;
}
.news-top .more {
  margin-left: auto;
  font-size: 0.9rem;
  text-decoration: none;
}
.dealer-board {
  display: grid;
  grid-template-columns: minmax(15rem, 21rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.dealer-board.no-map {
  grid-template-columns: minmax(0, 1fr);
}
.dealer-board.no-map .dlist {
  grid-template-columns: repeat(auto-fill, minmax(min(17rem, 100%), 1fr));
  max-height: none;
}
.dlist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
  max-height: calc(min(60vh, 30rem) + 2.9rem);
  overflow-y: auto;
}
.dlist-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: stretch;
  gap: 0.5rem;
  padding: 0.4rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  transition: border-color 0.15s, background-color 0.15s;
}
.dlist-row:hover {
  border-color: var(--accent-ink);
}
.dlist-row.is-selected {
  border-color: var(--accent-ink);
  background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--panel);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.dlist-row .dlist-item {
  padding: 0.2rem 0.3rem;
  background: transparent;
  border: 0;
}
.dlist-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.65rem 0.5rem 0.5rem;
  font: inherit;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.dlist-item:hover {
  color: var(--text);
  border-color: var(--accent-ink);
}
.dlist-item.is-selected,
.dcard.is-selected {
  border-color: var(--accent-ink);
  background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--panel);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.dlist-img {
  width: 3.25rem;
  height: 3.25rem;
  object-fit: cover;
  font-size: 1.4rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-s);
}
.dlist-text {
  display: grid;
  min-width: 0;
  line-height: 1.3;
}
.dlist-text strong {
  font: 650 0.98rem var(--display);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dlist-text small {
  color: var(--muted);
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dlist-n {
  display: grid;
  place-items: center;
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0 0.3rem;
  font: 700 0.75rem var(--mono);
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 999px;
}

@media (max-width: 60rem) {
  .home-grid,
  .dealer-board {
    grid-template-columns: minmax(0, 1fr);
  }
  .dlist {
    max-height: none;
  }
}

/* ---------- Lager: Gesamtübersicht ---------- */

.board-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1.25rem;
}
.board-search {
  flex: 1 1 22rem;
  max-width: 30rem;
}
.board-search input {
  padding-left: 2.3rem;
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b9692' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 0.75rem 50% / 1rem;
}
.board-sum {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 0;
  font: 500 0.75rem var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.board-sum b {
  color: var(--text);
  font-size: 0.95rem;
  margin-right: 0.25rem;
}
.board-sum a {
  text-decoration: none;
}

.board-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}
.board-layout.can-move {
  grid-template-columns: minmax(0, 1fr) 18rem;
  column-gap: 2rem;
}
/* Lager nutzt die ganze Breite: Fahrzeuge links, die Gegenstands-Leiste steht am rechten Bildschirmrand */
main.main-wide:has(.board-layout) {
  padding-right: clamp(1rem, 1.5vw, 1.5rem);
}
.board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(19rem, 100%), 1fr));
  gap: 1rem;
  align-items: start;
}
.board-none {
  grid-column: 1 / -1;
}

.vcard {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  scroll-margin-top: 5.5rem;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.vcard[hidden] {
  display: none;
}
.vcard-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.1rem 0.85rem;
  border-bottom: 1px solid var(--line);
}
.vcard-title {
  min-width: 0;
}
.vcard-name {
  display: block;
  font: 650 1.15rem/1.2 var(--display);
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.vcard-name:hover {
  color: var(--accent-ink);
}
.vcard-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  margin-top: 0.45rem;
  font-size: 0.84rem;
  color: var(--muted);
}
.vcard-meta .plate {
  font-size: 0.8rem;
}
.vcard-total {
  flex: none;
  display: grid;
  justify-items: end;
  font: 500 0.66rem var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.vcard-total b {
  font: 650 1.5rem/1 var(--display);
  letter-spacing: -0.03em;
  color: var(--text);
}
.vcard-items {
  list-style: none;
  margin: 0;
  padding: 0.35rem;
  display: grid;
  gap: 1px;
}
.vitem {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--r-s);
}
.vitem[draggable="true"] {
  cursor: grab;
}
.vitem:hover {
  background: var(--raised);
}
.vitem.is-dragged,
.chip.is-dragged {
  opacity: 0.4;
}
.vitem-pic,
.chip-pic {
  width: 3.25rem;
  height: 3.25rem;
  display: grid;
  place-items: center;
  border-radius: var(--r-s);
  background: var(--bg);
  border: 1px solid var(--line);
  overflow: hidden;
}
.vitem-pic img,
.chip-pic img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4%;
}
.vitem-pic .item-none,
.chip-pic .item-none {
  font-size: 1.35rem;
}
.vitem-name {
  font-size: 0.93rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vitem-qty {
  font: 600 0.88rem var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: var(--r-s);
  padding: 0.15rem 0.45rem;
}
.vitem-actions {
  display: flex;
  gap: 0.25rem;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  font: 600 0.95rem/1 var(--body);
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-s);
  cursor: pointer;
}
.icon-btn:hover {
  color: var(--accent-ink);
  border-color: var(--accent-ink);
}
.icon-btn.icon-out:hover {
  color: var(--out);
  border-color: var(--out);
}
/* Auf Geräten mit Maus erscheinen die Knöpfe erst beim Überfahren */
@media (hover: hover) {
  .vitem-actions {
    opacity: 0;
  }
  .vitem:hover .vitem-actions,
  .vitem:focus-within .vitem-actions {
    opacity: 1;
  }
}
.vcard-empty {
  margin: 0;
  padding: 1.25rem 1.1rem;
  color: var(--faint);
  font-size: 0.9rem;
}
.vcard-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-start;
  align-items: center;
  padding: 0.6rem 1.1rem 0.8rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
}
.vcard-foot a {
  text-decoration: none;
}

/* Gerade gebuchtes Fahrzeug kurz hervorheben */
.vcard.is-updated {
  --c: var(--accent);
  border-color: var(--accent-ink);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Während des Ziehens: mögliche Ziele zeigen, das Ziel unter der Maus hervorheben */
.is-dragging [data-drop]:not(.can-drop) {
  opacity: 0.45;
}
[data-drop].can-drop {
  --c: var(--accent);
  border-style: dashed;
  border-color: var(--accent-ink);
}
.vcard.is-over {
  background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--panel);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 30px var(--glow);
  transform: translateY(-2px);
}

.palette {
  position: sticky;
  top: 1rem;
  display: grid;
  gap: 1rem;
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: 1.1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
}
.palette h2 {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
}
.palette .hint {
  margin: 0;
}
.chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}
.chip {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.5rem 0.35rem 0.35rem;
  font: 500 0.92rem var(--body);
  color: var(--text);
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  cursor: grab;
}
.chip:hover {
  border-color: var(--accent-ink);
  background: var(--accent-soft);
}
.chip:active {
  cursor: grabbing;
}
.chip-pic {
  flex: none;
}
.dropout {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem;
  font-size: 0.84rem;
  line-height: 1.35;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-s);
}
.dropout strong {
  color: var(--text);
}
.dropout-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  font: 600 1.2rem/1 var(--body);
  color: var(--out);
  border: 1px solid var(--out);
  border-radius: 50%;
}
.dropout.can-drop {
  border-color: var(--out);
}
.dropout.is-over {
  color: var(--text);
  background: var(--out-soft);
  box-shadow: 0 0 0 3px var(--out-soft);
}

/* Buchungsfenster */
.move-dialog {
  width: min(28rem, calc(100vw - 2rem));
  padding: 0;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-m);
  box-shadow: 0 30px 80px var(--shade), 0 0 0 1px var(--accent-soft);
}
.move-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
}
.move-dialog .form {
  padding: 1.5rem;
  max-width: none;
}
.move-dialog .eyebrow {
  margin: 0 0 -0.6rem;
}
.move-dialog h2 {
  font-size: 1.5rem;
}
.seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  background: var(--bg);
}
.seg label {
  display: block;
  font-weight: 500;
}
.seg input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  min-height: 0;
}
.seg span {
  display: block;
  text-align: center;
  padding: 0.45rem 0.3rem;
  border-radius: 2px;
  color: var(--muted);
  cursor: pointer;
}
.seg input:checked + span {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}
.seg input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.qty-row {
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
}
.qty-row label {
  flex: 1;
}
.qty-row .btn {
  min-height: 2.75rem;
}
.move-dialog [data-stock]:empty {
  display: none;
}
.move-dialog [data-stock] {
  margin: -0.5rem 0 0;
}
.move-dialog [data-field][hidden] {
  display: none;
}

.vcard-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  margin-left: auto;
}
.vcard-links form {
  display: contents;
}
.link-danger {
  padding: 0;
  font: inherit;
  color: var(--out);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
}
.link-danger:hover {
  color: var(--text);
}

/* ---------- Gemeinsame Bausteine ---------- */

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.15rem 1rem;
}
.form-row > label {
  flex: 1 1 10rem;
}
.form-row > .grow {
  flex: 3 1 16rem;
}
.input-tag {
  text-transform: uppercase;
  font-family: var(--mono);
  letter-spacing: 0.06em;
}
.tab-n {
  display: inline-block;
  min-width: 1.4rem;
  margin-left: 0.3rem;
  padding: 0.05rem 0.35rem;
  font: 500 0.72rem var(--mono);
  text-align: center;
  color: var(--muted);
  background: var(--raised);
  border-radius: 999px;
}
.tag-strong {
  margin: 0;
  color: var(--accent-ink);
  border-color: var(--accent-ink);
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font: 600 0.66rem var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.status::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
}
.status-on {
  color: var(--in);
}
.status-on::before {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--in) 25%, transparent);
}
.status-off {
  color: var(--faint);
}

/* ---------- Fraktionen ---------- */

.fgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(19rem, 100%), 1fr));
  gap: 1rem;
}
.fcard {
  display: grid;
  gap: 1rem;
  padding: 1.15rem 1.2rem;
  color: var(--text);
  text-decoration: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  transition: border-color 0.15s, transform 0.15s;
}
.fcard:hover {
  color: var(--text);
  border-color: var(--accent-ink);
  transform: translateY(-1px);
}
.fcard-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.fcard-head > div {
  display: grid;
  min-width: 0;
}
.fcard-tag {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.9rem;
  height: 2.9rem;
  font: 700 0.8rem var(--mono);
  letter-spacing: 0.04em;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: var(--r-s);
}
.fcard-name {
  font: 650 1.15rem/1.2 var(--display);
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}
.fcard-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-s);
}
.fcard-stats div {
  padding: 0.5rem 0.65rem;
}
.fcard-stats div + div {
  border-left: 1px solid var(--line);
}
.fcard-stats dt {
  font: 500 0.62rem var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.fcard-stats dd {
  margin: 0.1rem 0 0;
  font: 650 1.3rem/1 var(--display);
}
.fcard-stats .is-open dd {
  color: var(--accent-ink);
}
.fcard-stats .is-done dd {
  color: var(--in);
}
.fcard-people {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
}
.faces {
  display: flex;
}
.faces .avatar {
  width: 1.75rem;
  height: 1.75rem;
  font-size: 0.75rem;
  border: 2px solid var(--panel);
}
.faces .avatar + .avatar {
  margin-left: -0.45rem;
}
.who {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text);
}
.who .avatar {
  width: 1.5rem;
  height: 1.5rem;
  font-size: 0.7rem;
}

/* Fraktionsfarbe: Streifen oben, Kürzel-Feld und Rahmen in der gewählten Farbe */
.fcard.has-color {
  position: relative;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--fc) 45%, var(--line));
  background: linear-gradient(color-mix(in srgb, var(--fc) 14%, transparent), transparent 7rem), var(--panel);
}
.fcard.has-color::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--fc);
}
.fcard.has-color:hover {
  border-color: var(--fc);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--fc) 22%, transparent);
}
.fcard.has-color .fcard-tag {
  color: var(--fc-ink);
  background: var(--fc);
  border-color: var(--fc);
}
.fcard.has-color .fcard-stats {
  border-color: color-mix(in srgb, var(--fc) 30%, var(--line));
}
.tag-color {
  color: var(--fc-ink);
  background: var(--fc);
  border-color: var(--fc);
}

/* Farbwähler mit Schnellauswahl */
.color-field {
  display: grid;
  gap: 0.4rem;
}
.color-field > label {
  font-weight: 600;
  font-size: 0.88rem;
}
.color-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.color-row input[type="color"] {
  width: 3.25rem;
  height: 2.75rem;
  min-height: 0;
  padding: 0.2rem;
  cursor: pointer;
}
.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.swatch {
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  background: var(--fc);
  border: 2px solid var(--panel);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line-strong);
  cursor: pointer;
}
.swatch:hover {
  transform: scale(1.1);
}
.swatch.is-current {
  box-shadow: 0 0 0 2px var(--text);
}

/* Mitglieder-Auswahl */
.pick {
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--panel);
  display: grid;
  gap: 0.7rem;
}
.pick legend {
  padding: 0 0.35rem;
  font-weight: 600;
  font-size: 0.88rem;
}
.pick .hint {
  margin: 0;
}
.pick-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
  max-height: 20rem;
  overflow-y: auto;
}
.pick-item {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.4rem 0.55rem;
  font-weight: 400;
  border-radius: var(--r-s);
  cursor: pointer;
}
.pick-item:hover {
  background: var(--raised);
}
.pick-item:has(input:checked) {
  background: var(--accent-soft);
}
.pick-item .avatar {
  width: 1.85rem;
  height: 1.85rem;
  font-size: 0.8rem;
}
.pick-item span {
  display: grid;
  line-height: 1.25;
}
.pick-item small {
  font-size: 0.78rem;
}

/* Anliegen */
.reqs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}
.req {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.9rem;
  align-items: start;
  padding: 0.95rem 1.1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-m);
  scroll-margin-top: 5.5rem;
}
.req-hold {
  border-left-color: var(--tint-3);
}
.req-erledigt {
  border-left-color: var(--in);
}
.req-erledigt .req-title {
  text-decoration: line-through;
  text-decoration-color: var(--faint);
  color: var(--muted);
}
.req-check {
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-top: 0.05rem;
  font: 700 0.8rem/1 var(--body);
  border: 1.5px solid var(--accent-ink);
  border-radius: 50%;
}
.req-hold .req-check {
  border-color: var(--tint-3);
  color: var(--tint-3);
}
.req-erledigt .req-check {
  background: var(--in);
  border-color: var(--in);
  color: var(--bg);
}
.req-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
}
.req-title {
  font: 600 1.02rem/1.3 var(--display);
  overflow-wrap: anywhere;
}
.req-badge {
  font: 600 0.62rem var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border: 1px solid currentColor;
  border-radius: var(--r-s);
}
.req-badge-offen {
  color: var(--accent-ink);
}
.req-badge-hold {
  color: var(--tint-3);
}
.req-badge-erledigt {
  color: var(--in);
}
.req-body {
  margin: 0.45rem 0 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
  color: var(--text);
}
.req-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.75rem;
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.req-meta time {
  font-family: var(--mono);
  font-size: 0.76rem;
}
.req-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
  max-width: 16rem;
}
.req-actions form {
  display: contents;
}
.reqs + .empty,
.tabs + .reqs {
  margin-top: 0;
}
.compose + .tabs {
  margin-top: 1.5rem;
}

/* ---------- Dealer ---------- */

.dgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(18rem, 100%), 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.dcard {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  scroll-margin-top: 5.5rem;
}
.dcard:target {
  border-color: var(--accent-ink);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.dcard-pic {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--bg);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px);
  background-size: 12px 12px;
  border-bottom: 1px solid var(--line);
}
.dcard-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dealer-none {
  display: grid;
  place-items: center;
  font: 650 3.5rem/1 var(--display);
  color: var(--accent-ink);
}
.dcard-n {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  display: grid;
  place-items: center;
  min-width: 1.9rem;
  height: 1.9rem;
  padding: 0 0.4rem;
  font: 700 0.85rem var(--mono);
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 999px;
  box-shadow: 0 2px 8px var(--shade);
}
.dcard-body {
  display: grid;
  align-content: start;
  gap: 0.45rem;
  padding: 1rem 1.1rem 1.1rem;
}
.dcard-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}
.dcard-head h2 {
  margin: 0;
  font-size: 1.15rem;
  overflow-wrap: anywhere;
}
.dcard-where {
  margin: 0;
  font-size: 0.9rem;
  color: var(--accent-ink);
}
.dcard-note {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  white-space: pre-line;
}
.dcard-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
}
.dcard-admin {
  display: flex;
  gap: 0.35rem;
}
.dcard-admin form {
  display: contents;
}

.inactive {
  margin-top: 2rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
}
.inactive summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.1rem;
  font-weight: 600;
  cursor: pointer;
}
.inactive summary small {
  margin-left: auto;
  font-weight: 400;
}
.inactive > :not(summary) {
  margin: 0 1.1rem 1.1rem;
}
.inactive-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 2px;
}
.inactive-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.6rem;
  border-radius: var(--r-s);
}
.inactive-list li:hover {
  background: var(--raised);
}
.inactive-list form {
  display: contents;
}
.inactive-text {
  display: grid;
  line-height: 1.3;
  min-width: 0;
  opacity: 0.75;
}
.dealer-mini {
  width: 2.2rem;
  height: 2.2rem;
  font-size: 1rem;
  color: var(--faint);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-s);
}
.map-upload {
  max-width: 34rem;
}
.current-image {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.dealer-thumb {
  width: 6rem;
  height: 4rem;
  object-fit: cover;
  font-size: 1.6rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-s);
}

/* Karte mit Zoom und Markierungen */
.map {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  overflow: hidden;
}
.map-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.55rem 0.75rem 0.55rem 1rem;
  border-bottom: 1px solid var(--line);
}
.map-label {
  font: 500 0.7rem var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
/* Feste Größe; die Karte wird eingepasst und nur beim Auswählen eines Dealers vergrößert */
.map-view {
  position: relative;
  height: min(70vh, 40rem);
  overflow: hidden;
  background: #0d1a22;
}
.map-home .map-view {
  height: min(60vh, 30rem);
}
.map-canvas {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  user-select: none;
}
.map-canvas img {
  display: block;
  width: 100%;
  height: 100%;
}
[data-map-picker] .map-canvas {
  cursor: crosshair;
}
@media (prefers-reduced-motion: no-preference) {
  .map-canvas {
    transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
  }
}
.map-tools .btn[hidden] {
  display: none;
}
.map-canvas.no-anim {
  transition: none;
}
.map.is-zoomed .map-view {
  cursor: grab;
}
.map.is-panning .map-view,
.map.is-panning .map-canvas {
  cursor: grabbing;
}
[data-map-picker].is-zoomed .map-view {
  cursor: crosshair;
}
.pin {
  position: absolute;
  z-index: 1;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  transform: translate(-50%, -100%) scale(calc(1 / var(--z, 1)));
  transform-origin: 50% 100%;
  display: grid;
  justify-items: center;
  text-decoration: none;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.6));
}
.pin span {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0 0.35rem;
  font: 700 0.8rem/1 var(--mono);
  color: #1b1306;
  background: #e4b762;
  border: 2px solid #1b1306;
  border-radius: 999px;
}
/* Spitze nach unten, zeigt auf die genaue Stelle */
.pin::after {
  content: "";
  width: 0;
  height: 0;
  margin-top: -2px;
  border: 6px solid transparent;
  border-top: 8px solid #1b1306;
  border-bottom: 0;
}
.pin em {
  position: absolute;
  bottom: calc(100% + 0.35rem);
  padding: 0.2rem 0.45rem;
  font: 600 0.75rem var(--body);
  font-style: normal;
  white-space: nowrap;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-s);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s;
}
.pin:hover em,
.pin:focus-visible em,
.pin.is-active em {
  opacity: 1;
}
.pin:hover span,
.pin.is-active span {
  background: #fff;
}
.pin.is-active {
  z-index: 2;
}
/* Popup am Dealer-Punkt */
.pin-pop {
  position: absolute;
  z-index: 3;
  width: min(20rem, calc(100% - 1rem));
  transform: translate(-50%, -100%);
  padding: 0.5rem;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-m);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  cursor: default;
}
.pin-pop.is-below {
  transform: translate(-50%, 0);
}
@media (prefers-reduced-motion: no-preference) {
  .pin-pop.is-opening {
    animation: pop-in 0.22s ease-out 0.4s both;
  }
  @keyframes pop-in {
    from {
      opacity: 0;
      margin-top: 6px;
    }
  }
}
.pin-pop.is-away {
  visibility: hidden;
}
/* kleiner Pfeil zum Punkt */
.pin-pop::after {
  content: "";
  position: absolute;
  left: var(--arrow, 50%);
  bottom: -7px;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  background: var(--panel);
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  transform: rotate(45deg);
}
.pin-pop.is-below::after {
  top: -7px;
  bottom: auto;
  transform: rotate(-135deg);
}
.pin-pop-shot {
  display: block;
  width: 100%;
  overflow: hidden;
  border-radius: var(--r-s);
  background: var(--bg);
}
.pin-pop-shot img {
  display: block;
  width: 100%;
  max-height: 12rem;
  object-fit: cover;
}
.pin-pop-shot:hover img {
  filter: brightness(1.08);
}
.pin-pop-none {
  display: grid;
  place-items: center;
  height: 4.5rem;
  font-size: 0.82rem;
  color: var(--faint);
  background: var(--bg);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-s);
}
.pin-pop-text {
  display: grid;
  gap: 0.1rem;
  padding: 0.55rem 0.25rem 0.15rem;
  line-height: 1.3;
}
.pin-pop-text strong {
  font: 650 1rem var(--display);
  padding-right: 1.5rem;
}
.pin-pop-text small {
  font-size: 0.82rem;
  color: var(--accent-ink);
}
.pin-pop-text small:empty {
  display: none;
}
.pin-pop-close {
  position: absolute;
  z-index: 1;
  top: 0.9rem;
  right: 0.9rem;
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  font: 400 1.2rem/1 var(--body);
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  cursor: pointer;
}
.pin-pop-close:hover {
  background: rgba(0, 0, 0, 0.8);
}
.pin-pop .pin-pop-shot[hidden] + .pin-pop-none ~ .pin-pop-text strong {
  padding-right: 2rem;
}

.pin-pick span {
  color: #fff;
  background: var(--red);
  border-color: #fff;
  font-size: 0.7rem;
}
.pos {
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  gap: 0.7rem;
}
.pos legend {
  padding: 0;
  margin-bottom: 0.4rem;
  font-weight: 600;
  font-size: 0.88rem;
}
.pos .hint {
  margin: 0;
}
.pos-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.88rem;
}

@media (max-width: 52rem) {
  .req {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .req-actions {
    grid-column: 2;
    justify-content: flex-start;
    max-width: none;
  }
  .inactive-list li {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .inactive-list .status {
    display: none;
  }
}

/* ---------- Bilder groß anzeigen ---------- */

.zoomable {
  display: block;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  border-radius: inherit;
  cursor: zoom-in;
}
.zoomable:focus-visible {
  outline-offset: -2px;
}
.dcard-img-btn {
  width: 100%;
  height: 100%;
}
.dcard-img-btn:hover .dcard-img {
  filter: brightness(1.08);
}
.dlist-img-btn,
.dealer-thumb-btn {
  flex: none;
  border-radius: var(--r-s);
}
.lightbox {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: clamp(1rem, 4vw, 3rem);
  background: transparent;
  border: 0;
  cursor: zoom-out;
}
.lightbox::backdrop {
  background: rgba(5, 4, 3, 0.88);
  backdrop-filter: blur(4px);
}
.lightbox[open] {
  display: grid;
  place-items: center;
}
.lightbox figure {
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 0.9rem;
  max-width: 100%;
  max-height: 100%;
}
/* Kleine Bilder werden auf eine gut sichtbare Mindestgröße gebracht */
.lightbox img {
  min-width: min(85vw, 34rem);
  max-width: min(100%, 72rem);
  max-height: calc(100vh - 8rem);
  object-fit: contain;
  image-rendering: auto;
  border-radius: var(--r-m);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  cursor: default;
}
.lightbox figcaption {
  font: 600 1rem var(--display);
  color: #f4efe6;
  text-align: center;
}
.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  font: 400 1.8rem/1 var(--body);
  color: #f4efe6;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  cursor: pointer;
}
.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.16);
}
.has-lightbox {
  overflow: hidden;
}
@media (prefers-reduced-motion: no-preference) {
  .lightbox[open] img {
    animation: lightbox-in 0.2s ease-out;
  }
  @keyframes lightbox-in {
    from {
      opacity: 0;
      transform: scale(0.96);
    }
  }
}

/* ---------- Screenshot einlesen ---------- */

.scan-cta {
  width: 100%;
}
.scan-intro {
  margin-top: -0.5rem;
}
.scan {
  display: grid;
  gap: 1rem;
}
.scan-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
}
.scan-top > label {
  flex: 1 1 18rem;
  max-width: 28rem;
}
.seg-2 {
  grid-template-columns: repeat(2, 1fr);
  flex: 0 1 22rem;
}
.scan [data-mode-hint] {
  margin: -0.25rem 0 0;
}
.scan-drop {
  display: grid;
  justify-items: center;
  gap: 0.4rem;
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--muted);
  background: var(--panel);
  border: 2px dashed var(--line-strong);
  border-radius: var(--r-m);
  transition: border-color 0.15s, background-color 0.15s;
}
.scan-drop strong {
  font: 650 1.25rem var(--display);
  color: var(--text);
}
.scan-drop:focus-visible,
.scan-drop.is-over {
  border-color: var(--accent-ink);
  background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--panel);
}
.scan-drop-icon {
  font-size: 2rem;
  line-height: 1;
  color: var(--accent-ink);
}
.scan-drop .btn {
  margin-top: 0.4rem;
}
kbd {
  font: 600 0.8em var(--mono);
  padding: 0.1em 0.4em;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 3px;
}
.scan-work {
  display: grid;
  grid-template-columns: minmax(16rem, 26rem) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}
.scan-stage {
  position: sticky;
  top: 1rem;
  display: grid;
  gap: 0.6rem;
}
.scan-stage-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}
.scan-stage-buttons {
  display: flex;
  gap: 0.35rem;
}
.scan-stage .hint {
  margin: 0;
}
.scan-canvas-wrap {
  max-height: calc(100vh - 9rem);
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
}
.scan-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
}
canvas.is-selecting {
  cursor: crosshair;
  touch-action: none;
}
.scan-manual {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.6rem;
  padding: 0.8rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
}
.scan-manual label {
  width: 5.5rem;
}
.scan-manual small {
  flex-basis: 100%;
}
.scan-results h2 {
  margin: 0 0 0.75rem;
}
.scan-groups {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.sg {
  display: grid;
  grid-template-columns: auto auto minmax(10rem, 1fr) auto auto auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.8rem 0.6rem 0.6rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
}
.sg.is-new {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}
.sg.is-skipped {
  opacity: 0.6;
}
.sg-n {
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  font: 700 0.8rem var(--mono);
  color: #1b1306;
  border-radius: var(--r-s);
}
.sg-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--r-s);
  background: var(--bg);
}
.sg-main {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}
.sg-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.sg-badge {
  font: 600 0.64rem var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.12rem 0.4rem;
  border-radius: var(--r-s);
  border: 1px solid currentColor;
}
.is-known .sg-badge {
  color: var(--in);
}
.is-new .sg-badge {
  color: var(--accent-ink);
}
.sg select,
.sg-name {
  min-height: 2.4rem;
  padding: 0.35rem 0.6rem;
}
.sg.is-creating {
  border-color: var(--accent-ink);
  background: linear-gradient(var(--accent-soft), transparent 70%), var(--panel);
}
.sg.is-creating .sg-badge::after {
  content: " · wird angelegt";
}
.hint-warn {
  color: var(--accent-ink);
}
.sg-qty {
  display: grid;
  gap: 0.2rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
}
.sg-qty input {
  width: 4.5rem;
  min-height: 2.4rem;
  padding: 0.35rem 0.5rem;
  font-family: var(--mono);
}
.sg-total {
  min-width: 3.5rem;
  font: 650 1.1rem var(--display);
  text-align: right;
}
.sg-learn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
}
.scan-summary {
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
}
.scan-summary ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
}
.scan-summary li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.scan-summary .hint {
  margin: 0.4rem 0 0;
}
.scan-summary .hint:first-child {
  margin-top: 0;
}

@media (max-width: 70rem) {
  .scan-work {
    grid-template-columns: minmax(0, 1fr);
  }
  .scan-stage {
    position: static;
  }
  .scan-canvas-wrap {
    max-height: 60vh;
  }
}
@media (max-width: 40rem) {
  .sg {
    grid-template-columns: auto auto minmax(0, 1fr);
  }
  .sg-qty,
  .sg-total,
  .sg-learn {
    grid-row: 2;
  }
  .sg-qty {
    grid-column: 1 / 3;
  }
}

/* ---------- Dealer-Preise ---------- */

.prices {
  width: 100%;
  margin-top: 0.4rem;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.prices th,
.prices td {
  padding: 0.3rem 0.45rem;
  text-align: right;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.prices thead th {
  font: 500 0.64rem var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.prices tbody th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
}
.prices td {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--accent-ink);
}
.prices tbody tr:last-child > * {
  border-bottom: 0;
}
.prices-compact {
  font-size: 0.76rem;
}
.prices-compact th,
.prices-compact td {
  padding: 0.18rem 0.3rem;
}
.prices-compact tbody th {
  font-weight: 500;
}
/* Im Popup eng gesetzt, damit drei Preise nebeneinander passen */
.pin-pop-prices {
  margin: 0.2rem 0 0.1rem;
  font-size: 0.7rem;
}
.pin-pop-prices th,
.pin-pop-prices td {
  padding: 0.16rem 0.22rem;
}
.pin-pop-prices tbody th {
  font-size: 0.68rem;
}
.pin-pop-prices[hidden] {
  display: none;
}

/* Eingabe der Preise im Dealer-Formular: Waren × Stufen */
.price-edit {
  margin: 0;
  padding: 1rem;
  display: grid;
  gap: 0.6rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
}
.price-edit legend {
  padding: 0 0.35rem;
  font-weight: 600;
  font-size: 0.88rem;
}
.price-edit .hint {
  margin: 0;
}
.price-grid {
  display: grid;
  grid-template-columns: auto repeat(3, minmax(0, 1fr));
  gap: 0.5rem 0.6rem;
  align-items: center;
}
.price-grid-head {
  font: 500 0.7rem var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  text-align: center;
}
.price-grid-label {
  font-weight: 600;
  font-size: 0.9rem;
  padding-right: 0.5rem;
}
.price-input {
  position: relative;
  display: block;
}
.price-input input {
  padding-right: 1.6rem;
  text-align: right;
  font-family: var(--mono);
}
.price-unit {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
  pointer-events: none;
}
@media (max-width: 40rem) {
  .price-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .price-grid > span:first-child {
    display: none;
  }
  .price-grid-label {
    grid-column: 1 / -1;
    margin-top: 0.3rem;
  }
}

/* Preise schnell ändern */
.price-form {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.4rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}
.price-form .price-grid {
  gap: 0.4rem 0.45rem;
}
.price-form .price-input input {
  min-height: 2.25rem;
  padding: 0.3rem 1.4rem 0.3rem 0.4rem;
  font-size: 0.88rem;
}
.price-form .price-unit {
  right: 0.5rem;
  font-size: 0.8rem;
}
.price-form .price-grid-label {
  font-size: 0.82rem;
}
.price-form-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.price-form-status {
  font-size: 0.82rem;
}
.price-form-compact .price-grid {
  grid-template-columns: auto repeat(3, minmax(0, 1fr));
}
.price-form-compact .price-grid-label {
  font-size: 0.74rem;
  padding-right: 0.2rem;
}
/* In der schmalen Kachel ohne $-Zeichen, damit auch fünfstellige Beträge ganz zu sehen sind */
.price-form-compact .price-input input {
  min-height: 2rem;
  font-size: 0.8rem;
  padding: 0.25rem 0.35rem;
}
.price-form-compact .price-unit {
  display: none;
}
.price-form-compact .price-grid-head::after {
  content: " $";
}

/* Kachel auf der Startseite: Inhalt und aufklappbare Preise */
.dtile-main {
  display: grid;
  align-content: start;
  min-width: 0;
}
.dtile-prices {
  margin: 0 1rem 0.85rem;
}
.dtile-prices summary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font: 600 0.72rem var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
  cursor: pointer;
  list-style: none;
}
.dtile-prices summary::-webkit-details-marker {
  display: none;
}
.dtile-prices summary::before {
  content: "✎";
  font-size: 0.85rem;
}
.dtile-prices[open] summary::before {
  content: "×";
}
.price-box:empty {
  display: none;
}

/* ---------- Waren mit Stufen: Anzeige ---------- */

.price-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.15rem 0.75rem;
  padding: 0.32rem 0;
  border-bottom: 1px solid var(--line);
}
.price-line:last-child {
  border-bottom: 0;
}
.price-good {
  font-weight: 600;
  color: var(--muted);
}
.price-vars {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.2rem 0.75rem;
}
.price-var {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  white-space: nowrap;
}
.price-var small {
  font: 500 0.62rem var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.price-var b {
  font: 600 0.92em var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--accent-ink);
}
.prices-compact {
  font-size: 0.78rem;
}
.prices-compact .price-line {
  padding: 0.2rem 0;
}
.pin-pop-prices {
  margin: 0.15rem 0.25rem 0.1rem;
}
.pin-pop-prices .prices {
  margin: 0;
  font-size: 0.76rem;
}

/* ---------- Waren mit Stufen: Eingabe ---------- */

.price-fields {
  display: grid;
  gap: 0.6rem;
}
.price-good-row {
  display: grid;
  grid-template-columns: minmax(6rem, 9rem) minmax(0, 1fr);
  gap: 0.6rem;
  align-items: end;
}
.price-good-name {
  font-weight: 600;
  font-size: 0.88rem;
  padding-bottom: 0.6rem;
  overflow-wrap: anywhere;
}
.price-var-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
  gap: 0.45rem;
}
.price-input {
  position: static;
  display: grid;
  gap: 0.2rem;
}
.price-var-label {
  font: 500 0.64rem var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.price-input-wrap {
  position: relative;
  display: block;
}
.price-form-compact .price-good-row {
  grid-template-columns: minmax(0, 1fr);
  gap: 0.25rem;
}
.price-form-compact .price-good-name {
  padding-bottom: 0;
  font-size: 0.8rem;
}
.price-form-compact .price-var-inputs {
  grid-template-columns: repeat(auto-fill, minmax(4.6rem, 1fr));
  gap: 0.35rem;
}
.price-form-compact .price-var-label {
  font-size: 0.58rem;
}
.price-form-compact .price-var-label::after {
  content: " $";
}

/* ---------- Waren & Stufen verwalten ---------- */

.goods-intro {
  margin-top: -0.5rem;
}
.goods-new {
  max-width: 44rem;
  padding: 1.2rem 1.3rem 1.3rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
}
.goods-new h2 {
  margin: 0 0 0.9rem;
  font-size: 1.1rem;
}
.goods {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(24rem, 100%), 1fr));
  gap: 1rem;
  align-items: start;
}
.good-card {
  display: grid;
  gap: 0.9rem;
  padding: 1rem 1.1rem 1.1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  scroll-margin-top: 5rem;
}
.good-card:target {
  border-color: var(--accent-ink);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.good-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.good-pos {
  display: grid;
  place-items: center;
  min-width: 1.6rem;
  height: 1.6rem;
  font: 700 0.75rem var(--mono);
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 999px;
}
.good-name {
  font: 650 1.1rem var(--display);
}
.good-head .quiet {
  font-size: 0.82rem;
}
.good-order {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}
.good-order form {
  display: contents;
}
.icon-btn:disabled {
  opacity: 0.3;
  cursor: default;
}
.good-form {
  max-width: none;
  gap: 0.8rem;
}
.variants {
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  gap: 0.45rem;
}
.variants legend {
  margin-bottom: 0.35rem;
  font-weight: 600;
  font-size: 0.88rem;
}
.variant-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}
.variant-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.5rem;
}
.variant-row input[name="variant_label"] {
  min-height: 2.4rem;
  padding: 0.35rem 0.6rem;
}
.variant-row:last-child input[name="variant_label"] {
  border-style: dashed;
}
.variant-uses {
  font-size: 0.78rem;
  white-space: nowrap;
}
.variant-move {
  display: flex;
  gap: 0.2rem;
}
.good-delete {
  justify-self: end;
  font-size: 0.85rem;
}

/* ---------- Heat-Stufe ---------- */

.heat-1 {
  --heat: #2ecc71;
  --heat-ink: #062c15;
}
.heat-2 {
  --heat: #a8cf2c;
  --heat-ink: #1f2a04;
}
.heat-3 {
  --heat: #f39c12;
  --heat-ink: #2d1700;
}
.heat-4 {
  --heat: #e74c3c;
  --heat-ink: #ffffff;
}
.heat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.12rem 0.45rem;
  font: 600 0.64rem var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--heat-ink, var(--text));
  background: var(--heat, var(--raised));
  border-radius: 999px;
  white-space: nowrap;
}
.heat-badge b {
  font-size: 0.8rem;
}
.heat-badge[hidden] {
  display: none;
}
/* Kachel und Dealer-Karte in Heat-Farbe: Rahmen, Leiste links, leichte Tönung */
.dtile[class*="heat-"],
.dcard[class*="heat-"] {
  border-color: var(--heat);
  box-shadow: inset 4px 0 0 var(--heat);
  background: linear-gradient(90deg, color-mix(in srgb, var(--heat) 16%, transparent), transparent 70%), var(--panel);
}
.dtile[class*="heat-"].is-selected {
  box-shadow: inset 4px 0 0 var(--heat), 0 0 0 3px color-mix(in srgb, var(--heat) 35%, transparent);
}
.dcard[class*="heat-"] {
  box-shadow: inset 0 4px 0 var(--heat);
}
.dtile-badges {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
/* Markierung auf der Karte in Heat-Farbe */
.pin[class*="heat-"] span {
  color: var(--heat-ink);
  background: var(--heat);
}
.pin-pop-heat {
  justify-self: start;
  margin-top: 0.25rem;
}
/* Auswahl */
.heat-pick {
  display: inline-flex;
  align-items: center;
  margin: 0;
}
.heat-pick label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font: 600 0.7rem var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.heat-pick select {
  width: auto;
  min-height: 2rem;
  padding: 0.2rem 1.8rem 0.2rem 0.55rem;
  font: 600 0.85rem var(--mono);
}
.dtile-main > .heat-pick {
  margin: 0 1rem 0.55rem;
}
.dcard-body > .heat-pick {
  margin: 0.15rem 0 0.25rem;
}
.heat-field select {
  max-width: 16rem;
}

/* ---------- Ränge verwalten ---------- */

.rank-edit {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.rank-edit li {
  display: grid;
  /* feste Spalten, damit alle Zeilen bündig sind (auch ohne Löschen-Knopf) */
  grid-template-columns: 3.5rem minmax(8rem, 18rem) 8.5rem 6.5rem 1.85rem;
  align-items: center;
  gap: 0.75rem;
}
.rank-color-field {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.rank-color-field input[type="color"] {
  width: 2.75rem;
  height: 2.4rem;
  min-height: 0;
  padding: 0.15rem;
  cursor: pointer;
}
.rank-color-use {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--muted);
}
.rank-count {
  font-size: 0.82rem;
  white-space: nowrap;
}
.icon-btn-space {
  display: inline-block;
  width: 1.85rem;
}
.rank-add {
  max-width: 44rem;
  margin-top: 2.5rem;
  padding: 1.2rem 1.3rem 1.3rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
}
.rank-add h2 {
  margin: 0 0 0.9rem;
  font-size: 1.1rem;
}
.rank.rank-color {
  color: var(--fc-ink);
  background: var(--fc);
  border-color: var(--fc);
}
@media (max-width: 52rem) {
  .rank-edit li {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .rank-edit .rank-color-field {
    grid-column: 2;
  }
}

/* Dealer-Auswahl auf der Startseite */
.dealer-pick {
  margin-left: auto;
  min-width: 0;
}
.dealer-pick select {
  min-height: 2.3rem;
  padding: 0.3rem 2rem 0.3rem 0.65rem;
  max-width: 22rem;
  font-size: 0.9rem;
}
.dealer-pick + .more {
  margin-left: 0.75rem;
}
.home-dealers .news-top {
  flex-wrap: wrap;
  row-gap: 0.5rem;
}

/* Fahrzeug-Kästchen verschieben */
.vcard.is-sortable .vcard-head {
  cursor: grab;
}
.vcard.is-sortable .vcard-head:active {
  cursor: grabbing;
}
.vcard-title {
  position: relative;
}
.vcard-grip {
  position: absolute;
  left: -0.85rem;
  top: 0.05rem;
  font-size: 0.85rem;
  line-height: 1.3;
  color: var(--faint);
  opacity: 0;
  transition: opacity 0.15s;
}
.vcard.is-sortable:hover .vcard-grip {
  opacity: 1;
}
.vcard.is-moving {
  opacity: 0.35;
  outline: 2px dashed var(--accent-ink);
  outline-offset: 2px;
}
.is-sorting .vcard:not(.is-moving) {
  transition: transform 0.15s;
}

/* Kurze Meldung unten rechts */
.toast {
  position: fixed;
  z-index: 50;
  right: 1.25rem;
  bottom: 1.25rem;
  max-width: 22rem;
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--in);
  border-radius: var(--r-s);
  box-shadow: 0 10px 30px var(--shade);
  transition: opacity 0.4s, transform 0.4s;
}
.toast-error {
  border-left-color: var(--out);
}
.toast.is-leaving {
  opacity: 0;
  transform: translateY(0.5rem);
}

/* ---------- Protokoll: Lagerbewegungen ---------- */

.facts-small {
  margin-bottom: 1.25rem;
}
.facts-small dd {
  font-size: 1.6rem;
}
.facts dd.is-in {
  color: var(--in);
}
.facts dd.is-out {
  color: var(--out);
}
.move-badge {
  display: inline-block;
  font: 600 0.68rem var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: var(--r-s);
  border: 1px solid currentColor;
  white-space: nowrap;
}
.move-badge-ein {
  color: var(--in);
  background: var(--accent-soft);
}
.move-badge-aus {
  color: var(--out);
  background: var(--out-soft);
}
.move-badge-um {
  color: var(--tint-3);
}
.qty-ein,
.qty-aus {
  font-family: var(--mono);
  font-weight: 600;
}
.qty-ein {
  color: var(--in);
}
.qty-aus {
  color: var(--out);
}
.moves td {
  font-size: 0.93rem;
}

/* ---------- Verwaltung ---------- */

.rank-names {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.rank-names li {
  display: grid;
  grid-template-columns: auto minmax(8rem, 20rem) auto;
  gap: 0.75rem;
  align-items: center;
}
.rank-names .quiet {
  font-size: 0.84rem;
  white-space: nowrap;
}

.matrix {
  min-width: 52rem;
}
.matrix th,
.matrix td {
  padding: 0.55rem 0.6rem;
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.matrix thead th {
  font: 500 0.7rem var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}
.matrix thead .group {
  color: var(--text);
  font-size: 0.75rem;
  border-left: 1px solid var(--line);
}
.matrix th[scope="row"],
.matrix thead th[rowspan] {
  text-align: left;
  position: sticky;
  left: 0;
  background: var(--panel);
  font-weight: 500;
}
.matrix .group-start {
  border-left: 1px solid var(--line);
}
.matrix tbody tr:hover > * {
  background: var(--accent-soft);
}
.matrix tbody tr:last-child > * {
  border-bottom: 0;
}
.matrix input {
  vertical-align: middle;
  cursor: pointer;
}
.matrix input:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.legend {
  margin: 1rem 0 1.5rem;
  max-width: 52rem;
}
.legend summary {
  cursor: pointer;
  color: var(--muted);
}
.legend dl,
.kv {
  margin: 0.75rem 0 0;
  display: grid;
  gap: 0.5rem;
}
.legend dl div,
.kv div {
  display: grid;
  grid-template-columns: 13rem 1fr;
  gap: 1rem;
}
.legend dt,
.kv dt {
  color: var(--muted);
}
.legend dd,
.kv dd {
  margin: 0;
}
.kv-line {
  display: block;
}
.readonly {
  max-width: 44rem;
  margin-top: 3rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}
.readonly h2 {
  margin-top: 1.5rem;
}

/* ---------- Anmeldung ---------- */

body.login {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 clamp(1.25rem, 5vw, 4rem) 2.5rem;
  background-image:
    radial-gradient(60rem 40rem at 85% 30%, var(--accent-soft), transparent 70%),
    radial-gradient(var(--dot) 1px, transparent 1.2px);
  background-size: auto, 22px 22px;
}
.login-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
}
.login-brand {
  font: 650 1.05rem var(--display);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.login-brand .brand-logo {
  width: 2.4rem;
  height: 2.4rem;
}

.login-hero {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: 2rem 4rem;
  padding: clamp(2rem, 6vh, 5rem) 0;
}
.login-main {
  position: relative;
  padding-left: clamp(0rem, 2vw, 1.75rem);
  border-left: 1px solid var(--line-strong);
  max-width: 40rem;
}
.eyebrow {
  font: 500 0.75rem var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.eyebrow::before {
  content: "";
  width: 1.8rem;
  height: 3px;
  background: var(--tricolore);
}
.login h1 {
  font-size: clamp(2.8rem, 6.5vw, 5.25rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.04em;
  margin-bottom: 1.25rem;
}
.lead {
  font-size: 1.12rem;
  color: var(--muted);
  max-width: 32rem;
  margin-bottom: 2rem;
}
.login .hint {
  margin-top: 1rem;
  max-width: 30rem;
}

/* Rechts: Punktraster mit leuchtender Raute, angelehnt an eine Lagekarte */
.login-art {
  position: relative;
  aspect-ratio: 1;
  max-height: 34rem;
  justify-self: center;
  width: 100%;
  display: grid;
  place-items: center;
}
/* Nur das Raster läuft zum Rand hin aus, Raute und Schildchen bleiben scharf */
.login-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--line-strong) 1.4px, transparent 1.6px);
  background-size: 16px 16px;
  -webkit-mask-image: radial-gradient(closest-side, #000 50%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 50%, transparent 100%);
}
.crest {
  position: relative;
  width: 74%;
  display: grid;
  place-items: center;
}
.crest::before {
  content: "";
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--glow), transparent 75%);
  filter: blur(10px);
}
.crest-logo {
  position: relative;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 18px 40px var(--shade));
}
.art-tag {
  position: absolute;
  z-index: 1;
  font: 500 0.66rem/1.35 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--text);
  color: var(--bg);
  padding: 0.35rem 0.55rem;
  border-radius: 2px;
}
.art-tag b {
  font-weight: 700;
}
.art-tag::before {
  content: "";
  position: absolute;
  width: 0.55rem;
  height: 0.55rem;
  border: 1.5px solid var(--accent-ink);
  transform: rotate(45deg);
  left: -1.1rem;
  top: 50%;
  margin-top: -0.3rem;
}
.art-tag-a {
  top: 24%;
  left: 18%;
}
.art-tag-b {
  bottom: 22%;
  right: 12%;
}

.login-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.login-features li {
  display: grid;
  gap: 0.35rem;
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--r-s);
}
.login-features strong {
  font: 600 0.95rem var(--display);
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.login-features strong::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  background: var(--accent);
  transform: rotate(45deg);
  flex: none;
}
.login-features span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.demo-login {
  margin-top: 2.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}
.demo-login h2 {
  margin-top: 1.5rem;
}
.demo-login .hint {
  margin-top: 0;
}
.demo-list {
  display: grid;
  gap: 0.5rem;
  max-width: 26rem;
}
.demo-pick {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font: 400 1rem var(--body);
  color: var(--muted);
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  padding: 0.6rem 0.75rem;
  cursor: pointer;
}
.demo-pick strong {
  color: var(--text);
  margin-right: 0.35rem;
}
.demo-pick:hover {
  border-color: var(--accent-ink);
  background: var(--accent-soft);
}

/* ---------- Schmale Bildschirme ---------- */

@media (max-width: 60rem) {
  .login-hero {
    grid-template-columns: minmax(0, 1fr);
  }
  .login-art {
    order: -1;
    max-height: 16rem;
    width: auto;
    height: 16rem;
  }
  .art-tag {
    display: none;
  }
  .login-features {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Leiste über die Fahrzeuge, Gegenstände nebeneinander zum Antippen */
@media (max-width: 70rem) {
  .board-layout.can-move {
    grid-template-columns: minmax(0, 1fr);
  }
  .palette {
    position: static;
    order: -1;
    max-height: none;
  }
  .chips {
    display: flex;
    flex-wrap: wrap;
  }
  .chip {
    width: auto;
  }
  .dropout {
    display: none;
  }
}

@media (max-width: 52rem) {
  body.app {
    display: block;
  }
  .side {
    position: sticky;
    z-index: 5;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    padding: 0.75rem 1rem 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand-row {
    padding: 0;
    flex: 1;
  }
  .brand {
    font-size: 1.1rem;
  }
  .side nav {
    order: 3;
    flex: 1 0 100%;
    flex-direction: row;
    gap: 0;
    margin: 0 -1rem;
    padding: 0 0.5rem;
    overflow-x: auto;
  }
  .side nav::before {
    display: none;
  }
  .side nav a {
    border-left: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    white-space: nowrap;
  }
  .side nav a[aria-current] {
    background: transparent;
    border-bottom-color: var(--accent);
  }
  .me {
    margin: 0;
    padding: 0;
    border: 0;
    display: flex;
  }
  .me-text,
  .me .avatar {
    display: none;
  }
  main {
    padding-top: 1.5rem;
  }
  h1 {
    font-size: 2rem;
  }
  .list {
    min-width: 38rem;
  }
  .vehicle {
    grid-template-columns: 1fr auto;
  }
  .vehicle-load {
    text-align: left;
  }
  .item-detail {
    grid-template-columns: minmax(0, 1fr);
  }
  .item-pic {
    max-width: 10rem;
  }
  .legend dl div,
  .kv div {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .rank-names li {
    grid-template-columns: auto 1fr;
  }
  .rank-names .quiet {
    display: none;
  }
  .feed li {
    flex-direction: column;
  }
  .slots {
    grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  }
  .login-main {
    border-left: 0;
    padding-left: 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .btn,
  .move,
  .side nav a,
  .vehicle,
  .theme-toggle,
  .list td,
  input,
  select,
  textarea {
    transition: background-color 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
  }
}
