/* ── KI-Abläufe: seitenspezifische Styles (Präfix wf-) ── */
:root {
    --wf-ai: #00d4ff;
    --wf-ai-soft: rgba(0, 212, 255, 0.10);
    --wf-human: #ff4500;
    --wf-human-soft: rgba(255, 69, 0, 0.12);
    --wf-ok: #00ff88;
    --wf-ok-soft: rgba(0, 255, 136, 0.10);
    --wf-line: #333;
    --wf-sunk: #141414;
    --wf-muted: #9a9a9a;
    --wf-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.wf-lead { color: #ccc; max-width: 760px; margin: 0 0 32px; font-size: 1.05rem; }
.wf-note { color: var(--wf-muted); font-size: 0.85rem; margin-top: 14px; }
.wf-hero-lead { color: #ccc; max-width: 720px; margin: 24px auto 0; font-size: 1.1rem; }

.wf-btn-row { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 32px; }
.wf-cta { display: inline-block; padding: 14px 32px; background: #00ff88; color: #000; font-weight: 700; font-size: 1.05rem; border-radius: 8px; text-decoration: none; }
.wf-cta:hover { color: #000; text-decoration: none; opacity: 0.9; }
.wf-cta.ghost { background: transparent; color: #00ff88; border: 2px solid #00ff88; }
.wf-cta.ghost:hover { color: #00ff88; }

/* Inseln vs. vernetzt */
.wf-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.wf-panel { background: var(--card-bg); border: 1px solid var(--wf-line); border-radius: 16px; padding: 28px; }
.wf-panel h3 { margin: 0 0 10px; }
.wf-panel p { color: #ccc; margin: 0; }
.wf-panel.good { border-color: var(--wf-ai); }
.wf-panel.good h3 { color: var(--wf-ai); }
.wf-panel.bad h3 { color: var(--wf-muted); }

/* ── Demo ── */
.wf-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.wf-tab {
    background: transparent; color: #ccc; border: 1px solid var(--wf-line);
    padding: 10px 16px; border-radius: 999px; font-size: 0.9rem; font-weight: 600;
    display: inline-flex; flex-direction: column; align-items: flex-start; gap: 0; text-align: left; line-height: 1.3;
}
.wf-tab small { font-weight: 400; color: var(--wf-muted); font-size: 0.75rem; }
.wf-tab:hover { border-color: var(--wf-ai); opacity: 1; }
.wf-tab[aria-selected="true"] { border-color: var(--wf-ai); background: var(--wf-ai-soft); color: #fff; }
.wf-tab:focus-visible { outline: 2px solid var(--wf-ai); outline-offset: 2px; }

.wf-demo { background: var(--card-bg); border: 1px solid var(--wf-line); border-radius: 16px; overflow: hidden; }
.wf-demo-bar {
    display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between;
    padding: 10px 18px; border-bottom: 1px solid var(--wf-line); background: var(--wf-sunk); font-size: 0.85rem;
}
.wf-app { font-weight: 600; display: flex; gap: 8px; align-items: center; }
.wf-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--wf-ok); display: inline-block; }
.wf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wf-chip { font-family: var(--wf-mono); font-size: 0.72rem; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--wf-line); color: var(--wf-muted); }

.wf-demo-grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.4fr); }
@media (max-width: 860px) { .wf-demo-grid { grid-template-columns: minmax(0, 1fr); } }

.wf-mail { padding: 20px; border-right: 1px solid var(--wf-line); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
@media (max-width: 860px) { .wf-mail { border-right: 0; border-bottom: 1px solid var(--wf-line); } }
.wf-eyebrow { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--wf-ai); font-weight: 600; }
.wf-mail-meta { font-size: 0.82rem; color: var(--wf-muted); display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; }
.wf-mail-meta b { color: #fff; font-weight: 500; overflow-wrap: anywhere; }
.wf-mail-subject { font-weight: 600; }
.wf-mail-body { font-size: 0.92rem; white-space: pre-line; background: var(--wf-sunk); border-radius: 8px; padding: 12px 14px; color: #ddd; }
.wf-attach { align-self: flex-start; font-family: var(--wf-mono); font-size: 0.78rem; padding: 4px 10px; border: 1px solid var(--wf-line); border-radius: 6px; color: #ccc; }
.wf-attach::before { content: "📎 "; }

.wf-chat { padding: 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.wf-agent { font-size: 0.8rem; color: var(--wf-muted); }
.wf-agent strong { color: var(--wf-ai); font-weight: 600; }
.wf-log { display: flex; flex-direction: column; gap: 12px; height: 540px; overflow-y: auto; padding-right: 4px; scroll-behavior: smooth; }
@media (max-width: 860px) { .wf-log { height: 600px; } }
.wf-hint { color: var(--wf-muted); font-size: 0.9rem; border: 1px dashed var(--wf-line); border-radius: 10px; padding: 14px; }
.wf-msg { max-width: 92%; padding: 10px 14px; border-radius: 12px; font-size: 0.93rem; animation: wf-rise .35s ease both; }
.wf-msg.user { align-self: flex-end; background: var(--wf-ai); color: #000; border-bottom-right-radius: 4px; }
.wf-msg.bot { align-self: flex-start; background: #242424; color: #eee; border-bottom-left-radius: 4px; }
.wf-msg.bot ul { margin: 6px 0 0; padding-left: 18px; }
.wf-tool { align-self: flex-start; font-family: var(--wf-mono); font-size: 0.76rem; color: var(--wf-muted); display: flex; gap: 8px; align-items: baseline; animation: wf-rise .35s ease both; }
.wf-tool::before { content: "↳"; color: var(--wf-ai); }
.wf-tool .src { color: var(--wf-ai); font-weight: 500; white-space: nowrap; }
.wf-typing { align-self: flex-start; font-size: 0.8rem; color: var(--wf-muted); font-style: italic; }
.wf-composer { display: flex; gap: 8px; border-top: 1px solid var(--wf-line); padding-top: 12px; }
.wf-composer input { flex: 1; min-width: 0; font-size: 0.92rem; padding: 10px 12px; cursor: default; }
.wf-composer button, .wf-reset, .wf-proposal button {
    padding: 9px 16px; font-size: 0.88rem; border-radius: 8px; font-weight: 600;
}
.wf-composer button { background: var(--wf-ai); color: #000; }
.wf-reset { align-self: flex-start; background: transparent; color: #ccc; border: 1px solid var(--wf-line); }
.wf-reset:hover { border-color: var(--wf-ai); }
@keyframes wf-rise { from { transform: translateY(6px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .wf-msg, .wf-tool, .wf-proposal { animation: none; } .wf-log { scroll-behavior: auto; } }

.wf-proposal { align-self: stretch; border: 1px solid var(--wf-human); border-radius: 12px; overflow: hidden; animation: wf-rise .35s ease both; flex-shrink: 0; }
.wf-proposal.done { border-color: var(--wf-ok); }
.wf-proposal-head { background: var(--wf-human-soft); padding: 10px 14px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 0.88rem; }
.wf-proposal.done .wf-proposal-head { background: var(--wf-ok-soft); }
.wf-proposal-head span { color: #ccc; }
.wf-tbl { overflow-x: auto; }
.wf-tbl table, .wf-matrix table, .wf-testrun table { border-collapse: collapse; width: 100%; font-size: 0.85rem; }
.wf-tbl th, .wf-tbl td, .wf-matrix th, .wf-matrix td, .wf-testrun th, .wf-testrun td { text-align: left; padding: 8px 14px; border-bottom: 1px solid var(--wf-line); vertical-align: top; }
.wf-tbl th, .wf-matrix th, .wf-testrun th { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--wf-muted); font-weight: 600; }
.wf-tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wf-mono { font-family: var(--wf-mono); font-size: 0.76rem; color: var(--wf-muted); }
.wf-flag { display: inline-block; font-size: 0.72rem; padding: 1px 8px; border-radius: 999px; background: var(--wf-human-soft); color: #ff7643; font-weight: 600; margin-top: 3px; }
.wf-draft { padding: 14px; font-size: 0.9rem; white-space: pre-line; color: #ddd; }
.wf-proposal-foot { padding: 12px 14px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.wf-proposal-foot .sum { font-size: 0.85rem; color: #ccc; }
.wf-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.wf-proposal button { background: transparent; color: #fff; border: 1px solid #555; }
.wf-proposal button.primary { background: var(--wf-human); border-color: var(--wf-human); }
.wf-proposal button:disabled { opacity: 0.45; }

/* ── Wer macht was ── */
.wf-flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 1000px) { .wf-flow { grid-template-columns: minmax(0, 1fr); } }
.wf-flow li { background: var(--card-bg); border: 1px solid var(--wf-line); border-top: 3px solid var(--wf-ai); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wf-flow li.human { border-top-color: var(--wf-human); background: #1f1410; }
.wf-who { font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; color: var(--wf-ai); }
.wf-flow li.human .wf-who { color: var(--wf-human); }
.wf-flow h3 { font-size: 1rem; margin: 0; }
.wf-flow p { font-size: 0.82rem; color: var(--wf-muted); margin: 0; }
.wf-legend { display: flex; gap: 20px; flex-wrap: wrap; font-size: 0.85rem; color: var(--wf-muted); margin-top: 16px; }
.wf-legend span { display: inline-flex; gap: 8px; align-items: center; }
.wf-sw { width: 14px; height: 4px; border-radius: 2px; background: var(--wf-ai); display: inline-block; }
.wf-sw.h { background: var(--wf-human); }

/* ── Katalog / Bausteine / Schnittstellen: gemeinsame Kacheln ── */
.wf-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.wf-tile { background: var(--card-bg); border: 1px solid var(--wf-line); border-radius: 14px; padding: 24px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.wf-tile h3 { margin: 0; color: var(--primary); font-size: 1.1rem; }
.wf-tile p { margin: 0; color: #ccc; font-size: 0.93rem; }
.wf-tile .meta { color: var(--wf-muted); font-size: 0.82rem; }
.wf-tile .ex { font-family: var(--wf-mono); font-size: 0.76rem; color: #ddd; background: var(--wf-sunk); border-radius: 6px; padding: 6px 10px; margin-top: auto; }
.wf-tile.featured { border-color: var(--wf-ai); }
.wf-tile.featured h3 { color: var(--wf-ai); }
.wf-io { margin: 4px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 0.86rem; color: #ccc; margin-top: 4px; }
.wf-io dt { color: var(--wf-muted); }
.wf-io dd { margin: 0; }
.wf-io dd.human { color: #ff7643; }
.wf-status { align-self: flex-start; font-size: 0.72rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; letter-spacing: 0.04em; }
.wf-status.ready { background: var(--wf-ok-soft); color: var(--wf-ok); }
.wf-status.build { background: #242424; color: var(--wf-muted); }

/* ── Vorgehen ── */
.wf-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 28px 32px; counter-reset: wfs; }
.wf-steps li { counter-increment: wfs; display: flex; flex-direction: column; gap: 6px; padding-top: 14px; border-top: 1px solid var(--wf-line); }
.wf-steps li::before { content: counter(wfs); font-weight: 800; font-size: 1.6rem; color: var(--primary); line-height: 1; }
.wf-steps h3 { margin: 0; font-size: 1.05rem; }
.wf-steps p { margin: 0; color: #ccc; font-size: 0.92rem; }
.wf-callout { margin-top: 32px; background: var(--wf-ai-soft); border: 1px solid rgba(0,212,255,0.35); border-radius: 12px; padding: 16px 20px; color: #ddd; }
.wf-callout strong { color: var(--wf-ai); }

/* ── Kontrolle ── */
.wf-testrun { margin-top: 28px; background: var(--card-bg); border: 1px solid var(--wf-line); border-radius: 12px; overflow: hidden; }
.wf-testrun-head { background: var(--wf-sunk); padding: 10px 14px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 0.88rem; }
.wf-testrun td:last-child { white-space: nowrap; }
.wf-pass { color: var(--wf-ok); font-weight: 600; }
.wf-warn { color: #ff7643; font-weight: 600; }

/* ── Ausbaustufen ── */
.wf-stages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-bottom: 24px; }
@media (max-width: 900px) { .wf-stages { grid-template-columns: minmax(0, 1fr); } }
.wf-stage .tag { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; color: var(--wf-muted); }
.wf-stage.first { border-color: var(--primary); }
.wf-stage.first .tag { color: var(--primary); }
.wf-stage .count { font-size: 0.85rem; color: var(--wf-ok); font-weight: 600; margin-top: auto; }
.wf-matrix { background: var(--card-bg); border: 1px solid var(--wf-line); border-radius: 12px; overflow-x: auto; }
.wf-matrix table { min-width: 600px; }
.wf-matrix th.p, .wf-matrix td.c { text-align: center; width: 17%; }
.wf-matrix tr.grp td { background: var(--wf-sunk); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; color: var(--wf-muted); padding-block: 6px; }
.wf-matrix tr.total td { font-weight: 700; border-bottom: 0; }
.wf-matrix tr.total td.c { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.wf-new, .wf-re { display: inline-block; font-size: 0.74rem; font-weight: 600; padding: 1px 9px; border-radius: 999px; }
.wf-new { background: var(--wf-human-soft); color: #ff7643; }
.wf-re { background: var(--wf-ok-soft); color: var(--wf-ok); }
.wf-no { color: #555; }

/* ── Technik ── */
.wf-tech .items { display: flex; flex-wrap: wrap; gap: 6px; }
.wf-tech .items span { font-size: 0.82rem; padding: 2px 10px; border-radius: 6px; background: #242424; color: #ddd; }

/* Bearbeitbare Vorschläge */
.wf-qty {
    width: 4.5em; padding: 4px 6px !important; font-size: 0.88rem; text-align: right;
    background: #111; border: 1px dashed #666; border-radius: 6px; color: #fff;
    font-variant-numeric: tabular-nums;
}
.wf-qty:hover:not(:disabled) { border-color: var(--wf-ai); }
.wf-qty:focus { border-style: solid; border-color: var(--wf-ai); }
.wf-qty.changed { border-color: var(--wf-ai); border-style: solid; color: var(--wf-ai); }
.wf-qty:disabled { border-color: transparent; background: transparent; opacity: 1; }
.wf-draft[contenteditable="true"] { cursor: text; background: #111; outline: 1px dashed #555; outline-offset: -6px; border-radius: 6px; }
.wf-draft[contenteditable="true"]:focus { outline: 1px solid var(--wf-ai); }
.wf-draft-flags { padding: 0 14px 14px; display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--wf-line); }
.wf-edit-hint { padding: 8px 14px 0; font-size: 0.8rem; color: var(--wf-ai); }
