/*
 * Projektauftrag (seit 29.11.2026): Gestaltung des Bausteins
 * src/komponenten/Projektauftrag.astro. Gilt auf der eigenen Seite
 * /projekte/<slug> und eingeklappt in der Projektkarte von Blatt 04.
 * Alle Klassen beginnen mit pb-, Farben und Schriften aus tokens/zeichnung.css.
 */
.pb-desk { background: var(--z-desk); min-height: 100dvh; padding: clamp(10px, 2.5vw, 30px) clamp(8px, 2.5vw, 30px) clamp(30px, 5vw, 64px); box-sizing: border-box; }
.pb-top { max-width: 1180px; margin: 0 auto 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.pb-wort { font-family: var(--z-cond); font-weight: 600; font-size: 20px; text-transform: uppercase; color: var(--z-ink); text-decoration: none; }
.pb-wort span { color: var(--z-amber); }
.pb-back { font-family: var(--z-mono); font-size: 13px; color: var(--z-ink); text-decoration: none; padding: 6px 12px; border: 1.5px solid var(--z-ink); background: var(--z-paper); }
.pb-back:hover { background: var(--z-amber); }

.pb-sheet { max-width: 1180px; margin: 0 auto; position: relative; background-color: var(--z-paper);
  background-image: linear-gradient(var(--z-grid) 1px, transparent 1px), linear-gradient(90deg, var(--z-grid) 1px, transparent 1px);
  background-size: 24px 24px; border: 1.5px solid var(--z-ink); box-shadow: 5px 6px 0 rgba(18,20,23,.14); }
.pb-frame { margin: clamp(8px, 2vw, 20px); border: 1px solid var(--z-ink); padding: clamp(20px, 4vw, 52px) clamp(16px, 4vw, 56px) clamp(18px, 3vw, 34px); }
.pb-eck { position: absolute; width: 16px; height: 16px; border: 1.5px solid var(--z-ink); background: var(--z-paper); }
.pb-eck.tl { top: -8px; left: -8px; } .pb-eck.tr { top: -8px; right: -8px; } .pb-eck.bl { bottom: -8px; left: -8px; } .pb-eck.br { bottom: -8px; right: -8px; }

.pb-mono { font-family: var(--z-mono); font-variant-numeric: tabular-nums; }
.pb-p { font-size: 17px; line-height: 1.7; color: var(--z-ink-2); max-width: 66ch; margin: 14px 0 0; text-wrap: pretty; }

/* Kopf: Name und Leitsatz links, Schriftfeld rechts */
.pb-head { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: end; padding-bottom: clamp(26px, 4vw, 40px); border-bottom: 1.5px solid var(--z-ink); }
.pb-zeichen { font-family: var(--z-mono); font-size: 13px; color: var(--z-muted); margin: 0 0 18px; }
.pb-head .pb-h1 { margin: 0; font-family: var(--z-cond); font-weight: 600; font-size: clamp(46px, 8vw, 96px); line-height: .9; letter-spacing: -.025em; text-transform: uppercase; color: var(--z-ink); }
.pb-head .pb-h1 em { font-style: normal; display: block; font-size: .42em; line-height: 1.1; letter-spacing: -.01em; margin-top: .45em; color: var(--z-ink-2); }
.pb-leit { margin: 22px 0 0; font-size: clamp(19px, 2.1vw, 23px); line-height: 1.45; color: var(--z-ink); max-width: 34ch; text-wrap: balance; }
.pb-sf { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1.5px solid var(--z-ink); border-left: 1.5px solid var(--z-ink); background: var(--z-paper); }
.pb-sf div { padding: 8px 11px 9px; border-right: 1.5px solid var(--z-ink); border-bottom: 1.5px solid var(--z-ink); min-width: 0; }
.pb-sf dt { font-family: var(--z-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--z-muted); }
.pb-sf dd { margin: 3px 0 0; font-size: 14.5px; line-height: 1.35; color: var(--z-ink); overflow-wrap: anywhere; }
.pb-ein { margin: 22px 0 0; padding: 12px 14px; border: 1.5px dashed var(--z-ink); font-size: 14.5px; line-height: 1.55; color: var(--z-ink-2); max-width: 74ch; background: var(--z-paper); }
.pb-ein strong { color: var(--z-ink); }

/* Abschnitte */
.pb-sec { margin-top: clamp(48px, 7vw, 84px); }
.pb-sec > .pb-h2 { margin: 0; font-family: var(--z-cond); font-weight: 600; font-size: clamp(24px, 3.2vw, 36px); text-transform: uppercase; letter-spacing: -.01em; color: var(--z-ink); padding-bottom: 10px; border-bottom: 1.5px solid var(--z-ink); display: flex; align-items: baseline; gap: 6px 14px; flex-wrap: wrap; }
.pb-sec > .pb-h2::before { content: '//'; color: var(--z-amber); }
.pb-sec > .pb-h2 small { margin-left: auto; font-family: var(--z-mono); font-size: 13px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--z-muted); }
.pb-zwei { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 4vw, 56px); margin-top: 8px; }
.pb-zwei .pb-h3 { margin: 22px 0 0; font-family: var(--z-cond); font-weight: 600; font-size: 19px; text-transform: uppercase; color: var(--z-ink); }

