/**
 * Projektmappe im Cockpit (Umbau vom frueheren, eigenstaendigen Artifact-Design auf
 * den Stil "Werkstatt" des Cockpits, siehe wiki/code/stil-werkstatt.md und
 * [[salonika-projektmappe-artifact]]). Der Inhalt der Kapitel kommt praktisch
 * unveraendert aus dem frueheren Artifact (projektmappeInhalt.js) mit
 * denselben Klassennamen (.card, .chip, .stepper, .stat, .diagram, ...) --
 * hier wird nur neu eingefaerbt/eingemessen, nicht neu gebaut. Alles unter
 * `.pm` skaliert, damit nichts in den Rest des Cockpits ausblutet (die
 * Klassen .chip/.card/.muted kommen dort mit eigener Bedeutung vor).
 *
 * Farb-/Schrift-Tokens kommen aus ../stil.css (Werkstatt, Tuerkis) --
 * --akzent nur als Flaeche/Kante (nie Text), --akzent-text fuer lesbare
 * farbige Beschriftung, --anzeige (Archivo Black) fuer Ueberschriften,
 * --schrift (Inter) fuer Fliesstext, --mono fuer Codes/Zahlen.
 */

.pm { --pm-taint: color-mix(in srgb, var(--akzent) 14%, transparent); }

.pm .kicker {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--akzent-text); font-weight: 700; margin-bottom: .3rem;
}
.pm h1 {
  font-family: var(--anzeige); font-weight: 400; font-size: 1.35rem; margin: 0 0 .35rem;
}
.pm .lede { font-size: .96rem; color: var(--still); max-width: 62ch; margin: 0 0 1.6rem; }
.pm h2.h { font-family: var(--anzeige); font-weight: 400; font-size: 1.1rem; margin: 2.1rem 0 .7rem; scroll-margin-top: 20px; }
.pm h2.h:first-of-type { margin-top: 0; }
.pm h3.h3 { font-size: .9rem; font-weight: 700; margin: 1.2rem 0 .45rem; }
.pm p { margin: 0 0 .7rem; max-width: 70ch; }
.pm .muted { color: var(--still); }
.pm code, .pm .mono, .pm .num { font-family: var(--mono); }
.pm .num { font-variant-numeric: tabular-nums; }
.pm a { color: var(--akzent-text); }

/* ---------- stat tiles ---------- */
.pm .stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; margin-bottom: .5rem; }
.pm .stat { background: var(--karte); border: 1px solid var(--linie); border-radius: 10px; padding: .8rem .95rem; }
.pm .stat .v { font-family: var(--anzeige); font-weight: 400; font-size: 1.4rem; color: var(--akzent-text); }
.pm .stat .l { font-size: .74rem; color: var(--still); margin-top: .1rem; }
@media (max-width: 820px) { .pm .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- chips / status (eigene Varianten, .chip selbst kollidiert
   bewusst nicht mit der Cockpit-weiten .chip-Grundregel, weil hier
   .done/.partial/.open/.neutral je eine eigene Farbe brauchen) ---------- */
.pm .chip {
  display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 700;
  padding: .15rem .55rem; border-radius: 999px; white-space: nowrap; line-height: 1.5;
}
.pm .chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.pm .chip.done { background: color-mix(in srgb, var(--gut) 16%, transparent); color: var(--gut); }
.pm .chip.partial { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.pm .chip.open { background: color-mix(in srgb, var(--schlecht) 16%, transparent); color: var(--schlecht); }
.pm .chip.neutral { background: color-mix(in srgb, var(--still) 18%, transparent); color: var(--still); }

.pm .card { background: var(--karte); border: 1px solid var(--linie); border-radius: 10px; padding: 1.1rem 1.25rem; position: relative; }
.pm .callout {
  border: 1px solid var(--linie); border-left: 3px solid var(--akzent); background: var(--pm-taint);
  border-radius: 8px; padding: .85rem 1.1rem; margin: 1rem 0;
}
.pm .callout.warn { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.pm .callout.gate { border-left-color: var(--schlecht); background: color-mix(in srgb, var(--schlecht) 8%, transparent); }
.pm .callout p:last-child { margin-bottom: 0; }
.pm .callout .t { font-weight: 700; margin-bottom: .25rem; }

/* ---------- tables ---------- */
.pm .twrap { overflow-x: auto; border: 1px solid var(--linie); border-radius: 10px; margin: .9rem 0 1.4rem; }
.pm .twrap table { margin: 0; }
.pm table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.pm th, .pm td { text-align: left; padding: .55rem .75rem; border-bottom: 1px solid var(--linie); vertical-align: top; }
.pm thead th { background: var(--seite); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--still); font-weight: 700; }
.pm tbody tr:last-child td { border-bottom: none; }
.pm td.num, .pm th.num { text-align: right; font-family: var(--mono); }
.pm tbody tr:hover { background: var(--seite); }

/* ---------- module map (architecture) ---------- */
.pm .modgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; margin: .9rem 0 .5rem; }
@media (max-width: 820px) { .pm .modgrid { grid-template-columns: 1fr 1fr; } }
.pm .modgroup { border: 1px solid var(--linie); border-radius: 10px; padding: .75rem .9rem; background: var(--karte); }
.pm .modgroup .gt { font-size: .74rem; font-weight: 700; color: var(--akzent-text); margin-bottom: .4rem; }
.pm .modgroup ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: .3rem; }
.pm .modgroup li { font-family: var(--mono); font-size: .72rem; background: var(--seite); color: var(--text); padding: .1rem .45rem; border-radius: 5px; }

