/* Feinplanung Produktion v2 - App-Stile.
   Ausschliesslich Norm-Variablen aus design-norm.css (letzte Stildatei).
   Farbtoene fuer Status-Flaechen entstehen per color-mix aus den Norm-Farben.
   Keine Inline-Stile: Positionen der Planungstafel laufen ueber CSS-Variablen
   (--fp-x, --fp-w, --fp-lane), die das Skript je Element setzt. */

* { box-sizing: border-box; }
[hidden] { display: none !important; }

/* Ampel-Gelb als Flaeche - dokumentierte Abweichung von der Norm (Manifest §18):
   Das Norm-Amber (--amber) ist ein Kontrast-Textton und wirkt als Flaeche braun
   (Rueckmeldung Thorsten 06.09.2026). Balken, Legende, Kapazitaetsbalken und
   Kachel-Tints nutzen deshalb ein echtes Ampelgelb wie die Vorgaenger-App
   (production-planning-v1: --tone-yellow-fill/-border/--soft-yellow).
   Text auf hellem Grund bleibt Norm-Amber (Kontrast). */
:root {
  --fp-gelb: #f5b73b;
  --fp-gelb-rand: #8a6300;
  --fp-gelb-hell: #fff0bd;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  font-size: 14px;
}
input, textarea, select, button { font-family: inherit; }
main { padding: 18px 20px 40px; max-width: 1600px; margin: 0 auto; }
h2 { font-size: 17px; color: var(--navy); margin: 18px 0 8px; }
h2:first-child { margin-top: 0; }
h3 { font-size: 14px; color: var(--navy); margin: 12px 0 6px; }

/* Kopfband */
.fp-kopf-zeile { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.fp-kopf-zeile h1 { margin: 0; font-size: 24px; color: var(--white); }
.fp-kopf-untertitel { margin: 4px 0 0; color: rgba(255, 255, 255, .85); font-size: 14px; }
.fp-kopf-aktionen { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fp-rolle, .fp-live {
  color: rgba(255, 255, 255, .85);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 999px;
  padding: 4px 12px;
}
.fp-live::before { content: "●"; margin-right: 6px; }
.fp-live.live::before { color: var(--aqua-light); }
.fp-live.verbinde::before { color: var(--aqua); }
.fp-live.rueckfall::before { color: var(--amber); }
.fp-live.getrennt::before { color: rgba(255, 255, 255, .5); }
.fp-zaehler {
  display: inline-block;
  min-width: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--red);
  color: var(--white);
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  margin-left: 4px;
}

/* Reiter-Inhalte */
.tab { display: none; }
.tab.aktiv { display: block; }
.fp-lade { color: var(--muted); padding: 30px 4px; }
.fp-leer { color: var(--muted); padding: 14px 4px; margin: 0; }
.fp-hinweis { color: var(--muted); font-size: 12.5px; margin: 6px 0; }
.fp-warnung { color: var(--amber); font-size: 13px; font-weight: 600; margin: 6px 0; }
.fp-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.fp-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.fp-liste { margin: 6px 0; padding: 0; list-style: none; }
.fp-liste li { position: relative; padding-left: 14px; margin: 3px 0; font-size: 13px; }
.fp-liste li::before { content: "•"; position: absolute; left: 0; color: var(--muted); }

/* Meldungen */
.fp-meldung {
  border-radius: var(--ma-field-radius);
  padding: 10px 14px;
  margin: 0 0 12px;
  font-size: 13.5px;
  border: 1px solid var(--line);
  background: var(--white);
}
.fp-meldung.success { border-color: var(--green); background: color-mix(in srgb, var(--green) 12%, white); }
.fp-meldung.warning { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 12%, white); }
.fp-meldung.error { border-color: var(--red); background: color-mix(in srgb, var(--red) 10%, white); }
.fp-toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100001; max-width: 360px; }
.fp-toast {
  background: var(--navy);
  color: var(--white);
  border-left: 4px solid var(--aqua);
  border-radius: var(--ma-field-radius);
  padding: 10px 14px;
  font-size: 13px;
  box-shadow: var(--shadow);
  transition: opacity .6s;
}
.fp-toast.weg { opacity: 0; }
body.fp-busy { cursor: progress; }
body.fp-busy button.knopf, body.fp-busy button.mini { opacity: .7; }

