/* Catalyst-Demo: ergänzt kit.css um Rohdaten-Zeilen, Pipeline und Ergebnisansicht. */

.pd-honest { margin-top: 28px; max-width: 820px; background: var(--white); }
.pd-honest p { margin: 0; color: var(--ink); }
.pd-honest strong { font-weight: 500; }
.pd-link { display: inline-block; margin-left: 4px; color: var(--signal-ink); font-weight: 500; text-underline-offset: 3px; }
.pd-link:hover { color: var(--ink); }

.pd { padding-top: 8px; }
.pd-sec-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 16px; }
.pd-sec-head-tight { margin-bottom: 10px; }
.pd-step { font-family: var(--mono); font-size: 12px; color: var(--ink-3); letter-spacing: 0.06em; }
.pd-sec-aside { flex-basis: 100%; }
@media (min-width: 760px) { .pd-sec-aside { flex-basis: auto; margin-left: auto; } }

/* ---------- 01 Rohdaten ---------- */
.pd-rows { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) { .pd-rows { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .pd-rows { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pd-row {
  position: relative; display: flex; flex-direction: column; gap: 10px; width: 100%; padding: 14px 16px 14px; text-align: left;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--sheet); cursor: pointer;
  transition: border-color .2s, background-color .2s, box-shadow .25s, transform .25s var(--ease);
}
.pd-row:hover { border-color: rgba(18, 18, 17, 0.35); background: var(--white); }
.pd-row:active { transform: translateY(1px); }
.pd-row[aria-pressed="true"] { border-color: var(--ink); background: var(--white); box-shadow: inset 0 0 0 1px var(--ink), var(--shadow-sm); }
.pd-row-head { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.pd-row-no { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.pd-row-branch { font-weight: 500; color: var(--ink); }
.pd-row-src { margin-left: auto; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); text-align: right; }
.pd-row-raw { display: block; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; color: var(--ink-2); overflow-wrap: anywhere; word-break: break-word; }
.pd-row-go { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); transition: color .2s; }
.pd-row:hover .pd-row-go, .pd-row[aria-pressed="true"] .pd-row-go { color: var(--ink); }
.pd-row:hover .pd-row-go .arrow { transform: translateX(3px); }
.pd-row-go .arrow { transition: transform .35s var(--ease); }
.pd-go-on { display: none; align-items: center; gap: 7px; }
.pd-go-on::before { content: ""; width: 7px; height: 7px; border-radius: 99px; background: var(--signal); }
.pd-row[aria-pressed="true"] .pd-go-on { display: inline-flex; }
.pd-row[aria-pressed="true"] .pd-go-idle { display: none; }

/* ---------- Raster ---------- */
.pd-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-items: start; margin-top: 28px; }
@media (min-width: 1000px) {
  .pd-grid { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 24px; }
  .pd-pipe-card { position: sticky; top: 84px; }
}

/* ---------- 02 Pipeline ---------- */
.pd-pipe-card { padding: 22px 22px 18px; }
.pd-pipe-status { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); min-height: 22px; }
.pd-state-dot { width: 7px; height: 7px; border-radius: 99px; background: var(--line); flex-shrink: 0; }
.pd-pipe-status[data-state="run"] .pd-state-dot { background: var(--signal); animation: pd-blink 1s ease-in-out infinite alternate; }
.pd-pipe-status[data-state="done"] .pd-state-dot { background: var(--ok); }
@keyframes pd-blink { from { opacity: 1; } to { opacity: .3; } }