/* ---------- figures / diagrams ---------- */
.pm figure { margin: 1.1rem 0 1.6rem; }
.pm .diagram { overflow-x: auto; border: 1px solid var(--linie); border-radius: 10px; background: var(--karte); padding: .6rem; }
.pm .diagram svg { display: block; margin: 0 auto; min-width: 560px; }
.pm .diagram text { font-family: var(--mono); fill: currentColor; }
.pm .dia-ink { color: var(--text); }
.pm .dia-soft { color: var(--text); }
.pm .dia-muted { color: var(--still); }
.pm .dia-line { color: var(--linie); }
.pm .dia-accent { color: var(--akzent); }
.pm .dia-accent-strong { color: var(--akzent-text); }
.pm .dia-good { color: var(--gut); }
.pm .dia-bad { color: var(--schlecht); }
.pm .dia-fill-surface { fill: var(--karte); }
.pm .dia-fill-soft { fill: var(--pm-taint); }
.pm .dia-fill-mono { fill: var(--seite); }
.pm figcaption { font-size: .78rem; color: var(--still); margin-top: .5rem; max-width: 70ch; }

/* ---------- roadmap stepper ---------- */
.pm .stepper { display: flex; flex-direction: column; gap: 0; margin: 1rem 0 .5rem; }
.pm .step { display: grid; grid-template-columns: 34px 1fr; gap: .85rem; position: relative; }
.pm .step .dot-col { display: flex; flex-direction: column; align-items: center; }
.pm .step .dot {
  width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: .68rem; font-weight: 700; border: 2px solid var(--linie);
  background: var(--karte); color: var(--still); flex: none;
}
.pm .step .stem { width: 2px; flex: 1; background: var(--linie); margin-top: .1rem; min-height: 18px; }
.pm .step:last-child .stem { display: none; }
.pm .step.done .dot { background: var(--gut); border-color: var(--gut); color: #fff; }
.pm .step.partial .dot { background: color-mix(in srgb, var(--warn) 18%, transparent); border-color: var(--warn); color: var(--warn); }
.pm .step.open .dot { border-color: var(--linie); color: var(--still); }
.pm .step .body { padding-bottom: 1.35rem; position: relative; }
.pm .step .head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .2rem; cursor: pointer; user-select: none; }
.pm .step .head:focus-visible { outline: 2px solid var(--akzent); outline-offset: 3px; border-radius: 4px; }
.pm .step .ttl { font-weight: 700; font-size: .9rem; }
.pm .step .desc { font-size: .84rem; color: var(--still); max-width: 64ch; }
.pm .step .chev { margin-left: auto; flex: none; font-size: .8em; color: var(--still); transition: transform .12s ease; }
.pm .step.is-collapsed .chev { transform: rotate(-90deg); }
.pm .step.is-collapsed .body { padding-bottom: .6rem; }
.pm .step.is-collapsed .body > *:not(.head) { display: none; }
.pm .step .promptbtn { margin-top: .6rem; }