/* KPI-Karten */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 10px; }
.kpi {
  background: color-mix(in srgb, var(--navy) 6%, white);
  border: 1px solid var(--line);
  border-left: 5px solid var(--navy);
  border-radius: var(--ma-field-radius);
  padding: 11px 15px;
}
.kpi .wert { font-size: 27px; font-weight: 800; color: var(--navy); line-height: 1.1; }
.kpi .titel { font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 3px; }
.kpi.gut { background: color-mix(in srgb, var(--green) 10%, white); border-left-color: var(--green); }
.kpi.gut .wert { color: var(--green); }
.kpi.gelbwert { background: var(--fp-gelb-hell); border-left-color: var(--fp-gelb); }
.kpi.gelbwert .wert { color: var(--amber); }
.kpi.warn { background: color-mix(in srgb, var(--red) 10%, white); border-left-color: var(--red); }
.kpi.warn .wert { color: var(--red); }

/* Tabellen */
.tabellen-box { background: var(--white); border: 1px solid var(--line); border-radius: var(--ma-field-radius); overflow-x: auto; margin-bottom: 10px; }
.tabellen-box-schmal { max-width: 920px; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
td.umbruch { white-space: normal; min-width: 160px; overflow-wrap: anywhere; }
th { background: var(--navy); color: var(--white); font-size: 12px; font-weight: 600; position: sticky; top: 0; }
th.sortierbar { cursor: pointer; user-select: none; }
th.sortierbar:hover { color: var(--aqua-light); }
tbody tr:nth-child(even) { background: var(--paper); }
tbody tr:hover { background: var(--aqua-soft); }
td.zahl, th.zahl { text-align: right; font-variant-numeric: tabular-nums; }
tr.erledigt td { color: var(--muted); }
tr.aktuell td { font-weight: 700; }
tr.zurueckgenommen td { color: var(--muted); text-decoration: line-through; }
tr.zeit-fehlt td { background: var(--fp-gelb-hell); }
tr.ziehbar { cursor: grab; }
tr.wird-gezogen { opacity: .5; }
tr.ziel td { border-top: 3px solid var(--aqua); }
tr.sim-besser td { background: color-mix(in srgb, var(--green) 10%, white); }
tr.sim-schlechter td { background: color-mix(in srgb, var(--red) 10%, white); }
td.aktionen { white-space: nowrap; }
td.aktionen button + button { margin-left: 4px; }
td input.klein, .klein { width: 90px; }
td input, td select { height: 30px; border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; font-size: 13px; background: var(--white); color: var(--ink); }
button.link { background: none; border: none; color: var(--navy); font-weight: 600; cursor: pointer; padding: 0; text-decoration: underline; font-size: inherit; }

/* Status-Marken: Flaeche + Text */
.status { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status.gruen { background: color-mix(in srgb, var(--green) 14%, white); color: var(--green); }
.status.gelb { background: var(--fp-gelb-hell); color: var(--amber); }
.status.rot { background: color-mix(in srgb, var(--red) 12%, white); color: var(--red); }
.status.blau { background: color-mix(in srgb, var(--blue) 12%, white); color: var(--blue); }
.status.grau { background: var(--paper); color: var(--muted); }

/* Werkzeugleisten + Knoepfe (alles buendig auf einer Linie) */
.werkzeuge { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; flex-wrap: wrap; }
.suchfeld, .fp-select, .fp-datum {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  height: 34px;
  font-size: 13px;
  background: var(--white);
  color: var(--ink);
}
.suchfeld { width: 230px; }
.suchfeld:focus, .fp-select:focus, .fp-datum:focus { outline: 2px solid var(--aqua); border-color: var(--navy); }
.werkzeuge > button.knopf, .werkzeuge > button.mini { height: 34px; display: inline-flex; align-items: center; padding-top: 0; padding-bottom: 0; }
button.knopf, a.knopf {
  border: none;
  border-radius: 9px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: var(--navy);
  color: var(--white);
  display: inline-block;
  text-decoration: none;
  line-height: 1.4;
}
button.knopf:hover, a.knopf:hover { background: var(--navy-2); }
button.knopf.aqua, a.knopf.aqua { background: var(--aqua); color: var(--navy); }
button.knopf.aqua:hover, a.knopf.aqua:hover { background: color-mix(in srgb, var(--aqua) 78%, white); color: var(--navy); }
button.knopf.hell, a.knopf.hell { background: var(--white); color: var(--navy); border: 1px solid var(--line); }
button.knopf.hell:hover, a.knopf.hell:hover { background: var(--paper); color: var(--navy); }
button.knopf.gefahr { background: var(--white); color: var(--red); border: 1px solid var(--red); }
button.knopf.gefahr:hover { background: color-mix(in srgb, var(--red) 10%, white); color: var(--red); }
button.mini { border: 1px solid var(--line); background: var(--white); color: var(--navy); border-radius: 7px; padding: 3px 8px; font-size: 12px; cursor: pointer; }
button.mini:hover { background: var(--aqua-soft); }
button.mini.gefahr { color: var(--red); }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--aqua); outline-offset: 1px; }
.form-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.ma-compact-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.ma-compact-form label.fp-check { flex-direction: row; align-items: center; font-weight: 500; color: var(--ink); margin: 8px 0; }
.ma-compact-form textarea { border: 1px solid var(--line); border-radius: var(--ma-field-radius); padding: 8px 12px; font-size: 14px; min-height: 60px; }
.ma-compact-form input[type="file"] { padding: 10px 12px; height: auto !important; }
.fp-karten { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px; margin-bottom: 14px; }
.fp-karten .ma-card h3:first-child { margin-top: 0; }
.ma-card { margin-bottom: 12px; }
.fp-wochentage { border: 1px solid var(--line); border-radius: var(--ma-field-radius); padding: 6px 12px; margin: 10px 0; display: flex; gap: 12px; flex-wrap: wrap; }
.fp-wochentage legend { font-size: 12.5px; font-weight: 600; color: var(--muted); }

