:root {
  --stone: #eceee9;
  --paper: #f8f9f6;
  --basalt: #1b2720;
  --muted: #5d6862;
  --line: #cdd3cc;
  /* Akzent: Grün ist Standard, Gelb über das Zahnrad-Menü wählbar (data-farbe auf <html>). */
  --signal: #39941b;
  --signal-hover: #43a622;
  --signal-schatten: #286d12;
  --signal-hell: #eef6ea;
  --signal-mittel: #a9cf98;
  --signal-text: #fff;
  --signal-dunkel: #6cc04a; /* auf dunklem Grund */
  --soil: #7a5a3f;
  --moss: #2f6b4a;
  --alert: #c2410c;
  --display: "IBM Plex Sans", system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, sans-serif;
}
:root[data-farbe="gelb"] {
  --basalt: #1e2622;
  --signal: #f2c200;
  --signal-hover: #ffd21a;
  --signal-schatten: #b38f00;
  --signal-hell: #fffbe6;
  --signal-mittel: #d9c98a;
  --signal-text: var(--basalt);
  --signal-dunkel: var(--signal);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--stone);
  color: var(--basalt);
  font: 400 15px/1.55 var(--body);
  font-variant-numeric: tabular-nums;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }

/* Seitenleiste */
.rahmen { flex: 1; display: grid; grid-template-columns: 236px minmax(0, 1fr); }
.seitenleiste {
  position: sticky; top: 0; z-index: 40;
  height: 100vh;
  display: flex; flex-direction: column;
  padding: 20px 12px 14px;
  background: var(--basalt);
  color: var(--paper);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 10px 26px;
  text-decoration: none;
  font: 600 20px/1 var(--display);
  letter-spacing: -.01em;
}
.brand img { width: 30px; height: auto; }
.tabs { display: flex; flex-direction: column; gap: 2px; }
.tabs a {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px;
  border-radius: 6px;
  text-decoration: none;
  font: 500 15px/1.2 var(--display);
  color: #aab5ae;
}
.tabs a svg { width: 19px; height: 19px; flex: none; }
.tabs a:hover { color: var(--paper); background: rgb(255 255 255 / .06); }
.tabs a.active { color: var(--paper); background: rgb(255 255 255 / .1); box-shadow: inset 3px 0 0 var(--signal-dunkel); }
.tabs .mehr-pfeil { width: 14px; height: 14px; margin-left: auto; opacity: .6; }

/* Ausklappmenü rechts neben der Seitenleiste. Das Polster links überbrückt den Spalt zur Leiste,
   und es schließt erst nach kurzer Pause, damit man auch schräg hinüberfahren kann. */
.nav-gruppe { position: relative; }
.flyout { position: absolute; left: 100%; top: -8px; padding-left: 26px; visibility: hidden; opacity: 0; transition: visibility 0s .3s, opacity .12s .18s; }
.nav-gruppe:hover .flyout, .nav-gruppe:focus-within .flyout { visibility: visible; opacity: 1; transition-delay: 0s; }
.nav-gruppe:hover > a { color: var(--paper); background: rgb(255 255 255 / .06); }
.flyout-panel { width: 220px; padding: 6px; background: var(--paper); color: var(--basalt); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px rgb(0 0 0 / .18); }
.flyout-titel { padding: 6px 10px 8px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tabs .flyout-panel a { padding: 8px 10px; border-radius: 4px; font: 400 14px/1.2 var(--body); color: var(--basalt); box-shadow: none; background: none; }
.tabs .flyout-panel a:hover, .tabs .flyout-panel a:focus-visible { background: var(--signal-hell); }
.leiste-fuss { margin-top: auto; padding-top: 12px; border-top: 1px solid #33403a; display: flex; flex-direction: column; gap: 4px; }
.botstatus { padding: 6px 12px; font-size: 13px; color: #aab5ae; display: flex; align-items: center; gap: 8px; }
.botstatus:empty { display: none; }
.bs-text { display: flex; align-items: center; gap: 8px; }
.botstatus .dot { width: 9px; height: 9px; border-radius: 50%; background: #5fbf8a; flex: none; }
.botstatus .dot.off { background: #7d8781; }
.inhalt { display: flex; flex-direction: column; min-width: 0; }

main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 32px 40px; }
.foot { text-align: center; font-size: 13px; color: var(--muted); padding: 16px; }

h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; line-height: 1.2; letter-spacing: -.015em; }
h1 { font-size: 32px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px 40px;
  align-items: end;
  padding-bottom: 28px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
}
.hero .log { grid-column: 1 / -1; }
.control h1 { margin-bottom: 8px; }
.control p.lead { color: var(--muted); margin: 0; max-width: 62ch; }
.startbtn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 28px;
  background: var(--signal);
  color: var(--signal-text);
  border: 0; border-radius: 4px;
  font: 600 17px/1 var(--display);
  cursor: pointer;
  box-shadow: 0 3px 0 var(--signal-schatten);
}
.startbtn:hover { background: var(--signal-hover); }
.startbtn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--signal-schatten); }
.startbtn:disabled { background: var(--line); color: var(--muted); box-shadow: none; cursor: progress; }
.log {
  padding: 14px 16px;
  background: var(--paper);
  border-left: 4px solid var(--signal);
  font-size: 14px;
  min-height: 0;
}
.log:empty { display: none; }
.log div { padding: 2px 0; }
.log div.done { color: var(--muted); }
.log div.done::before { content: "✓ "; color: var(--moss); }

/* Runs list */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; gap: 16px; flex-wrap: wrap; }
.section-head .meta { color: var(--muted); font-size: 14px; }