/* Maßkette der Ziele */
.pb-mass { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); margin-top: 34px; }
.pb-mass > div { position: relative; padding: 30px 14px 0; text-align: center; border-left: 1px solid var(--z-ink); }
.pb-mass > div:last-child { border-right: 1px solid var(--z-ink); }
.pb-mass > div::before { content: ''; position: absolute; top: 12px; left: 0; right: 0; border-top: 1px solid var(--z-ink); }
.pb-mass > div::after { content: ''; position: absolute; top: 8px; left: -1px; width: 0; height: 0; border-top: 4.5px solid transparent; border-bottom: 4.5px solid transparent; border-left: 9px solid var(--z-ink); }
.pb-mass b { display: block; font-family: var(--z-cond); font-weight: 600; font-size: clamp(34px, 4.6vw, 54px); line-height: 1; color: var(--z-ink); }
.pb-mass span { display: block; margin-top: 8px; font-size: 14.5px; line-height: 1.4; color: var(--z-ink-2); }

/* Stückliste */
.pb-tab { width: 100%; border-collapse: collapse; margin-top: 18px; background: var(--z-paper); }
.pb-tab th, .pb-tab td { border: 1.5px solid var(--z-ink); padding: 11px 14px; text-align: left; vertical-align: top; }
.pb-tab th { font-family: var(--z-mono); font-weight: 400; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--z-muted); background: var(--z-desk); }
.pb-tab td { font-size: 15.5px; line-height: 1.6; color: var(--z-ink-2); }
.pb-tab td.pos { font-family: var(--z-mono); font-variant-numeric: tabular-nums; color: var(--z-ink); width: 3.5em; }
.pb-tab td.ben { font-weight: 600; color: var(--z-ink); width: 28%; }
.pb-tab .stempel { display: inline-block; font-family: var(--z-mono); font-weight: 400; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; padding: 2px 7px; border: 1.5px solid var(--z-ink); color: var(--z-ink); margin-top: 8px; }
.pb-tab .stempel::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--z-ok); margin-right: 7px; vertical-align: 1px; }

/* Schaltbild der Agenten */
.pb-legende { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 16px; font-family: var(--z-mono); font-size: 12.5px; color: var(--z-ink-2); }
.pb-legende i { display: inline-block; width: 22px; height: 13px; vertical-align: -2px; margin-right: 7px; background: var(--z-paper); border: 1.5px solid var(--z-ink); }
.pb-legende i.aus { border-style: dashed; border-color: var(--z-muted); }
.pb-legende i.mensch { background: var(--z-amber); }
.pb-plan { margin-top: 22px; }
.pb-bus { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; }
.pb-knoten { border: 1.5px solid var(--z-ink); background: var(--z-paper); padding: 12px 14px; min-width: 0; }
.pb-knoten.mensch { background: var(--z-amber); }
.pb-knoten.aus { border-style: dashed; border-color: var(--z-muted); background: rgba(247,247,244,.7); }
.pb-knoten b { display: block; font-family: var(--z-cond); font-weight: 600; font-size: 17px; text-transform: uppercase; color: var(--z-ink); }
.pb-knoten span { display: block; margin-top: 4px; font-size: 14px; line-height: 1.45; color: var(--z-ink-2); }
.pb-knoten .st { font-family: var(--z-mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; margin-top: 8px; color: var(--z-ink); }
.pb-knoten .st::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--z-ok); margin-right: 7px; vertical-align: 1px; }
.pb-knoten.aus .st { color: var(--z-muted); }
.pb-knoten.aus .st::before { background: transparent; border: 1.5px solid var(--z-muted); width: 5px; height: 5px; }
.pb-draht { width: clamp(24px, 5vw, 60px); position: relative; }
.pb-draht::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1.5px solid var(--z-ink); }
/* Sammelschiene von der Mitte der ersten bis zur Mitte der letzten Spalte; Abgriff hängt am Orchestrator */
.pb-schiene { height: 18px; margin: 0 calc((100% - 42px) / 8); border-bottom: 1.5px solid var(--z-ink); }
.pb-bus > .pb-knoten:last-child { position: relative; }
.pb-bus > .pb-knoten:last-child::after { content: ''; position: absolute; left: 50%; top: 100%; height: 19.5px; border-left: 1.5px solid var(--z-ink); }
.pb-spalten { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.pb-spalte { padding-top: 0; position: relative; }
.pb-spalte::before { content: ''; position: absolute; left: 50%; top: -14px; height: 14px; border-left: 1.5px solid var(--z-ink); }
.pb-spalte .pb-h3 { margin: 0; padding: 6px 0 10px; text-align: center; background: var(--z-paper); font-family: var(--z-mono); font-weight: 400; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--z-muted); }
.pb-spalte .pb-knoten + .pb-knoten { margin-top: 10px; }
.pb-hinweis { margin: 16px 0 0; font-size: 14px; line-height: 1.6; color: var(--z-muted); max-width: 80ch; }