/* ---------- Ausklappen: Kurzstand sichtbar, Ausfuehrliches auf Klick ---------- */
.pm details { margin-top: .5rem; }
.pm details > summary {
  cursor: pointer; color: var(--akzent-text); font-size: .78rem; font-weight: 700; list-style: none;
  display: inline-flex; align-items: center; gap: .35rem; padding: .1rem 0;
}
.pm details > summary::-webkit-details-marker { display: none; }
.pm details > summary::before { content: "▸"; font-size: .85em; transition: transform .12s ease; }
.pm details[open] > summary::before { transform: rotate(90deg); }
.pm details > summary:hover { text-decoration: underline; }
.pm details > summary:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; border-radius: 3px; }
.pm details > :not(summary) { margin-top: .5rem; }
.pm details > p:last-child { margin-bottom: 0; }
.pm .step .desc details { max-width: none; }
.pm .hist-detail { font-size: inherit; }

/* ---------- viz: cost stacked bars ---------- */
.pm .viz { margin: 1rem 0 .4rem; --viz-1: #2a78d6; --viz-2: #eb6834; --viz-3: #1baf7a; --viz-4: #eda100; --viz-5: #e87ba4; }
.pm .viz-track { display: flex; flex-direction: column; gap: .85rem; }
.pm .viz-row { display: grid; grid-template-columns: 96px 1fr 64px; align-items: center; gap: .6rem; }
.pm .viz-row .rl { font-size: .78rem; color: var(--still); text-align: right; }
.pm .viz-bar-track { background: var(--seite); border-radius: 5px; height: 26px; position: relative; }
.pm .viz-bar { height: 26px; border-radius: 5px; display: flex; overflow: hidden; }
.pm .viz-seg { height: 100%; }
.pm .viz-row .rv { font-family: var(--mono); font-size: .8rem; font-weight: 700; text-align: right; }
.pm .viz-legend { display: flex; flex-wrap: wrap; gap: .85rem; margin: .85rem 0 .25rem; font-size: .74rem; color: var(--still); }
.pm .viz-legend .lg { display: inline-flex; align-items: center; gap: .35rem; }
.pm .viz-legend .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }

/* ---------- viz: margin columns ---------- */
.pm .margin-chart { display: flex; align-items: flex-end; gap: 1.3rem; height: 100px; margin: 1.8rem .25rem .4rem; padding: 0 .4rem; }
.pm .mcol { display: flex; flex-direction: column; align-items: center; flex: 1; }
.pm .mcol .val { font-family: var(--mono); font-size: .74rem; font-weight: 700; margin-bottom: .25rem; }
.pm .mcol .bararea { width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100px; }
.pm .mcol .bar { width: 56%; border-radius: 4px 4px 0 0; background: var(--gut); }
.pm .mcol.neg .bararea { justify-content: flex-start; }
.pm .mcol.neg .bar { border-radius: 0 0 4px 4px; background: var(--schlecht); }
.pm .mcol .name { margin-top: .5rem; font-size: .74rem; color: var(--still); text-align: center; }
.pm .baseline { position: relative; }
.pm .baseline::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--linie); }