.pd-pipe { list-style: none; margin: 0; padding: 0; }
.pd-mod { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding-bottom: 14px; }
.pd-mod:last-child { padding-bottom: 4px; }
.pd-mod::before { content: ""; position: absolute; left: 13.5px; top: 30px; bottom: 2px; width: 1px; background: var(--line); }
.pd-mod:last-child::before { display: none; }
.pd-mod[data-state="done"]::before { background: var(--ink); }
.pd-mod-icon {
  position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  border-radius: 99px; border: 1px solid var(--line); background: var(--sheet); font-family: var(--mono); font-size: 11.5px; color: var(--ink-3);
  transition: background-color .25s, border-color .25s, color .25s;
}
.pd-mod[data-state="run"] .pd-mod-icon { border-color: var(--ink); color: var(--ink); }
.pd-mod[data-state="run"] .pd-mod-icon::after { content: ""; position: absolute; inset: -4px; border-radius: 99px; border: 1.5px solid transparent; border-top-color: var(--signal); animation: kit-spin .9s linear infinite; }
.pd-mod[data-state="done"] .pd-mod-icon { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.pd-mod[data-state="done"] .pd-mod-num { display: none; }
.pd-mod[data-state="done"] .pd-mod-icon::before { content: ""; width: 9px; height: 5px; border-left: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: translateY(-1px) rotate(-45deg); }
.pd-mod-body { display: flex; flex-direction: column; min-width: 0; padding-top: 3px; }
.pd-mod-name { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 500; color: var(--ink-2); line-height: 1.3; }
.pd-mod[data-state="run"] .pd-mod-name, .pd-mod[data-state="done"] .pd-mod-name { color: var(--ink); }
.pd-mod-desc { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.pd-bar { position: relative; display: block; height: 2px; margin-top: 8px; border-radius: 99px; background: var(--line-soft); overflow: hidden; }
.pd-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--ink); transition-property: width; transition-timing-function: cubic-bezier(.45, .05, .35, 1); }
.pd-mod[data-state="done"] .pd-bar { display: none; }
.pd-mod-res { font-family: var(--mono); font-size: 11.5px; color: var(--ok); margin-top: 4px; line-height: 1.45; }
.pd-mod-res:empty { display: none; }
.pd-pro { height: 20px; padding: 0 7px; font-size: 10.5px; font-family: var(--mono); letter-spacing: 0.04em; }
.pd-pipe-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
@media (min-width: 1000px) { .pd-goto { display: none !important; } }
.pd-result:focus { outline: none; }
.pd-pipe-actions:not(:has(:not([hidden]))) { display: none; }

