/* Planspiel: ergänzt app.css (gleiche Farb-Tokens) */
.planspiel #panel.ps-panel { left: auto; right: 12px; width: 430px; }
.planspiel h2 { font-size: 15px; margin: 4px 0 0; }
.planspiel h3 { font-size: 14px; margin: 12px 0 4px; }
.planspiel .panel-head p { margin: 2px 0 0; }

.ps-grow { flex: 1; }
.ps-inline { flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink); }

.ps-area-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--chip); }
.ps-area-bar span { display: block; height: 100%; border-right: 1px solid var(--surface); }
.ps-area p { margin: 4px 0 0; font-size: 12px; }

.ps-stepper { display: inline-flex; align-items: center; gap: 4px; }
.ps-stepper output { min-width: 52px; text-align: center; font-weight: 600; color: var(--ink); }
.ps-stepper .icon-btn { min-width: 30px; padding: 4px 8px; }
.ps-stepper .icon-btn[disabled] { opacity: .35; cursor: not-allowed; }

.ps-uses { display: flex; flex-direction: column; gap: 8px; }
.ps-use { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.ps-use-head { display: flex; align-items: center; gap: 8px; }
.ps-use-head strong { flex: 1; font-size: 14px; }
.ps-use-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ps-use-row select { padding: 4px 6px; font-size: 13px; }
.ps-use-row .muted { font-size: 12px; }
.ps-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.ps-del { min-width: 28px; padding: 2px 6px; }

.ps-checks { display: flex; flex-direction: column; gap: 4px; }
.ps-checks label { flex-direction: row; align-items: center; gap: 6px; color: var(--ink); font-size: 14px; }
.ps-split { font-size: 12px; }
input[type=range] { accent-color: var(--accent); }

.ps-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ps-kpis > div { background: var(--chip); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.ps-kpis .muted { font-size: 11.5px; line-height: 1.3; }
.ps-k { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ps-warn { color: #b42318; }
@media (prefers-color-scheme: dark) { .ps-warn { color: #ff8a80; } }

.ps-chart { margin: 0; }
.ps-chart canvas { width: 100%; height: 150px; display: block; cursor: pointer; }
.ps-chart figcaption { font-size: 11.5px; margin-top: 2px; }

.ps-compare table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.ps-compare caption { text-align: left; font-weight: 600; margin-bottom: 4px; }
.ps-compare th, .ps-compare td { padding: 3px 6px; border-bottom: 1px solid var(--line); text-align: right; }
.ps-compare th:first-child { text-align: left; font-weight: 500; color: var(--muted); }
.ps-compare .ps-better { color: #15803d; font-weight: 600; }
@media (prefers-color-scheme: dark) { .ps-compare .ps-better { color: #4ade80; } }
.ps-compare p { font-size: 11.5px; margin: 4px 0 0; }

.ps-assumptions summary { cursor: pointer; font-weight: 600; }
.ps-assumptions p { font-size: 13px; }
.ps-ass-use { border-top: 1px solid var(--line); padding: 6px 0; }
.ps-ass-use summary { font-weight: 400; font-size: 13px; }
.ps-dirs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; margin: 6px 0; }
.ps-dirs label { flex-direction: row; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; }
.ps-dirs input { width: 58px; padding: 3px 5px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; }

@media (max-width: 760px) {
  .planspiel #panel.ps-panel { top: auto; bottom: 0; left: 0; right: 0; width: auto; max-height: 70%; border-radius: 14px 14px 0 0; }
}

/* --- Zwei Karten nebeneinander (links Heute, rechts Mit Planung) --- */
.ps-maps { position: fixed; top: 0; bottom: 0; left: 0; right: 454px; display: flex; gap: 6px; background: var(--line); }
.ps-mapbox { position: relative; flex: 1; min-width: 0; }
.ps-map { position: absolute; inset: 0; }
.ps-maplabel {
  position: absolute; z-index: 500; top: 8px; left: 50px; right: 8px; pointer-events: none;
  font-size: 13px; color: var(--ink);
}
.ps-maplabel strong, .ps-maplabel span {
  display: inline-block; background: var(--surface); padding: 3px 8px; border-radius: 6px; box-shadow: 0 1px 4px rgba(0,0,0,.18);
}
.ps-maplabel span { font-size: 12px; color: var(--muted); margin-top: 3px; }
.ps-mapswitch { display: none; }

.ps-legend-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ps-legend-cols ul { grid-template-columns: 1fr; }
.ps-legend-sub { font-size: 12px; font-weight: 600; margin: 0 0 4px; color: var(--muted); }

.ps-hotspots ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.ps-hot {
  display: flex; flex-direction: column; gap: 1px; width: 100%; text-align: left;
  background: var(--chip); color: var(--ink); font-weight: 400; font-size: 13px; padding: 6px 8px;
}
.ps-hot strong { font-size: 13.5px; }
.ps-hot .muted { font-size: 12px; }
.ps-actions { gap: 6px; }
.ps-actions button { font-size: 13px; padding: 7px 10px; }

@media (max-width: 760px) {
  .ps-maps { right: 0; }
  .ps-mapbox { display: none; }
  .show-now #boxNow, .show-plan #boxPlan { display: block; }
  .ps-mapswitch {
    display: flex; position: absolute; z-index: 600; top: 8px; right: 8px; background: var(--surface);
    border-radius: 8px; padding: 3px; box-shadow: 0 1px 4px rgba(0,0,0,.2);
  }
  .ps-mapswitch button { background: transparent; color: var(--muted); padding: 5px 10px; font-size: 13px; }
  .ps-mapswitch button[aria-pressed=true] { background: var(--accent); color: var(--accent-ink); }
  .ps-maplabel { left: 50px; right: 150px; }
  .ps-legend-cols { grid-template-columns: 1fr; }
}

/* --- Steckbrief (nur beim Drucken sichtbar) --- */
#printArea { display: none; }
@media print {
  @page { size: A4 portrait; margin: 12mm; }
  body > *:not(#printArea) { display: none !important; }
  html, body { height: auto; background: #fff; }
  #printArea { display: block; color: #111; font: 10.5pt/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
  #printArea h1 { font-size: 16pt; margin: 0 0 2px; }
  #printArea h2 { font-size: 11.5pt; margin: 10px 0 4px; }
  #printArea .pa-sub { margin: 0 0 6px; color: #444; }
  #printArea img { width: 100%; height: auto; max-height: 165mm; object-fit: contain; border: 1px solid #ccc; }
  #printArea img.pa-chart { max-height: 45mm; object-fit: contain; }
  #printArea table { border-collapse: collapse; width: 100%; font-size: 9.5pt; }
  #printArea th, #printArea td { border-bottom: 1px solid #ddd; padding: 2px 4px; text-align: left; vertical-align: top; }
  #printArea .pa-kpi th { width: 55%; font-weight: 500; color: #333; }
  #printArea .pa-note { font-size: 8.5pt; color: #444; }
  #printArea ol { margin: 0; padding-left: 18px; }
}

/* Rechenweg je Nutzung */
.ps-herl { width: 100%; border-collapse: collapse; font-size: 12px; margin: 6px 0; font-variant-numeric: tabular-nums; }
.ps-herl caption { text-align: left; font-weight: 600; font-size: 12px; margin-bottom: 2px; }
.ps-herl th { text-align: left; font-weight: 500; padding: 3px 6px 3px 0; border-bottom: 1px solid var(--line); }
.ps-herl th span { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; }
.ps-herl td { text-align: right; vertical-align: top; padding: 3px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ps-herl-sum th, .ps-herl-sum td { font-weight: 700; border-bottom: 0; }
.ps-dirs-title { font-size: 12px; font-weight: 600; margin: 8px 0 0; }
.ps-sources { font-size: 12px; padding-left: 18px; margin: 4px 0; }

/* Speichern & Teilen gut sichtbar direkt unter "3. Ergebnis" */
.ps-export { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.ps-export button { font-size: 13px; padding: 8px 6px; white-space: nowrap; }
@media (max-width: 420px) { .ps-export { grid-template-columns: 1fr 1fr; } }

/* Fußleiste des Bedienfelds: Speichern/Teilen immer sichtbar */
.ps-foot { flex-direction: column; align-items: stretch; gap: 6px; padding-top: 10px; }
.ps-foot > span { font-size: 12px; }
.ps-share-info { margin: 0; font-size: 12px; }
.ps-share-info:empty { display: none; }
/* Eingeklapptes Bedienfeld (Handy): Fußleiste trotzdem zeigen */
.planspiel #panel.collapsed .panel-foot { display: flex; }

/* Meine Varianten (im Browser gespeichert) + Hinweis "wiederhergestellt" */
.ps-saved { display: flex; flex-direction: column; gap: 6px; }
.ps-saved-row { display: flex; gap: 6px; align-items: center; }
.ps-saved-row select, .ps-saved-row input { flex: 1; min-width: 0; padding: 6px 8px; font-size: 13px; }
.ps-saved-row .icon-btn { min-width: 32px; padding: 5px 7px; }
.ps-saved-row .icon-btn[disabled], .ps-saved-row select[disabled] { opacity: .45; cursor: not-allowed; }
.ps-saved-row > button:not(.icon-btn) { font-size: 13px; padding: 6px 10px; }
.ps-saved-info { margin: 0; font-size: 12px; }
.ps-saved-info:empty { display: none; }
.ps-note { margin: 0; padding: 6px 10px; border-radius: 8px; background: var(--chip); font-size: 12.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ps-note[hidden] { display: none; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; font-size: 12.5px; text-decoration: underline; cursor: pointer; }
.ps-note .link-btn:last-child { margin-left: auto; text-decoration: none; color: var(--muted); }
.ps-saved-row[hidden] { display: none; }