/* Stromlaufplan der zwölf Schritte */
.pb-lauf { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; counter-reset: s; }
.pb-lauf li { position: relative; padding: 30px 18px 34px 0; border-top: 1.5px solid var(--z-ink); }
.pb-lauf li::before { counter-increment: s; content: counter(s, decimal-leading-zero); position: absolute; top: -12px; left: 0; font-family: var(--z-mono); font-size: 12px; background: var(--z-paper); border: 1.5px solid var(--z-ink); padding: 2px 6px; color: var(--z-ink); }
.pb-lauf li p { margin: 0; font-size: 15.5px; line-height: 1.5; color: var(--z-ink-2); max-width: 30ch; }
.pb-lauf li.frei { border-top-color: var(--z-ink); }
.pb-lauf li.frei::before { background: var(--z-amber); }
.pb-schalter { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-family: var(--z-mono); font-size: 12px; white-space: nowrap; text-transform: uppercase; letter-spacing: .06em; background: var(--z-amber); color: var(--z-ink); padding: 3px 8px 3px 6px; border: 1.5px solid var(--z-ink); }
.pb-schalter .pb-wer { opacity: .75; }
.pb-schalter svg { width: 28px; height: 12px; }

/* Leitplanken */
.pb-planken { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); border-left: 1.5px solid var(--z-ink); border-top: 1.5px solid var(--z-ink); margin-top: 18px; background: var(--z-paper); }
.pb-planke { border-right: 1.5px solid var(--z-ink); border-bottom: 1.5px solid var(--z-ink); padding: 16px 16px 18px; min-width: 0; }
.pb-planke .pb-h3 { margin: 0; font-family: var(--z-cond); font-weight: 600; font-size: 18px; text-transform: uppercase; color: var(--z-ink); }
.pb-planke ul { list-style: none; margin: 10px 0 0; padding: 0; }
.pb-planke li { position: relative; padding-left: 16px; margin-top: 9px; font-size: 14.5px; line-height: 1.5; color: var(--z-ink-2); }
.pb-planke li::before { content: ''; position: absolute; left: 0; top: .62em; width: 7px; height: 7px; background: var(--z-amber); border: 1px solid var(--z-ink); }

/* Infrastruktur und Änderungsvermerk */
.pb-vermerk { margin-top: 22px; border: 1.5px solid var(--z-ink); background: var(--z-paper); }
.pb-vermerk div:first-child { font-family: var(--z-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--z-ink); background: var(--z-amber); padding: 5px 12px; border-bottom: 1.5px solid var(--z-ink); }
.pb-vermerk p { margin: 0; padding: 12px 14px 14px; font-size: 15px; line-height: 1.6; color: var(--z-ink-2); }
.pb-tab.teile td:first-child { font-weight: 600; color: var(--z-ink); width: 30%; }

/* Messprotokoll */
.pb-mess td.wert { font-family: var(--z-cond); font-weight: 600; font-size: 24px; color: var(--z-ink); white-space: nowrap; width: 1%; }
.pb-mess td.q { font-family: var(--z-mono); font-size: 13px; color: var(--z-muted); }
.pb-tab td.prio { font-family: var(--z-mono); color: var(--z-ink); width: 3.5em; }
.pb-tab tr.p0 td.prio { background: var(--z-amber); }

/* Erkenntnis */
.pb-befund { margin-top: clamp(48px, 7vw, 84px); background: var(--z-ink); color: var(--z-paper); padding: clamp(24px, 4vw, 44px); border: 1.5px solid var(--z-ink); }
.pb-befund .pb-h2 { margin: 0; font-family: var(--z-mono); font-weight: 400; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--z-amber); }
.pb-befund p:first-of-type { margin: 16px 0 0; font-family: var(--z-cond); font-weight: 600; font-size: clamp(24px, 3.4vw, 38px); line-height: 1.12; text-transform: uppercase; letter-spacing: -.01em; max-width: 30ch; color: var(--z-paper); text-wrap: balance; }
.pb-befund p { margin: 18px 0 0; font-size: 17px; line-height: 1.7; color: var(--z-muted-dark); max-width: 66ch; }