/* Unter-Reiter (Stammdaten) */
.fp-unternav { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 2px solid var(--line); margin-bottom: 14px; }
.fp-untertab { background: none; border: none; border-bottom: 3px solid transparent; padding: 8px 12px; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; margin-bottom: -2px; }
.fp-untertab:hover { color: var(--navy); }
.fp-untertab.is-active { color: var(--navy); border-bottom-color: var(--aqua); }

/* Einklappbare Listen (Hausregel: details, Zustand bleibt) */
details.fp-klapp { background: var(--white); border: 1px solid var(--line); border-radius: var(--ma-field-radius); margin: 10px 0; }
details.fp-klapp > summary { cursor: pointer; padding: 10px 14px; font-weight: 700; color: var(--navy); list-style: none; }
details.fp-klapp > summary::-webkit-details-marker { display: none; }
details.fp-klapp > summary::before { content: "▸ "; color: var(--muted); }
details.fp-klapp[open] > summary::before { content: "▾ "; }
details.fp-klapp > div { padding: 0 14px 12px; }
details.fp-klapp .tabellen-box { margin-bottom: 0; }

/* Antraege */
.fp-antrag { background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--fp-gelb); border-radius: var(--ma-field-radius); padding: 10px 14px; margin-bottom: 10px; }
.fp-antrag-kopf { margin-bottom: 4px; }
.fp-antrag .werkzeuge { margin: 8px 0 0; }
.fp-vorschau { background: var(--paper); border: 1px solid var(--line); border-radius: var(--ma-field-radius); padding: 8px 12px; }