.runs { list-style: none; margin: 0; padding: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; }
.run {
  display: grid;
  grid-template-columns: 190px 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 18px 20px;
  text-decoration: none;
  border-top: 1px solid var(--line);
}
.runs li:first-child .run { border-top: 0; }
.run:hover { background: var(--signal-hell); }
.run .when strong { display: block; font: 600 16px/1.3 var(--display); }
.run .when span { font-size: 13px; color: var(--muted); }
.badges { display: flex; gap: 8px; flex-wrap: wrap; }
.badge {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 4px 10px;
  border-radius: 3px;
  background: var(--stone);
  font-size: 14px;
  white-space: nowrap;
}
.badge b { font: 600 14px/1 var(--display); }
.badge.new { background: var(--signal); color: var(--signal-text); }
.badge.tender { background: #ffe1d1; color: #8a2d06; }
.badge.ton { background: #efe6dc; color: var(--soil); }
.run .go { font: 500 14px var(--display); color: var(--muted); }
.run.unseen .when strong::after { content: "neu"; margin-left: 8px; font: 600 12px var(--body); background: var(--basalt); color: var(--signal-dunkel); padding: 2px 6px; border-radius: 3px; vertical-align: 3px; }

/* Unterseiten: Zurück-Knopf oben links */
.seitenkopf { margin-bottom: 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.zurueck {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px 6px 8px;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--paper);
  font: 500 14px/1.2 var(--display);
  color: var(--basalt); text-decoration: none;
}
.zurueck svg { width: 16px; height: 16px; }
.zurueck:hover { border-color: var(--muted); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.chip {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  font-size: 14px;
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--basalt); color: var(--paper); border-color: var(--basalt); }

.finds { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.find-card { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; display: flex; align-items: center; }
.find-card .find-head { flex: 1; min-width: 0; padding-right: 8px; }
.find-card:hover { border-color: var(--muted); }
.find-head {
  width: 100%;
  display: grid;
  grid-template-columns: 64px 1fr auto 16px;
  gap: 18px;
  align-items: center;
  padding: 14px 18px;
  color: inherit; text-decoration: none;
}
.find-head .pfeil { width: 16px; height: 16px; color: var(--muted); }
/* Lesezeichen für Favoriten, an der Kachel und auf der Projektseite */
.favorit {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  margin-right: 10px; padding: 8px; border: 0; border-radius: 6px;
  background: none; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer;
}
.favorit svg { width: 20px; height: 20px; }
.favorit:hover { color: var(--basalt); background: var(--stone); }
.favorit[aria-pressed="true"] { color: var(--signal-schatten); }
.favorit.mit-text { margin: 0; padding: 6px 12px 6px 8px; border: 1px solid var(--line); color: var(--basalt); }
.favorit.mit-text svg { width: 16px; height: 16px; }
.favorit.mit-text[aria-pressed="true"] svg { color: var(--signal-schatten); }
.favorit.mit-text:hover { background: none; border-color: var(--muted); }
.find-head:hover .pfeil { color: var(--basalt); }
.score {
  width: 64px; height: 64px;
  display: grid; place-items: center;
  border-radius: 50%;
  font: 600 22px/1 var(--display);
  background: var(--stone);
  border: 4px solid var(--line);
}
.score.hi { border-color: var(--signal); }
.score.mid { border-color: var(--signal-mittel); }
.find-head .title { font: 600 16px/1.35 var(--display); overflow-wrap: anywhere; }
.sub { font-size: 14px; color: var(--muted); display: flex; gap: 4px 14px; flex-wrap: wrap; margin-top: 2px; }
.find-head .right, .projekt-kopf .right { text-align: right; }
.find-head .ton, .projekt-kopf .ton { font: 600 18px/1 var(--display); color: var(--soil); }
.find-head .ton small, .projekt-kopf .ton small { font-size: 14px; font-weight: 500; }
.frist { display: inline-block; margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--alert); }

/* Detailseite eines Projekts */
.projekt-kopf { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 20px; align-items: center; padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.projekt-kopf .score { width: 72px; height: 72px; font-size: 24px; }
.projekt-kopf h1 { font-size: 24px; line-height: 1.3; overflow-wrap: anywhere; }
.projekt-kopf .sub { margin-top: 6px; }
.projekt-kopf .ton { font-size: 22px; }
.projekt-raster { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.projekt-haupt, .projekt-seite { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.projekt-seite { position: sticky; top: 24px; }
.projekt-haupt .action { margin: 0; }
.tafel { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 18px 22px 20px; }
.tafel h2 { margin-bottom: 12px; font: 600 12px/1.2 var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tafel > p { margin: 0 0 16px; }
.tafel > p.meta { margin: 0 0 8px; font-size: 14px; }
.tafel > p:last-child { margin-bottom: 0; }
.tafel .facts { margin: 0; }
.tafel .dist { margin: 0; max-width: none; }
.tafel.vertrieb { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.tafel.vertrieb h2 { margin-bottom: 0; }
.gewinner .kontakt { display: flex; flex-direction: column; gap: 2px; font-size: 14px; overflow-wrap: anywhere; }
.gewinner .kontakt + .kontakt { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.originaltext summary { cursor: pointer; list-style-position: inside; color: var(--muted); }
.originaltext summary h2 { display: inline; margin: 0; }
.originaltext[open] summary { margin-bottom: 14px; }
.original + .original { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.original h3 { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.original-titel { margin: 0 0 10px; font-weight: 500; }
.original-text { margin: 0 0 10px; white-space: pre-line; overflow-wrap: anywhere; }
.original .meta { margin: 0 0 4px; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px 24px; margin: 0 0 18px; }
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; }
.dist { margin-bottom: 16px; max-width: 520px; }
.dist-row { display: grid; grid-template-columns: 90px 1fr auto; gap: 10px; align-items: center; font-size: 14px; margin: 4px 0; }
.dist-row .bar { height: 8px; background: var(--stone); border-radius: 4px; overflow: hidden; }
.dist-row .bar i { display: block; height: 100%; background: var(--line); }
.dist-row.best .bar i { background: var(--moss); }
.dist-row.best { font-weight: 600; }
.dist-row > span:last-child { white-space: nowrap; text-align: right; }
.action { background: var(--signal-hell); border-left: 4px solid var(--signal); padding: 10px 14px; margin-bottom: 12px; }
.src { font-size: 14px; color: var(--muted); word-break: break-all; }

.empty { padding: 40px; text-align: center; color: var(--muted); background: var(--paper); border: 1px dashed var(--line); border-radius: 6px; }

/* Settings */
.settings { max-width: 880px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 24px 28px; margin-bottom: 20px; scroll-margin-top: 24px; }
.panel h2 { font-size: 20px; margin-bottom: 4px; }
.panel > p { margin: 0 0 20px; color: var(--muted); font-size: 15px; }
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.field > label, .field > .label { display: block; font-weight: 600; margin-bottom: 6px; }
.field .hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="time"], select, textarea {
  font: inherit;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  width: 100%;
  max-width: 420px;
}
textarea { min-height: 80px; resize: vertical; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }
.toggle-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.toggle-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.toggle-item small { display: block; color: var(--muted); font-size: 13px; }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 13px; transition: background .15s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--moss); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid var(--signal); outline-offset: 2px; }
.plant-radius { display: grid; grid-template-columns: 200px 1fr 64px; gap: 14px; align-items: center; margin-bottom: 10px; }
.plant-radius output { font: 600 15px var(--display); text-align: right; }
input[type="range"] { accent-color: var(--basalt); width: 100%; }
.chips-select { display: flex; flex-wrap: wrap; gap: 8px; }
.save-bar {
  position: sticky; bottom: 0;
  display: flex; justify-content: flex-end; gap: 12px;
  padding: 16px 0;
  background: linear-gradient(transparent, var(--stone) 30%);
}
.btn { padding: 10px 20px; border-radius: 4px; border: 1px solid var(--basalt); background: transparent; font-weight: 600; cursor: pointer; }
.btn.primary { background: var(--basalt); color: var(--paper); }
.btn.primary:hover { background: #33403a; }

.toast {
  position: fixed; left: 50%; bottom: 96px;
  transform: translate(-50%, 20px);
  background: var(--basalt); color: var(--paper);
  padding: 12px 20px; border-radius: 4px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 860px) {
  .rahmen { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .seitenleiste { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 0 16px; }
  .brand { padding: 14px 0; }
  .leiste-fuss { order: 2; margin: 0 0 0 auto; padding: 0; border: 0; flex-direction: row; align-items: center; }
  .botstatus { display: none; }
  .zahnrad { width: auto; padding: 8px; }
  .zahnrad > span { display: none; }
  .tabs { order: 3; width: 100%; flex-direction: row; overflow-x: auto; scrollbar-width: none; padding-bottom: 8px; }
  .tabs a { padding: 8px 12px; white-space: nowrap; gap: 8px; }
  .tabs a svg { width: 16px; height: 16px; }
  .nav-gruppe { display: contents; }
  .flyout, .tabs .mehr-pfeil { display: none !important; }
  .tabs a.active { box-shadow: inset 0 -3px 0 var(--signal-dunkel); }
  main { padding: 20px 16px; }
  .projekt-kopf { grid-template-columns: 56px minmax(0, 1fr); gap: 14px; align-items: start; }
  .projekt-kopf .score { width: 56px; height: 56px; font-size: 20px; }
  .projekt-kopf h1 { font-size: 20px; }
  .projekt-kopf .right { grid-column: 2; text-align: left; }
  .projekt-raster { grid-template-columns: minmax(0, 1fr); }
  .projekt-seite { position: static; }
  .tafel { padding: 16px; }
  .find-head .pfeil { display: none; }
  .hero { grid-template-columns: 1fr; gap: 20px; }
  .startbtn { justify-self: start; }
  .run { grid-template-columns: 1fr; gap: 10px; }
  .run .go { display: none; }
  .find-head { grid-template-columns: 52px minmax(0, 1fr); }
  .score { width: 52px; height: 52px; font-size: 18px; }
  .find-head .right { grid-column: 2; text-align: left; }
  .panel { padding: 20px 16px; }
  .plant-radius { grid-template-columns: 1fr 56px; }
  .plant-radius label { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .toast { transition: none; }
}

/* Login, Vertrieb, Herkunft */
.login { max-width: 420px; margin: 40px auto; }
.login h1 { margin-bottom: 8px; }
.login .lead { color: var(--muted); margin: 0 0 24px; }
.fehler { color: var(--alert); font-weight: 600; }
.badge.fehler { background: #fde2d6; color: #8a2d06; }
.herkunft { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: 0 5px; margin-left: 4px; }
.action.warn { background: #fdeee6; border-left-color: var(--alert); }
.action .aufgegeben { margin: 6px 0 0; padding-left: 18px; }
.action .aufgegeben a { color: inherit; overflow-wrap: anywhere; }
/* Neue Lage nach geänderter Adresse wird berechnet */
.lage-laedt { display: inline-block; margin-top: 4px; font-size: 12px; color: var(--muted); animation: lage-puls 1.2s ease-in-out infinite; }
.tafel.laedt { opacity: .45; transition: opacity .2s; }
.lage-fehler { display: block; margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--alert); }
@keyframes lage-puls { 50% { opacity: .4; } }
@media (prefers-reduced-motion: reduce) { .lage-laedt { animation: none; } }
.score-erklaerung { margin: 8px 0 16px; font-size: 14px; color: var(--muted); }
.score-erklaerung summary { cursor: pointer; }
.vertrieb { display: grid; grid-template-columns: 220px 1fr; gap: 16px; margin-bottom: 14px; }
.vertrieb label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 14px; }
.vertrieb textarea { min-height: 60px; max-width: none; }
.vertrieb select { max-width: none; }
.vertrieb-irrelevant { text-decoration: line-through; }
.vertrieb-gewonnen { color: var(--moss); font-weight: 600; }
.toggle-item.bald, .panel.bald { opacity: .55; }
/* Zahnrad-Menü unten in der Seitenleiste */
.menue { position: relative; }
.menue[hidden] { display: none; }
.zahnrad { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; background: none; border: 0; border-radius: 6px; color: #aab5ae; font: 500 14px/1.2 var(--display); text-align: left; cursor: pointer; }
.zahnrad:hover, .zahnrad[aria-expanded="true"] { color: var(--paper); background: rgb(255 255 255 / .06); }
.zahnrad svg { width: 19px; height: 19px; flex: none; }
.menue-panel { position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); z-index: 10; padding: 14px; background: var(--paper); color: var(--basalt); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px rgb(0 0 0 / .18); }
.menue-panel[hidden] { display: none; }
.menue-label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.farbwahl { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 14px; }
.farbwahl button { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 7px 8px; background: var(--stone); border: 1px solid var(--line); border-radius: 4px; font-size: 14px; cursor: pointer; }
.farbwahl button i { width: 12px; height: 12px; border-radius: 50%; }
.farbwahl button[aria-pressed="true"] { background: var(--basalt); color: var(--paper); border-color: var(--basalt); font-weight: 600; }
.menue-eintrag { width: 100%; padding: 8px 0 0; background: none; border: 0; border-top: 1px solid var(--line); text-align: left; font-size: 15px; cursor: pointer; }
.menue-eintrag:hover { color: var(--alert); }
.meta { color: var(--muted); font-size: 14px; }
@media (max-width: 860px) {
  .vertrieb { grid-template-columns: 1fr; }
  .menue-panel { top: calc(100% + 8px); bottom: auto; left: auto; right: 0; width: 220px; }
}
.tabs[hidden] { display: none; }

.lauf-aktionen { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }
.btn.loeschen { border-color: var(--alert); color: var(--alert); }
.btn.loeschen:hover { background: #fdeee6; }

/* Etiketten an Funden, Werkzeugleiste „Alle Projekte“ */
.etikett { font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 3px; background: var(--stone); color: var(--muted); }
.etikett.neu { background: var(--signal); color: var(--signal-text); }
.etikett.aktualisiert { background: var(--basalt); color: var(--paper); }
.etikett.ausgeblendet { border: 1px dashed var(--muted); background: none; }
.werkzeuge { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-bottom: 16px; }
.werkzeuge input[type="search"] { font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: 4px; background: #fff; flex: 1 1 280px; max-width: none; }
.auswahlen { display: flex; flex-wrap: wrap; gap: 8px; flex-basis: 100%; }
.auswahl { position: relative; }
.auswahl-knopf { display: flex; align-items: center; gap: 4px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); font: inherit; font-size: 14px; cursor: pointer; white-space: nowrap; }
.auswahl-knopf:hover { border-color: var(--muted); }
.auswahl-titel { color: var(--muted); }
.auswahl-wert { font-weight: 600; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.auswahl-knopf svg { width: 12px; height: 12px; margin-left: 2px; color: var(--muted); transition: transform .15s; }
.auswahl-knopf[aria-expanded="true"] svg { transform: rotate(180deg); }
.auswahl.aktiv .auswahl-knopf { background: var(--basalt); border-color: var(--basalt); color: var(--paper); }
.auswahl.aktiv .auswahl-titel, .auswahl.aktiv svg { color: #aab5ae; }
.auswahl-liste { position: absolute; left: 0; top: calc(100% + 6px); z-index: 20; min-width: 220px; max-height: 340px; overflow-y: auto; padding: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px rgb(0 0 0 / .14); }
.auswahl-liste[hidden] { display: none; }
.auswahl-option { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 4px; font-size: 14px; cursor: pointer; white-space: nowrap; }
.auswahl-option:hover { background: var(--signal-hell); }
.auswahl-option input { width: 16px; height: 16px; margin: 0; accent-color: var(--basalt); }
.auswahl-leeren { width: 100%; margin-top: 4px; padding: 8px 8px 4px; border: 0; border-top: 1px solid var(--line); background: none; font-size: 13px; color: var(--muted); text-align: left; cursor: pointer; }
.auswahl-leeren:hover:not(:disabled) { color: var(--basalt); }
.auswahl-leeren:disabled { opacity: .5; cursor: default; }
.sub .zeitfenster { color: var(--moss); font-weight: 600; }
.listenkopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.listenkopf .projektzahl { margin: 0; }
.auswahl.rechts .auswahl-liste { left: auto; right: 0; }
.werkzeuge .ausgeblendete { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
@media (max-width: 860px) {
  .auswahl-wert { max-width: 140px; }
  .auswahl:has(.auswahl-liste:not([hidden])) { flex-basis: 100%; }
  .auswahl-liste { position: static; margin-top: 6px; box-shadow: none; max-height: none; }
}

/* Dashboard: Kacheln im Raster, Zahlen- und Diagramm-Kacheln */
.filters .chip i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; }
.dash { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.kachel { grid-column: span 6; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 18px 20px 20px; min-width: 0; }
.kachel > header { margin-bottom: 14px; }
.kachel h3 { font-size: 16px; }
.kachel > header .meta { margin: 2px 0 0; font-size: 13px; }
.kachel.breit { grid-column: span 8; }
.kachel.schmal { grid-column: span 4; }
.kachel.karte-kachel { grid-column: span 7; }
.kachel.fristen-kachel { grid-column: span 5; }
.kachel.voll { grid-column: 1 / -1; }
.leer { color: var(--muted); font-size: 14px; padding: 24px 0; text-align: center; }

.kpi { grid-column: span 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 20px 16px; text-align: center; font: inherit; color: inherit; }
button.kpi { cursor: pointer; }
button.kpi:hover { border-color: var(--muted); }
.kpi-titel { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.kpi-wert { font: 600 36px/1.15 var(--display); font-variant-numeric: proportional-nums; letter-spacing: -.02em; }
.kpi-unter { font-size: 13px; color: var(--muted); }
.kpi-unter .plus { color: var(--moss); }

.legende { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--muted); }
.legende li { display: flex; align-items: center; gap: 6px; }
.legende i { width: 10px; height: 10px; border-radius: 2px; }

/* Boden-Kalender: gestapelte Säulen */
.saeulen { padding: 0 0 0 52px; }
.plot { position: relative; height: 240px; display: flex; gap: 8px; align-items: stretch; margin: 22px 0 26px; }
.gitter { position: absolute; left: 0; right: 0; border-top: 1px solid #e3e6e1; pointer-events: none; }
.gitter span { position: absolute; right: calc(100% + 8px); top: -9px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.saeule { position: relative; flex: 1; display: flex; justify-content: center; }
.stapel { position: relative; width: 100%; max-width: 44px; height: 100%; display: flex; flex-direction: column-reverse; gap: 2px; }
.stapel i { display: block; flex: none; min-height: 2px; outline-offset: 1px; background: var(--c); }
.stapel i.geschaetzt { background: color-mix(in srgb, var(--c) 40%, var(--paper)); }
.legende .muster-geschaetzt { background: color-mix(in srgb, var(--muted) 40%, var(--paper)); }
.stapel i:last-of-type { border-radius: 4px 4px 0 0; }
.stapel i:hover, .stapel i:focus-visible { filter: brightness(1.12); }
.stapel b { order: 99; margin-bottom: 4px; font-size: 12px; font-weight: 600; text-align: center; white-space: nowrap; align-self: center; }
.saeule .x { position: absolute; top: calc(100% + 6px); font-size: 12px; color: var(--muted); white-space: nowrap; }

/* Balkenlisten: Projektarten, Firmen, Auftraggeber */
.balken { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.balken button { width: 100%; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(60px, 1fr) auto; gap: 12px; align-items: center; padding: 6px 6px; background: none; border: 0; border-radius: 4px; text-align: left; font-size: 14px; cursor: pointer; }
.balken button:hover { background: var(--signal-hell); }
.b-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-spur { height: 12px; }
.b-spur i { display: block; height: 100%; min-width: 3px; background: var(--moss); border-radius: 0 4px 4px 0; }
.b-wert { font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.kachel.schmal .balken button { grid-template-columns: 110px minmax(0, 1fr) 28px; }
.kachel.schmal .b-wert { text-align: right; }

/* Karte (Leaflet) */
.karte { position: relative; z-index: 0; height: 520px; border-radius: 4px; border: 1px solid var(--line); background: #e9ece6; }
.karte .leaflet-tile-pane { filter: grayscale(1) contrast(.85) brightness(1.06); }
.karte .leaflet-control-attribution { font-size: 11px; }
.routen-block { margin: 16px 0 10px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.routen-block .routenkarte { height: 260px; border: 0; border-radius: 0; }
.routen-link { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); color: var(--moss); font-weight: 600; font-size: 14px; text-decoration: none; transition: background .15s; }
.routen-link:hover { background: rgb(47 107 74 / .07); }
.routen-link svg { width: 17px; height: 17px; flex: none; }
.routen-link .extern { width: 14px; height: 14px; margin-left: auto; opacity: .6; }
.route-linie { stroke: var(--moss); stroke-opacity: .9; }
.route-start { stroke: var(--basalt); fill: #fff; fill-opacity: 1; stroke-width: 3; }
.route-ziel { stroke: var(--moss); fill: var(--moss); fill-opacity: 1; }
.kp { display: grid; place-items: center; box-sizing: border-box; border-radius: 50%; border: 2.5px solid var(--c); background: color-mix(in srgb, var(--c) 22%, transparent); font: 700 12px/1 var(--body); color: var(--basalt); cursor: pointer; }
.kp.genau { background: var(--c); border: 2px solid #fff; color: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .35); }
.leaflet-marker-icon:focus-visible .kp, .leaflet-marker-icon:hover .kp { outline: 2px solid var(--basalt); outline-offset: 1px; }
.kp-anlage { position: absolute; transform: translate(-50%, -7px); display: flex; flex-direction: column; align-items: center; gap: 3px; font: 600 13px/1 var(--body); color: var(--basalt); white-space: nowrap; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff; pointer-events: none; }
.kp-anlage i { width: 14px; height: 14px; border-radius: 2px; background: var(--basalt); border: 2px solid #fff; }
.kp-tip { font: 13px/1.45 var(--body); max-width: 300px; white-space: normal; }
.kp-liste ul { list-style: none; margin: 8px 0 0; padding: 0; max-height: 240px; overflow-y: auto; }
.kp-liste button { display: block; width: 100%; padding: 6px 4px; background: none; border: 0; border-top: 1px solid var(--line); text-align: left; font: 500 13px/1.35 var(--body); cursor: pointer; }
.kp-liste button:hover { background: var(--signal-hell); }
.kp-liste small { display: block; color: var(--muted); font-weight: 400; }
.legende .kp-muster { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--muted); background: color-mix(in srgb, var(--muted) 22%, transparent); }
.legende .kp-muster.genau { background: var(--muted); border-color: #fff; box-shadow: 0 0 0 1px var(--muted); }

/* Fristen */
.fristliste { list-style: none; margin: 0; padding: 0; }
.fristliste li + li { border-top: 1px solid var(--line); }
.fristliste button { width: 100%; display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 4px; background: none; border: 0; text-align: left; cursor: pointer; }
.fristliste button:hover { background: var(--signal-hell); }
.tage { justify-self: start; padding: 3px 8px; border-radius: 3px; background: var(--stone); font-size: 13px; font-weight: 600; white-space: nowrap; }
.tage.knapp { background: #ffe1d1; color: #8a2d06; }
.f-titel { font-size: 14px; font-weight: 500; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.f-titel small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); }
.mehr { margin-top: 10px; padding: 0; background: none; border: 0; font-weight: 600; text-decoration: underline; cursor: pointer; }

/* Vertriebs-Trichter */
.trichter { display: grid; grid-template-columns: 140px minmax(0, 1fr) 130px 90px; font-size: 14px; }
.t-kopf, .t-zeile { display: contents; }
.t-kopf span { padding: 0 0 8px; font-size: 12px; color: var(--muted); }
.t-kopf span:nth-child(n+3), .t-quote { text-align: right; }
.t-zeile > span { padding: 6px 0; border-top: 1px solid var(--line); display: flex; align-items: center; }
.t-quote { justify-content: flex-end; font-variant-numeric: tabular-nums; }
.t-balken { gap: 10px; }
.t-balken i { display: block; height: 24px; min-width: 2px; background: var(--moss); border-radius: 0 4px 4px 0; }
.t-balken b { font-weight: 600; font-variant-numeric: tabular-nums; }
.hinweis { margin: 12px 0 0; font-size: 13px; color: var(--muted); }

.tip { position: fixed; z-index: 50; max-width: 300px; padding: 8px 12px; background: var(--basalt); color: var(--paper); border-radius: 4px; font-size: 13px; line-height: 1.45; white-space: pre-line; pointer-events: none; box-shadow: 0 6px 18px rgb(0 0 0 / .2); }
.tip::first-line { font-weight: 600; }
.tip[hidden] { display: none; }

@media (max-width: 1000px) {
  .kpi { grid-column: span 6; }
  .kachel.breit, .kachel.schmal, .kachel.karte-kachel, .kachel.fristen-kachel, .kachel.halb { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .dash { gap: 12px; }
  .kpi-wert { font-size: 28px; }
  .kachel { padding: 16px; }
  .plot { gap: 4px; }
  .saeulen { padding-left: 44px; }
  .saeule .x { font-size: 11px; writing-mode: vertical-rl; transform: rotate(180deg); top: calc(100% + 4px); }
  .plot { margin-bottom: 64px; }
  .stapel b { font-size: 10px; }
  .trichter { grid-template-columns: 96px minmax(0, 1fr) 70px 56px; font-size: 13px; }
}

/* Mengen im Datenblatt: Aushub links, Materialbedarf rechts */
.mengen { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.menge-spalte { padding: 14px 16px 12px; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--soil); border-radius: 4px; min-width: 0; }
.menge-spalte.bedarf { border-top-color: var(--moss); }
.menge-spalte h3 { margin: 0 0 6px; font: 600 15px/1.3 var(--display); }
.menge-spalte h3 span { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 4px; }
.menge-wert { font: 600 28px/1.2 var(--display); margin: 0 -6px 10px; padding: 2px 6px; }
.menge-wert small { font-size: 15px; font-weight: 500; color: var(--muted); }
.menge-wert .herkunft { vertical-align: 6px; }
.menge-spalte dl { margin: 0; display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 6px 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.menge-spalte dl > div { display: contents; }
.menge-spalte dt { font-size: 13px; color: var(--muted); padding: 2px 0; }
.menge-spalte dd { margin: 0 -6px; padding: 1px 6px; font-weight: 500; }
.leer { color: var(--muted); font-weight: 400; font-style: italic; }

/* Per Doppelklick änderbare Werte */
[data-feld] { border-radius: 3px; cursor: default; transition: background .1s; }
[data-feld]:not(.editor):hover { background: var(--signal-hell); box-shadow: inset 0 -1px 0 var(--signal-mittel); }
[data-feld]:focus-visible { outline-offset: 0; }
.facts dd[data-feld], .tafel > p[data-feld] { margin-left: -6px; margin-right: -6px; padding: 1px 6px; }
.leer-feld { cursor: pointer; }
/* Handy und Tablet: einmal Tippen öffnet; leise Unterstreichung zeigt, was sich ändern lässt, kein Zoom beim Tippen */
@media (hover: none) {
  [data-feld]:not(.editor) { cursor: pointer; touch-action: manipulation; text-decoration: underline dotted var(--line); text-underline-offset: 3px; }
}
/* Eingabefeld sitzt genau an der Stelle des Werts: gleiche Schrift, dünner Rahmen, kein Fokusrahmen */
.editor input:not([type="checkbox"], [type="radio"]), .editor select, .editor textarea {
  font: inherit; color: inherit; letter-spacing: inherit;
  width: 100%; max-width: none; min-height: 0; margin: -1px -5px; padding: 0 4px;
  background: #fff; border: 1px solid var(--line); border-radius: 3px; box-shadow: none;
}
.editor input:not([type="checkbox"], [type="radio"]):focus, .editor select:focus, .editor textarea:focus { outline: none; border-color: color-mix(in srgb, var(--basalt) 40%, var(--line)); }
.editor textarea { display: block; resize: none; line-height: inherit; }
.editor input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.editor input[type="number"]::-webkit-inner-spin-button, .editor input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.editor input[type="date"] { width: auto; font-size: 15px; }
.editor-zahl { display: inline-flex; align-items: baseline; gap: 8px; }
.editor-zahl input { width: 5em; margin-right: 0; }
.editor-zeitraum { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; color: var(--muted); }
.editor-zeitraum .bis { display: inline-flex; align-items: center; gap: 8px; }
.editor-zeitraum input { margin: -1px 0; color: var(--basalt); }
.menge-spalte .editor-zeitraum { flex-direction: column; align-items: flex-start; }
.menge-spalte .editor-zeitraum .bis { position: relative; }
.menge-spalte .editor-zeitraum .bis-text { position: absolute; right: calc(100% + 8px); }
.sub [data-feld] { margin: 0 -4px; padding: 0 4px; }
.sub .editor input, .sub .editor select { width: auto; font-size: 14px; }
.projekt-kopf h1[data-feld] { margin: 0 -6px; padding: 0 6px; }

/* Kleine Zeile unten: Anpassungen zurücksetzen */
.anpassungen { margin: -4px 0 0; font-size: 13px; color: var(--muted); }
.link { padding: 0; background: none; border: 0; font: inherit; font-size: inherit; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.link:hover { color: var(--basalt); }
.anpassungen .link { margin-right: 6px; }

/* Einstellungen der App */
.menue-link { display: block; padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; text-decoration: none; }
.menue-link:hover { text-decoration: underline; }
.klassen-liste { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 8px; counter-reset: klasse; }
.klasse-zeile { display: grid; grid-template-columns: 22px minmax(0, 200px) minmax(0, 1fr) auto; gap: 10px; align-items: center; counter-increment: klasse; }
.klasse-zeile::before { content: counter(klasse); color: var(--muted); font-size: 13px; text-align: right; }
.klasse-zeile input { max-width: none; }
.btn.klein { padding: 6px 14px; font-size: 14px; }

@media (max-width: 860px) {
  .mengen { grid-template-columns: 1fr; }
  .klasse-zeile { grid-template-columns: 22px minmax(0, 1fr) auto; }
  .klasse-zeile input[name="beschreibung"] { grid-column: 2 / 4; }
}

/* Eigenes Auswahlmenü an Werten der Projektseite (gleich auf Mac und Windows) */
.editor { position: relative; }
.feld-menue { top: calc(100% + 4px); min-width: 240px; max-width: 380px; font-size: 14px; font-weight: 400; color: var(--basalt); font-style: normal; letter-spacing: normal; line-height: 1.4; text-transform: none; }
.feld-menue:focus { outline: none; }
.feld-menue .auswahl-option { white-space: normal; align-items: flex-start; }
.feld-menue .auswahl-option input { margin-top: 1px; flex: none; }
.feld-menue .auswahl-option small { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.feld-menue .auswahl-option:has(input:focus-visible) { background: var(--signal-hell); }
.feld-menue .auswahl-option input:focus-visible { outline: none; }
.feld-menue-fuss { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; padding: 8px 8px 2px; border-top: 1px solid var(--line); }
.feld-menue-fuss .btn { padding: 5px 14px; font-size: 13px; }
.projekt-kopf .feld-menue { font-size: 14px; }
@media (max-width: 860px) { .feld-menue { position: absolute; max-height: 340px; box-shadow: 0 8px 24px rgb(0 0 0 / .14); } }
.feld-menue:has(small) { min-width: 330px; }

/* Eigener Kalender für Datumsfelder */
.kalender { min-width: 0; width: max-content; padding: 10px 10px 6px; }
.kal-kopf { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.kal-kopf strong { font: 600 14px var(--display); }
.kal-nav { width: 28px; height: 28px; border: 0; border-radius: 4px; background: none; font-size: 18px; line-height: 1; color: var(--muted); cursor: pointer; }
.kal-nav:hover { background: var(--stone); color: var(--basalt); }
.kal-zeile { display: grid; grid-template-columns: 30px repeat(7, 32px); gap: 2px 0; align-items: center; }
.kal-wochentage span { font-size: 11px; color: var(--muted); text-align: center; padding: 2px 0 4px; }
.kal-kw { font-size: 11px; color: var(--muted); text-align: center; }
button.kal-kw { height: 28px; margin-right: 2px; border: 0; border-radius: 4px; background: none; cursor: pointer; }
button.kal-kw:hover { background: var(--stone); color: var(--basalt); }
.kal-tag { height: 30px; border: 0; border-radius: 4px; background: none; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--basalt); cursor: pointer; }
.kal-tag:hover { background: var(--signal-hell); }
.kal-tag.fremd { color: #a3aba6; }
.kal-tag.heute { font-weight: 700; box-shadow: inset 0 -2px 0 var(--signal); }
.kal-tag.im-zeitraum { background: var(--signal-hell); border-radius: 0; }
.kal-tag.gewaehlt { background: var(--basalt); color: var(--paper); font-weight: 600; }
.kal-tag:focus-visible, button.kal-kw:focus-visible, .kal-nav:focus-visible { outline: 2px solid var(--signal); outline-offset: -2px; }
.kal-fuss { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 6px; padding: 6px 2px 0; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

/* Adressformular */
.adress-form { width: 340px; padding: 12px 12px 8px; display: flex; flex-direction: column; gap: 10px; }
.adress-form label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.feld-menue.adress-form input { margin: 0; font: 400 14px var(--body); color: var(--basalt); padding: 6px 8px; border: 1px solid var(--line); border-radius: 3px; background: #fff; width: 100%; max-width: none; }
.feld-menue.adress-form input:focus { outline: none; border-color: color-mix(in srgb, var(--basalt) 40%, var(--line)); }
.adress-zeile { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 8px; }
.adress-fehler { margin: -4px 0 0; font-size: 12px; color: var(--alert); }
.adress-form .feld-menue-fuss { margin-top: 0; padding: 8px 0 0; }
.feld-menue.oben { top: auto; bottom: calc(100% + 4px); }
.feld-menue.rechts { left: auto; right: 0; }
.feld-menue.kalender { max-height: none; overflow-y: auto; }
.feld-menue { max-height: 460px; }

/* Mehrere Klassen: untereinander, Menge je Klasse rechts */
.klassen-mengen { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.klassen-mengen li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.klasse-name { min-width: 0; }
.klasse-menge { display: inline-flex; align-items: center; gap: 4px; flex: none; font-size: 13px; font-weight: 400; color: var(--muted); }
.klasse-menge input { width: 76px; max-width: none; padding: 1px 6px; font: 500 14px var(--body); color: var(--basalt); text-align: right; background: #fff; border: 1px solid var(--line); border-radius: 3px; -moz-appearance: textfield; appearance: textfield; }
.klasse-menge input::-webkit-inner-spin-button, .klasse-menge input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.klasse-menge input:focus { outline: none; border-color: color-mix(in srgb, var(--basalt) 40%, var(--line)); }
.klassen-summe { margin: 4px 0 0; font-size: 12px; font-weight: 400; color: var(--muted); }

/* Aufgaben (Block 6) */
.nav-zahl { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--alert); color: #fff; font: 600 12px/20px var(--body); text-align: center; }
.nav-zahl[hidden] { display: none; }
.chip .zahl, .umschalter .zahl { opacity: .7; font-size: 12px; }
.toast.show.mit-aktion { pointer-events: auto; }
.toast-aktion { margin-left: 14px; padding: 0; border: 0; background: none; color: var(--signal-dunkel); font: 600 14px var(--body); cursor: pointer; }

.aufgaben-liste { list-style: none; margin: 0; padding: 0; }
.aufgabe { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.aufgabe:first-child { border-top: 0; padding-top: 0; }
.haken { width: 22px; height: 22px; margin-top: 1px; padding: 0; display: grid; place-items: center; border: 1.5px solid var(--muted); border-radius: 50%; background: transparent; color: transparent; cursor: pointer; }
.haken:hover { border-color: var(--moss); color: var(--moss); }
.haken[aria-pressed="true"] { background: var(--moss); border-color: var(--moss); color: #fff; }
.haken svg { width: 14px; height: 14px; }
.aufgabe-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.aufgabe-titel { font-weight: 600; overflow-wrap: anywhere; }
.aufgabe-text:hover .aufgabe-titel { text-decoration: underline; }
.aufgabe.erledigt .aufgabe-titel { text-decoration: line-through; color: var(--muted); }
.aufgabe-notiz, .aufgabe-meta { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.aufgabe-faellig.ueberfaellig { color: var(--alert); font-weight: 600; }
.prio { padding: 2px 8px; border-radius: 10px; background: var(--stone); font-size: 12px; font-weight: 600; white-space: nowrap; }
.prio-hoch { background: #fdeee6; color: var(--alert); }
.prio-mittel { background: #efe6dc; color: var(--soil); }
.leer-wert { color: var(--muted); }

.aufgaben-tabelle { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 0 18px; }
.aufgaben-tabelle .aufgabe { grid-template-columns: 22px minmax(0, 2fr) minmax(0, 1.4fr) 110px 90px 130px; align-items: center; padding: 12px 0; }
.aufgaben-tabelle .aufgabe-kopf { font-size: 13px; font-weight: 600; color: var(--muted); }
.aufgabe-projekt { font-size: 14px; color: var(--basalt); overflow-wrap: anywhere; }
.aufgabe-spalte { font-size: 14px; }
.aufgabe-form-zeile { padding: 12px 0; border-top: 1px solid var(--line); }

.aufgabe-form { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; padding: 14px; background: var(--stone); border-radius: 6px; }
.aufgabe-form-zeile .aufgabe-form { margin-top: 0; }
.aufgabe-form input[aria-invalid="true"] { border-color: var(--alert); }
.aufgabe-form label, .aufgabe-form .form-feld { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; }
.aufgabe-form input[type=text], .aufgabe-form textarea, .aufgabe-form select { width: 100%; max-width: none; font-weight: 400; }
.form-reihe { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.datum-wahl { position: relative; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.datum-knopf { padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); font: 400 14px var(--body); text-align: left; cursor: pointer; }
.form-fehler { margin: -6px 0 0; color: var(--alert); font-size: 13px; font-weight: 400; }
.form-fehler[hidden] { display: none; }
.form-knoepfe { display: flex; gap: 8px; flex-wrap: wrap; }
.form-knoepfe .loeschen { margin-left: auto; }

@media (max-width: 860px) {
  .aufgaben-tabelle { padding: 0 14px; }
  .aufgaben-tabelle .aufgabe-kopf { display: none; }
  .aufgaben-tabelle .aufgabe { grid-template-columns: 22px minmax(0, 1fr); row-gap: 4px; align-items: start; }
  .aufgaben-tabelle .aufgabe > .aufgabe-projekt, .aufgaben-tabelle .aufgabe > .aufgabe-spalte { grid-column: 2; }
  .aufgaben-tabelle .aufgabe > .aufgabe-spalte:has(.leer-wert) { display: none; }
  .aufgaben-tabelle .aufgabe-kopf + .aufgabe { border-top: 0; }
}

.tafel-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.tafel-kopf h2 { margin-bottom: 0; }
.umschalter { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.umschalter button { padding: 4px 10px; border: 0; background: var(--paper); font: 500 13px/1.2 var(--body); color: var(--muted); cursor: pointer; }
.umschalter button + button { border-left: 1px solid var(--line); }
.umschalter button[aria-pressed="true"] { background: var(--basalt); color: var(--paper); }
.aufgaben-tafel > p.meta { margin: 0; }
.neue-aufgabe { margin-top: 10px; }