/* Schriftfeld unten */
.pb-fuss { margin-top: 44px; }
.pb-fuss .pb-sf { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pb-nav { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; font-family: var(--z-mono); font-size: 12px; color: var(--z-muted); }
.pb-nav nav { display: flex; gap: 8px; flex-wrap: wrap; }
.pb-nav a { color: var(--z-ink); text-decoration: none; padding: 4px 9px; border: 1.5px solid var(--z-ink); background: var(--z-paper); }
.pb-nav a:hover { background: var(--z-amber); }

/* Auftritt: die Freigabe-Schalter legen sich einmal um */
@media (prefers-reduced-motion: no-preference) {
  .pb-schalter .hebel { transform-origin: 6px 8px; animation: pbHebel .9s cubic-bezier(.16, 1, .3, 1) .6s both; }
  @keyframes pbHebel { from { transform: rotate(-28deg); } to { transform: rotate(0deg); } }
}

@media (max-width: 900px) {
  .pb-head, .pb-zwei { grid-template-columns: minmax(0, 1fr); }
  .pb-spalten { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pb-spalte::before { display: none; }
  .pb-schiene, .pb-bus > .pb-knoten:last-child::after { display: none; }
  .pb-spalten { margin-top: 18px; }
  .pb-lauf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pb-planken { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pb-mass { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 26px; }
  .pb-mass > div:nth-child(2n) { border-right: 1px solid var(--z-ink); }
}
@media (max-width: 560px) {
  .pb-sec > .pb-h2 { display: block; }
  .pb-sec > .pb-h2::before { content: '// '; }
  .pb-sec > .pb-h2 small { display: block; margin: 6px 0 0; }
  .pb-bus { grid-template-columns: minmax(0, 1fr); }
  .pb-draht { width: auto; height: 18px; }
  .pb-bus > .pb-knoten:last-child::after { display: none; }
  .pb-draht::before { top: 0; bottom: 0; left: 50%; right: auto; border-top: 0; border-left: 1.5px solid var(--z-ink); }
  .pb-spalten, .pb-lauf, .pb-planken { grid-template-columns: minmax(0, 1fr); }
  .pb-sf, .pb-fuss .pb-sf { grid-template-columns: minmax(0, 1fr); }
  .pb-tab thead { display: none; }
  .pb-tab, .pb-tab tbody, .pb-tab tr, .pb-tab td { display: block; width: auto !important; }
  .pb-tab tr { border: 1.5px solid var(--z-ink); border-top: 0; }
  .pb-tab tr:first-child { border-top: 1.5px solid var(--z-ink); }
  .pb-tab td { border: 0; padding: 6px 12px; }
  .pb-tab td:first-child { padding-top: 12px; }
  .pb-tab td:last-child { padding-bottom: 12px; }
  .pb-mess td.wert { white-space: normal; }
}


/* Business Case, Rolle und Technik, Stempel ohne Betrieb */
.pb-klein { font-size: 12.5px; color: var(--z-muted); }
.pb-tab .stempel.aus { border-style: dashed; color: var(--z-ink-2); }
.pb-tab .stempel.aus::before { background: transparent; border: 1.5px solid var(--z-muted); width: 5px; height: 5px; }
.pb-chips { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pb-chips li { font-family: var(--z-mono); font-size: 13px; color: var(--z-ink); padding: 4px 10px; border: 1.5px solid var(--z-ink); background: var(--z-paper); }

/* Lange Wörter (29.11.2026): Überschrift richtet sich nach dem längsten Wort und dem
   verfügbaren Platz (Containerbreite), Fließtext trennt Silben, Namen nie. */
.pb-auftrag { hyphens: auto; overflow-wrap: break-word; }
.pb-head > div { container-type: inline-size; min-width: 0; }
.pb-head .pb-h1 { font-size: min(clamp(46px, 8vw, 96px), calc(100cqi / (var(--wl, 10) * 0.6))); hyphens: manual; overflow-wrap: normal; }
.pb-head .pb-h1 em { font-size: min(calc(100cqi / (var(--wl2, 10) * 0.62)), clamp(18px, 2.6vw, 34px)); hyphens: manual; }
@media (max-width: 560px) {
  .pb-mass b { font-size: clamp(26px, 8vw, 34px); }
}