/* ---------- viz: diverging horizontal margin bars in Tabellenzelle ---------- */
.pm .db-cell { min-width: 210px; }
.pm .db-track { display: flex; align-items: stretch; height: 22px; }
.pm .db-neg-zone { flex: 0 0 58px; background: var(--seite); border-radius: 5px 0 0 5px; display: flex; overflow: hidden; }
.pm .db-zero { flex: 0 0 2px; background: var(--linie); }
.pm .db-pos-zone { flex: 1 1 auto; background: var(--seite); border-radius: 0 5px 5px 0; overflow: hidden; }
.pm .db-fill { height: 100%; display: flex; align-items: center; box-sizing: border-box; }
.pm .db-fill.neg { width: 100%; justify-content: center; background: var(--schlecht); border-radius: 5px 0 0 5px; }
.pm .db-pos-zone .db-fill { justify-content: flex-end; padding-right: .45rem; background: var(--gut); border-radius: 0 5px 5px 0; }
.pm .db-lbl { font-family: var(--mono); font-size: .68rem; font-weight: 700; color: #fff; white-space: nowrap; }

.pm .pill-row { display: flex; gap: .4rem; flex-wrap: wrap; }

/* ---------- Prompt-kopieren-Knoepfe ---------- */
.pm .promptbtn {
  display: inline-flex; align-items: center; gap: .4rem; font-family: var(--mono);
  font-size: .72rem; font-weight: 700; padding: .4rem .7rem; border-radius: 7px; cursor: pointer;
  border: 1px solid var(--linie); background: var(--karte); color: var(--akzent-text); width: auto;
  line-height: 1.3; transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.pm .promptbtn:hover { background: var(--pm-taint); border-color: var(--akzent); }
.pm .promptbtn:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
.pm .promptbtn.copied { background: color-mix(in srgb, var(--gut) 14%, transparent); border-color: var(--gut); color: var(--gut); }
.pm .promptbtn svg { flex: none; }
.pm .card .promptbtn { margin-top: .75rem; }
.pm .promptbtn.row { padding: .3rem .35rem; border-radius: 6px; }
.pm td.promptcell { text-align: center; white-space: nowrap; }
.pm .promptbtn.corner { position: absolute; top: .75rem; right: .75rem; padding: .35rem; border-radius: 7px; }

.pm .footnote { font-size: .74rem; color: var(--still); margin-top: 3.2rem; padding-top: 1rem; border-top: 1px solid var(--linie); }

/* ---------- hardware matrix ---------- */
.pm .hwmatrix {
  display: grid; grid-template-columns: 168px repeat(3, 1fr); gap: 1px;
  background: var(--linie); border: 1px solid var(--linie); border-radius: 10px; overflow: hidden; margin: 1rem 0 .5rem;
}
.pm .hwmatrix .hwc { background: var(--karte); padding: .75rem .8rem; min-height: 30px; }
.pm .hwmatrix .hwc.head { background: var(--seite); font-weight: 700; font-size: .8rem; color: var(--text); display: flex; align-items: center; }
.pm .hwmatrix .hwc.rowlabel { background: var(--seite); font-weight: 700; font-size: .76rem; color: var(--still); display: flex; align-items: center; }
.pm .hwmatrix .hwc.cell { display: flex; flex-direction: column; gap: .35rem; }
.pm .hwmatrix .hwc.cell .top { display: flex; align-items: center; gap: .5rem; }
.pm .hwmatrix .hwc.cell .txt { font-size: .74rem; color: var(--still); line-height: 1.4; }
.pm .hwmatrix .hwc.cell .price { font-family: var(--mono); font-size: .74rem; font-weight: 700; color: var(--text); }
.pm .hwmatrix .hwc.cell .photobox {
  width: 100%; height: 74px; display: flex; align-items: center; justify-content: center;
  background: var(--seite); border: 1px solid var(--linie); border-radius: 6px; overflow: hidden;
}
.pm .hwmatrix .hwc.cell .photobox img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.pm .hwmatrix .hwc.cell.empty { display: flex; align-items: center; justify-content: center; color: var(--still); font-size: 1rem; min-height: 64px; }
@media (max-width: 820px) {
  .pm .hwmatrix { grid-template-columns: 120px repeat(3, 1fr); font-size: .74rem; }
  .pm .hwmatrix .hwc { padding: .55rem .5rem; }
  .pm .hwmatrix .hwc.cell .photobox { height: 56px; }
}