/* Auftragsdetail */
.fp-detail h3 { margin-top: 14px; }
.fp-ampelzeile { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--white); border: 1px solid var(--line); border-radius: var(--ma-field-radius); padding: 8px 12px; margin: 0 0 10px; font-size: 13px; }

/* Kapazitaetsbalken */
.kap-balken { display: inline-block; width: 120px; height: 10px; border-radius: 5px; background: var(--paper); border: 1px solid var(--line); vertical-align: middle; margin-right: 8px; overflow: hidden; }
.kap-balken-fuellung { height: 100%; width: calc(var(--kap, 0) * 1%); background: var(--ampel-gruen, #34c759); }
.kap-balken-fuellung.gelb { background: var(--fp-gelb); }
.kap-balken-fuellung.rot { background: var(--ampel-rot, #f25f5a); }

/* Planungstafel */
.tafel {
  --hour-width: 24px;
  --label-width: 200px;
  --lane-height: 26px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--ma-field-radius);
  overflow: auto;
  position: relative;
  user-select: none;
  max-height: 70vh;
}
.tafel-kopf, .tafel-zeile { display: flex; min-width: max-content; }
.tafel-kopf { position: sticky; top: 0; z-index: 3; background: var(--navy); color: var(--white); }
.tafel-label {
  position: sticky;
  left: 0;
  z-index: 2;
  width: var(--label-width);
  min-width: var(--label-width);
  padding: 6px 10px;
  background: var(--white);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  font-size: 12.5px;
  overflow: hidden;
}
.tafel-label strong { color: var(--navy); }
.tafel-label span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tafel-label-kopf { background: var(--navy); color: var(--white); border-right-color: rgba(255,255,255,.2); font-weight: 600; justify-content: center; }
.tafel-tage { display: flex; }
.tafel-tag {
  width: calc(var(--hour-width) * 16);
  min-width: calc(var(--hour-width) * 16);
  padding: 4px 6px;
  border-right: 1px solid rgba(255, 255, 255, .15);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  overflow: hidden;
}
.tafel-tag.wochenende { background: rgba(255, 255, 255, .08); }
.tafel-tag.heute { background: var(--aqua-text); }
.tafel-tag-wt { font-weight: 700; }
.tafel-tag-datum { opacity: .85; }
.tafel-spur {
  position: relative;
  height: calc(var(--lane-height) * var(--lanes, 1) + 12px);
  width: calc(var(--hour-width) * 16 * 14);
  min-width: max-content;
  border-bottom: 1px solid var(--line);
  flex: 1;
}
.tafel-raster {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--fp-x) * var(--hour-width));
  width: calc(var(--hour-width) * 16);
  border-right: 1px solid var(--line);
}
.tafel-raster.wochenende { background: color-mix(in srgb, var(--navy) 4%, white); }
.tafel-raster.heute { background: color-mix(in srgb, var(--aqua) 10%, white); }
.tafel-schicht {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: calc(var(--fp-x) * var(--hour-width));
  width: calc(var(--fp-w) * var(--hour-width));
  background: color-mix(in srgb, var(--green) 9%, white);
  border-left: 1px dashed color-mix(in srgb, var(--green) 40%, white);
}
.tafel-schicht.leer { background: color-mix(in srgb, var(--red) 6%, white); border-left-color: color-mix(in srgb, var(--red) 40%, white); }
.tafel-balken {
  position: absolute;
  top: calc(6px + var(--fp-lane) * var(--lane-height));
  left: calc(var(--fp-x) * var(--hour-width));
  width: calc(var(--fp-w) * var(--hour-width));
  min-width: 8px;
  height: calc(var(--lane-height) - 6px);
  border-radius: 6px;
  background: var(--green);
  color: var(--white);
  font-size: 11.5px;
  line-height: calc(var(--lane-height) - 6px);
  padding: 0 6px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(7, 27, 54, .25);
  z-index: 1;
}
.tafel-balken.delivery-warning { background: var(--fp-gelb); color: var(--navy); }
.tafel-balken.delivery-critical { background: var(--red); }
.tafel-balken.warnung { outline: 2px solid var(--fp-gelb-rand); outline-offset: -2px; }
.tafel-balken.manuell { border: 2px solid var(--navy); line-height: calc(var(--lane-height) - 10px); }
.tafel-balken .ico-pin { display: inline-block; width: 1em; height: 1em; vertical-align: -0.15em; margin-right: 3px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tafel-balken.links-offen { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.tafel-balken.rechts-offen { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.tafel-balken.wird-gezogen { opacity: .75; z-index: 4; cursor: grabbing; }
body.rolle-planer .tafel-balken { cursor: grab; }
.tafel-tooltip {
  position: fixed;
  left: var(--tip-left, 0);
  top: var(--tip-top, 0);
  z-index: 100002;
  background: var(--navy);
  color: var(--white);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
  max-width: 330px;
  box-shadow: var(--shadow);
  pointer-events: none;
}
.tafel-tooltip .tip-warn { color: var(--aqua-light); }
.tafel-tooltip .fp-hinweis { color: rgba(255,255,255,.8); }
.legende { display: inline-block; width: 14px; height: 10px; border-radius: 3px; vertical-align: middle; background: var(--green); }
.legende.gelb { background: var(--fp-gelb); }
.legende.rot { background: var(--red); }
.legende.manuell { background: var(--green); border: 2px solid var(--navy); }

/* Dialog: immer im Vordergrund (Hausregel) */
.fp-dialog { border: none; border-radius: var(--ma-card-radius); padding: 0; max-width: min(720px, 94vw); width: 94vw; box-shadow: var(--shadow); z-index: 100000; }
.fp-dialog.breit { max-width: min(1100px, 96vw); width: 96vw; }
.fp-dialog::backdrop { background: rgba(7, 27, 54, .45); }
.fp-dialog-rahmen { padding: 18px 22px 16px; max-height: 88vh; display: flex; flex-direction: column; }
.fp-dialog-rahmen h2 { margin: 0 0 10px; font-size: 18px; }
.fp-dialog-inhalt { overflow: auto; flex: 1; }
.fp-dialog-inhalt h3 { margin-top: 14px; }
.fp-dialog-aktionen { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }

/* Rollen-Sichtbarkeit */
body:not(.rolle-planer) .nur-planer-sichtbar { display: none !important; }

/* Handy/Tablet: lesen ja, Tafel scrollt, Formulare stapeln */
@media (max-width: 900px) {
  main { padding: 12px 10px 30px; }
  .fp-kopf-zeile h1 { font-size: 20px; }
  .werkzeuge { gap: 8px; }
  .suchfeld { width: 100%; }
  .fp-karten { grid-template-columns: 1fr; }
  .tafel { max-height: none; }
  .tafel-label { --label-width: 130px; width: 130px; min-width: 130px; }
  .fp-dialog, .fp-dialog.breit { width: 100vw; max-width: 100vw; margin: 0; border-radius: 0; }
  .fp-dialog-rahmen { max-height: 100vh; }
}

/* ===== Hilfeseite (hilfe.html), Muster wie ZielKompass ===== */
.hilfe-body { max-width: 900px; margin: 0 auto; padding: 24px 20px 60px; }
.hilfe-kopf { display: flex; align-items: center; gap: 14px; border-bottom: 3px solid var(--aqua); padding-bottom: 14px; margin-bottom: 8px; flex-wrap: wrap; }
.hilfe-kopf h1 { margin: 0; color: var(--navy); font-size: 26px; }
.hilfe-kopf .hilfe-zurueck { margin-left: auto; }
.hilfe-intro { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.hilfe-inhalt { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 12px 18px; margin: 16px 0 24px; }
.hilfe-inhalt strong { color: var(--navy); }
.hilfe-inhalt ol { margin: 6px 0 0; padding-left: 20px; }
.hilfe-inhalt a { color: var(--navy); }
.hilfe-abschnitt { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 6px 22px 18px; margin-bottom: 16px; }
.hilfe-abschnitt h2 { color: var(--navy); font-size: 19px; border-bottom: 2px solid var(--navy); padding-bottom: 4px; margin: 18px 0 10px; }
.hilfe-abschnitt h3 { color: var(--navy); font-size: 15px; margin: 16px 0 4px; }
.hilfe-abschnitt p { margin: 6px 0; }
.hilfe-abschnitt ul, .hilfe-abschnitt ol { margin: 6px 0; padding-left: 22px; }
.hilfe-abschnitt li { margin: 4px 0; }
.hilfe-schritte { counter-reset: schritt; list-style: none; padding-left: 0; }
.hilfe-schritte > li { position: relative; padding-left: 40px; margin: 10px 0; }
.hilfe-schritte > li::before {
  counter-increment: schritt; content: counter(schritt);
  position: absolute; left: 0; top: 0;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--navy); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.hilfe-ampel { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.hilfe-ampel.rot { background: color-mix(in srgb, var(--red) 12%, white); color: var(--red); }
.hilfe-ampel.gelb { background: var(--fp-gelb-hell); color: var(--amber); }
.hilfe-ampel.gruen { background: color-mix(in srgb, var(--green) 14%, white); color: var(--green); }
.hilfe-merk { background: var(--aqua-soft); border-left: 4px solid var(--aqua); border-radius: 6px; padding: 10px 14px; margin: 10px 0; font-size: 13px; }
.hilfe-achtung { background: var(--fp-gelb-hell); border-left: 4px solid var(--fp-gelb); border-radius: 6px; padding: 10px 14px; margin: 10px 0; font-size: 13px; }
.hilfe-fuss { color: var(--muted); font-size: 12px; margin-top: 24px; border-top: 1px solid var(--line); padding-top: 10px; }

/* ===== Maschinenpark (Konzept 2026-09-08) ===== */
.mp-legende .legende.mp-laeuft { background: var(--ampel-gruen, var(--green)); }
.mp-legende .legende.mp-geplant { background: var(--ampel-gelb, var(--fp-gelb)); }
.mp-legende .legende.mp-ungeplant { background: var(--ampel-rot, var(--red)); }
.mp-legende .legende.mp-leer { background: var(--line); }
.mp-plan {
  position: relative;
  min-height: 72vh;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--ma-field-radius);
  margin-bottom: 14px;
  overflow: hidden;
}
.mp-plan.mp-anordnen { background: repeating-linear-gradient(0deg, transparent 0 39px, var(--paper) 39px 40px), repeating-linear-gradient(90deg, transparent 0 39px, var(--paper) 39px 40px), var(--white); }
.mp-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.mp-kachel {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 8px solid var(--line);
  border-radius: var(--ma-field-radius);
  padding: 7px 9px;
  box-shadow: 0 1px 3px rgba(7, 27, 54, .12);
  font-size: 12px;
  min-width: 160px;
  cursor: pointer;
  user-select: none;
}
.mp-kachel:hover { box-shadow: 0 2px 8px rgba(7, 27, 54, .18); }
.mp-kachel:focus-visible { outline: 3px solid var(--aqua); outline-offset: 2px; }
.mp-kachel.mp-laeuft { border-left-color: var(--ampel-gruen, var(--green)); background: color-mix(in srgb, var(--ampel-gruen, var(--green)) 28%, white); }
.mp-kachel.mp-geplant { border-left-color: var(--ampel-gelb, var(--fp-gelb)); background: color-mix(in srgb, var(--ampel-gelb, var(--fp-gelb)) 30%, white); }
.mp-kachel.mp-ungeplant { border-left-color: var(--ampel-rot, var(--red)); background: color-mix(in srgb, var(--ampel-rot, var(--red)) 22%, white); }
.mp-kachel.mp-leer, .mp-kachel.mp-keine_schicht { border-left-color: var(--line); color: var(--muted); }
.mp-kachel.mp-gesperrt { opacity: .7; }
.mp-plan .mp-kachel.mp-platziert {
  position: absolute;
  left: calc(var(--mp-x, 0) * 1%);
  top: calc(var(--mp-y, 0) * 1%);
  width: calc(var(--mp-w, 185) * 1px);
}
.mp-plan .mp-kachel.mp-hoehe-fest { height: calc(var(--mp-h, 120) * 1px); overflow: hidden; }
.mp-griff {
  position: absolute; right: 2px; bottom: 2px; width: 16px; height: 16px;
  cursor: nwse-resize; border-right: 3px solid var(--navy); border-bottom: 3px solid var(--navy); border-radius: 0 0 4px 0; opacity: .6;
}
.mp-griff:hover { opacity: 1; }
.mp-standard { position: absolute; right: 22px; bottom: 2px; }
.mp-kachel.mp-ziehbar { cursor: grab; }
.mp-kachel.wird-gezogen { cursor: grabbing; opacity: .85; z-index: 5; }
.mp-kopf { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.mp-code { font-weight: 800; color: var(--navy); font-size: 14px; }
.mp-name { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; font-size: 11.5px; }
.mp-typ { margin-left: auto; font-size: 11px; color: var(--muted); }
.mp-status { font-weight: 700; margin: 2px 0 4px; color: var(--ink); font-size: 11.5px; }
.mp-kachel.mp-ungeplant .mp-status { color: var(--red); }
.mp-kachel.mp-geplant .mp-status { color: var(--amber); }
.mp-kachel.mp-laeuft .mp-status { color: var(--green); }
.mp-laeufe { list-style: none; margin: 0; padding: 0; }
.mp-lauf { border-top: 1px solid var(--line); padding: 3px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-menge { color: var(--muted); }
.mp-lauf-still { color: var(--red); font-weight: 600; }
.mp-lauf.mp-lauf-geplant .mp-lauf-still { color: var(--amber); }
.mp-warnmarke { margin-left: auto; color: var(--red); font-weight: 700; font-size: 12px; }
.mp-lauf-kopf { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mp-lauf-info { color: var(--muted); font-size: 12px; margin-top: 2px; }
.mp-lauf-aktionen, .mp-aktionen { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.mp-still { margin-top: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; }
.mp-lauf.mp-lauf-ungeplant .mp-still strong { color: var(--red); }
.mp-lauf.mp-lauf-geplant .mp-still strong { color: var(--amber); }
.mp-leer-text { margin: 4px 0; color: var(--muted); }
.mp-warnung { margin-top: 6px; color: var(--red); font-weight: 600; font-size: 12.5px; }
.mp-korrigiert td { font-style: italic; }
body.rolle-werker .nur-planer { display: none !important; }
/* Gruppen-Maske */
.mp-maske-status { font-size: 13px; margin: 0 0 8px; }
.mp-maske-status.mp-ungeplant strong { color: var(--red); }
.mp-maske-status.mp-geplant strong { color: var(--amber); }
.mp-maske-status.mp-laeuft strong { color: var(--green); }
.mp-maske-block { background: var(--paper); border-radius: var(--ma-field-radius); padding: 8px 10px; }
.mp-maske-laeufe .mp-lauf { white-space: normal; overflow: visible; padding: 8px 0; }
.mp-maske h3 { margin: 14px 0 6px; }
/* M9: am Handy als Liste, kein freier Plan */
@media (max-width: 767px) {
  .mp-plan { min-height: 0; background: transparent; border: none; overflow: visible; }
  .mp-plan .mp-kachel.mp-platziert { position: static; width: auto; height: auto; overflow: visible; margin-bottom: 10px; }
  .mp-anordnen-label, #mp-anordnen-label { display: none; }
  .mp-kachel { min-width: 0; }
}