/* ---------- 03 Ergebnis ---------- */
.pd-result { padding: 22px 20px 26px; min-height: 420px; }
@media (min-width: 768px) { .pd-result { padding: 28px 32px 34px; } }
.pd-res-head { margin-bottom: 8px; align-items: center; }
.pd-export { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.pd-export[hidden] { display: none; }

.pd-empty { display: grid; place-items: center; gap: 18px; padding: 56px 16px 40px; text-align: center; color: var(--ink-3); font-size: 14.5px; }
.pd-empty p { margin: 0; max-width: 36ch; }
.pd-empty-art { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pd-empty-art span { font-family: var(--mono); font-size: 12px; padding: 6px 10px; border: 1px dashed var(--line); border-radius: 8px; color: var(--ink-3); background: var(--paper); }
.pd-empty-art span:nth-child(2) { transform: rotate(-3deg); }
.pd-empty-art span:nth-child(3) { transform: rotate(2deg); }

.pd-block { padding-top: 22px; margin-top: 22px; border-top: 1px solid var(--line-soft); }
.pd-block:first-child { margin-top: 10px; }
.pd-label { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin: 0 0 12px; font-family: var(--mono); font-size: 12px; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.pd-label-note { text-transform: none; letter-spacing: 0; font-family: var(--font); font-size: 12.5px; color: var(--ink-3); }
.pd-label .pd-pro { text-transform: none; }

/* Normalisierung */
.pd-raw { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; background: var(--ink); color: rgba(243, 242, 238, 0.72); font-family: var(--mono); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.pd-raw mark { background: transparent; color: var(--paper); box-shadow: inset 0 -1.5px 0 var(--signal); padding: 0 1px; }
.pd-sep { color: rgba(243, 242, 238, 0.4); }
.pd-norm { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px 18px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .pd-norm { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pd-norm li { display: flex; align-items: baseline; gap: 8px; min-width: 0; font-size: 14px; padding: 5px 0; border-bottom: 1px dashed var(--line-soft); }
.pd-norm code { font-family: var(--mono); font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.pd-arrow { color: var(--ink-3); font-size: 12px; }
.pd-norm li > span:last-child { color: var(--ink); overflow-wrap: anywhere; }

/* Kategorie */
.pd-crumbs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 0; }
.pd-crumbs li { display: inline-flex; align-items: center; font-size: 15px; color: var(--ink-2); }
.pd-crumbs li + li::before { content: "›"; margin: 0 10px; color: var(--ink-3); }
.pd-crumbs li.is-leaf > span:first-child { padding: 4px 12px; border-radius: 99px; background: var(--ink); color: var(--paper); font-weight: 500; }
.pd-leaf-tag { margin-left: 8px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--signal-ink); }

/* Merkmale */
.pd-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px 0 12px; }
.pd-legend[hidden] { display: none; }
.pd-table-wrap { border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--white); overflow: hidden; }
.pd-table th[scope="row"] { font-weight: 500; font-size: 14px; color: var(--ink); background: transparent; white-space: normal; text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.pd-table td { vertical-align: top; }
.pd-table tr:last-child th[scope="row"] { border-bottom: 0; }
.pd-src { font-family: var(--mono); font-size: 12px; padding: 2px 7px; border-radius: 6px; background: var(--paper); color: var(--ink-2); white-space: nowrap; }
.pd-missing { font-style: italic; color: var(--err); }
.pd-conf { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.pd-conf-bar { position: relative; width: 44px; height: 4px; border-radius: 99px; background: var(--paper-2); overflow: hidden; }
.pd-conf-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink); border-radius: 99px; }
.pd-conf.is-low .pd-conf-bar i { background: var(--warn); }
.pd-conf.is-low .num { color: var(--warn); }
.pd-check { min-width: 170px; }
.pd-wait { font-size: 12.5px; color: var(--ink-3); }
.pd-verdict { display: none; flex-direction: column; align-items: flex-start; gap: 4px; }
.is-checked .pd-wait { display: none; }
.is-checked .pd-verdict { display: flex; animation: kit-in .5s var(--ease) both; }
.pd-note { font-size: 12.5px; color: var(--ink-3); line-height: 1.45; }
.is-checked .pd-attr.is-fehlt { background: rgba(179, 38, 30, 0.03); }
.is-checked .pd-attr.is-unsicher { background: rgba(245, 165, 36, 0.05); }

@media (max-width: 759px) {
  .pd-table thead { display: none; }
  .pd-table, .pd-table tbody { display: block; width: 100%; }
  .pd-table tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "k k" "v v" "src conf" "chk chk";
    gap: 4px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft);
  }
  .pd-table tr:last-child { border-bottom: 0; }
  .pd-table th[scope="row"] { grid-area: k; padding: 0; border: 0; font-family: var(--mono); font-size: 10.5px; font-weight: 400; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
  .pd-table td { padding: 0; border: 0; min-width: 0; }
  .pd-table td[data-label="Wert"] { grid-area: v; font-size: 15.5px; font-weight: 500; }
  .pd-table td[data-label="Quelle"] { grid-area: src; align-self: center; font-size: 13px; }
  .pd-table td[data-label="Konfidenz"] { grid-area: conf; align-self: center; }
  .pd-table td.pd-check { grid-area: chk; min-width: 0; margin-top: 4px; }
  .pd-src { white-space: normal; overflow-wrap: anywhere; }
}

/* Titel und Beschreibung */
.pd-title { margin: 0; font-size: clamp(1.3rem, 2.4vw, 1.6rem); font-weight: 500; letter-spacing: -0.025em; line-height: 1.25; }
.pd-title-meta { margin: 8px 0 18px; }
.pd-tabs { align-items: flex-end; }
.pd-copy { margin-left: auto; align-self: center; border: 0; background: none; padding: 4px 6px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; white-space: nowrap; }
.pd-copy:hover { color: var(--ink); }
.pd-panel { margin-top: 14px; }
.pd-panel:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.pd-preview { padding: 16px 18px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--sheet); font-size: 15px; color: var(--ink-2); line-height: 1.65; }
.pd-preview p { margin: 0 0 10px; color: var(--ink); }
.pd-preview ul { margin: 0; padding-left: 20px; }
.pd-preview li { margin: 2px 0; }
.pd-code { margin: 0; padding: 14px 16px; border-radius: var(--radius); background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: 12.5px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Bullet Points */
.pd-bullets { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pd-bullets li { position: relative; padding: 10px 14px 10px 36px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--white); font-size: 15px; }
.pd-bullets li::before { content: ""; position: absolute; left: 15px; top: 19px; width: 8px; height: 2px; background: var(--signal); }

/* Marktplätze */
.pd-markets { display: grid; gap: 8px; }
.pd-market {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name badge" "path path" "note note"; gap: 6px 12px; align-items: center;
  padding: 12px 16px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--sheet);
}
@media (min-width: 700px) {
  .pd-market { grid-template-columns: 136px minmax(0, 1fr) auto; grid-template-areas: "name path badge" ". note ."; }
}
.pd-market.is-open { border-style: dashed; border-color: rgba(154, 91, 0, 0.45); }
.pd-market-name { grid-area: name; font-weight: 500; font-size: 14.5px; }
.pd-market-badge { grid-area: badge; justify-self: end; }
.pd-path { grid-area: path; margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--ink-2); overflow-wrap: break-word; }
.pd-seg { white-space: nowrap; }
.pd-chev { color: var(--ink-3); }
.pd-path > .pd-seg:last-child { color: var(--ink); font-weight: 500; }
.pd-path-open { color: var(--warn); font-style: italic; }
.pd-market-note { grid-area: note; margin: 0; font-size: 12.5px; color: var(--warn); line-height: 1.45; }

/* Faktenprüfung */
.pd-fact-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: center; }
@media (min-width: 760px) { .pd-fact-grid { grid-template-columns: auto minmax(0, 1fr); gap: 28px; } }
.pd-fact-counts { display: grid; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 760px) { .pd-fact-counts { grid-template-columns: repeat(3, 120px); } }
.pd-count { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-soft); background: var(--white); }
.pd-count-num { font-size: 26px; font-weight: 500; line-height: 1; letter-spacing: -0.03em; }
.pd-count-label { font-size: 12px; color: var(--ink-2); }
.pd-count.is-belegt .pd-count-num { color: var(--ok); }
.pd-count.is-unsicher .pd-count-num { color: var(--warn); }
.pd-count.is-fehlt .pd-count-num { color: var(--err); }
.pd-fact-rule { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.55; }
.pd-asks { margin-top: 18px; padding: 16px 18px; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line-soft); }
.pd-asks-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.pd-asks-title { margin: 0; font-size: 15px; font-weight: 500; }
.pd-asks .pd-copy { margin-left: 0; }
.pd-asks-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
.pd-asks-list strong { font-weight: 500; color: var(--ink); }

/* ---------- Unterer Block ---------- */
.pd-about { margin-top: 56px; border-radius: var(--radius-lg); padding: 32px 24px; }
@media (min-width: 768px) { .pd-about { padding: 48px 48px 44px; } }
.pd-about-eyebrow { color: rgba(243, 242, 238, 0.6); margin-bottom: 14px; }
.pd-about .h2 { max-width: 26ch; }
.pd-about-grid { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); margin-top: 36px; padding-top: 28px; border-top: 1px solid rgba(243, 242, 238, 0.16); }
@media (min-width: 860px) { .pd-about-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; } }
.pd-about-h { margin: 0 0 8px; font-size: 16px; font-weight: 500; letter-spacing: -0.01em; }
.pd-about p { margin: 0; color: rgba(243, 242, 238, 0.78); font-size: 14.5px; line-height: 1.6; }
.pd-about-cta { margin-top: 18px; }
.pd-btn-signal { background: var(--signal); color: var(--ink); }
.pd-btn-signal:hover { background: #ff7444; }
.pd-about :focus-visible { outline-color: var(--paper); }

#pd-toast { white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 420px) {
  .pd-pipe-card { padding: 18px 16px 14px; }
  .pd-result { padding: 20px 16px 24px; }
  .pd-export { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .pd-bar i { transition: none !important; }
  .is-checked .pd-verdict { animation: none; }
}

/* hidden-Attribut gewinnt immer, auch gegen display-Regeln aus kit.css */
.pd [hidden] { display: none !important; }
