/* ============================================================================
 * LOOM Shell — App-spezifische Klassen
 * ============================================================================
 *
 * Materialisiert ADR-0006 (App-Shell Layout) und ADR-0007 (List/Comments)
 * Setzt iron-core.css und accent/loom.css voraus.
 *
 * Usage:
 *   <link rel="stylesheet" href="/design-system/iron-core.css">
 *   <link rel="stylesheet" href="/design-system/accent/loom.css">
 *   <link rel="stylesheet" href="/design-system/loom-shell.css">
 * ============================================================================ */


/* ----- Shell-Grundgerüst ------------------------------------------------ */
.app-shell {
    display: grid;
    grid-template-rows: 52px 44px 1fr 28px;
    /* US-287 (FLOCK-166): pin the single column to the shell width. Without this the implicit
       column grows to the widest row's content (top bar / beacons sub-bar reached ~1719px) and
       overflow:hidden CLIPPED everything right of the viewport on 13" laptops. With minmax(0,1fr)
       each row gets exactly the shell width and must shrink or scroll internally. */
    grid-template-columns: minmax(0, 1fr);
    height: 100vh;
    overflow: hidden;
}
/* US-291 (FLOCK-173): the sub-bar row may GROW for the two-row beacons toolbar (and only grows —
   minmax keeps the 44px floor, so sections without a wrapping sub-bar look exactly as before). */
.app-shell { grid-template-rows: 52px minmax(44px, auto) 1fr 28px; }

.app-topbar,
.app-subbar,
.app-statusbar {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 0 var(--space-4);
}

/* US-142: pin every shell row explicitly. There are 5 sub-bars (one per section, all but the active
   one display:none); a section without one (Dashboard) leaves row 2 empty, so without explicit rows
   grid auto-placement slid .app-content AND .app-statusbar up into the wrong rows. */
.app-topbar    { grid-row: 1; background: var(--surface-1); border-bottom: 0.5px solid var(--border-subtle); }
.app-subbar    { grid-row: 2; background: var(--surface-page); border-bottom: 0.5px solid var(--border-subtle); padding-top: 8px; padding-bottom: 8px; }
.app-statusbar { grid-row: 4; background: var(--surface-1); border-top: 0.5px solid var(--border-subtle); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; color: var(--text-secondary); }

.app-content {
    /* Pin to the 1fr content row (grid: topbar 52 · subbar 44 · content 1fr · statusbar 28).
       US-142: a section without a sub-bar (Dashboard) leaves row 2 empty; without this, grid
       auto-placement slid .app-content up into the 44px sub-bar row → content clipped to 44px. */
    grid-row: 3;
    overflow: auto;
    background: var(--surface-page);
    position: relative;
}

.spacer { flex: 1; }


/* ----- Top-Bar Elemente ------------------------------------------------- */
.brand { display: flex; align-items: center; gap: 10px; }
.brand .wordmark { font-family: var(--font-display); font-size: 17px; font-weight: 700; color: var(--text-primary); letter-spacing: 0.01em; }
.brand .sep { color: var(--border); }
.brand .board-switcher {
    background: var(--surface-2);
    color: var(--text-primary);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 5px 10px;
    font-family: var(--font-mono);
    font-size: 12px;
    display: flex; align-items: center; gap: 6px;
    cursor: pointer;
    transition: border-color var(--motion-fast) var(--ease-out);
}
.brand .board-switcher:hover { border-color: var(--border-strong); }
/* C15 rule: this element has an explicit `display`, so it needs its own [hidden] escape —
   otherwise the author rule beats the UA default and the hidden attribute does nothing. */
.brand .board-switcher[hidden] { display: none; }
/* US-294: hosted mode keeps the vault NAME (identity.js and board.js read the slug from the label)
   but drops the switch affordance entirely — no button, no chevron, no menu. */
.brand .board-switcher-pinned { cursor: default; }
.brand .board-switcher-pinned:hover { border-color: var(--border); }

.section-tabs { display: flex; gap: 2px; margin-left: 12px; }
.section-tabs a {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    border: 0.5px solid transparent;
    transition: color var(--motion-fast) var(--ease-out);
}
.section-tabs a:hover { color: var(--text-primary); }
/* US-287 (FLOCK-166): the shell grid sizes its column to the widest row's min-content — the top bar
   (~1540–1720px with text labels) CLIPPED the whole shell right of the viewport on 13" laptops
   (.app-shell has overflow:hidden). Below 1560px the nav drops its labels (icon + title tooltip),
   below 1300px the model switcher shows only its icon. Target stays laptop ≥ 1280 — LOOM is
   deliberately not a mobile tool (CLAUDE.md §Was LOOM bewusst nicht ist). */
@media (max-width: 1560px) {
    .section-tabs .tab-label { display: none; }
    .section-tabs a { gap: 0; }
}
@media (max-width: 1300px) {
    #model-switcher-label { display: none; }
}
.section-tabs a.active {
    color: var(--text-primary);
    background: var(--surface-2);
    border-color: var(--border);
}
.section-tabs a.active .ti { color: var(--accent); }
.section-tabs .badge {
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    color: var(--accent);
    padding: 1px 6px;
    border-radius: var(--radius-pill);
    font-family: var(--font-mono);
    font-size: 11px;
}

.cycle-indicator {
    display: flex; align-items: center; gap: 8px;
    background: var(--surface-2);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    cursor: pointer;
    transition: border-color var(--motion-fast) var(--ease-out);
}
.cycle-indicator:hover { border-color: var(--border-strong); }
.cycle-indicator .dot { color: var(--color-success); font-size: 12px; }

/* US-277 (FLOCK-137): the split widget — cycle info + a labelled rituals entry, visually one control. */
.cycle-widget { display: flex; align-items: stretch; }
.cycle-widget .cycle-indicator {
    border-top-right-radius: 0; border-bottom-right-radius: 0;
    border-right: 0;
}
.rituals-btn {
    display: flex; align-items: center; gap: 6px;
    background: var(--surface-2);
    border: 0.5px solid var(--border);
    border-top-left-radius: 0; border-bottom-left-radius: 0;
    border-top-right-radius: var(--radius-sm); border-bottom-right-radius: var(--radius-sm);
    padding: 4px 10px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--accent);
    cursor: pointer;
    transition: border-color var(--motion-fast) var(--ease-out);
}
.rituals-btn:hover { border-color: var(--border-strong); }
.rituals-btn .ti-sparkles { font-size: 12px; }

.icon-toolbar { display: flex; gap: 2px; color: var(--text-tertiary); }
.icon-toolbar button {
    background: none; border: 0; color: inherit; padding: 6px;
    cursor: pointer; border-radius: var(--radius-sm);
    transition: background var(--motion-fast) var(--ease-out);
}
.icon-toolbar button:hover { background: var(--surface-2); color: var(--text-primary); }


/* ----- Sub-Bar ---------------------------------------------------------- */
.lane-pills { display: flex; gap: 4px; flex-wrap: nowrap; overflow-x: auto; }
.lane-pill {
    background: transparent;
    /* US-264 (Maintainer-Befund Design-Runde): label always text-primary — dark mode read the old
       secondary-grey row of (mostly inactive) pills as barely visible. State shows via bg + border. */
    color: var(--text-primary);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 4px 11px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color var(--motion-fast) var(--ease-out);
}
.lane-pill:hover { border-color: var(--accent); }
.lane-pill.active {
    background: var(--surface-1);
    color: var(--text-primary);
    border-color: var(--accent);
}
.lane-pill .count.warning { color: var(--color-warning); }
.lane-pill .count.success { color: var(--color-success); }
.lane-pill .count.accent  { color: var(--accent); }
/* US-79: Lane-Pill-Counts in der jeweiligen Lane-Farbe (slug-basiert, Mockup-Form).
 * ALL trägt keine Slug-Klasse → bleibt neutral. */
.lane-pill .count.triage     { color: var(--color-warning); }
.lane-pill .count.candidates { color: var(--color-info); }
.lane-pill .count.backlog    { color: var(--lane-backlog); }
.lane-pill .count.spinning   { color: var(--color-success); }
.lane-pill .count.showcase   { color: var(--accent); }
.lane-pill .count.woven      { color: var(--woven); }
.lane-pill .count.cut        { color: var(--color-error); }

.throw-flock-btn {
    display: flex; align-items: center; gap: 6px;
    background: var(--accent-fill);
    color: var(--on-accent);
    border: 0;
    border-radius: var(--radius-sm);
    padding: 6px 11px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity var(--motion-fast) var(--ease-out);
}
.throw-flock-btn:hover { opacity: 0.9; }
.throw-flock-btn kbd {
    font-family: var(--font-mono);
    font-size: 11px;
    opacity: 0.8;
    background: rgba(255,255,255,0.15);
    padding: 0 4px;
    border-radius: 3px;
}

.search-field {
    display: flex; align-items: center; gap: 6px;
    background: var(--surface-2);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
}
.search-field input {
    background: none; border: 0; color: var(--text-primary);
    font-size: 13px; outline: none; width: 120px; font-family: inherit;
}
.search-field .ti { font-size: 12px; color: var(--text-tertiary); }

.view-toggle {
    display: inline-flex;
    align-items: center;
    background: var(--surface-2);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 9px;
    gap: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: border-color var(--motion-fast) var(--ease-out);
}
.view-toggle:hover { border-color: var(--accent); color: var(--accent); }
.view-toggle .ti { font-size: 14px; }
.view-toggle .label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.1em;
}


/* ----- List-View Table ------------------------------------------------- */
.list-view { display: grid; grid-template-columns: 1fr 400px; height: 100%; }
.list-view.no-drawer { grid-template-columns: 1fr; }

.story-list { overflow-y: auto; }
.story-list-header,
.story-row {
    display: grid;
    grid-template-columns: 1fr 90px 60px 80px 96px 200px;   /* US-77: +96px Counts-Spalte (💬/📎). ACTIONS 200 = 140px Button + Chevron-3-Dot */
    gap: 12px;
    padding: 10px 16px;
    align-items: center;
}
.story-list-header {
    padding-top: 10px; padding-bottom: 10px;
    border-bottom: 0.5px solid var(--border-subtle);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    color: var(--text-secondary);
}
.story-list-header .right { text-align: right; }

.story-row {
    border-bottom: 0.5px solid var(--border-subtle);
    cursor: pointer;
    transition: background var(--motion-fast) var(--ease-out);
}
.story-row:hover { background: var(--surface-2); }
.story-row.selected {
    background: var(--surface-1);
    border-left: 2px solid var(--accent);
    padding-left: 14px;
}
.story-row .title { font-size: 14px; color: var(--text-primary); font-weight: 500; }
.story-row .meta {
    font-size: 12px; color: var(--text-secondary);
    margin-top: 4px;
    display: flex; gap: 10px; align-items: center;
}
.story-row .meta .comment-btn,
.story-row .meta .attachment-info {
    display: flex; align-items: center; gap: 3px;
    background: transparent; border: 0;
    color: inherit; cursor: pointer;
    font-family: inherit; font-size: inherit;
    padding: 0;
}
.story-row .meta .comment-btn:hover,
.story-row.selected .meta .comment-btn { color: var(--accent); }
.story-row .meta .ti { font-size: 13px; }

.lane-badge {
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    text-align: center;
    width: fit-content;
    background: rgba(255,255,255,0.07);
    color: var(--text-primary);
}
.lane-badge.triage    { background: color-mix(in srgb, var(--color-warning) 18%, transparent); color: var(--color-warning); }
.lane-badge.spinning  { background: color-mix(in srgb, var(--color-success) 15%, transparent); color: var(--color-success); }
.lane-badge.showcase  { background: color-mix(in srgb, var(--accent) 18%, transparent);        color: var(--accent); }
/* US-76: WOVEN im Spinning-Stil (getönt + 100%-Schrift), aber im GOOD-Grün —
 * Erfolg, ohne so dominant wie ein gefülltes Badge zu wirken (Maintainer-Befund). */
.lane-badge.woven     { background: color-mix(in srgb, var(--woven) 18%, transparent);        color: var(--woven); }
/* US-79: Lückenschluss — jede Lane eine Farbe. candidates=Teal, backlog=Stahl-Blau,
 * cut=Rot (für die spätere CUT-Sichtungsansicht). Alles getönter Spinning-Stil. */
.lane-badge.candidates{ background: color-mix(in srgb, var(--color-info) 18%, transparent);    color: var(--color-info); }
.lane-badge.backlog   { background: color-mix(in srgb, var(--lane-backlog) 18%, transparent);  color: var(--lane-backlog); }
.lane-badge.cut       { background: color-mix(in srgb, var(--color-error) 18%, transparent);   color: var(--color-error); }

.size-letter {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
}
.size-letter.s { color: var(--color-warning); }
.size-letter.m { color: var(--color-info); }
.size-letter.l { color: var(--color-error); }

.estimate { font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); }

.row-actions { display: flex; gap: 2px; justify-content: flex-end; }
.row-actions .quick-move {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    width: 140px;                       /* Reicht für längstes Wort CANDIDATES */
    height: 26px;                       /* Fixe Höhe — keine vertikale Verzerrung */
    box-sizing: border-box;
    background: transparent;
    color: var(--accent);                                                /* Glow: Text in Accent */
    border: 0.5px solid color-mix(in srgb, var(--accent) 35%, transparent); /* Glow: subtile Accent-Border */
    border-radius: var(--radius-sm);
    padding: 0 8px;
    font-size: 11px;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: border-color var(--motion-fast) var(--ease-out),
                background var(--motion-fast) var(--ease-out),
                color var(--motion-fast) var(--ease-out);
}
.row-actions .quick-move > span:first-child {
    flex: 1;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.row-actions .quick-move:hover {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    color: var(--accent);
}
.row-actions .quick-move .ti {
    color: var(--accent);
    opacity: 0.7;
    font-size: 12px;
}
.row-actions .quick-move:hover .ti { opacity: 1; }
.row-actions .quick-move:hover { border-color: var(--accent); color: var(--accent); }
.row-actions .quick-move .ti { font-size: 12px; opacity: 0.7; }
.row-actions .more-menu {
    background: transparent;
    color: var(--text-tertiary);
    border: 0;
    padding: 2px 4px;
    cursor: pointer;
    border-radius: 3px;
}
.row-actions .more-menu:hover { background: var(--surface-2); color: var(--text-primary); }


/* ----- Drawer ----------------------------------------------------------- */
.drawer {
    background: var(--surface-1);
    border-left: 0.5px solid var(--border);
    display: flex; flex-direction: column;
    overflow: hidden;
}
.drawer-header {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 16px;
    border-bottom: 0.5px solid var(--border-subtle);
}
.drawer-header .story-id { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.16em; color: var(--text-secondary); }
.drawer-header button { background: transparent; color: var(--text-tertiary); border: 0; padding: 4px; cursor: pointer; }
.drawer-header button:hover { color: var(--text-primary); }

/* US-151/FLOCK-094: min-height:0 lets this flex child actually scroll in Safari (default min-height:auto
   keeps it from shrinking below content → a resized textarea would overflow + get clipped by the
   .drawer overflow:hidden, feeling "non-resizable"). Chromium is lenient; Safari needs this. */
.drawer-body { flex: 1; overflow-y: auto; min-height: 0; }

.drawer-title-block { padding: 14px 16px 8px; }
.drawer-title-block h2 {
    font-family: var(--font-sans);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
}
.drawer-title-block .meta { display: flex; gap: 6px; margin-top: 8px; align-items: center; }
.drawer-title-block .size-pill {
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--color-info) 15%, transparent);
    color: var(--color-info);
}
.drawer-title-block .estimate-text { font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); }
.drawer-title-block .quick-move {
    background: transparent;
    color: var(--accent);
    border: 0.5px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    font-size: 12px;
    font-family: var(--font-mono);
    cursor: pointer;
}

.drawer section {
    padding: 12px 16px;
    border-top: 0.5px solid var(--border-subtle);
}
.drawer section .section-label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.2em;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.drawer section .section-label .kis { color: var(--accent); margin-left: auto; }
.drawer section p { font-size: 13px; color: var(--text-primary); line-height: 1.6; margin: 0; }
.drawer section ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text-primary); line-height: 1.7; }

.comment-item {
    background: var(--surface-2);
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
}
.comment-item:last-child { margin-bottom: 0; }
.comment-item .meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); margin-bottom: 4px; }
.comment-item .body { font-size: 13px; color: var(--text-primary); line-height: 1.5; }

.conversation-distilled {
    background: var(--surface-2);
    border-left: 2px solid var(--accent);
    padding: 10px 12px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 13px; color: var(--text-primary); line-height: 1.6;
}

.drawer-footer {
    border-top: 0.5px solid var(--border);
    padding: 10px 12px;
    background: var(--surface-1);
}
.composer { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea {
    flex: 1;
    background: var(--surface-2);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    padding: 7px 9px;
    outline: none;
    resize: vertical;
    min-height: 28px;
    transition: border-color var(--motion-fast) var(--ease-out);
}
.composer textarea:focus { border-color: var(--accent); }
.composer .send-btn {
    background: var(--accent-fill);
    color: var(--on-accent);
    border: 0;
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    display: flex; align-items: center; gap: 4px;
    transition: opacity var(--motion-fast) var(--ease-out);
}
.composer .send-btn:hover { opacity: 0.9; }
.composer-hints {
    display: flex; gap: 12px; margin-top: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
}


/* ----- Inline Quick-Comment Popover ------------------------------------ */
.quick-comment-popover {
    margin: 0 16px 0 32px;
    background: var(--surface-2);
    border: 0.5px solid var(--accent);
    border-radius: var(--radius-md);
    padding: 8px 10px;
    box-shadow: var(--shadow-md);
}
.quick-comment-popover .header {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    color: var(--text-secondary);
}
.quick-comment-popover .header .ti { font-size: 13px; color: var(--accent); }
.quick-comment-popover .header .label { color: var(--text-tertiary); }
.quick-comment-popover .header .hint { color: var(--text-disabled); margin-left: auto; }
.quick-comment-popover textarea {
    width: 100%;
    background: var(--surface-1);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    padding: 8px 10px;
    outline: none;
    resize: vertical;
    box-sizing: border-box;
}


/* ----- Cycle-Menu Popover ---------------------------------------------- */
.cycle-menu {
    position: absolute;
    background: var(--surface-1);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 6px;
    min-width: 240px;
    z-index: 100;
}
.cycle-menu .menu-label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    color: var(--text-secondary);
    padding: 6px 8px;
}
.cycle-menu button {
    display: flex; align-items: center; gap: 10px;
    width: 100%;
    background: none; border: 0;
    color: var(--text-primary);
    font-size: 13px;
    padding: 8px 10px;
    text-align: left;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background var(--motion-fast) var(--ease-out);
}
.cycle-menu button:hover { background: var(--surface-2); }
.cycle-menu button:disabled { color: var(--text-disabled); cursor: not-allowed; }
.cycle-menu button:disabled:hover { background: transparent; }
.cycle-menu button .ti { font-size: 14px; color: var(--accent); }
.cycle-menu .ritual-note {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
}
.cycle-menu hr { border: 0; border-top: 0.5px solid var(--border-subtle); margin: 4px 0; }


/* ----- 3-Dot-Menu ------------------------------------------------------- */
.row-context-menu {
    position: absolute;
    background: var(--surface-1);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 4px;
    min-width: 180px;
    z-index: 100;
}
.row-context-menu button {
    display: flex; align-items: center; gap: 10px;
    width: 100%;
    background: none; border: 0;
    color: var(--text-primary);
    font-size: 13px;
    padding: 8px 12px;
    text-align: left;
    cursor: pointer;
    border-radius: var(--radius-sm);
}
.row-context-menu button:hover { background: var(--surface-2); }
.row-context-menu button.destructive { color: var(--color-error); }
.row-context-menu button .ti { font-size: 13px; color: var(--text-tertiary); }
.row-context-menu button.destructive .ti { color: var(--color-error); }
.row-context-menu hr { border: 0; border-top: 0.5px solid var(--border-subtle); margin: 4px 0; }


/* ----- Status-Bar ------------------------------------------------------- */
.vault-status { display: flex; align-items: center; gap: 6px; }
.vault-status .dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--color-success);
}


/* ----- Kanban-View Drawer als Slide-Over (Revision 2026-05-29) ---------- */
/* Drawer in Kanban öffnet als rechtes Overlay, ohne dass das Board     */
/* horizontal weichen muss (Spalten würden sonst abgeschnitten).        */
.kanban-drawer-container {
    position: relative;
    height: 100%;
    overflow: hidden;
}
.kanban-drawer-container > .drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 400px;
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform var(--motion-medium) var(--ease-out);
    z-index: 50;
}
.kanban-drawer-container.drawer-open > .drawer {
    transform: translateX(0);
}

/* ----- US-62/US-64: Board Kanban-View (vendored from iron-labs loom-shell-preview) ----------- */
.kanban-view {
    display: grid;
    grid-template-columns: repeat(6, 240px);   /* US-64: Triage | Candidates | Backlog | Spinning | Showcase | Woven (Cut excluded — D1) */
    gap: 12px;
    padding: 16px;
    overflow-x: auto;
    align-items: stretch;   /* US-263: lanes fill the row height — the whole column is a drop surface */
}
/* US-263 (FLOCK-154): Trello-style lane container — visible surface over the full height, so a
   drop can land anywhere in the lane (an empty lane used to offer only its header as a target). */
.kanban-column {
    display: flex; flex-direction: column; gap: 8px; min-width: 0;
    background: var(--surface-1);
    border: 0.5px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 8px;
}
.kanban-column-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 4px 4px 8px;
    position: sticky; top: 0;
    background: var(--surface-1);   /* US-263: matches the lane container (was the undefined --surface-0) */
}
.kanban-column-header .name {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.18em;
    color: var(--text-secondary);
    font-weight: 500;
}
.kanban-column-header .count { font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); }
.kanban-column-header .count.spinning   { color: var(--color-success); }
.kanban-column-header .count.showcase   { color: var(--accent); }
.kanban-column-header .count.woven      { color: var(--woven); }          /* US-76 */
.kanban-column-header .count.triage     { color: var(--color-warning); }  /* US-79 */
.kanban-column-header .count.candidates { color: var(--color-info); }     /* US-79 */
.kanban-column-header .count.backlog    { color: var(--lane-backlog); }   /* US-79 */
.kanban-column-header .count.cut        { color: var(--color-error); }    /* US-79 */
.story-card {
    background: var(--surface-1);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px;
    transition: border-color var(--motion-fast) var(--ease-out);
}
.story-card:hover { border-color: var(--border-strong); cursor: pointer; }
.story-card.needs-triage { border-left: 2px solid var(--color-warning); padding-left: 8.5px; }
/* US-72: kanban drag-and-drop — dragged card dims; a valid drop column highlights in accent. */
.story-card[draggable="true"]:active { cursor: grabbing; }
.story-card.dragging { opacity: 0.45; }
.kanban-column.drop-target {
    outline: 1px dashed var(--accent);
    outline-offset: 3px;
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--accent) 7%, transparent);
}
.story-card .title { font-size: 14px; color: var(--text-primary); font-weight: 500; margin-bottom: 6px; line-height: 1.35; overflow-wrap: anywhere; }
.story-card .meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.story-card .meta .card-id { font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); }
.story-card .meta .est { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); }
.story-card .meta .triage-badge {
    font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em;
    color: var(--color-warning);
    background: color-mix(in srgb, var(--color-warning) 15%, transparent);
    padding: 1px 6px; border-radius: var(--radius-pill);
}
/* US-176: Sticky-Stories volume marker (§6) — gets "louder" as a card outlasts cycles.
   Whispers = quiet/muted, Speaks = accent, Calls = strong + bordered (permanent, hard to miss). */
.story-card .meta .sticky {
    font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em;
    padding: 1px 6px; border-radius: var(--radius-pill);
}
.story-card .meta .sticky-whispers { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.story-card .meta .sticky-speaks   { color: var(--color-warning); background: color-mix(in srgb, var(--color-warning) 16%, transparent); }
.story-card .meta .sticky-calls    { color: var(--color-error); background: color-mix(in srgb, var(--color-error) 18%, transparent); font-weight: 700; border: 0.5px solid var(--color-error); }
/* US-263: an empty lane is an explicit drop zone — not a bare dash. Capped: with stretch the
   column can be as tall as the fullest lane, and a 20k-px dashed box reads absurd; the drop
   itself works on the WHOLE column (the drag wiring targets .kanban-column). */
.kanban-empty {
    flex: 1;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-sm);
    min-height: 72px;
    max-height: 260px;
    color: var(--text-tertiary); font-family: var(--font-mono); font-size: 12px;
}

/* US-77: Comment-/Attachment-Counts (💬/📎) — immer sichtbar (auch 0). In der Liste eine eigene
   Spalte, im Kanban-Chip rechts im .ml-auto-Cluster (Mockup-Parität). */
.card-counts { display: inline-flex; gap: 8px; align-items: center; font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); }
.card-counts .cnt { display: inline-flex; gap: 3px; align-items: center; }
.card-counts .cnt .ti { font-size: 13px; color: var(--text-tertiary); }
.story-list-header .comm-col { display: inline-flex; gap: 8px; align-items: center; }
.story-list-header .comm-col .ti { font-size: 13px; }
.story-card .meta .ml-auto { margin-left: auto; display: inline-flex; gap: 8px; align-items: center; }
/* Kanban size-chip (vendored from mockup) — nur sichtbar, wenn die Story eine Size trägt (Weg 1). */
.story-card .meta .size { font-family: var(--font-mono); font-size: 11px; padding: 0 5px; border-radius: var(--radius-pill); }
.story-card .meta .size.s { color: var(--color-warning); background: color-mix(in srgb, var(--color-warning) 15%, transparent); }
.story-card .meta .size.m { color: var(--color-info);    background: color-mix(in srgb, var(--color-info) 15%, transparent); }
.story-card .meta .size.l { color: var(--color-error);   background: color-mix(in srgb, var(--color-error) 15%, transparent); }

/* US-73 (FLOCK-031): the Card-Detail-Drawer lives IN the content area — a column beside the board,
   not a viewport overlay. So topbar/sub-bar/footer stay visible. The board section is a grid that
   shrinks the board content when the drawer opens. The .drawer-internals are vendored above. */
/* US-78: Diese Regel ist die Show-Regel der Board-Section (display: grid). Die Board-
   Section ist DESHALB bewusst aus der generischen `display: block`-Section-Liste unten
   ausgenommen — sonst überschrieb jene (gleich spezifisch, aber später in der Quelle)
   das Grid auf block, die grid-template-columns blieben wirkungslos ("keine Story"). */
[data-section="board"] .section-board {
    display: grid;
    /* minmax(0, 1fr) statt nacktem 1fr — sonst bläht die flexible Spalte auf
       Inhaltsbreite auf (die breite List-View) und drängt die Drawer-Spalte in eine
       zweite Zeile. minmax(0,…) kappt das Track-Minimum hart. */
    grid-template-columns: minmax(0, 1fr) 0;
    grid-template-rows: 1fr;
    transition: grid-template-columns var(--motion-medium) var(--ease-out);
    height: 100%;
    overflow: hidden;
}
.section-board.drawer-open { grid-template-columns: minmax(0, 1fr) 520px; }   /* US-78: Maintainer-Override 400→520 (iron-labs 400 war der Story-Drawer-Default) */
/* US-78: beide Inhalts-Spalten fest in Zeile 1 — verbietet jeden Zeilen-Umbruch des Drawers. */
.section-board > .kanban-view,
.section-board > .list-view { grid-column: 1; grid-row: 1; min-width: 0; min-height: 0; overflow: auto; }
#card-drawer { grid-column: 2; grid-row: 1; min-width: 0; min-height: 0; }   /* US-82-Nachbesserung: Drawer-Body scrollt (siehe .section-setup) */
/* US-263 (FLOCK-044): the drawer separates itself from board/list with an accent edge — the
   generic .drawer hairline (0.5px --border) was too subtle against the same-surface content. */
#card-drawer { border-left: 2px solid var(--accent); }
/* Closed: the 0-width column collapses it; this also stops .drawer's display:flex from showing. */
.section-board:not(.drawer-open) > #card-drawer { display: none; }
.drawer-backdrop { display: none; }   /* US-73: the beside-layout doesn't dim the board */

/* US-74: drawer content parity — sharper section separators (FLOCK-032), empty-states for the
   always-present Comments/Attachments (FLOCK-033), and an inert composer placeholder (D3). */
.drawer-body > section { border-top: 0.5px solid var(--border); }
/* US-78 (Showcase-Nachbesserung): CONVERSATION = narratives Herz der Story → dezent als
   Callout hervorgehoben (Accent-Tint + linke Kante), ohne laut zu sein.
   US-267: die Read-Sektionen sitzen jetzt in Zonen-Boxen — der Akzent trägt auf der ZONE
   (die alte `.drawer-body > section.section-conversation`-Kante träfe das genestete Element
   nicht mehr); beacon-/flock-Tend teilen die .tend-zone unangetastet. */
.tend-zone.zone-conversation {
    border-left: 2px solid var(--accent);
    background: color-mix(in srgb, var(--accent) 7%, transparent);
}
/* US-267: inside a zone the section needs no own top separator (the box separates). */
.tend-zone .section-conversation { border-top: none; }
.drawer .empty-hint { font-size: 12px; color: var(--text-tertiary); font-style: italic; }
.drawer-footer .composer textarea:disabled,
.drawer-footer .composer .send-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.drawer-footer .composer-hints { color: var(--text-tertiary); }

/* US-75 (FLOCK-034): board-label chips — colour from the curated token palette (no free hex). */
.label-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.story-row .label-chips { margin: 5px 0 0; }
.drawer-title-block .label-chips { margin-top: 8px; }
.label-chip {
    display: inline-flex; align-items: center;
    font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em;
    padding: 1px 7px; border-radius: var(--radius-pill);
    background: var(--surface-2); color: var(--text-secondary);   /* neutral fallback */
}
.label-chip.c-info    { background: color-mix(in srgb, var(--color-info) 18%, transparent);    color: var(--color-info); }
.label-chip.c-accent  { background: color-mix(in srgb, var(--accent) 18%, transparent);        color: var(--accent); }
.label-chip.c-success { background: color-mix(in srgb, var(--color-success) 18%, transparent); color: var(--color-success); }
.label-chip.c-warning { background: color-mix(in srgb, var(--color-warning) 18%, transparent); color: var(--color-warning); }
.label-chip.c-error   { background: color-mix(in srgb, var(--color-error) 18%, transparent);   color: var(--color-error); }
.label-chip.c-neutral { background: var(--surface-2); color: var(--text-secondary); }

/* US-261 (FLOCK-153/072): owner chip — initial-avatar + username, shared by kanban card, list row
   and drawer meta (unscoped on purpose, C31). Avatar buckets reuse the semantic token palette. */
.owner-chip {
    display: inline-flex; align-items: center; gap: 4px;
    font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em;
    color: var(--text-secondary);
}
.owner-avatar {
    display: inline-flex; align-items: center; justify-content: center; flex: none;
    position: relative; overflow: hidden;   /* US-265: the woven img overlays the initials */
    width: 16px; height: 16px; border-radius: 50%;
    font-size: 8px; font-weight: 600; letter-spacing: 0;
}
.owner-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; }

/* US-265: member avatar preview in the Team dialog — the woven identity next to the fields. */
.member-avatar {
    width: 34px; height: 34px; border-radius: 50%; overflow: hidden; flex: none;
    background: var(--surface-2); border: 0.5px solid var(--border);
    display: inline-flex; align-self: end; margin-bottom: 2px;
}
.member-avatar img { width: 100%; height: 100%; display: block; }
.owner-avatar.av-1 { background: color-mix(in srgb, var(--color-info) 22%, transparent);    color: var(--color-info); }
.owner-avatar.av-2 { background: color-mix(in srgb, var(--accent) 22%, transparent);        color: var(--accent); }
.owner-avatar.av-3 { background: color-mix(in srgb, var(--color-success) 22%, transparent); color: var(--color-success); }
.owner-avatar.av-4 { background: color-mix(in srgb, var(--color-warning) 22%, transparent); color: var(--color-warning); }
.owner-avatar.av-5 { background: color-mix(in srgb, var(--color-error) 22%, transparent);   color: var(--color-error); }

/* US-266: the CASTING zone — three compact measures side by side, dark token controls. */
.casting-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.casting-grid label {
    display: flex; flex-direction: column; gap: 4px;
    font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em;
    color: var(--text-tertiary);
}

/* US-262 (FLOCK-153): sub-bar member filter — quiet next to the search, accented while it narrows. */
.member-filter {
    background: var(--surface-2); border: 0.5px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text-secondary); font-family: inherit; font-size: 12px; padding: 5px 8px;
}
.member-filter.filter-on { border-color: var(--accent); color: var(--accent); }

/* US-67: view-toggle shows one view at a time (the .view-toggle / .list-view internals are vendored). */
.section-board[data-view="kanban"] .list-view { display: none; }
.section-board[data-view="list"] .kanban-view { display: none; }
/* US-71: the list ACTIONS column is back (write-side); the base 5-column grid applies.
   The kebab trigger is a bordered button (present, not a faint glyph) — it opens the shared
   actions menu. The menu is fixed-positioned (board.js) so the list scroll never clips it. */
.card-menu-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 9px;
    cursor: pointer;
}
.card-menu-btn:hover { border-color: var(--accent); color: var(--accent); }
.card-menu-btn .ti { font-size: 15px; }
/* US-71: the drawer trigger is labelled + accent-coloured (the roomy detail view — more present). */
.card-menu-btn-labeled {
    display: inline-flex; align-items: center; gap: 6px;
    border-color: var(--accent);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 5px 12px;
}
.card-menu-btn-labeled:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }

.card-actions-menu {
    position: fixed;
    width: 180px;
    background: var(--surface-1);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 4px;
    z-index: 70;
}
.card-actions-menu .menu-group-label {
    font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em;
    color: var(--text-tertiary); padding: 6px 8px 4px;
}
.card-actions-menu .menu-item {
    display: block; width: 100%; text-align: left;
    background: transparent; border: 0; border-radius: var(--radius-sm);
    color: var(--text-primary); font-family: var(--font-mono); font-size: 12px;
    padding: 7px 8px; cursor: pointer;
}
.card-actions-menu .menu-item:hover { background: var(--surface-2); color: var(--accent); }
/* US-100/US-101: STORY group — icons muted, destructive exits in error red (mockup .row-context-menu). */
.card-actions-menu .menu-item .ti { font-size: 13px; color: var(--text-tertiary); margin-right: 2px; }
.card-actions-menu .menu-item.destructive,
.card-actions-menu .menu-item.destructive .ti { color: var(--color-error); }
.card-actions-menu .menu-item.destructive:hover { background: var(--surface-2); color: var(--color-error); }
.card-actions-menu .menu-sep { border: 0; border-top: 0.5px solid var(--border-subtle); margin: 4px 0; }
/* Drawer LINKS section: simple mono reference rows. */
.drawer .card-links { display: flex; flex-direction: column; gap: 4px; }
.drawer .card-links .link-row { font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); }
.drawer .card-links .link-row .k { color: var(--text-tertiary); margin-right: 6px; }
.drawer section .conversation-raw { font-size: 13px; color: var(--text-primary); line-height: 1.6; white-space: pre-wrap; margin: 0; }

/* Selected-State für Kanban-Cards (parallel zu story-row.selected) */
.story-card.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}


/* ============================================================================
 * Section-Switching (Board / Flocks / Setup / Logbook)
 * Materialisiert ADR-0009 Flocks + Sub-Bar-Kontext-Sensitivität (ADR-0006)
 * ============================================================================ */

/* Alle Sub-Bars und Content-Sections per Default ausblenden,
 * die zur aktiven Section gehörige wird via [data-section] eingeblendet. */
.app-subbar { display: none; }
.content-section { display: none; }

[data-section="board"]   .subbar-board,
[data-section="flocks"]  .subbar-flocks,
[data-section="setup"]   .subbar-setup { display: flex; }
/* US-285/US-286 (FLOCK-159/160): Prompt-Lab + Documents got their own sub-bars. */
[data-section="prompt-lab"] .subbar-prompt-lab { display: flex; }
[data-section="documents"] .subbar-documents { display: flex; }

/* US-78/US-80/US-103: .section-board, .section-setup UND .section-flocks fehlen hier bewusst —
   sie werden unten als `display: grid` gezeigt (Drawer als Spalte). Würden sie hier zusätzlich
   auf block gesetzt, gewänne block (gleich spezifisch, später in der Quelle). */
[data-section="dashboard"] .section-dashboard { display: block; }   /* US-142 */

/* US-103: flocks section = grid so the detail drawer opens as a column (US-73/80 pattern). */
[data-section="flocks"] .section-flocks {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 0;   /* minmax(0,…) — see .section-board note */
    grid-template-rows: 1fr;
    transition: grid-template-columns var(--motion-medium) var(--ease-out);
    height: 100%;
    overflow: hidden;
}
.section-flocks.drawer-open { grid-template-columns: minmax(0, 1fr) 520px; }
.section-flocks > .flocks-view { grid-column: 1; grid-row: 1; min-width: 0; min-height: 0; overflow: auto; }
#flock-drawer { grid-column: 2; grid-row: 1; min-width: 0; min-height: 0; }
.section-flocks:not(.drawer-open) > #flock-drawer { display: none; }

/* US-181 (KI-Tiefe): Prompt Lab — list + editor drawer (grid-column pattern like flocks). */
[data-section="prompt-lab"] .section-prompt-lab {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 0;
    grid-template-rows: 1fr;
    transition: grid-template-columns var(--motion-medium) var(--ease-out);
    height: 100%;
    overflow: hidden;
}
.section-prompt-lab.drawer-open { grid-template-columns: minmax(0, 1fr) 560px; }
.section-prompt-lab > .prompt-lab-view { grid-column: 1; grid-row: 1; min-width: 0; min-height: 0; overflow: auto; padding: var(--space-6); }
.section-prompt-lab > #prompt-lab-drawer { grid-column: 2; grid-row: 1; min-width: 0; min-height: 0; overflow: auto; }
.section-prompt-lab:not(.drawer-open) > #prompt-lab-drawer { display: none; }

.prompt-lab-title { font-family: var(--font-display); font-size: 1.4rem; margin: 0 0 var(--space-2); }
.prompt-lab-sub { color: var(--text-secondary); max-width: 64ch; margin: 0; }
.prompt-lab-list { display: flex; flex-direction: column; gap: var(--space-3); margin-top: var(--space-5); }
.prompt-card {
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
    padding: var(--space-4); border: 0.5px solid var(--border); border-radius: var(--radius-md);
    background: var(--surface-1); cursor: pointer; transition: border-color var(--motion-medium) var(--ease-out);
}
.prompt-card:hover { border-color: var(--accent); }
.prompt-card-title { font-weight: 500; color: var(--text-primary); }
.prompt-card-id { color: var(--text-tertiary); font-family: var(--font-mono); font-size: 0.8em; margin-left: var(--space-2); }
.prompt-card-purpose { display: block; color: var(--text-secondary); font-size: 0.85rem; margin-top: 2px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prompt-card-text { min-width: 0; }   /* lets the purpose line ellipsize instead of widening the card */
.pl-empty { color: var(--text-tertiary); }
.doc-list-empty { color: var(--text-tertiary); padding: 8px 4px; }   /* US-286: honest empty-search hint */
.pl-badge { font-size: 0.75rem; color: var(--text-secondary); white-space: nowrap; }
.pl-badge-edited { color: var(--accent); font-weight: 500; }

.pl-label { display: block; font-size: 0.8rem; color: var(--text-secondary); margin: var(--space-4) 0 var(--space-2); }
.pl-hint { color: var(--text-tertiary); font-weight: 400; }

/* US-248: the prompt Steckbrief — purpose, integration location, and the team note (prefs.yaml). */
.pl-about {
    background: var(--surface-2); border: 0.5px solid var(--border); border-radius: var(--radius-sm);
    padding: var(--space-3) var(--space-4); margin-bottom: var(--space-2);
}
.pl-about-head { font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-tertiary); }
.pl-about-purpose { margin: var(--space-2) 0; color: var(--text-primary); line-height: 1.5; }
.pl-about-loc { display: flex; align-items: center; gap: var(--space-2); font-size: 0.8rem; }
.pl-loc-chip {
    display: inline-flex; align-items: center; gap: 4px; font-size: 0.78rem;
    padding: 2px 10px; border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent);
}
.pl-note-row {
    display: flex; align-items: center; gap: var(--space-2);
    margin-top: var(--space-3); padding-top: var(--space-3); border-top: 0.5px dashed var(--border);
    color: var(--text-tertiary);
}
.pl-note-row input { flex: 1; min-width: 0; }
.pl-editor {
    width: 100%; min-height: 220px; box-sizing: border-box; resize: vertical;
    font-family: var(--font-mono); font-size: 0.85rem; line-height: 1.5;
    color: var(--text-primary); background: var(--surface-2);
    border: 0.5px solid var(--border); border-radius: var(--radius-sm); padding: var(--space-3);
}
.pl-row { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-3); }

/* US-249: the slot-autocomplete menu — floats right under the editor, scrolls past ~8 rows. */
.pl-editor-wrap { position: relative; }
.pl-slot-menu {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 30; margin-top: 2px;
    background: var(--surface-2); border: 0.5px solid var(--border-strong); border-radius: var(--radius-sm);
    padding: var(--space-1); max-height: 240px; overflow: auto;
}
.pl-slot-menu[hidden] { display: none; }   /* explicit display + [hidden] exception (C15 rule) */
.pl-slot-group { font-size: 0.68rem; letter-spacing: 0.06em; color: var(--text-tertiary); padding: var(--space-2) var(--space-2) 2px; }
.pl-slot-item {
    display: flex; gap: var(--space-3); align-items: baseline; cursor: pointer;
    padding: var(--space-2); border-radius: var(--radius-sm);
}
.pl-slot-item code { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent); white-space: nowrap; }
.pl-slot-item span { font-size: 0.78rem; color: var(--text-secondary); }
.pl-slot-item.selected, .pl-slot-item:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.pl-transparency { margin-top: var(--space-5); border-top: 0.5px solid var(--border); padding-top: var(--space-4); }
.pl-trans-head { font-weight: 500; display: flex; gap: var(--space-2); align-items: baseline; color: var(--text-primary); }
.pl-meta { color: var(--text-tertiary); font-family: var(--font-mono); font-size: 0.75rem; }
.pl-rendered, .pl-response {
    white-space: pre-wrap; word-break: break-word; margin: var(--space-2) 0 0;
    font-family: var(--font-mono); font-size: 0.8rem; line-height: 1.5; color: var(--text-primary);
    background: var(--surface-2); border: 0.5px solid var(--border); border-radius: var(--radius-sm);
    padding: var(--space-3);
    height: 180px; min-height: 64px; overflow: auto; resize: vertical;   /* US-181: user-resizable height */
}

/* US-251 (BEACON-260 E1): Documents — template pills, live-render preview, export bar.
   US-256 (FLOCK-150): the section carries the sibling views' padding — without it the title sticks
   to the window edge (maintainer catch, C99 showcase). */
[data-section="documents"] .section-documents { display: block; height: 100%; overflow: auto; padding: var(--space-6); }
.documents-view { max-width: 900px; }
.documents-title { font-family: var(--font-display); font-size: 1.4rem; margin: 0 0 var(--space-2); }
.documents-sub { color: var(--text-secondary); max-width: 64ch; margin: 0; }
.documents-preview {
    white-space: pre-wrap; word-break: break-word; margin: var(--space-4) 0 0;
    font-family: var(--font-mono); font-size: 0.8rem; line-height: 1.55; color: var(--text-primary);
    background: var(--surface-2); border: 0.5px solid var(--border); border-radius: var(--radius-sm);
    padding: var(--space-4); min-height: 200px;
}
.documents-actions { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-3); }
.documents-actions[hidden] { display: none; }   /* explicit display + [hidden] exception (C15 rule) */
.documents-hint { color: var(--text-tertiary); font-size: 0.78rem; }

/* US-258 (mockup-fixed): the Documents home — quick-access cards (pinned, max 3) + template list. */
/* Breathing room under the intro text — maintainer polish, C101 sign-off. */
.documents-pills { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-3); margin-top: var(--space-6); }
.doc-home-card {
    position: relative; background: var(--surface-2); border: 0.5px solid var(--border);
    border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); cursor: pointer;
    display: flex; flex-direction: column; gap: 2px;
    transition: border-color var(--motion-medium) var(--ease-out);
}
.doc-home-card:hover, .doc-home-card.active { border-color: var(--accent); }
.doc-home-card > .ti { font-size: 1.1rem; color: var(--accent); }
.doc-home-new { border-style: dashed; }
.doc-home-new > .ti { color: var(--text-tertiary); }
.doc-home-title { font-weight: 500; color: var(--text-primary); }
.doc-home-sub { font-size: 0.78rem; color: var(--text-secondary); }
.doc-pin-toggle {
    background: none; border: none; color: var(--text-tertiary); cursor: pointer;
    padding: 2px; font-size: 0.9rem;
}
.doc-pin-toggle:hover { color: var(--accent); }
.doc-home-card .doc-pin-toggle { position: absolute; top: var(--space-2); right: var(--space-2); }
.documents-list { margin-top: var(--space-4); background: var(--surface-2); border: 0.5px solid var(--border); border-radius: var(--radius-md); }
.doc-list-row {
    display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-4);
    border-top: 0.5px solid var(--border); cursor: pointer; font-size: 0.9rem;
}
.doc-list-row:first-child { border-top: none; }
.doc-list-row:hover, .doc-list-row.active { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.doc-list-id { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-tertiary); }
.doc-list-badge { font-size: 0.75rem; color: var(--text-secondary); margin-left: auto; }

/* US-257: the template editor card (new blank/copy · edit override/team); reuses the pl-editor and
   pl-slot-menu styles — shared hooks stay shared (C36 rule). */
.documents-tpl-editor {
    background: var(--surface-2); border: 0.5px solid var(--accent); border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4); margin-top: var(--space-4);
}
.documents-tpl-editor[hidden] { display: none; }   /* explicit display + [hidden] exception (C15 rule) */
.doc-tpl-row { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-2); }
.doc-tpl-row input[type="text"] { flex: 1; min-width: 200px; }

/* US-252/253: the curation cards — frozen prose with a stamp, or the draft/edit flow (mockup-fixed). */
.documents-curation { display: flex; flex-direction: column; gap: var(--space-3); margin-top: var(--space-4); }
.doc-cur-card {
    background: var(--surface-2); border: 0.5px solid var(--border); border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
}
.doc-cur-card.editing { border-color: var(--accent); }
.doc-cur-head { font-size: 0.7rem; letter-spacing: 0.06em; color: var(--text-tertiary); margin-bottom: var(--space-2); }
.doc-cur-prose { margin: 0; color: var(--text-primary); line-height: 1.55; }
.doc-cur-empty { margin: 0; color: var(--text-tertiary); }
.doc-cur-row { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-3); }
.doc-cur-stamp {
    display: inline-flex; align-items: center; gap: 4px; font-size: 0.78rem;
    padding: 2px 10px; border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent);
}
.doc-cur-editor {
    width: 100%; min-height: 96px; box-sizing: border-box; resize: vertical;
    font-size: 0.9rem; line-height: 1.55; color: var(--text-primary); background: var(--surface-1);
    border: 0.5px solid var(--border); border-radius: var(--radius-sm); padding: var(--space-3);
}

/* US-103: the open flock keeps its context mark in the list (mockup .story-row.selected). */
.flock-item.selected {
    border-left: 2px solid var(--accent);
    background: color-mix(in srgb, var(--accent) 7%, transparent);
}

/* US-103: flock-detail drawer — meta rows, edit form, tag picker. */
#flock-drawer .meta-rows { display: flex; flex-direction: column; gap: 5px; }
#flock-drawer .meta-row { display: flex; gap: 8px; font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); }
#flock-drawer .meta-row .k { width: 90px; color: var(--text-tertiary); }
#flock-drawer .flock-body-full { font-size: 13px; line-height: 1.55; white-space: pre-wrap; }
#flock-drawer .fd-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
#flock-drawer .fd-field > span { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; color: var(--text-tertiary); }
#flock-drawer .fd-field textarea,
#flock-drawer .fd-field select {
    background: var(--surface-2); color: var(--text-primary);
    border: 0.5px solid var(--border); border-radius: var(--radius-sm);
    padding: 6px 9px; font-family: inherit; font-size: 13px;
}
#flock-drawer .fd-field textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
#flock-drawer .fd-field textarea:focus,
#flock-drawer .fd-field select:focus { outline: none; border-color: var(--accent); }
/* Tag picker: the curated label chips become toggle buttons (US-75 palette). */
#flock-drawer .tag-picker { display: flex; flex-wrap: wrap; gap: 5px; }
#flock-drawer .tag-pick { cursor: pointer; border: 1px solid transparent; opacity: 0.55; }
#flock-drawer .tag-pick:hover { opacity: 0.85; }
#flock-drawer .tag-pick.on { opacity: 1; border-color: currentColor; }


/* ----- Flocks-View: Throw-Composer (persistente Zone) ------------------ */
.flocks-view { padding: 16px; }

.throw-composer {
    background: var(--surface-1);
    border: 0.5px solid var(--accent);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    margin-bottom: 16px;
}
.throw-composer .header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.throw-composer .header .ti-icon { font-size: 18px; color: var(--accent); }
.throw-composer .header .title {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}
.throw-composer .header .hint {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
}
.throw-composer .header .shortcut {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
}
.throw-composer textarea {
    width: 100%;
    min-height: 56px;
    background: var(--surface-2);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    padding: 8px 10px;
    outline: none;
    resize: vertical;
    box-sizing: border-box;
    margin-bottom: 8px;
    transition: border-color var(--motion-fast) var(--ease-out);
}
.throw-composer textarea:focus { border-color: var(--accent); }
/* US-56 (FLOCK-018): right-aligned action cluster. The flex-growing tags-input
   was replaced by a non-growing subtype-select in US-55, leaving a gap; we drop
   the spacer and right-align the group instead. Carries the US-58 attach-btn
   (cluster grows leftward from the right edge — no re-design). */
.throw-composer .composer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}
/* US-56 (FLOCK-018): the subtype-select fell back to the light browser-default
   look in dark theme. Align it to the token world like .form-field select. */
.throw-composer .composer-actions select {
    background: var(--surface-2);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    padding: 6px 9px;
    outline: none;
    transition: border-color var(--motion-fast) var(--ease-out);
}
.throw-composer .composer-actions select:focus { border-color: var(--accent); }
/* US-68 (FLOCK-024): un-scoped from .throw-composer so the modal's #flock-attach button gets the
   dark token styling too — scoped, it fell back to the light UA default (same family as US-59). */
.attach-btn {
    display: flex; align-items: center; gap: 5px;
    background: transparent;
    color: var(--text-secondary);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
}
.throw-composer .throw-btn {
    display: flex; align-items: center; gap: 6px;
    background: var(--accent-fill);
    color: var(--on-accent);
    border: 0;
    border-radius: var(--radius-sm);
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: opacity var(--motion-fast) var(--ease-out);
}
.throw-composer .throw-btn:hover { opacity: 0.9; }

/* US-59 (FLOCK-021): .btn-primary was used (modal Throw button) but never defined,
   so it fell back to the light UA default. Mirror the composer accent button. */
.btn-primary {
    display: flex; align-items: center; gap: 6px;
    background: var(--accent-fill);
    color: var(--on-accent);
    border: 0;
    border-radius: var(--radius-sm);
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: opacity var(--motion-fast) var(--ease-out);
}
.btn-primary:hover { opacity: 0.9; }
/* C15 rule, 4th occurrence (US-302): the explicit `display: flex` above beats the [hidden] UA
   default, so a hidden .btn-primary stayed visible AND clickable — a dead button answering 409. */
.btn-primary[hidden] { display: none; }
/* US-101: destructive primary (Cut story) — same shape, error red instead of accent. */
.btn-primary.btn-destructive { background: var(--color-error); }

/* US-101: cut modal details — the story id in the header, the hint turning into the error message. */
.modal .cut-story-ref { font-family: var(--font-mono); font-size: 12px; color: var(--text-tertiary); }
.flock-modal-row .hint.cut-hint-error { color: var(--color-error); }

/* US-109 (improvement #2): the stage footer (with the decided-counter) stays visible on long
   candidate lists. LOOM deviation from the vendored casting block. */
.casting-content .stage-footer {
    position: sticky;
    bottom: 0;
    background: var(--surface-page);
    padding-top: 10px;
    padding-bottom: 10px;
    border-top: 0.5px solid var(--border-subtle);
}

/* US-58 (ADR-0009): chosen-attachment chip, shared by composer + modal. Replaces the
   paperclip button while a file is selected; the × clears it. */
/* The explicit display below would otherwise beat the [hidden] UA default — keep hidden hidden. */
.attach-chip[hidden] { display: none; }
.attach-chip {
    display: inline-flex; align-items: center; gap: 5px;
    max-width: 180px;
    background: var(--surface-2);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 3px 4px 3px 8px;
}
.attach-chip .chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-chip .chip-remove {
    display: inline-flex; align-items: center;
    background: transparent; border: 0; color: var(--text-tertiary);
    cursor: pointer; padding: 2px; border-radius: var(--radius-sm);
}
.attach-chip .chip-remove:hover { color: var(--color-error); }


/* ----- Flock-Liste & Items --------------------------------------------- */
.flock-list { display: flex; flex-direction: column; gap: 8px; }

.flock-item {
    background: var(--surface-1);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    cursor: pointer;
    transition: border-color var(--motion-fast) var(--ease-out);
}
.flock-item:hover { border-color: var(--border-strong); }
.flock-item[data-source="showcase"] { border-left: 2px solid var(--color-warning); padding-left: 12px; }
.flock-item[data-status="processed"] { opacity: 0.78; }
.flock-item[data-status="discarded"] { opacity: 0.75; }
.flock-item[data-status="deferred"]  { opacity: 0.85; }
/* US-164: bug flock — distinct marker (red accent + badge) so bugs stand out + get casting priority.
   .flock-type-bug is global (not scoped to .flock-item) so it also styles the casting-sighting line. */
.flock-item[data-type="bug"] { border-left: 2px solid var(--color-error); padding-left: 12px; }
.flock-type-bug { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 10px; font-weight: 600; color: var(--color-error); background: color-mix(in srgb, var(--color-error) 12%, transparent); border: 0.5px solid color-mix(in srgb, var(--color-error) 30%, transparent); padding: 1px 7px; border-radius: var(--radius-pill); }
.flock-type-bug .ti { font-size: 12px; }

/* US-208: feature flock — distinct marker (info accent) so feature requests stand out as roadmap/casting input.
   .flock-type-feature is global (mirrors .flock-type-bug) so it also styles the casting-sighting line. */
.flock-item[data-type="feature"] { border-left: 2px solid var(--color-info); padding-left: 12px; }
.flock-type-feature { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 10px; font-weight: 600; color: var(--color-info); background: color-mix(in srgb, var(--color-info) 12%, transparent); border: 0.5px solid color-mix(in srgb, var(--color-info) 30%, transparent); padding: 1px 7px; border-radius: var(--radius-pill); }
.flock-type-feature .ti { font-size: 12px; }

.flock-item > header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.flock-item .flock-id {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.12em;
    color: var(--text-secondary);
}
.flock-item .status-badge {
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
}
.status-fresh     { color: var(--accent);         background: color-mix(in srgb, var(--accent) 18%, transparent); }
.status-processed { color: var(--color-success);  background: color-mix(in srgb, var(--color-success) 15%, transparent); }
.status-discarded { color: var(--color-error);    background: color-mix(in srgb, var(--color-error) 15%, transparent); }
.status-deferred  { color: var(--color-warning);  background: color-mix(in srgb, var(--color-warning) 15%, transparent); }
/* US-52: real flock schema-v2 statuses (active/promoted/archived) — see BEACON-047 (status-vocab decision). */
.status-active    { color: var(--accent);         background: color-mix(in srgb, var(--accent) 18%, transparent); }
.status-promoted  { color: var(--color-success);  background: color-mix(in srgb, var(--color-success) 15%, transparent); }
.status-archived  { color: var(--text-tertiary);  background: rgba(255, 255, 255, 0.05); }
.source-showcase  {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--color-warning);
    background: color-mix(in srgb, var(--color-warning) 15%, transparent);
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.source-showcase .ti { font-size: 12px; }
.flock-item .timestamp {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
}
.flock-item .body {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
}
.flock-item[data-status="processed"] .body,
.flock-item[data-status="deferred"] .body { color: var(--text-secondary); }
.flock-item .tags {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.flock-item .tag {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--surface-2);
    padding: 2px 7px;
    border-radius: var(--radius-pill);
}
/* US-58 (ADR-0009): ATTACHMENTS row — each path links to the serve route. */
.flock-item .attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.flock-item .attachment-link {
    display: inline-flex; align-items: center; gap: 4px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--surface-2);
    border: 0.5px solid var(--border);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    text-decoration: none;
}
.flock-item .attachment-link:hover { color: var(--accent); border-color: var(--accent); }
.flock-item .processed-link {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
}
.flock-item .processed-link strong { color: var(--text-primary); }


/* ----- Quick-Throw-Modal ----------------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
    z-index: 200;
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--surface-1);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 520px;
    padding: 16px 18px;
    border: 0.5px solid var(--border);
}
.modal header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.modal header .ti-icon { font-size: 18px; color: var(--accent); }
.modal header .title {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}
.modal header .spacer { flex: 1; }
.modal header .close {
    background: transparent;
    color: var(--text-secondary);
    border: 0;
    padding: 4px;
    cursor: pointer;
    border-radius: var(--radius-sm);
}
.modal header .close:hover { background: var(--surface-2); color: var(--text-primary); }

.modal textarea {
    width: 100%;
    min-height: 72px;
    background: var(--surface-2);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    padding: 8px 10px;
    outline: none;
    resize: vertical;
    box-sizing: border-box;
    margin-bottom: 8px;
}
.modal textarea:focus { border-color: var(--accent); }
/* US-206: theme the Start-cycle inputs (number + theme) like the modal textareas — a bare input
   defaults to a white background and breaks in dark mode (Maintainer-Live-Befund Cycle 73). */
#cycle-start-modal-overlay input {
    width: 100%;
    background: var(--surface-2);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    padding: 8px 10px;
    outline: none;
    box-sizing: border-box;
    margin-bottom: 8px;
}
#cycle-start-modal-overlay input:focus { border-color: var(--accent); }
/* US-122: the assign-owner picker — match the modal's input look. */
.assign-select {
    width: 100%;
    background: var(--surface-2);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    padding: 8px 10px;
    outline: none;
    box-sizing: border-box;
    margin-bottom: 8px;
}
.assign-select:focus { border-color: var(--accent); }
.modal .tags-input {
    width: 100%;
    background: var(--surface-2);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 5px 8px;
    outline: none;
    box-sizing: border-box;
    margin-bottom: 12px;
}
.modal footer {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
}
.modal footer .spacer { flex: 1; }
.modal footer a {
    color: var(--accent);
    text-decoration: none;
    font-family: inherit;
}
.modal footer a:hover { text-decoration: underline; }
.modal footer .throw-btn {
    display: flex; align-items: center; gap: 6px;
    background: var(--accent-fill);
    color: var(--on-accent);
    border: 0;
    border-radius: var(--radius-sm);
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}
.modal footer .throw-btn kbd {
    font-family: var(--font-mono);
    font-size: 11px;
    background: rgba(255,255,255,0.18);
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 4px;
}


/* ----- Stub-Sections (Setup, Logbook) ---------------------------------- */
.section-stub {
    padding: 64px 16px;
    text-align: center;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.1em;
}
.section-stub .ti { font-size: 32px; color: var(--text-disabled); display: block; margin: 0 auto 12px; }


/* ============================================================================
 * Setup-View (ADR-0010)
 * ============================================================================ */

.setup-view { padding: 16px; }

/* ----- Banners (Warnings + Suggestions) -------------------------------- */
.setup-banner {
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.setup-banner.warnings {
    background: color-mix(in srgb, var(--color-warning) 12%, transparent);
    border: 0.5px solid var(--color-warning);
    border-left: 2px solid var(--color-warning);
}
.setup-banner.suggestions {
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border: 0.5px solid var(--accent);
    border-left: 2px solid var(--accent);
    padding: 10px 14px;
}
.setup-banner .ti-icon { flex-shrink: 0; font-size: 18px; }
.setup-banner.warnings .ti-icon { color: var(--color-warning); }
.setup-banner.suggestions .ti-icon { color: var(--accent); font-size: 16px; }
.setup-banner .text { flex: 1; }
.setup-banner.warnings .title {
    font-size: 13px;
    color: var(--color-warning);
    font-weight: 500;
    margin-bottom: 2px;
}
.setup-banner.warnings .detail {
    font-size: 12px;
    color: var(--text-secondary);
}
.setup-banner.suggestions .text {
    font-size: 13px;
    color: var(--text-primary);
}
.setup-banner .btn-review,
.setup-banner .btn-show {
    background: transparent;
    border-radius: var(--radius-sm);
    padding: 4px 11px;
    font-size: 11px;
    font-family: var(--font-mono);
    cursor: pointer;
}
.setup-banner.warnings .btn-review {
    color: var(--color-warning);
    border: 0.5px solid var(--color-warning);
}
.setup-banner.suggestions .btn-show {
    color: var(--accent);
    border: 0;
}
.setup-banner .dismiss {
    background: transparent;
    color: var(--text-tertiary);
    border: 0;
    padding: 4px;
    cursor: pointer;
}


/* ----- Setup-Cards ------------------------------------------------------ */
/* US-198: Overview-Landing als responsives Karten-Grid (Maintainer-Wunsch, Design-Runden-Mockup).
   auto-fit + minmax wählt die Spaltenzahl nach Breite (2 im Fokus-Panel, 1 bei schmalem Viewport). */
.setup-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; align-content: start; }

.setup-card {
    background: var(--surface-1);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: border-color var(--motion-fast) var(--ease-out);
}
.setup-card:hover { border-color: var(--border-strong); }
.setup-card[data-status="needs-attention"] { border-color: var(--accent); }
.setup-card[data-status="warning"] { border-color: var(--color-warning); }
.setup-card[data-status="incomplete"] { border-color: var(--color-error); }   /* US-81 (FLOCK-039): unvollständig = rot hervorheben, nicht grau */

.setup-card .icon-box {
    width: 36px; height: 36px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.setup-card .icon-box i { font-size: 18px; }

.setup-card[data-status="complete"]        .icon-box { background: color-mix(in srgb, var(--color-success) 15%, transparent); color: var(--color-success); }
.setup-card[data-status="incomplete"]      .icon-box { background: color-mix(in srgb, var(--color-error) 15%, transparent); color: var(--color-error); }   /* US-81 */
.setup-card[data-status="needs-attention"] .icon-box { background: color-mix(in srgb, var(--accent) 18%, transparent);        color: var(--accent); }
.setup-card[data-status="warning"]         .icon-box { background: color-mix(in srgb, var(--color-warning) 15%, transparent); color: var(--color-warning); }

.setup-card .content { flex: 1; }
.setup-card .card-header {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;   /* US-198: im schmaleren Grid-Karten-Layout darf last-edit umbrechen */
}
.setup-card .title {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}
.setup-card .status-pill {
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 2px 7px;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.setup-card .status-pill .ti { font-size: 11px; }
.setup-card[data-status="complete"]        .status-pill { color: var(--color-success); background: color-mix(in srgb, var(--color-success) 15%, transparent); }
.setup-card[data-status="incomplete"]      .status-pill { color: var(--color-error); background: color-mix(in srgb, var(--color-error) 15%, transparent); }   /* US-81 */
.setup-card[data-status="needs-attention"] .status-pill { color: var(--accent);         background: color-mix(in srgb, var(--accent) 18%, transparent); }
.setup-card[data-status="warning"]         .status-pill { color: var(--color-warning);  background: color-mix(in srgb, var(--color-warning) 15%, transparent); }

/* US-81 (FLOCK-010): Dark-Theme-Scrollbalken — der helle UA-Default stört auf dunklen Flächen.
   scrollbar-color für Firefox, ::-webkit-scrollbar für Chromium/WebKit. Nur im Dark-Theme. */
[data-theme="dark"] textarea,
[data-theme="dark"] .drawer-body,
[data-theme="dark"] .setup-view,
[data-theme="dark"] .list-view,
[data-theme="dark"] .kanban-view { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
[data-theme="dark"] ::-webkit-scrollbar { width: 10px; height: 10px; }
[data-theme="dark"] ::-webkit-scrollbar-track { background: transparent; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text-tertiary) 45%, transparent); border-radius: 6px; }
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

.setup-card .last-edit {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
}
.setup-card .summary {
    font-size: 12px;
    color: var(--text-secondary);
}
.setup-card .edit-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 5px 11px;
    font-family: var(--font-mono);
    font-size: 11px;
    cursor: pointer;
    transition: border-color var(--motion-fast) var(--ease-out);
}
.setup-card .edit-btn:hover { border-color: var(--accent); color: var(--accent); }


/* ----- Setup-Sub-Bar Beacon-Counter & Generate-Button ------------------ */
.subbar-setup .setup-info {
    display: flex; align-items: center; gap: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
}
.subbar-setup .beacon-counter {
    display: flex; align-items: center; gap: 4px;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent);
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    border: 0;
    font-family: var(--font-mono);
    font-size: 11px;
    transition: opacity var(--motion-fast) var(--ease-out);
}
.subbar-setup .beacon-counter:hover { opacity: 0.85; }
.subbar-setup .beacon-counter .ti { font-size: 12px; }

/* US-293 (FLOCK-175): per-section save-reason history — a collapsed fold at the editor's end. */
.setup-history { margin-top: 18px; border-top: 0.5px solid var(--border-subtle); padding-top: 10px; }
.setup-history-toggle {
    background: transparent; border: 0; padding: 2px 0;
    color: var(--text-secondary);
    font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em;
    cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.setup-history-toggle:hover { color: var(--text-primary); }
.setup-history-list { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.setup-history-list[hidden] { display: none; }   /* C15 rule: explicit display needs its [hidden] escape */
.setup-history-row { display: flex; gap: 10px; align-items: baseline; font-size: var(--text-size-small); }
.setup-history-row .hist-when { flex: 0 0 70px; font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); }
.setup-history-row .hist-who { flex: 0 0 auto; font-family: var(--font-mono); font-size: 11px; color: var(--accent); }
.setup-history-row .hist-reason { min-width: 0; color: var(--text-secondary); }
.setup-history-empty { color: var(--text-tertiary); font-size: var(--text-size-small); }


/* ----- Toast (für Setup-Save / Beacon-Created) ------------------------- */
.toast-container {
    position: fixed;
    bottom: 36px;
    right: 16px;
    z-index: 300;
    pointer-events: none;
}
.toast {
    background: var(--surface-1);
    border: 0.5px solid var(--color-success);
    border-left: 2px solid var(--color-success);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    max-width: 380px;
    pointer-events: auto;
    animation: slide-in var(--motion-medium) var(--ease-out);
}
.toast .ti-check { color: var(--color-success); font-size: 16px; }
.toast .text {
    font-size: 13px;
    color: var(--text-primary);
    flex: 1;
}
.toast .text strong { color: var(--color-success); }
.toast a {
    color: var(--accent);
    text-decoration: none;
    font-size: 12px;
    font-family: var(--font-mono);
}
@keyframes slide-in {
    from { transform: translateX(20px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}


/* ============================================================================
 * KI-Action-Pattern (ADR-0011)
 * ============================================================================ */

.ki-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    color: var(--accent);
    border: 0.5px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 5px 11px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: background var(--motion-fast) var(--ease-out);
}
.ki-action:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.ki-action .ti { font-size: 14px; }
.ki-action.loading {
    cursor: wait;
    opacity: 0.7;
}
.ki-action .duration-hint {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    margin-left: 4px;
}
.ti-spin { animation: spin 1s linear infinite; }
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.ki-suggestion-box {
    background: color-mix(in srgb, var(--accent) 8%, transparent);
    border: 0.5px solid var(--accent);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-top: 10px;
}
.ki-suggestion-box header {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 10px;
}
.ki-suggestion-box header .ti-sparkles { color: var(--accent); font-size: 14px; }
.ki-suggestion-box header .label {
    font-size: 13px;
    color: var(--accent);
    font-weight: 500;
}
.ki-suggestion-box header .meta {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
}
.ki-suggestion-box header .close {
    background: transparent;
    color: var(--text-tertiary);
    border: 0;
    padding: 4px;
    cursor: pointer;
}
.ki-suggestion-box .content {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
}
.ki-suggestion-box footer {
    display: flex; gap: 8px; margin-top: 12px;
    padding-top: 10px;
    border-top: 0.5px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.ki-suggestion-box footer button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: var(--radius-sm);
    padding: 5px 11px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    border: 0.5px solid var(--border);
    background: transparent;
    color: var(--text-primary);
}
.ki-suggestion-box footer button .ti { font-size: 13px; }
.ki-suggestion-box footer button.apply {
    background: var(--accent-fill);
    color: var(--on-accent);
    border-color: transparent;
}

/* SMART-Tabelle als Render-Template-Beispiel */
.smart-table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
}
.smart-table td {
    padding: 4px 8px;
    border-bottom: 0.5px solid color-mix(in srgb, var(--accent) 25%, transparent);
    font-size: 12px;
}
.smart-table td:first-child {
    font-family: var(--font-mono);
    font-weight: 500;
    color: var(--accent);
    width: 24px;
}
.smart-table td:nth-child(2) {
    width: 24px;
    text-align: center;
    font-family: var(--font-mono);
}
.smart-table tr:last-child td { border-bottom: 0; }
.smart-score {
    margin-top: 6px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-primary);
}
.smart-score strong { color: var(--accent); font-size: 14px; }
.smart-suggestion-text {
    margin-top: 12px;
    padding: 12px 14px;
    background: var(--surface-2);
    border-left: 2px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.6;
    white-space: pre-wrap;          /* Zeilenumbrüche im Goal-Text erhalten */
    word-wrap: break-word;
    max-height: 240px;              /* "Roman-Schutz" — bei extrem langen Zielen scrollbar */
    overflow-y: auto;
}
.smart-suggestion-text::before {
    content: "Suggested goal";
    display: block;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 6px;
}


/* ----- Setup Drawer-Specifics ------------------------------------------ */
.setup-drawer-body { padding: 14px 16px; }
.setup-drawer-body h3 {
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 16px 0 8px;
}
.setup-drawer-body h3:first-child { margin-top: 0; }
.setup-drawer-body .goal-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
}
.setup-drawer-body .goal-row .goal-id {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
}
.setup-drawer-body .goal-row .goal-text {
    flex: 1;
    font-size: 13px;
    color: var(--text-primary);
}
.smart-bar {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
}
.smart-bar .bar {
    display: inline-block;
    width: 50px;
    height: 6px;
    background: var(--surface-1);
    border-radius: 3px;
    overflow: hidden;
}
.smart-bar .bar-fill {
    display: block;
    height: 100%;
    background: var(--accent);
}
/* US-134: the inline goal bar tints by the same traffic-light tier as the panel score. */
.smart-bar.bad .bar-fill { background: var(--color-error); }
.smart-bar.mid .bar-fill { background: var(--color-warning); }
.smart-bar.good .bar-fill { background: var(--color-success); }


/* ============================================================================
 * Beacons-View (ADR-0012)
 * Tab vormals "Logbook" — Tab-Name + Section ist jetzt "beacons"
 * ============================================================================ */

/* Section-Switching ergänzen */
[data-section="beacons"] .subbar-beacons { display: flex; }

/* US-104: beacons section = grid so the detail drawer opens as a column (US-73/80/103 pattern —
   the former display:block rule is gone on purpose, see the .section-board note). */
[data-section="beacons"] .section-beacons {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 0;
    grid-template-rows: 1fr;
    transition: grid-template-columns var(--motion-medium) var(--ease-out);
    height: 100%;
    overflow: hidden;
}
.section-beacons.drawer-open { grid-template-columns: minmax(0, 1fr) 520px; }
.section-beacons > .beacons-view { grid-column: 1; grid-row: 1; min-width: 0; min-height: 0; overflow: auto; }
#beacon-drawer { grid-column: 2; grid-row: 1; min-width: 0; min-height: 0; }
.section-beacons:not(.drawer-open) > #beacon-drawer { display: none; }

/* US-104: the open beacon keeps its context mark (mockup .story-row.selected). */
.beacon-item.selected {
    border-left: 2px solid var(--accent);
    background: color-mix(in srgb, var(--accent) 7%, transparent);
}

/* US-104: beacon-detail drawer — shares the flock drawer's meta/body shapes. */
#beacon-drawer .meta-rows { display: flex; flex-direction: column; gap: 5px; }
#beacon-drawer .meta-row { display: flex; gap: 8px; font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); }
#beacon-drawer .meta-row .k { width: 90px; color: var(--text-tertiary); }
#beacon-drawer .beacon-body-full { font-size: 13px; line-height: 1.55; white-space: pre-wrap; }
/* The card's chip styles are scoped to .beacon-item — mirror them for the drawer (read + edit). */
#beacon-drawer .beacon-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
#beacon-drawer .tag {
    display: inline-flex; align-items: center; gap: 2px;
    font-family: var(--font-mono); font-size: 11px;
    color: var(--text-secondary); background: var(--surface-2);
    padding: 2px 7px; border-radius: var(--radius-pill);
}
/* Tags editor: removable chips + free input with suggestions from the existing vocabulary. */
#beacon-drawer .bt-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
#beacon-drawer .bt-chip button { background: transparent; border: 0; color: inherit; cursor: pointer; padding: 0 0 0 2px; }
#beacon-drawer .bt-input {
    width: 100%; background: var(--surface-2); color: var(--text-primary);
    border: 0.5px solid var(--border); border-radius: var(--radius-sm);
    padding: 6px 9px; font-family: inherit; font-size: 13px;
}
#beacon-drawer .bt-input:focus { outline: none; border-color: var(--accent); }
#beacon-drawer .bt-hint { font-size: 11px; color: var(--text-tertiary); margin-top: 4px; }
/* US-141: body editor textarea (mirrors .bt-input) + the read-only reason hint in the BODY label. */
#beacon-drawer .bb-input {
    width: 100%; background: var(--surface-2); color: var(--text-primary);
    border: 0.5px solid var(--border); border-radius: var(--radius-sm);
    padding: 6px 9px; font-family: inherit; font-size: 13px; line-height: 1.55;
    min-height: 140px; resize: vertical;
}
#beacon-drawer .bb-input:focus { outline: none; border-color: var(--accent); }
#beacon-drawer .section-label .bb-lock {
    margin-left: auto; font-family: var(--font-mono); font-size: 10px;
    font-weight: 400; color: var(--text-tertiary); text-transform: none;
}

/* ── US-239/US-244 (FLOCK-141, BEACON-244): Read/Tend — the drawers' workflow split. The seg,
   meta-line and tend-zone classes are shared by the beacon AND flock drawer (unscoped on purpose —
   the C31 scoped-style trap); the remaining #beacon-drawer rules are genuinely beacon-specific. ── */
/* flex:none + nowrap: the segment control never shrinks or clips in the tight header row. */
.drawer-mode-seg { display: inline-flex; flex: none; border: 0.5px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.drawer-mode-seg button {
    border: 0; background: transparent; color: var(--text-secondary); cursor: pointer;
    font-family: var(--font-mono); font-size: 11px; padding: 4px 10px; white-space: nowrap;
    display: inline-flex; align-items: center; gap: 4px;
}
.drawer-mode-seg button.on { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
#beacon-drawer .drawer-status-chip {
    font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em;
    padding: 2px 8px; border-radius: var(--radius-pill);
    background: var(--surface-2); color: var(--text-secondary);
}
#beacon-drawer .drawer-status-chip[data-status="accepted"],
#beacon-drawer .drawer-status-chip[data-status="sealed"] { color: var(--color-success); background: color-mix(in srgb, var(--color-success) 12%, transparent); }
#beacon-drawer .drawer-status-chip[data-status="proposed"],
#beacon-drawer .drawer-status-chip[data-status="draft"] { color: var(--color-warning); background: color-mix(in srgb, var(--color-warning) 12%, transparent); }
#beacon-drawer .drawer-status-chip[data-status="rejected"],
#beacon-drawer .drawer-status-chip[data-status="superseded"] { color: var(--color-error); background: color-mix(in srgb, var(--color-error) 10%, transparent); }
.beacon-meta-line {
    display: flex; flex-wrap: wrap; gap: 12px; padding: 10px 0 2px;
    font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary);
}
#beacon-drawer .beacon-read-lead { font-size: 13.5px; font-weight: 600; line-height: 1.5; color: var(--text-primary); margin-bottom: 4px; }
/* US-245 (Maintainer-Befund): the story drawer's CONTENT section labels carry the story colour —
   analog to the beacon drawer's decision-green body headings. --color-info is the established
   story-kind colour (thread chips, candidates lane); structural labels (LINKS/COMMENTS) stay muted. */
.drawer section.story-sec > .section-label { color: var(--color-info); }   /* outweighs the generic .drawer section .section-label */

/* US-241: the forward pointer of a superseded decision — visible before the body is read. */
#beacon-drawer .superseded-pointer {
    display: flex; align-items: center; gap: 6px; margin: 8px 0 2px;
    font-family: var(--font-mono); font-size: 11px; color: var(--color-error);
}
/* Section headings in the decision green (#5DCAA5, the decision subtype colour) — easier to read
   than indigo against the dark surface (Maintainer-Befund, US-239 showcase). */
#beacon-drawer .body-sec-h { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; color: #5DCAA5; margin: 10px 0 3px; }
.tend-zone { border: 0.5px solid var(--border); border-radius: var(--radius-md); margin: 10px 0; }
.tend-zone > section { border-top: 0; }
#beacon-drawer .bs-field { display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }
#beacon-drawer .bs-input {
    display: block; width: 100%; margin-top: 3px; background: var(--surface-2); color: var(--text-primary);
    border: 0.5px solid var(--border); border-radius: var(--radius-sm);
    padding: 6px 9px; font-family: inherit; font-size: 13px; line-height: 1.5; resize: vertical;
}
#beacon-drawer .bs-input:focus { outline: none; border-color: var(--accent); }

/* ── US-142: Dashboard — read-only overview landing (FLOCK-088) ── */
.dashboard-view { padding: 20px 24px; max-width: 920px; overflow-y: auto; }
.dash-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.dash-metric { background: var(--surface-2); border-radius: var(--radius-md); padding: 14px 16px; }
.dash-metric-label { font-size: 12px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.04em; }
.dash-metric-value { font-family: var(--font-display); font-size: 28px; font-weight: 600; color: var(--text-primary); line-height: 1.2; }
.dash-metric-sub { font-size: 12px; color: var(--text-tertiary); }
.dash-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-bottom: 16px; }
.dash-card { background: var(--surface-1); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 14px 16px; }
.dash-card-head { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 10px; }
.dash-card-head > i { color: var(--accent); }
.dash-list { display: flex; flex-direction: column; gap: 8px; }
.dash-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.dash-id { font-family: var(--font-mono); font-size: 11px; color: var(--accent); }
.dash-row-title { flex: 1; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-assignee { font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); background: var(--surface-2); padding: 2px 8px; border-radius: var(--radius-pill); }
.dash-muted { color: var(--text-tertiary); font-size: 12px; }
.dash-pill { font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); background: var(--surface-2); padding: 2px 8px; border-radius: var(--radius-pill); }
.dash-clickable { cursor: pointer; }
.dash-clickable:hover .dash-row-title { color: var(--accent); }
.dash-empty { font-size: 13px; color: var(--text-tertiary); padding: 4px 0; }
.dash-bar { height: 8px; background: var(--surface-2); border-radius: var(--radius-pill); overflow: hidden; }
.dash-bar-fill { height: 100%; background: var(--accent); }
.dash-pulse-meta { margin-left: auto; }
.dash-pulse-legend { display: flex; gap: 16px; margin-top: 10px; font-size: 12px; color: var(--text-secondary); }

/* ── US-156 (FLOCK-103): Setup-Nudge — fehlende/dünne Setup-Sektionen oben auf der Landing.
   Reuse der mh-row-Nudge-Mechanik (getönte Zeile, Lead-Icon, Pfeil rechts, Klick → Dialog). ── */
/* US-313: the AI-setup nudge. Warning-toned, not error-toned — nothing is broken, something is
   not set up yet, and the card says how. Shown only when the probe says so (nudge-not-score). */
.dash-ai-nudge { background: color-mix(in srgb, var(--color-warning) 7%, var(--surface-1)); border: 1px solid color-mix(in srgb, var(--color-warning) 28%, transparent); border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 16px; }
.dash-ai-head { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 14px; font-weight: 600; color: var(--text-primary); }
.dash-ai-head > i { color: var(--color-warning); }
.dash-ai-sub { font-size: 12px; color: var(--text-secondary); margin: 3px 0 10px; }
.dash-ai-steps { display: flex; flex-direction: column; gap: 7px; margin-bottom: 11px; }
.dash-ai-step { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--text-secondary); }
.dash-ai-step > b { min-width: 62px; color: var(--text-primary); font-weight: 600; }
.dash-ai-step code { font-family: var(--font-mono); font-size: 11.5px; padding: 2px 6px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-primary); }
.dash-ai-step > span { flex: 1 1 240px; color: var(--text-tertiary); }
.dash-ai-recheck { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 12px; cursor: pointer; padding: 6px 11px; border-radius: var(--radius-md); color: var(--text-primary); background: color-mix(in srgb, var(--color-warning) 12%, transparent); border: 0.5px solid color-mix(in srgb, var(--color-warning) 30%, transparent); }
.dash-ai-recheck:hover { background: color-mix(in srgb, var(--color-warning) 20%, transparent); }

.dash-setup { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 16px; }
.dash-setup-head { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 14px; font-weight: 600; color: var(--text-primary); }
.dash-setup-head > i { color: var(--accent); }
.dash-setup-count { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--text-secondary); }
.dash-setup-sub { font-size: 12px; color: var(--text-tertiary); margin: 2px 0 11px; }
.dash-setup-list { display: flex; flex-direction: column; gap: 6px; }
.dash-setup-row { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 8px 10px; border-radius: var(--radius-md); cursor: pointer; font: inherit; color: var(--text-primary); background: color-mix(in srgb, var(--accent) 7%, transparent); border: 0.5px solid color-mix(in srgb, var(--accent) 22%, transparent); }
.dash-setup-row.warn { background: color-mix(in srgb, var(--color-warning) 8%, transparent); border-color: color-mix(in srgb, var(--color-warning) 24%, transparent); }
.dash-setup-row:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.dash-setup-row.warn:hover { background: color-mix(in srgb, var(--color-warning) 16%, transparent); }
.dash-setup-ico { font-size: 16px; color: var(--text-tertiary); }
.dash-setup-row.warn .dash-setup-ico { color: var(--color-warning); }
.dash-setup-name { font-size: 13px; min-width: 150px; }
.dash-setup-detail { flex: 1; font-size: 12px; color: var(--text-tertiary); }
.dash-setup-row.warn .dash-setup-detail { color: var(--color-warning); }
.dash-setup-go { font-size: 15px; color: var(--text-tertiary); }
.dash-setup-row:hover .dash-setup-go { color: var(--accent); }
.dash-setup.done { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--color-success); }

/* ── US-268 (FLOCK-155, BEACON-281): identity greeting + personal lane. Accent-left card echoes
   the beacon-drawer zones; identity is a plain token select — the picker writes through the
   currentUser() seam, never straight to localStorage. ── */
.dash-greeting { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.dash-greeting-hi { font-family: var(--font-display); font-size: 18px; color: var(--text-primary); }
.dash-greeting-switch { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-tertiary); }
.dash-identity-select { font: inherit; font-size: 13px; padding: 5px 9px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-1); color: var(--text-primary); }
.dash-personal { background: var(--surface-1); border: 1px solid var(--border-subtle); border-left: 3px solid var(--accent); border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 16px; }
.dash-personal-head { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 14px; font-weight: 600; color: var(--accent); margin-bottom: 11px; }
.dash-personal-metrics { margin-bottom: 12px; }
.dash-personal-sub { font-size: 13px; color: var(--text-secondary); margin: 2px 0 11px; }

/* ── US-269 (FLOCK-155): project arc — roadmap versions as a bead ribbon + overall bar. Released =
   success, current = indigo accent, planned = muted; all adaptive tokens (both themes). ── */
.dash-arc-sub { margin-left: auto; font-weight: 400; }
.dash-arc-track { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.dash-arc-ver { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 50px; }
.dash-arc-dot { width: 28px; height: 28px; border-radius: var(--radius-pill); display: flex; align-items: center; justify-content: center; font-size: 14px; background: var(--surface-2); color: var(--text-tertiary); border: 1px solid var(--border-subtle); }
.dash-arc-id { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); }
.dash-arc-released .dash-arc-dot { background: color-mix(in srgb, var(--color-success) 16%, transparent); color: var(--color-success); border-color: transparent; }
.dash-arc-current .dash-arc-dot { background: var(--accent); color: #fff; border-color: transparent; }
.dash-arc-current .dash-arc-id { color: var(--accent); font-weight: 600; }

/* ── US-270 (FLOCK-123): roadmap/changelog condenser modal — range picker + curated proposal. ── */
.roadmap-digest-modal { max-width: 720px; width: 92vw; max-height: 88vh; overflow-y: auto; }
.roadmap-ki-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.rd-hint, .rd-empty { font-size: 13px; color: var(--text-secondary); margin: 0 0 14px; }
.rd-picker { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.rd-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-tertiary); }
.rd-field select { min-width: 120px; background: var(--surface-2); border: 0.5px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-family: inherit; font-size: 13px; padding: 8px 10px; outline: none; }
.rd-field select:focus { border-color: var(--accent); }
.rd-feat-title, .rd-feat-desc, .rd-changelog { background: var(--surface-2); border: 0.5px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-family: inherit; padding: 8px 10px; outline: none; box-sizing: border-box; }
.rd-feat-title:focus, .rd-feat-desc:focus, .rd-changelog:focus { border-color: var(--accent); }
.rd-arrow { color: var(--text-tertiary); margin-bottom: 8px; }
.rd-strip { font-size: 12px; color: var(--text-tertiary); background: var(--surface-2); border-radius: var(--radius-sm); padding: 6px 10px; margin-bottom: 14px; display: flex; align-items: center; gap: 6px; }
.rd-col { margin-bottom: 16px; }
.rd-col-head { display: flex; align-items: center; gap: 7px; font-family: var(--font-display); font-size: 13px; font-weight: 600; color: var(--accent); margin-bottom: 8px; }
.rd-mut { color: var(--text-tertiary); font-weight: 400; font-size: 12px; }
.rd-feats { display: flex; flex-direction: column; gap: 8px; }
.rd-feat { display: flex; align-items: flex-start; gap: 10px; background: var(--surface-1); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 10px 12px; }
.rd-feat-on { margin-top: 5px; }
.rd-feat-fields { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.rd-feat-title { font-weight: 500; }
.rd-feat-desc { min-height: 42px; resize: vertical; }
.rd-changelog { width: 100%; min-height: 150px; font-family: var(--font-mono); font-size: 13px; line-height: 1.5; resize: vertical; }
.rd-actions { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.rd-actions .spacer { flex: 1; }
.rd-degrade { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--color-warning); background: color-mix(in srgb, var(--color-warning) 8%, transparent); border-radius: var(--radius-md); padding: 12px 14px; }

.beacons-view { padding: 16px; }

/* ----- Blocker-Banner (sehr prominent) --------------------------------- */
.blocker-banner {
    background: color-mix(in srgb, var(--color-error) 14%, transparent);
    border: 0.5px solid var(--color-error);
    border-left: 2px solid var(--color-error);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.blocker-banner .ti-icon { font-size: 18px; color: var(--color-error); flex-shrink: 0; }
.blocker-banner .text { flex: 1; }
.blocker-banner .title {
    font-size: 13px;
    color: var(--color-error);
    font-weight: 500;
    margin-bottom: 2px;
}
.blocker-banner .detail {
    font-size: 12px;
    color: var(--text-secondary);
}
.blocker-banner .btn-review {
    background: transparent;
    color: var(--color-error);
    border: 0.5px solid var(--color-error);
    border-radius: var(--radius-sm);
    padding: 4px 11px;
    font-size: 11px;
    font-family: var(--font-mono);
    cursor: pointer;
}

/* US-148/FLOCK-071: proposed-decision attention banner — mirrors the blocker banner, but indigo
   (an open decision needs ratification: attention, not alarm). */
.proposed-banner {
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    border: 0.5px solid var(--accent);
    border-left: 2px solid var(--accent);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.proposed-banner .ti-icon { font-size: 18px; color: var(--accent); flex-shrink: 0; }
.proposed-banner .text { flex: 1; }
.proposed-banner .title { font-size: 13px; color: var(--accent); font-weight: 500; margin-bottom: 2px; }
.proposed-banner .detail { font-size: 12px; color: var(--text-secondary); }
.proposed-banner .btn-review {
    background: transparent;
    color: var(--accent);
    border: 0.5px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 4px 11px;
    font-size: 11px;
    font-family: var(--font-mono);
    cursor: pointer;
}

/* US-284 (FLOCK-158): status-filter row — the AWAITING pill stays visible but quiet at zero. */
.lane-pill.quiet { opacity: 0.55; }

/* US-291 (FLOCK-173, Variante D — replaces the US-284 half/half rule): the beacons sub-bar wraps
   into TWO rows. The subtype pills take the full first row (every pill readable — the visible row
   teaches the taxonomy), status pills + cycle filter + search + actions share the second. The
   groups keep overflow-x as a fallback for extreme narrowness; the shell grid row grows via
   minmax(44px, auto) (see .app-shell). */
.subbar-beacons { flex-wrap: wrap; row-gap: 6px; }
.subbar-beacons #beacon-filter-pills { flex: 1 1 100%; }
.subbar-beacons #beacon-status-pills { flex: 0 1 auto; min-width: 0; }
.subbar-beacons .cycle-filter,
.subbar-beacons .search-field { flex-shrink: 0; }

/* US-284: chip on a current-cycle draft ritual — legitimately unsealed, distinct from overdue.
   Own class (NOT .cycle-chip): cycle-group bodies hide .cycle-chip, this one must stay visible. */
.current-cycle-chip {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-secondary);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1px 6px;
    flex-shrink: 0;
}

/* US-148/FLOCK-069: cycle chip on ritual beacon cards (casting/loomback/weekly). */
.cycle-chip {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    border-radius: var(--radius-sm);
    padding: 1px 6px;
    flex-shrink: 0;
}

/* ----- Beacon-Stream --------------------------------------------------- */
.beacon-list { display: flex; flex-direction: column; gap: 8px; }

/* US-153: memory-at-a-glance — project state on the class level (Ritual · Ad-hoc · Auto), an
   orientation header distinct from the subtype filter pills. */
.memory-glance { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; padding: 10px 14px; margin-bottom: 12px; background: var(--surface-1); border: 0.5px solid var(--border); border-radius: var(--radius-md); }
.memory-glance b { font-weight: 500; color: var(--text-primary); }
.glance-total { font-size: 13px; color: var(--text-secondary); }
.glance-total .ti { font-size: 15px; color: var(--accent); vertical-align: -2px; margin-right: 2px; }
.glance-classes { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.glance-class { font-family: var(--font-mono); font-size: 11px; padding: 2px 9px; border-radius: 20px; color: var(--text-tertiary); background: var(--surface-2); }
.glance-class[data-class="ritual"] { color: var(--color-info); background: color-mix(in srgb, var(--color-info) 13%, transparent); }
.glance-class[data-class="adhoc"]  { color: var(--accent);     background: color-mix(in srgb, var(--accent) 14%, transparent); }
.glance-class[data-class="auto"]   { color: var(--text-tertiary); background: var(--surface-2); }

/* US-154: Memory Health — good signs + warnings from real invariants (BEACON-137). nudge-not-score:
   warnings are clickable buttons, no number anywhere. Semantic tokens auto-adapt to dark mode. */
/* US-177 (FLOCK-121): Flock-Triage mini-dashboard — same language as memory-health (nudge-not-score). */
.flock-triage { background: var(--surface-1); border: 0.5px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; margin-bottom: 12px; }
.ft-head { font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; }
.ft-head b { font-weight: 500; color: var(--text-primary); }
.ft-head .ti { color: var(--accent); vertical-align: -2px; margin-right: 4px; }
.ft-sub { color: var(--text-tertiary); font-size: 12px; margin-left: 6px; }
.ft-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ft-stat { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); padding: 4px 9px; border-radius: var(--radius-pill); background: var(--surface-2); border: 0.5px solid var(--border); }
.ft-stat .ti { font-size: 14px; }
.ft-stat.good { color: var(--color-success); border-color: color-mix(in srgb, var(--color-success) 30%, transparent); }
.ft-stat.nudge { cursor: pointer; color: var(--color-warning); border-color: color-mix(in srgb, var(--color-warning) 35%, transparent); background: color-mix(in srgb, var(--color-warning) 10%, transparent); }
.ft-stat.nudge:hover { background: color-mix(in srgb, var(--color-warning) 18%, transparent); }
.ft-stat.nudge.on { background: color-mix(in srgb, var(--color-warning) 22%, transparent); }
.ft-stat .ft-go { font-size: 13px; opacity: 0.7; }
.ft-mix { display: inline-flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.ft-mix-chip { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); }
.flock-quick { margin-left: auto; display: inline-flex; gap: 4px; }
.fq-btn { background: transparent; border: 0.5px solid var(--border); border-radius: var(--radius-sm); color: var(--text-tertiary); cursor: pointer; padding: 2px 6px; display: inline-flex; align-items: center; }
.fq-btn:hover { color: var(--text-primary); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.fq-btn .ti { font-size: 15px; }
.memory-health { background: var(--surface-1); border: 0.5px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; margin-bottom: 12px; }
.mh-head { font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; }
.mh-head b { font-weight: 500; color: var(--text-primary); }
.mh-head .ti { color: var(--accent); vertical-align: -2px; margin-right: 4px; }
.mh-sub { color: var(--text-tertiary); font-size: 12px; margin-left: 6px; }
.mh-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 720px) { .mh-cols { grid-template-columns: 1fr; } }
.mh-col-head { font-size: 12px; font-weight: 500; margin-bottom: 6px; }
.mh-col.good .mh-col-head { color: var(--color-success); }
.mh-col.warn .mh-col-head { color: var(--color-warning); }
.mh-col-head .ti { font-size: 15px; vertical-align: -2px; margin-right: 4px; }
.mh-row { display: flex; align-items: flex-start; gap: 8px; width: 100%; text-align: left; padding: 8px 10px; border-radius: var(--radius-md); background: transparent; border: 0.5px solid transparent; }
.mh-row + .mh-row { margin-top: 6px; }
/* Good signs are cards too (transparent green) — students hunt the ✓ motivators (Maintainer, C45). */
.mh-col.good .mh-row { background: color-mix(in srgb, var(--color-success) 8%, transparent); border-color: color-mix(in srgb, var(--color-success) 22%, transparent); }
.mh-lead { font-size: 15px; margin-top: 1px; flex-shrink: 0; }
.mh-col.good .mh-lead { color: var(--color-success); }
.mh-col.warn .mh-lead { color: var(--color-warning); }
.mh-row-text { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.mh-row-label { font-size: 13px; color: var(--text-primary); }
.mh-row-detail { font-size: 11px; color: var(--text-tertiary); }
.mh-go { font-size: 14px; color: var(--text-tertiary); align-self: center; flex-shrink: 0; }
button.mh-row.nudge { cursor: pointer; background: color-mix(in srgb, var(--color-warning) 8%, transparent); border-color: color-mix(in srgb, var(--color-warning) 22%, transparent); font: inherit; }
button.mh-row.nudge:hover { background: color-mix(in srgb, var(--color-warning) 16%, transparent); }
button.mh-row.nudge:hover .mh-go { color: var(--color-warning); }
.mh-empty { font-size: 12px; color: var(--text-tertiary); padding: 7px 8px; }

/* US-212 (FLOCK-138): shared "couldn't load" state — board / memory-health / loomback overview surface a
   visible error instead of an empty view when a plan-dependent fetch fails. */
.load-error {
    display: flex; gap: 10px; align-items: flex-start;
    margin: 16px; padding: 14px 16px; border-radius: 8px;
    border: 1px solid color-mix(in srgb, var(--color-error) 40%, transparent);
    background: color-mix(in srgb, var(--color-error) 10%, transparent);
}
.load-error > .ti { color: var(--color-error); font-size: 18px; margin-top: 1px; }
.load-error b { display: block; font-size: 13px; color: var(--text-primary); }
.load-error span { display: block; font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* US-152: cycle-grouping — each cycle a collapsible card, the project memory as a narrative. */
.cycle-group { background: var(--surface-1); border: 0.5px solid var(--border); border-radius: var(--radius-md); margin-bottom: 10px; }
.cycle-group-header { display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; }
.cycle-group-header:hover { background: var(--surface-2); border-radius: var(--radius-md); }
.cycle-group-body > * + * { margin-top: 0; }
.cycle-group-body { padding: 4px 12px 10px; display: flex; flex-direction: column; gap: 8px; }
.cycle-group-header > .ti { font-size: 16px; color: var(--text-tertiary); flex-shrink: 0; }
.cycle-num { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--text-primary); }
.cycle-theme { font-size: 13px; color: var(--text-secondary); }
.cycle-chips { margin-left: auto; display: flex; gap: 5px; flex-wrap: wrap; }
/* US-152: per-subtype count chips in the cycle header. (Distinct from .cycle-chip, the per-beacon
   cycle badge from US-148 — that one is redundant inside a group and hidden below.) */
.cycle-count-chip { font-family: var(--font-mono); font-size: 10px; padding: 2px 7px; border-radius: 20px; color: var(--text-tertiary); background: var(--surface-2); }
.cycle-count-chip[data-subtype="casting"]   { color: var(--color-info);    background: color-mix(in srgb, var(--color-info) 14%, transparent); }
.cycle-count-chip[data-subtype="decision"]  { color: #5DCAA5;              background: color-mix(in srgb, #5DCAA5 18%, transparent); }
.cycle-count-chip[data-subtype="loomback"]  { color: var(--color-success); background: color-mix(in srgb, var(--color-success) 16%, transparent); }
.cycle-count-chip[data-subtype="learnings"],
.cycle-count-chip[data-subtype="weekly"]    { color: var(--accent);        background: color-mix(in srgb, var(--accent) 16%, transparent); }
.cycle-count-chip[data-subtype="risk"]      { color: var(--color-warning); background: color-mix(in srgb, var(--color-warning) 16%, transparent); }
.cycle-count-chip[data-subtype="blocker"]   { color: var(--color-error);   background: color-mix(in srgb, var(--color-error) 16%, transparent); }
/* The per-beacon cycle badge (US-148) is redundant inside a cycle group — the header states the cycle. */
.cycle-group-body .cycle-chip { display: none; }
.setup-edits-fold { padding-top: 2px; }
.setup-edits-toggle { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); cursor: pointer; padding: 4px 2px; }
.setup-edits-toggle:hover { color: var(--text-secondary); }
.setup-edits-toggle > .ti { font-size: 13px; vertical-align: -2px; }

.beacon-item {
    background: var(--surface-1);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    cursor: pointer;
    transition: border-color var(--motion-fast) var(--ease-out);
}
.beacon-item:hover { border-color: var(--border-strong); }

/* Subtyp-spezifische Border-Color für prominente Subtypes */
.beacon-item[data-subtype="blocker"] { border-color: var(--color-error); border-left: 2px solid var(--color-error); padding-left: 12px; }

/* Auto-Beacons (setup-edit) — gedämpft & kompakt */
.beacon-item.compact {
    opacity: 0.75;
    padding: 10px 14px;
}
.beacon-item.compact > .beacon-body,
.beacon-item.compact > .beacon-tags { display: none; }

.beacon-item > header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.beacon-item.compact > header { margin-bottom: 0; }

.beacon-item .beacon-id {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.12em;
    color: var(--text-secondary);
}
.beacon-item .subtype-badge {
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.beacon-item .subtype-badge .ti { font-size: 11px; }
.beacon-item .source-time {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
}
.beacon-item .more-menu {
    background: transparent;
    color: var(--text-tertiary);
    border: 0;
    padding: 2px 4px;
    cursor: pointer;
}
.beacon-item .beacon-body {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
}
.beacon-item .beacon-tags {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.beacon-item .beacon-tags .tag {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--surface-2);
    padding: 2px 7px;
    border-radius: var(--radius-pill);
}
.beacon-item .beacon-tags .related {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    display: flex; align-items: center; gap: 4px;
}
.beacon-item .auto-summary {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
}

/* ----- Subtyp-Badge-Colors (3 Klassen, siehe loom-prozess.md §7) ------- */
/* Ritual */
.subtype-badge[data-subtype="casting"]    { color: var(--color-info);     background: color-mix(in srgb, var(--color-info) 15%, transparent); }
.subtype-badge[data-subtype="loomback"]   { color: var(--color-success);  background: color-mix(in srgb, var(--color-success) 15%, transparent); }
.subtype-badge[data-subtype="weekly"]     { color: var(--accent);         background: color-mix(in srgb, var(--accent) 15%, transparent); }
/* Ad-hoc */
.subtype-badge[data-subtype="learnings"]  { color: var(--accent);         background: color-mix(in srgb, var(--accent) 18%, transparent); }
.subtype-badge[data-subtype="decision"]   { color: #5DCAA5;               background: color-mix(in srgb, #5DCAA5 15%, transparent); }
.subtype-badge[data-subtype="risk"]       { color: var(--color-warning);  background: color-mix(in srgb, var(--color-warning) 15%, transparent); }
.subtype-badge[data-subtype="blocker"]    { color: var(--color-error);    background: color-mix(in srgb, var(--color-error) 18%, transparent); }
.subtype-badge[data-subtype="insight"]    { color: #5DCAA5;               background: color-mix(in srgb, #5DCAA5 15%, transparent); }
/* Auto */
.subtype-badge[data-subtype="setup-edit"] { color: var(--text-tertiary);  background: rgba(255,255,255,0.05); }


/* ----- Subtyp-Filter-Pills (extending .lane-pill für Beacons) --------- */
.subbar-beacons .lane-pill .count.mint     { color: #5DCAA5; }
.subbar-beacons .lane-pill .count.error    { color: var(--color-error); }
.subbar-beacons .lane-pill .count.neutral  { color: var(--text-tertiary); }
/* US-86 (FLOCK-042-Muster): Beacon-Pill-Counts pro Subtype gefärbt (spiegelt die .subtype-badge-Farben). */
.subbar-beacons .lane-pill .count.learnings  { color: var(--accent); }
.subbar-beacons .lane-pill .count.decision   { color: #5DCAA5; }
.subbar-beacons .lane-pill .count.risk       { color: var(--color-warning); }
.subbar-beacons .lane-pill .count.blocker    { color: var(--color-error); }
.subbar-beacons .lane-pill .count.insight    { color: #5DCAA5; }
.subbar-beacons .lane-pill .count.casting    { color: var(--color-info); }
.subbar-beacons .lane-pill .count.loomback   { color: var(--color-success); }
.subbar-beacons .lane-pill .count.weekly     { color: var(--accent); }
.subbar-beacons .lane-pill .count.setup-edit { color: var(--text-tertiary); }

/* ----- US-221 (FLOCK-082): Browse-by-tag facet ----------------------------
   A thematic wander-axis above the beacon list (subtype pills live in the sub-bar; tags wrap here
   in the content area). Token-based, theme-aware. */
.beacon-tag-facet {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0 0 14px;
}
/* US-15: an explicit display needs its own [hidden] exception, else the attribute is ignored. */
.beacon-tag-facet[hidden] { display: none; }
.beacon-tag-facet .beacon-tags-label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    margin-right: 4px;
}
.beacon-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--surface-1);
    color: var(--text-secondary);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 4px 11px;
    font-family: var(--font-mono);
    font-size: 11px;
    cursor: pointer;
    transition: border-color var(--motion-fast) var(--ease-out);
}
.beacon-tag-chip:hover { border-color: var(--accent); }
.beacon-tag-chip.active {
    background: var(--accent-fill);
    color: var(--on-accent);
    border-color: var(--accent-fill);
}
.beacon-tag-chip .count { color: var(--text-tertiary); }
.beacon-tag-chip.active .count { color: var(--on-accent); opacity: 0.8; }
.beacon-tag-more,
.beacon-tag-clear {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    color: var(--text-tertiary);
    border: none;
    font-family: var(--font-mono);
    font-size: 11px;
    cursor: pointer;
    padding: 4px 6px;
}
.beacon-tag-more { text-decoration: underline; text-underline-offset: 2px; }
.beacon-tag-more:hover,
.beacon-tag-clear:hover { color: var(--accent); }

/* ----- US-222 (FLOCK-082): "tending" fold ---------------------------------
   Hygiene (glance + Memory Health + proposed banner) collapses behind a summary chip so the browse
   surface is the default face. The blocker banner stays above this, outside the fold. Token-based. */
.beacon-tending { margin: 0 0 16px; }
.beacon-tending[hidden] { display: none; }   /* US-15: explicit-display elements need their own [hidden] rule */
.beacon-tending-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: transparent;
    color: var(--text-tertiary);
    border: 0.5px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    padding: 5px 12px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: border-color var(--motion-fast) var(--ease-out), color var(--motion-fast) var(--ease-out);
}
.beacon-tending-toggle:hover { border-color: var(--border-strong); color: var(--text-secondary); }
/* US-234 (FLOCK-144): assertive entry when open nudges wait — discoverable without auto-expanding. */
.beacon-tending-toggle.has-nudges { border-color: var(--color-warning); color: var(--color-warning); background: color-mix(in srgb, var(--color-warning) 8%, transparent); }
.beacon-tending-toggle.has-nudges:hover { border-color: var(--color-warning); }
.beacon-tending-chevron { transition: transform var(--motion-fast) var(--ease-out); }
.beacon-tending.open .beacon-tending-chevron { transform: rotate(90deg); }
.beacon-tending-count { color: var(--text-tertiary); }
.beacon-tending-count.has-nudges { color: var(--color-warning); }
.beacon-tending-body { margin-top: 12px; }
.beacon-tending-body[hidden] { display: none; }

/* ----- US-223 (BEACON-228): woven threads in the drawer -------------------
   related_* edges become rich, clickable threads (weaves to / woven from). Kind colours reuse the
   semantic tokens — no invented brand colours. */
.thread-group { margin-bottom: 12px; }
.thread-group:last-child { margin-bottom: 0; }
.thread-group-label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; color: var(--text-tertiary); margin-bottom: 7px; display: flex; align-items: center; gap: 5px; }
.thread-chip { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: var(--surface-1); border: 0.5px solid var(--border); border-radius: 8px; padding: 7px 10px; margin-bottom: 6px; cursor: pointer; transition: border-color var(--motion-fast) var(--ease-out); }
.thread-chip:hover { border-color: var(--accent); }
.thread-chip > i { font-size: 14px; width: 20px; text-align: center; flex: none; color: var(--text-secondary); }
.thread-chip .thread-id { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); flex: none; }
.thread-chip .thread-label { font-size: 13px; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-chip[data-kind="decision"] > i { color: var(--accent); }
.thread-chip[data-kind="story"] > i { color: var(--color-info); }
.thread-chip[data-kind="flock"] > i,
.thread-chip[data-kind="risk"] > i { color: var(--color-warning); }
.thread-chip[data-kind="loomback"] > i,
.thread-chip[data-kind="insight"] > i { color: var(--color-success); }
.thread-chip[data-kind="blocker"] > i { color: var(--color-error); }
.thread-chip[data-kind="casting"] > i,
.thread-chip[data-kind="weekly"] > i { color: var(--color-info); }
.thread-peek { border: 0.5px solid var(--border); border-radius: 8px; padding: 9px 11px; margin-top: 4px; background: var(--surface-2); }
.thread-peek-head { display: flex; align-items: center; gap: 7px; }
.thread-peek-head .thread-id { font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); }
.thread-peek-close { background: transparent; border: none; color: var(--text-tertiary); cursor: pointer; font-size: 13px; }
.thread-peek-label { font-size: 13px; color: var(--text-primary); margin-top: 5px; line-height: 1.45; }
.thread-crumb-bar { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-bottom: 12px; }
.thread-crumb { background: transparent; border: none; color: var(--accent); cursor: pointer; font-family: var(--font-mono); font-size: 11px; padding: 2px 3px; }
.thread-crumb.current { color: var(--text-secondary); cursor: default; }
.thread-crumb-bar > i { font-size: 12px; color: var(--text-disabled); }

/* ----- US-224 (BEACON-228): the constellation — the woven net made visible ------------------
   Inline-SVG neighbourhood graph. Kind colours live on the node stroke (semantic tokens only). */
.constellation { display: block; margin-top: 4px; background: var(--surface-page); border: 0.5px solid var(--border-subtle); border-radius: 8px; }
.cst-hint { font-family: var(--font-mono); font-size: 10px; color: var(--text-disabled); letter-spacing: 0; }
.cst-edge { stroke: var(--border-strong); stroke-width: 1.3; }
.cst-edge.in { stroke-dasharray: 3 3; }
#cst-arrow path { fill: var(--border-strong); }
.cst-node { cursor: pointer; }
.cst-node circle { fill: var(--surface-1); stroke: var(--border-strong); stroke-width: 1.5; transition: stroke-width var(--motion-fast) var(--ease-out); }
.cst-node:hover circle { stroke-width: 2.5; }
.cst-node text { font-family: var(--font-mono); font-size: 9px; fill: var(--text-secondary); text-anchor: middle; pointer-events: none; }
.cst-node.centre { cursor: default; }
.cst-node.centre circle { fill: var(--accent-fill); stroke: var(--accent-fill); }
.cst-node.centre text { fill: var(--on-accent); }
.cst-node[data-kind="decision"] circle { stroke: var(--accent); }
.cst-node[data-kind="story"] circle,
.cst-node[data-kind="casting"] circle,
.cst-node[data-kind="weekly"] circle { stroke: var(--color-info); }
.cst-node[data-kind="flock"] circle,
.cst-node[data-kind="risk"] circle { stroke: var(--color-warning); }
.cst-node[data-kind="loomback"] circle,
.cst-node[data-kind="insight"] circle { stroke: var(--color-success); }
.cst-node[data-kind="blocker"] circle { stroke: var(--color-error); }
.cst-more { font-family: var(--font-mono); font-size: 9px; fill: var(--text-tertiary); }

/* ----- US-227: weave-mode editor (curate related_* in the drawer) ----------------------------- */
.weave-entry { background: transparent; border: 0.5px solid var(--border); border-radius: var(--radius-pill); color: var(--accent); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em; padding: 2px 9px; cursor: pointer; margin-left: 4px; }
.weave-entry:hover { border-color: var(--accent); background: var(--surface-2); }
.thread-empty { font-size: 13px; color: var(--text-tertiary); padding: 4px 0; }
/* US-229: harvest a loomback learning into an insight — a row per bullet + a "→ insight" entry. */
.harvest-row { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; border-bottom: 0.5px solid var(--border); }
.harvest-row:last-child { border-bottom: 0; }
.harvest-text { flex: 1; font-size: 13px; color: var(--text-secondary); line-height: 1.45; }
.harvest-row .weave-entry { flex: none; margin-top: 2px; }
.weave-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.weave-empty { font-size: 12px; color: var(--text-tertiary); }
.weave-chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; padding: 4px 9px; border-radius: var(--radius-pill); border: 0.5px solid var(--border); background: var(--surface-1); color: var(--text-secondary); cursor: pointer; }
.weave-chip:hover { border-color: var(--color-error); color: var(--color-error); }
.weave-search { width: 100%; background: var(--surface-1); color: var(--text-primary); border: 0.5px solid var(--border); border-radius: var(--radius-pill); padding: 8px 13px; font-size: 13px; font-family: var(--font-sans); }
.weave-search:focus { outline: none; border-color: var(--accent); }
.weave-results { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; max-height: 260px; overflow-y: auto; }   /* US-244: unbounded hits scroll instead of a silent top-8 cap */
.weave-results[hidden] { display: none; }
.weave-result { display: flex; align-items: center; gap: 8px; text-align: left; background: var(--surface-1); border: 0.5px solid var(--border-subtle); border-radius: 6px; padding: 6px 9px; cursor: pointer; font-size: 12px; color: var(--text-primary); }
.weave-result:hover { border-color: var(--accent); }
.weave-result .rel-kind { font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); }
.weave-actions { display: flex; align-items: center; margin-top: 12px; gap: 8px; }
/* Constellation legend — colours mirror the node strokes; edge keys mirror the line styles. */
.cst-legend { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-top: 9px; }
.cst-leg, .cst-leg-edge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-secondary); }
.cst-leg-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); }
.cst-leg[data-kind="decision"] .cst-leg-dot { background: var(--accent); }
.cst-leg[data-kind="story"] .cst-leg-dot,
.cst-leg[data-kind="casting"] .cst-leg-dot,
.cst-leg[data-kind="weekly"] .cst-leg-dot { background: var(--color-info); }
.cst-leg[data-kind="flock"] .cst-leg-dot,
.cst-leg[data-kind="risk"] .cst-leg-dot { background: var(--color-warning); }
.cst-leg[data-kind="loomback"] .cst-leg-dot,
.cst-leg[data-kind="insight"] .cst-leg-dot { background: var(--color-success); }
.cst-leg[data-kind="blocker"] .cst-leg-dot { background: var(--color-error); }
.cst-edge-key { width: 16px; border-top: 1.5px solid var(--border-strong); display: inline-block; }
.cst-edge-key.dashed { border-top-style: dashed; }

/* ----- US-225 (Browse-Oase C-γ Zone B): spotlight + wander ----------------
   The serendipity layer atop the browse surface — a featured decision + a random entry. */
.beacon-spotlight { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; margin: 0 0 16px; }
.beacon-spotlight[hidden] { display: none; }
.spotlight-hero { flex: 1; min-width: 280px; background: var(--surface-1); border: 0.5px solid var(--border); border-left: 3px solid var(--accent); border-radius: 12px; padding: 13px 16px; cursor: pointer; transition: border-color var(--motion-fast) var(--ease-out); }
.spotlight-hero:hover { border-color: var(--accent); }
.spotlight-eyebrow { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; color: var(--color-success); margin-bottom: 8px; }
.spotlight-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.spotlight-meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); }
.spotlight-degree { font-family: var(--font-mono); font-size: 11px; color: var(--accent); }
.spotlight-summary { font-family: var(--font-display); font-size: 15px; font-weight: 500; line-height: 1.35; color: var(--text-primary); }
.spotlight-open { font-family: var(--font-mono); font-size: 11px; color: var(--accent); margin-top: 10px; }
.spotlight-wander { width: 180px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; background: var(--surface-1); border: 0.5px solid var(--border); border-radius: 12px; padding: 14px; cursor: pointer; transition: border-color var(--motion-fast) var(--ease-out); }
.spotlight-wander:hover { border-color: var(--accent); }
.spotlight-wander-ic { width: 42px; height: 42px; border-radius: 50%; background: var(--surface-2); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.spotlight-wander-label { font-family: var(--font-display); font-size: 14px; font-weight: 500; color: var(--text-primary); }
.spotlight-wander-hint { font-size: 11px; color: var(--text-tertiary); text-align: center; }

/* US-85 (FLOCK-040a): custom dropdown — replaces the native <select> popup (OS-unthemeable).
   Progressive enhancement: the native <select> stays hidden inside .custom-select as the value
   source. Pattern: the US-71 card-actions menu. Token-based, theme-aware (Light + Dark). */
.custom-select { position: relative; display: inline-block; }
.custom-select > select { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.custom-select-trigger {
    display: inline-flex; align-items: center; gap: 8px; min-width: 110px;
    font-family: var(--font-mono); font-size: 12px;
    background: var(--surface-1); color: var(--text-primary);
    border: 0.5px solid var(--border); border-radius: var(--radius-md);
    padding: 5px 10px; cursor: pointer;
}
.custom-select-trigger:hover { border-color: var(--border-strong); }
.custom-select.open .custom-select-trigger { border-color: var(--accent); }
.custom-select-trigger > span { flex: 1; text-align: left; }
.custom-select-trigger .ti { font-size: 12px; opacity: 0.6; }
.custom-select-popup {
    position: absolute; top: calc(100% + 4px); left: 0; min-width: 100%;
    background: var(--surface-1); border: 0.5px solid var(--border); border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg); padding: 4px; z-index: 300; max-height: 240px; overflow-y: auto;
}
.custom-select-option {
    font-family: var(--font-mono); font-size: 12px; color: var(--text-primary);
    padding: 6px 10px; border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap;
}
.custom-select-option:hover,
.custom-select-option.active { background: var(--surface-2); }
.custom-select-option.selected { color: var(--accent); }
/* US-88: enhanced setup-drawer selects — match the native field width/look in form context. */
.form-field .custom-select,
.mfield .custom-select { display: block; width: 100%; }
.form-field .custom-select-trigger,
.mfield .custom-select-trigger { width: 100%; box-sizing: border-box; font-size: 13px; padding: 6px 9px; }
/* Roadmap feature status/move: the wrapper carries the native class (US-88) — neutralise the
   native-select box (the trigger is the visible control) and colour the trigger as before. */
.feature-card .custom-select.feature-status-select,
.feature-card .custom-select.feature-move { background: transparent; border: 0; padding: 0; }
.feature-card .custom-select.feature-status-select.s-planned     .custom-select-trigger { color: var(--color-warning); }
.feature-card .custom-select.feature-status-select.s-in-progress .custom-select-trigger { color: var(--accent); }
.feature-card .custom-select.feature-status-select.s-done        .custom-select-trigger { color: var(--color-success); }
/* US-83 (FLOCK-042): Flock-Status-Counts farbig (slug-basiert). active = offen (Accent),
   promoted = wurde Story/Beacon (Grün), archived = geschlossen (gedämpft). ALL bleibt neutral. */
.subbar-flocks .lane-pill .count.active   { color: var(--accent); }
.subbar-flocks .lane-pill .count.promoted { color: var(--color-success); }
.subbar-flocks .lane-pill .count.archived { color: var(--text-tertiary); }
.subbar-flocks .lane-pill .count.processed{ color: var(--color-success); }

/* US-91: vault switcher dropdown + open-vault dialog fields. The menu/create-row toggle via the
   [hidden] attribute and set no own `display`, so the UA default (display:none) hides them. */
.board-switcher-wrap { position: relative; display: inline-block; }
.vault-menu {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 400;
    min-width: 260px; padding: 4px;
    background: var(--surface-1); border: 0.5px solid var(--border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
}
.vault-menu-item {
    display: flex; flex-direction: column; gap: 2px; width: 100%;
    text-align: left; padding: 7px 10px; border-radius: var(--radius-sm);
    background: transparent; border: 0; cursor: pointer; color: var(--text-primary);
    font-family: var(--font-mono); font-size: 12px;
}
.vault-menu-item:hover { background: var(--surface-2); }
.vault-menu-item.active .vault-slug { color: var(--accent); }
.vault-menu-item .vault-slug { font-weight: 600; }
.vault-menu-item .vault-path {
    font-size: 11px; color: var(--text-tertiary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.vault-menu-item[data-action="open"] { flex-direction: row; align-items: center; gap: 6px; color: var(--accent); }
/* US-121 (FLOCK-049): a vault row = the switch button + a ✕ to forget a stale entry. */
.vault-menu-row { display: flex; align-items: stretch; gap: 2px; }
.vault-menu-row .vault-menu-item { flex: 1; min-width: 0; }
.vault-menu-remove {
    background: transparent; border: 0; cursor: pointer; color: var(--text-tertiary);
    padding: 0 9px; border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 12px;
}
.vault-menu-remove:hover { background: color-mix(in srgb, var(--color-error) 14%, transparent); color: var(--color-error); }
.vault-menu-sep { height: 1px; background: var(--border); margin: 4px 0; }
.vault-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-secondary); margin-bottom: 10px; }
.vault-field input {
    font-family: var(--font-mono); font-size: 13px; padding: 7px 9px;
    background: var(--surface-2); color: var(--text-primary);
    border: 0.5px solid var(--border); border-radius: var(--radius-sm);
}
.vault-field input:focus { border-color: var(--accent); outline: none; }
.vault-open-msg { font-size: 12px; color: var(--color-warning); margin: 0 0 10px; }

/* US-96: AI model switcher in the topbar — mirrors .board-switcher + .vault-menu. */
.model-switcher-wrap { position: relative; display: inline-block; }
.model-switcher {
    background: var(--surface-2);
    color: var(--text-primary);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 5px 10px;
    font-family: var(--font-mono);
    font-size: 12px;
    display: flex; align-items: center; gap: 6px;
    cursor: pointer;
    transition: border-color var(--motion-fast) var(--ease-out);
}
.model-switcher:hover { border-color: var(--border-strong); }
.model-switcher .ti-sparkles { color: var(--accent); font-size: 13px; }
.model-menu {
    position: absolute; top: calc(100% + 6px); right: 0; z-index: 400;
    min-width: 220px; max-height: 60vh; overflow-y: auto; padding: 4px;
    background: var(--surface-1); border: 0.5px solid var(--border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
}
.model-menu-item {
    display: flex; align-items: center; gap: 7px; width: 100%;
    text-align: left; padding: 7px 10px; border-radius: var(--radius-sm);
    background: transparent; border: 0; cursor: pointer; color: var(--text-primary);
    font-family: var(--font-mono); font-size: 12px;
}
.model-menu-item:hover { background: var(--surface-2); }
.model-menu-item.active { color: var(--accent); }
.model-menu-item .ti { font-size: 13px; color: var(--text-tertiary); }
.model-menu-item.active .ti { color: var(--accent); }
.model-menu-loading { padding: 9px 10px; font-family: var(--font-mono); font-size: 12px; color: var(--text-tertiary); }

/* US-166: Help dropdown on the topbar Info button — mirrors .model-menu, anchored to .help-wrap. */
.help-wrap { position: relative; display: inline-flex; }
.help-menu {
    position: absolute; top: calc(100% + 6px); right: 0; z-index: 400;
    min-width: 200px; padding: 4px;
    background: var(--surface-1); border: 0.5px solid var(--border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
}
.help-menu-item {
    display: flex; align-items: center; gap: 8px; width: 100%;
    text-align: left; padding: 7px 10px; border-radius: var(--radius-sm);
    color: var(--text-primary); text-decoration: none; font-size: 13px;
}
.help-menu-item:hover { background: var(--surface-2); }
.help-menu-item .ti { font-size: 15px; color: var(--text-tertiary); }
.help-menu-sep { height: 1px; background: var(--border); margin: 4px 0; }

/* US-167: full-screen goodbye after the shutdown POST — the server is gone, so this is the last thing
   the page can show. The explicit display:flex below would beat the [hidden] UA default, so keep the
   [hidden] exception (the recurring LOOM trap — see Cycle 15 / .attach-chip[hidden]). */
#shutdown-overlay {
    position: fixed; inset: 0; z-index: 9000;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-0);
}
#shutdown-overlay[hidden] { display: none; }
#shutdown-overlay .shutdown-card { text-align: center; padding: 2rem; }
#shutdown-overlay .ti { font-size: 44px; color: var(--text-tertiary); }
#shutdown-overlay .shutdown-title { margin: 14px 0 4px; font-size: 18px; font-weight: 600; color: var(--text-primary); }
#shutdown-overlay .shutdown-sub { margin: 0; font-size: 14px; color: var(--text-secondary); }

/* US-296: the team-server login screen. Same full-screen shape as the shutdown overlay — including
   the [hidden] exception, because the explicit display:flex would otherwise beat the UA default
   (C15 rule, the recurring LOOM trap). */
#login-overlay {
    position: fixed; inset: 0; z-index: 9000;
    display: flex; align-items: center; justify-content: center;
    /* --surface-1, NOT --surface-0: the latter is never defined anywhere (see the US-263 note at
       .board-lane) — a login screen with a transparent background would show the app behind it. */
    background: var(--surface-1);
}
#login-overlay[hidden] { display: none; }
#login-overlay .login-card {
    display: flex; flex-direction: column; gap: 10px;
    width: min(360px, calc(100vw - 48px)); padding: 2rem; text-align: center;
}
#login-overlay .login-brand {
    font-family: var(--font-display); font-size: 26px; font-weight: 700;
    letter-spacing: 0.02em; color: var(--accent); margin-bottom: 6px;
}
#login-overlay .login-title { margin: 0; font-size: 17px; font-weight: 600; color: var(--text-primary); }
#login-overlay .login-sub { margin: 0 0 10px; font-size: 13.5px; color: var(--text-secondary); }
#login-overlay input {
    padding: 9px 12px; border: 0.5px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface-1); color: var(--text-primary);
    font-family: var(--font-mono); font-size: 13px; text-align: center;
}
#login-overlay input:focus { outline: none; border-color: var(--accent); }
#login-overlay .login-error { margin: 2px 0 0; font-size: 13px; color: var(--color-error); }
#login-overlay .login-error[hidden] { display: none; }
#login-overlay .login-foot { margin: 14px 0 0; font-size: 12px; color: var(--text-tertiary); line-height: 1.5; }

/* US-297: the operator's token list in the Settings App pane. */
.token-list { display: flex; flex-direction: column; gap: 6px; }
.token-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.token-row .tk-name { flex: 1; font-family: var(--font-mono); font-size: 12px; color: var(--text-primary); }
.token-row .tk-state { font-size: 11.5px; color: var(--text-tertiary); }
.token-row .tk-maintainer { font-size: 10.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); }
.token-row button {
    padding: 4px 10px; border: 0.5px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface-1); color: var(--text-secondary);
    font-size: 12px; cursor: pointer;
}
.token-row button:hover { border-color: var(--accent); color: var(--accent); }
/* The one moment the plaintext exists — deliberately loud, and selectable so copying by hand works
   even if the clipboard API is blocked (C42: never rely on navigator.clipboard alone). */
.token-reveal {
    display: flex; flex-direction: column; gap: 6px;
    padding: 10px 12px; margin-top: 4px;
    border: 0.5px solid var(--accent); border-radius: var(--radius-sm); background: var(--surface-2);
}
.token-reveal code { font-family: var(--font-mono); font-size: 12px; word-break: break-all; user-select: all; color: var(--text-primary); }
.token-reveal .tk-warn { font-size: 11.5px; color: var(--text-secondary); }

/* US-92: AI offline → dim + disable the ki-stub buttons. The manual path stays fully usable.
   US-96: the model switcher dims too — you can't switch when Ollama is down. */
body.ai-offline .ki-stub-btn,
body.ai-offline .ki-action,
body.ai-offline .model-switcher { opacity: 0.45; pointer-events: none; }

/* US-98: "New Story" reuses the solid .throw-flock-btn accent style — no override needed. */

/* US-98: story composer form (rendered into the beside-board drawer, #card-drawer). */
.composer-form { display: flex; flex-direction: column; gap: 16px; }
.cf-field { display: flex; flex-direction: column; gap: 5px; }
.cf-field > span { font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); }
.cf-field input, .cf-field textarea {
    background: var(--surface-2); color: var(--text-primary);
    border: 0.5px solid var(--border); border-radius: var(--radius-sm);
    padding: 8px 10px; font-family: inherit; font-size: 13px; resize: vertical;
}
.cf-field input:focus, .cf-field textarea:focus { outline: none; border-color: var(--accent); }
.cf-card { display: flex; flex-direction: column; gap: 10px; padding-left: 12px; border-left: 2px solid var(--border); }
.cf-acs { display: flex; flex-direction: column; gap: 8px; }
.cf-acs .ac-item { display: flex; align-items: flex-start; gap: 8px; }
.cf-acs .ac-bullet { color: var(--text-tertiary); padding-top: 6px; }
/* US-100 (Maintainer-Befund): the AK row is a textarea — multi-line + vertically resizable. */
.cf-acs .ac-input {
    flex: 1; background: var(--surface-2); color: var(--text-primary);
    border: 0.5px solid var(--border); border-radius: var(--radius-sm); padding: 6px 9px;
    font-family: inherit; font-size: 13px;
    resize: vertical; min-height: 30px; line-height: 1.4;
}
.cf-acs .ac-input:focus { outline: none; border-color: var(--accent); }
/* US-245 (Maintainer-Wunsch): auto-grow fields size themselves to their content — the manual
   resize handle and the inner scrollbar would fight the script-set height. */
textarea.auto-grow { resize: none; overflow-y: hidden; }
/* US-246: the tend CONVERSATION zone — condenser trigger row + the quiet proposal hint. */
#tend-conversation {
    width: 100%; background: var(--surface-2); color: var(--text-primary);
    border: 0.5px solid var(--border); border-radius: var(--radius-sm); padding: 6px 9px;
    font-family: inherit; font-size: 13px; line-height: 1.5; min-height: 54px;
}
#tend-conversation:focus { outline: none; border-color: var(--accent); }
.cv-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.cv-hint { font-size: 11px; color: var(--text-tertiary); }
.cv-hint[hidden] { display: none; }   /* C15: explicit display context needs the [hidden] exception */
.cv-hint .attach-link { margin-left: 4px; }
.cf-acs .ac-delete { background: transparent; border: 0; color: var(--text-tertiary); cursor: pointer; padding: 4px; }
.cf-acs .ac-delete:hover { color: var(--color-error); }
.cf-hint { color: var(--color-error); font-size: 12px; margin: 0; }
.cf-actions { display: flex; align-items: center; width: 100%; }

/* US-99: AI acceptance-criteria proposal block (✦ AI proposes N → Apply all/Discard). */
.cs-loading, .cs-err { font-family: var(--font-mono); font-size: 12px; color: var(--text-tertiary); margin: 8px 0 0; display: flex; align-items: center; gap: 6px; }
.cs-err { color: var(--color-error); }
.ac-proposal { margin-top: 10px; border: 0.5px solid color-mix(in srgb, var(--accent) 35%, var(--border)); border-radius: var(--radius-md); padding: 10px; }
.ac-proposal-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.ac-proposal-head .proposal-label { font-family: var(--font-mono); font-size: 12px; color: var(--accent); display: flex; align-items: center; gap: 5px; }
.ac-proposal-head .proposal-meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); }
.ac-proposal-list { display: flex; flex-direction: column; gap: 6px; }
.ac-item.proposed { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--text-primary); }
.ac-item.proposed .ac-bullet { color: var(--accent); }
.ac-item.proposed .ac-text { line-height: 1.4; }

/* US-93: SMART KI-action panel (FLOCK-013) — the reusable KI-action layout. */
.smart-panel { max-width: 560px; }
.smart-meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); margin-right: 8px; }
.smart-loading, .smart-err { font-size: 13px; color: var(--text-secondary); padding: 16px 4px; display: flex; align-items: center; gap: 8px; }
.smart-err { color: var(--color-warning); }
.smart-rows { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 14px; }
.smart-row { display: grid; grid-template-columns: 18px 92px 1fr; align-items: start; gap: 8px; font-size: 12px; }
.smart-row .ti { font-size: 15px; margin-top: 1px; }
.smart-row.ok .ti { color: var(--color-success); }
.smart-row.warn .ti { color: var(--color-warning); }
/* US-94: field-check rows — icon + reason (no SMART dimension column). */
.field-row { display: grid; grid-template-columns: 18px 1fr; align-items: start; gap: 8px; font-size: 12px; }
.field-row .ti { font-size: 15px; margin-top: 1px; }
.field-row.ok .ti { color: var(--color-success); }
.field-row.warn .ti { color: var(--color-warning); }
.smart-dim { font-weight: 600; color: var(--text-primary); }
.smart-reason { color: var(--text-secondary); line-height: 1.4; }
.smart-scoreline { display: flex; align-items: center; gap: 9px; margin: 10px 0 14px; flex-wrap: wrap; }
/* US-134 (FLOCK-050): the score is reframed as a rough traffic-light — de-emphasised so the five
   criteria reasons stay king; the exact number suggested precision the local model doesn't have. */
.smart-score { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.score-dot { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 auto; }
.score-dot.bad { background: var(--color-error); }
.score-dot.mid { background: var(--color-warning); }
.score-dot.good { background: var(--color-success); }
.smart-score-cap { font-size: 11.5px; color: var(--text-tertiary); font-style: italic; }
.smart-score-label { font-size: 11px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.04em; }
.smart-suggest { background: var(--surface-2); border: 0.5px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px; margin-bottom: 14px; }
.smart-suggest header { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-tertiary); margin-bottom: 4px; }
.smart-suggest p { font-size: 13px; color: var(--text-primary); margin: 0; line-height: 1.45; }
.smart-suggest-input {
    width: 100%; box-sizing: border-box; resize: vertical; min-height: 56px;
    font-family: inherit; font-size: 13px; line-height: 1.45;
    background: var(--surface-1); color: var(--text-primary);
    border: 0.5px solid var(--border); border-radius: var(--radius-sm); padding: 7px 9px;
}
.smart-suggest-input:focus { border-color: var(--accent); outline: none; }
.smart-actions { display: flex; align-items: center; gap: 8px; }
.smart-btn { font-family: var(--font-mono); font-size: 12px; padding: 6px 12px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-primary); border: 0.5px solid var(--border); cursor: pointer; }
.smart-btn:hover { border-color: var(--border-strong); }
.smart-btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); display: inline-flex; align-items: center; gap: 5px; }
/* US-144: KI tag-suggestion hint under the quick-throw textarea (empty → no box, no stray margin). */
.ki-tag-hint { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); margin: 6px 2px 0; }
.ki-tag-hint:empty { display: none; }

/* US-215: two-depth capture — subtype chips (depth 1). note is the default seed; active = indigo accent. */
.subtype-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 2px 0; }
.subtype-chip {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12px; padding: 4px 11px; border-radius: 999px;
    border: 1px solid var(--border); background: transparent; color: var(--text-secondary); cursor: pointer;
}
.subtype-chip .ti { font-size: 14px; }
.subtype-chip:hover { border-color: var(--accent); color: var(--accent); }
.subtype-chip.active {
    border-color: var(--accent); color: var(--accent);
    background: color-mix(in srgb, var(--accent) 14%, transparent);
}

/* US-216: depth 2 — the decision template fields (shown only for templated subtypes). */
.beacon-template { display: flex; flex-direction: column; gap: 8px; margin: 10px 2px 0; }
.beacon-template[hidden], .smart-btn[hidden] { display: none; }   /* C15: explicit display needs a [hidden] exception */
.bt-shape-row { display: flex; align-items: center; gap: 10px; }
.bt-shape-label { font-size: 12px; color: var(--text-tertiary); }
.bt-shape-label .ti { color: var(--accent); vertical-align: -2px; }
.bt-field { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--text-secondary); }
.bt-field textarea { min-height: 38px; }
/* US-220: cross-cutting Related-picker (link stories/beacons/flocks → related_*). */
.beacon-related { display: flex; flex-direction: column; gap: 6px; margin: 10px 2px 0; font-size: 12px; color: var(--text-secondary); }
.beacon-related input { font: inherit; padding: 7px 9px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-1); color: var(--text-primary); }
/* US-240: the results/chips run on the shared weave classes (weave.js); only .rel-kind stays
   (the weave result rows carry it). The former .rel-results/.rel-result/.rel-chip(s) are gone. */
.rel-kind { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-tertiary); }
/* US-240: type-first composer — the ask line, the per-type hint, and the optional draft zone. */
.bc-ask { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); margin: 2px 2px 0; }
.bc-type-hint { font-size: 12px; color: var(--text-tertiary); margin: 0 2px 4px; min-height: 15px; }
.bc-draft { border: 0.5px solid var(--border); border-radius: var(--radius-md); background: var(--surface-1); padding: 9px 10px; margin-bottom: 10px; }
.bc-draft textarea { width: 100%; min-height: 52px; margin-top: 7px; }
/* US-144 (Stufe 2): weekly stand-up modal — question labels + compact answer fields. */
.standup-q { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.04em; margin: 10px 2px 3px; }
#standup-modal-overlay .standup-field { min-height: 40px; }
#standup-modal-overlay #standup-braindump { min-height: 56px; }

/* US-120: ratify controls in the beacon detail drawer (decision + proposed). Token-based, semantic. */
.ratify-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ratify-btn { font-family: var(--font-mono); font-size: 12px; padding: 6px 12px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-primary); border: 0.5px solid var(--border); cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.ratify-btn:hover { border-color: var(--border-strong); }
.ratify-btn.accept { color: var(--color-success); border-color: color-mix(in srgb, var(--color-success) 45%, transparent); }
.ratify-btn.accept:hover { background: color-mix(in srgb, var(--color-success) 14%, transparent); }
.ratify-btn.reject { color: var(--color-error); border-color: color-mix(in srgb, var(--color-error) 45%, transparent); }
.ratify-btn.reject:hover { background: color-mix(in srgb, var(--color-error) 14%, transparent); }
.ratify-hint { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); margin-top: 6px; }
.ratify-status { font-family: var(--font-mono); font-weight: 600; text-transform: uppercase; }
.ratify-status.accepted   { color: var(--color-success); }
.ratify-status.rejected   { color: var(--color-error); }
.ratify-status.superseded { color: var(--text-tertiary); }


/* ----- Date-Range Selector --------------------------------------------- */
.date-range-select {
    background: var(--surface-2);
    color: var(--text-primary);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 5px 10px;
    font-family: var(--font-mono);
    font-size: 11px;
    cursor: pointer;
}


/* ----- Auto-Toggle für setup-edit ------------------------------------- */
.auto-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    color: var(--text-secondary);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    font-family: var(--font-mono);
    font-size: 11px;
    cursor: pointer;
    transition: border-color var(--motion-fast) var(--ease-out);
}
.auto-toggle.active { color: var(--accent); border-color: var(--accent); }
.auto-toggle .ti { font-size: 13px; }


/* ============================================================================
 * Setup-Detail-Form-Patterns (ADR-0013)
 * ============================================================================ */

/* Setup-Drawer Basis */
/* US-80: Setup-Section wird Grid, der Drawer ist Spalte 2 (beside-content, Muster aus
   US-73/US-78). Topbar/Sub-Bar/Cards bleiben sichtbar; der Inhalt schrumpft beim Öffnen.
   minmax(0,1fr) kappt das Aufblähen; grid-row:1 verbietet den Zeilen-Umbruch. */
/* US-197 (BEACON-196): focus model — nav rail (col 1) + one main panel (col 2) that shows the
   overview landing OR the focus editor, never beside-content. Replaces the US-80 grid-column drawer. */
[data-section="setup"] .section-setup {
    display: grid;
    grid-template-columns: 168px minmax(0, 1fr);
    grid-template-rows: 1fr;
    height: 100%;
    overflow: hidden;
}
/* min-height:0 begrenzt die Grid-Kinder auf die Zeilenhöhe (statt auf Inhaltshöhe zu wachsen) —
   sonst scrollt der Editor-Body nicht, lange Dialoge überlaufen (US-82-Lehre). */
.section-setup > #setup-rail   { grid-column: 1; grid-row: 1; min-height: 0; overflow-y: auto; border-right: 0.5px solid var(--border); padding: 10px 8px; }
.section-setup > .setup-view   { grid-column: 2; grid-row: 1; min-width: 0; min-height: 0; overflow: auto; }
.section-setup > #setup-drawer { grid-column: 2; grid-row: 1; min-width: 0; min-height: 0; border-left: none; }
.section-setup:not(.editing) > #setup-drawer { display: none; }
.section-setup.editing > .setup-view { display: none; }

/* Nav-rail items — icon + name + status dot; active = accent-tinted with accent border. */
.setup-rail { display: flex; flex-direction: column; gap: 2px; }
.setup-rail-item {
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 7px 9px;
    border: 1.5px solid transparent; border-radius: 7px;
    background: transparent; cursor: pointer;
    font-family: inherit; font-size: 12.5px; text-align: left;
    color: var(--text-secondary);
}
.setup-rail-item:hover { background: var(--surface-2); }
.setup-rail-item.active {
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    border-color: var(--accent); color: var(--accent); font-weight: 500;
}
.setup-rail-item i { font-size: 15px; color: var(--text-tertiary); flex-shrink: 0; }
.setup-rail-item.active i { color: var(--accent); }
.setup-rail-item .rail-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.setup-rail-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.setup-rail-dot.good { background: var(--color-success); }
.setup-rail-dot.warn { background: var(--color-warning); }
.setup-rail-dot.bad  { background: var(--color-error); }
.setup-rail-sep { height: 0.5px; background: var(--border); margin: 5px 4px; }

.setup-drawer {
    background: var(--surface-1);
    border-left: 0.5px solid var(--border);
    display: flex;
    flex-direction: column;
}

.setup-drawer .drawer-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border-bottom: 0.5px solid var(--border-subtle);
}
.setup-drawer .drawer-header .header-icon-box {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.setup-drawer .drawer-header .header-icon-box i { font-size: 28px; }
.setup-drawer .drawer-header .header-text { flex: 1; }
.setup-drawer .drawer-header .dialog-name {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    display: block;
}
.setup-drawer .drawer-header .dialog-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-top: 4px;
    display: block;
}
.setup-drawer .drawer-header .close {
    background: transparent;
    color: var(--text-tertiary);
    border: 0;
    padding: 6px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    align-self: flex-start;
}
.setup-drawer .drawer-header .close:hover { background: var(--surface-2); color: var(--text-primary); }

.setup-drawer .drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* US-198: focus panel is ~1150px wide — far wider than the old 520px drawer. Constrain the editor
   content to a comfortable centered column so form fields/textareas don't span the full width.
   Header, body and footer share the column so they stay aligned. */
.setup-drawer .drawer-header,
.setup-drawer .drawer-body,
.setup-drawer .save-footer,
.setup-drawer .save-reason-zone { width: 100%; max-width: 880px; margin-inline: auto; }

.setup-drawer .save-footer {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 0.5px solid var(--border);
    background: var(--surface-1);
}
.setup-drawer .save-footer .spacer { flex: 1; }

.setup-drawer .cancel-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 14px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
}
.setup-drawer .save-btn {
    background: var(--accent-fill);
    color: var(--on-accent);
    border: 0;
    border-radius: var(--radius-sm);
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: opacity var(--motion-fast) var(--ease-out);
}
.setup-drawer .save-btn:hover { opacity: 0.9; }

/* Save-Reason-Zone (inline expand) */
.save-reason-zone {
    padding: 14px 16px;
    background: color-mix(in srgb, var(--accent) 8%, transparent);
    border-top: 0.5px solid var(--accent);
}
.save-reason-zone[hidden] { display: none; }
.save-reason-zone label {
    display: block;
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 500;
}
.save-reason-zone label .required { color: var(--color-error); }
.save-reason-zone textarea {
    width: 100%;
    box-sizing: border-box;
    background: var(--surface-2);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    padding: 8px 10px;
    outline: none;
    resize: vertical;
    min-height: 56px;
}
.save-reason-zone textarea:focus { border-color: var(--accent); }
.save-reason-zone textarea.error { border-color: var(--color-error); }
.save-reason-zone .field-error {
    font-size: 11px;
    color: var(--color-error);
    margin-top: 4px;
    display: none;
}
.save-reason-zone textarea.error + .field-error { display: block; }
.save-reason-zone .actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 10px;
}
.save-reason-zone .save-with-reason-btn {
    background: var(--accent-fill);
    color: var(--on-accent);
    border: 0;
    border-radius: var(--radius-sm);
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}


/* ----- Form-Patterns -------------------------------------------------- */
.form-section { margin-bottom: 20px; }
.form-section:last-child { margin-bottom: 0; }
.form-section > .section-label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.2em;
    color: var(--text-secondary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.form-section > .section-label .count {
    color: var(--text-tertiary);
    font-weight: 400;
}

.form-field { margin-bottom: 12px; }
.form-field label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.form-field label .required { color: var(--color-error); }
.form-field input[type="text"],
.form-field input[type="date"],
.form-field select,
.form-field textarea {
    width: 100%;
    box-sizing: border-box;
    background: var(--surface-2);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    padding: 6px 9px;
    outline: none;
    transition: border-color var(--motion-fast) var(--ease-out);
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus { border-color: var(--accent); }
.form-field textarea { min-height: 60px; resize: vertical; }
/* US-82 (FLOCK-038): Name + Organisation nebeneinander; Contact steht als eigene Zeile darunter. */
.client-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-field .field-hint {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 4px;
    font-family: var(--font-mono);
}

/* Editable Form-Table */
.form-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 8px;
}
.form-table th,
.form-table td {
    text-align: left;
    padding: 6px 8px;
    border-bottom: 0.5px solid var(--border-subtle);
    font-size: 12px;
    vertical-align: top;
}
.form-table th {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    color: var(--text-tertiary);
    font-weight: 400;
}
.form-table td input[type="text"],
.form-table td select,
.form-table td textarea {
    width: 100%;
    box-sizing: border-box;
    background: var(--surface-2);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 12px;
    padding: 4px 6px;
    outline: none;
}
.form-table td.delete-col {
    width: 28px;
    text-align: center;
    padding-right: 0;
}
.form-table .delete-row-btn {
    background: transparent;
    color: var(--text-tertiary);
    border: 0;
    padding: 4px;
    cursor: pointer;
    border-radius: var(--radius-sm);
}
.form-table .delete-row-btn:hover { color: var(--color-error); }

.add-item-btn {
    background: transparent;
    color: var(--accent);
    border: 0.5px dashed color-mix(in srgb, var(--accent) 50%, transparent);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-family: var(--font-mono);
    font-size: 12px;
    cursor: pointer;
    width: 100%;
    text-align: center;
    transition: border-color var(--motion-fast) var(--ease-out);
}
.add-item-btn:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.add-item-btn .ti { font-size: 13px; vertical-align: -2px; margin-right: 4px; }

/* Pin-Toggle für Communication Rules Focus */
.pin-toggle {
    background: transparent;
    color: var(--text-tertiary);
    border: 0;
    padding: 4px;
    cursor: pointer;
    border-radius: var(--radius-sm);
}
.pin-toggle:hover { color: var(--accent); }
.pin-toggle.active { color: var(--accent); }
.pin-toggle.active .ti { transform: rotate(45deg); }
.pin-toggle .ti { font-size: 14px; transition: transform var(--motion-fast) var(--ease-out); }

/* Goal-Item-Block (für Dialog 4) */
.goal-item {
    background: var(--surface-2);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    margin-bottom: 8px;
}
.goal-item .goal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.goal-item .goal-id {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
}
.goal-item .smart-bar-inline {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.goal-item .ki-action.compact {
    padding: 3px 8px;
    font-size: 11px;
}
.goal-item textarea { min-height: 40px; }

/* Communication-Rules Focus-Card-Stack */
.focus-cards {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}
.focus-card {
    background: var(--surface-2);
    border: 0.5px solid var(--accent);
    border-left: 2px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
}
.focus-card .focus-title {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}
.focus-card .focus-consequence {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}
.focus-hint {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
    padding: 8px 10px;
    background: color-mix(in srgb, var(--accent) 6%, transparent);
    border-radius: var(--radius-sm);
}
.focus-hint a { color: var(--accent); text-decoration: none; }

/* Form-Sub-Tabs (für Project Description) */
.form-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 0.5px solid var(--border);
    margin-bottom: 14px;
}
.form-tabs button {
    background: transparent;
    color: var(--text-tertiary);
    border: 0;
    padding: 6px 12px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.form-tabs button.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Eskalations-Box (Fallback Dialog 6) */
.escalation-rule {
    background: var(--surface-2);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    margin-top: 12px;
}
.escalation-rule .escalation-level {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}
.escalation-rule .escalation-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 6px;
}
.escalation-rule .level-immediate .escalation-dot { background: var(--color-error); }
.escalation-rule .level-48h .escalation-dot { background: var(--color-warning); }
.escalation-rule .level-review .escalation-dot { background: var(--color-success); }
.escalation-rule .escalation-text {
    width: 100%;
    box-sizing: border-box;
    background: var(--surface-1);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    padding: 8px 10px;
    outline: none;
    min-height: 56px;
    resize: vertical;
}


/* ----- Form-Grid (BOARD-Sektion in Dialog 1) ----------------------------- */
.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}
.form-grid-3 .form-field { margin-bottom: 0; }

/* ----- Stack-Items (Dialog 1 Remake) ------------------------------------ */
.stack-tags-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 6px 0 10px;
    border-bottom: 0.5px solid var(--border-subtle);
    margin-bottom: 12px;
}
.stack-tags-bar .label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    margin-right: 4px;
}
.stack-tag {
    background: var(--surface-2);
    color: var(--text-secondary);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 3px 10px;
    font-family: var(--font-mono);
    font-size: 11px;
    cursor: pointer;
    transition: border-color var(--motion-fast) var(--ease-out);
}
.stack-tag:hover { border-color: var(--accent); color: var(--accent); }
.stack-tag.active {
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    color: var(--accent);
    border-color: var(--accent);
}
.stack-tag .count {
    opacity: 0.6;
    margin-left: 4px;
    font-size: 10px;
}

.stack-item {
    background: var(--surface-2);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 8px;
    transition: border-color var(--motion-fast) var(--ease-out);
}
.stack-item:hover { border-color: var(--border-strong); }
.stack-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.stack-item-header .item-name {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}
.stack-item-header .item-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.stack-item-header .item-tag {
    background: color-mix(in srgb, var(--accent) 15%, transparent);
    color: var(--accent);
    padding: 1px 7px;
    border-radius: var(--radius-pill);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.06em;
}
.stack-item-header .actions {
    margin-left: auto;
    display: flex;
    gap: 2px;
}
.stack-item-header .actions button {
    background: transparent;
    color: var(--text-tertiary);
    border: 0;
    padding: 4px;
    cursor: pointer;
    border-radius: var(--radius-sm);
}
.stack-item-header .actions button:hover { color: var(--text-primary); background: var(--surface-1); }
.stack-item .item-description {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 4px;
}
.stack-item .item-reason {
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.5;
    font-style: italic;
    padding-left: 10px;
    border-left: 2px solid var(--border);
    margin-top: 6px;
}
.stack-item .item-reason::before {
    content: 'why · ';
    font-family: var(--font-mono);
    font-size: 10px;
    font-style: normal;
    color: var(--text-tertiary);
    letter-spacing: 0.1em;
}

/* Stack-Item Inline-Editor (Add/Edit) */
.stack-item-editor {
    background: var(--surface-2);
    border: 0.5px solid var(--accent);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 8px;
}
.stack-item-editor .editor-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: flex-start; }
.stack-item-editor .editor-row label {
    flex: 0 0 90px;
    font-size: 12px;
    color: var(--text-secondary);
    padding-top: 6px;
}
.stack-item-editor input[type="text"],
.stack-item-editor textarea {
    flex: 1;
    background: var(--surface-1);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    padding: 6px 9px;
    outline: none;
}
.stack-item-editor textarea { min-height: 50px; resize: vertical; }
.stack-item-editor .editor-tags-input {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    background: var(--surface-1);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 5px 8px;
    min-height: 32px;
}
.stack-item-editor .editor-tags-input .picked-tag {
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    color: var(--accent);
    padding: 1px 7px;
    border-radius: var(--radius-pill);
    font-family: var(--font-mono);
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.stack-item-editor .editor-tags-input .picked-tag .remove {
    background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font-size: 12px;
}
.stack-item-editor .editor-tags-input input {
    flex: 1;
    min-width: 120px;
    background: transparent;
    border: 0;
    outline: 0;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 12px;
    padding: 2px 0;
}
.stack-item-editor .editor-tag-suggestions {
    display: flex;
    gap: 4px;
    margin-top: 6px;
    flex-wrap: wrap;
}
.stack-item-editor .editor-tag-suggestions .suggest {
    background: transparent;
    color: var(--text-tertiary);
    border: 0.5px dashed var(--border);
    border-radius: var(--radius-pill);
    padding: 2px 8px;
    font-family: var(--font-mono);
    font-size: 10px;
    cursor: pointer;
}
.stack-item-editor .editor-tag-suggestions .suggest:hover { border-color: var(--accent); color: var(--accent); }
.stack-item-editor .editor-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 0.5px solid var(--border);
}
.stack-item-editor .editor-actions button {
    background: transparent;
    color: var(--text-secondary);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
}
.stack-item-editor .editor-actions .save {
    background: var(--accent-fill);
    color: var(--on-accent);
    border-color: transparent;
    font-weight: 500;
}


/* ----- Subsystem-Item (Dialog 3 Remake) -------------------------------- */
.subsystem-item {
    background: var(--surface-2);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 10px;
}
.subsystem-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 0.5px solid var(--border-subtle);
}
.subsystem-header .subsystem-num {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    color: var(--accent);
    font-weight: 500;
}
.subsystem-header .subsystem-sep {
    color: var(--border);
}
.subsystem-header .subsystem-id {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
}
.subsystem-header .subsystem-close {
    background: transparent;
    color: var(--text-tertiary);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 3px 5px;
    cursor: pointer;
    transition: border-color var(--motion-fast) var(--ease-out), color var(--motion-fast) var(--ease-out);
}
.subsystem-header .subsystem-close:hover {
    border-color: var(--color-error);
    color: var(--color-error);
}


/* ----- Goals Dashboard: Distribution + Notes ---------------------------- */
.distribution-block {
    padding: 14px 16px;
    background: var(--surface-2);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}
.distribution-block .dist-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 10px;
}
.distribution-block .legend-dot {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 12px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
}
.distribution-block .legend-dot::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.distribution-block .legend-dot.red::before    { background: var(--color-error); }
.distribution-block .legend-dot.orange::before { background: var(--color-warning); }
.distribution-block .legend-dot.green::before  { background: var(--color-success); }

.distribution-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
}
.member-dist-card {
    background: var(--surface-1);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    border-left: 3px solid var(--border);
}
.member-dist-card.dist-red    { border-left-color: var(--color-error);   background: color-mix(in srgb, var(--color-error) 6%, var(--surface-1)); }
.member-dist-card.dist-orange { border-left-color: var(--color-warning); background: color-mix(in srgb, var(--color-warning) 6%, var(--surface-1)); }
.member-dist-card.dist-green  { border-left-color: var(--color-success); background: color-mix(in srgb, var(--color-success) 6%, var(--surface-1)); }
.member-dist-card .member-name {
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 4px;
}
.member-dist-card .member-counts {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
}
.member-dist-card .member-counts strong {
    color: var(--accent);
    margin-right: 4px;
}

.notes-banner {
    background: color-mix(in srgb, var(--color-warning) 12%, transparent);
    border: 0.5px solid var(--color-warning);
    border-left: 2px solid var(--color-warning);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-top: 16px;
}
.notes-banner .notes-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--color-warning);
    font-weight: 500;
    margin-bottom: 8px;
}
.notes-banner ul {
    margin: 0;
    padding-left: 22px;
    font-size: 12px;
    color: var(--text-primary);
    line-height: 1.6;
}
.notes-banner li { margin-bottom: 4px; }
.notes-banner li:last-child { margin-bottom: 0; }


/* ----- Milestone-Item + Status-Badges (Dialog 5) ----------------------- */
.milestone-item {
    background: var(--surface-2);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 12px;
}
.milestone-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 0.5px solid var(--border-subtle);
}
.milestone-header .milestone-num {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    color: var(--accent);
    font-weight: 500;
}
.milestone-header .milestone-sep { color: var(--border); }
.milestone-header .milestone-id {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
}
.milestone-header .ms-status-pill {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.ms-status-pill.active   { background: color-mix(in srgb, var(--color-success) 18%, transparent); color: var(--color-success); }
.ms-status-pill.upcoming { background: rgba(255,255,255,0.07);                                     color: var(--text-secondary); }
.ms-status-pill.planned  { background: color-mix(in srgb, var(--accent) 18%, transparent);         color: var(--accent); }
.ms-status-pill.done     { background: color-mix(in srgb, var(--color-success) 22%, transparent);  color: var(--color-success); }
.ms-status-pill.overdue  { background: color-mix(in srgb, var(--color-error) 18%, transparent);    color: var(--color-error); }
.ms-status-pill.atrisk   { background: color-mix(in srgb, var(--color-warning) 18%, transparent);  color: var(--color-warning); }
.milestone-header .ms-close {
    margin-left: auto;
    background: transparent;
    color: var(--text-tertiary);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 3px 5px;
    cursor: pointer;
}
.milestone-header .ms-close:hover { border-color: var(--color-error); color: var(--color-error); }

.deliverables-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 6px;
}
.deliverables-table th,
.deliverables-table td {
    text-align: left;
    padding: 6px 8px;
    border-bottom: 0.5px solid var(--border-subtle);
    font-size: 12px;
    vertical-align: top;
}
.deliverables-table th {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    color: var(--text-tertiary);
    font-weight: 400;
}
.deliverables-table td:first-child {
    white-space: nowrap;
    padding-right: 12px;
    color: var(--text-primary);
    font-weight: 500;
    width: 40%;
}
.deliverables-table textarea {
    width: 100%;
    box-sizing: border-box;
    background: var(--surface-1);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 12px;
    padding: 6px 8px;
    outline: none;
    min-height: 38px;
    resize: vertical;
}
.deliverables-table textarea:focus { border-color: var(--accent); }
.deliverables-table .empty-marker {
    display: inline-block;
    margin-left: 6px;
    color: var(--color-warning);
    font-family: var(--font-mono);
    font-size: 10px;
}


/* ----- Fallback-Dialog Components (Dialog 6) --------------------------- */
.practice-banner {
    background: color-mix(in srgb, var(--color-iron-hot) 14%, transparent);
    border: 0.5px solid var(--color-iron);
    border-left: 2px solid var(--color-iron);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 16px;
}
.practice-banner .tag-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.practice-banner .tag {
    background: var(--color-iron);
    color: #FFFFFF;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
}
.practice-banner .meta {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--color-iron);
    letter-spacing: 0.15em;
}
.practice-banner .punch {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
    margin: 0 0 8px;
    font-weight: 500;
}
.practice-banner .quote {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
    font-style: italic;
}

.scenario-card {
    background: var(--surface-2);
    border: 0.5px solid var(--border);
    border-left: 2px solid var(--accent);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 10px;
}
.scenario-card .scenario-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.scenario-card .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--on-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    flex-shrink: 0;
}
.scenario-card .scenario-name {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}
.scenario-card .scenario-default {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}
.scenario-card .field-block,
.special-card .field-block { margin-bottom: 12px; }
.scenario-card .field-block:last-child,
.special-card .field-block:last-child { margin-bottom: 0; }
.scenario-card .field-block .field-label,
.special-card .field-block .field-label {
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 4px;
    display: block;
}
.scenario-card .field-block textarea,
.special-card .field-block textarea {
    width: 100%;
    box-sizing: border-box;
    background: var(--surface-1);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    padding: 8px 10px;
    outline: none;
    min-height: 56px;
    resize: vertical;
}
.scenario-card .handoff-sub {
    border-top: 0.5px dashed var(--border);
    padding-top: 10px;
    margin-top: 10px;
}
.scenario-card .handoff-sub .label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.15em;
    color: var(--text-tertiary);
    display: block;
    margin-bottom: 4px;
}
.scenario-card .handoff-sub .hint {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.5;
}
.handoff-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}
.handoff-row select {
    flex: 1;
    background: var(--surface-1);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 12px;
    padding: 5px 8px;
    outline: none;
}
.handoff-row .arrow {
    font-family: var(--font-mono);
    color: var(--text-tertiary);
    padding: 0 4px;
}
.handoff-row .remove-row {
    background: transparent;
    color: var(--text-tertiary);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 6px;
    cursor: pointer;
}
.handoff-row .remove-row:hover { color: var(--color-error); border-color: var(--color-error); }

/* Special-Situation Cards */
.special-card {
    background: var(--surface-2);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 10px;
    border-left: 2px solid var(--border);
}
.special-card.motivation { border-left-color: var(--color-warning); background: color-mix(in srgb, var(--color-warning) 4%, var(--surface-2)); }
.special-card.double-out { border-left-color: var(--color-error); background: color-mix(in srgb, var(--color-error) 4%, var(--surface-2)); }
.special-card.maintainer { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 4%, var(--surface-2)); }
.special-card .special-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.special-card .special-icon-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    flex-shrink: 0;
}
.special-card.motivation .special-icon-circle { background: var(--color-warning); }
.special-card.double-out .special-icon-circle { background: var(--color-error); }
.special-card.maintainer .special-icon-circle { background: var(--accent); }
.special-card .special-icon-circle i { font-size: 18px; }
.special-card .special-title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--accent);
}
.special-card.motivation .special-title { color: var(--color-warning); }
.special-card.double-out .special-title { color: var(--color-error); }
.special-card.maintainer .special-title { color: var(--accent); }


/* ----- Communication Rules · Remake (Dialog 7) ------------------------- */
.moderation-banner {
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border: 0.5px solid var(--accent);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 14px;
}
.moderation-banner .label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.2em;
    color: var(--accent);
    font-weight: 500;
    margin: 0 0 6px;
    display: block;
}
.moderation-banner .question {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin: 0 0 8px;
}
.moderation-banner .sub {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.rule-card {
    background: var(--surface-2);
    border: 0.5px solid var(--border);
    border-left: 3px solid var(--border-strong);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: border-left-color var(--motion-fast) var(--ease-out);
}
.rule-card.focus { border-left-color: var(--color-success); }
.rule-card.empty { border-left-color: var(--border-strong); opacity: 0.7; }
.rule-card .pin-area {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.rule-card .num-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border-strong);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 500;
}
.rule-card.focus .num-circle { background: var(--color-success); }
.rule-card.empty .num-circle { background: var(--border-strong); color: var(--text-tertiary); }
.rule-card .pin-btn {
    background: transparent;
    color: var(--text-tertiary);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 3px 5px;
    cursor: pointer;
    transition: color var(--motion-fast) var(--ease-out), border-color var(--motion-fast) var(--ease-out);
}
.rule-card .pin-btn:hover { color: var(--color-success); border-color: var(--color-success); }
.rule-card.focus .pin-btn { color: var(--color-success); border-color: var(--color-success); background: color-mix(in srgb, var(--color-success) 12%, transparent); }
.rule-card .pin-btn .ti { font-size: 13px; }
.rule-card .delete-btn {
    background: transparent;
    color: var(--text-tertiary);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 3px 5px;
    cursor: pointer;
    transition: color var(--motion-fast) var(--ease-out), border-color var(--motion-fast) var(--ease-out);
}
.rule-card .delete-btn:hover { color: var(--color-error); border-color: var(--color-error); }
.rule-card .delete-btn .ti { font-size: 13px; }
/* Backward-compat falls noch alte Klasse genutzt wird */
.focus-rule-card { /* alias to .rule-card.focus */
    background: var(--surface-2);
    border: 0.5px solid var(--border);
    border-left: 3px solid var(--color-success);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.focus-rule-card.empty { border-left-color: var(--border-strong); opacity: 0.7; }
.focus-rule-card .num-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-success);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 500;
    flex-shrink: 0;
}
.focus-rule-card.empty .num-circle { background: var(--border-strong); color: var(--text-tertiary); }
.rule-card .rule-body,
.focus-rule-card .rule-body { flex: 1; }
.rule-card .rule-field,
.focus-rule-card .rule-field { margin-bottom: 8px; }
.rule-card .rule-field:last-child,
.focus-rule-card .rule-field:last-child { margin-bottom: 0; }
.rule-card .rule-field label,
.focus-rule-card .rule-field label {
    display: block;
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 4px;
}
.rule-card .rule-field input[type="text"],
.rule-card .rule-field textarea,
.focus-rule-card .rule-field input[type="text"],
.focus-rule-card .rule-field textarea {
    width: 100%;
    box-sizing: border-box;
    background: var(--surface-1);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    padding: 7px 9px;
    outline: none;
}
.rule-card .rule-field textarea,
.focus-rule-card .rule-field textarea { min-height: 56px; resize: vertical; }

.rule-pool-section {
    background: var(--surface-2);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-top: 16px;
}
.rule-pool-section .pool-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0 0 10px;
    line-height: 1.5;
}
.cross-ref {
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    border: 0.5px solid var(--accent);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
}
.cross-ref .source-tag {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    color: #FFFFFF;
    background: var(--accent);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    flex-shrink: 0;
    align-self: flex-start;
}
.rule-pool-section .pool-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.pool-pill {
    background: var(--surface-1);
    color: var(--text-primary);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: border-color var(--motion-fast) var(--ease-out), color var(--motion-fast) var(--ease-out);
}
.pool-pill:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.pool-pill .ti { font-size: 11px; margin-right: 3px; vertical-align: -1px; }


/* ============================================================================
 * Roadmap (Dialog 8, ADR-0014)
 * ============================================================================ */

/* Version Distribution Pills (Header) */
.version-distribution {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.vd-pill {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    padding: 5px 11px;
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    color: var(--text-secondary);
    border: 0.5px solid var(--border);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.vd-pill strong { font-weight: 700; }
.vd-pill.released { color: var(--color-success); border-color: var(--color-success); background: color-mix(in srgb, var(--color-success) 10%, transparent); }
.vd-pill.current  { color: var(--accent);        border-color: var(--accent);        background: color-mix(in srgb, var(--accent) 12%, transparent); }
.vd-pill.next     { color: #5DCAA5;              border-color: #5DCAA5;              background: color-mix(in srgb, #5DCAA5 10%, transparent); }
.vd-pill.planned  { color: var(--color-warning); border-color: var(--color-warning); background: color-mix(in srgb, var(--color-warning) 10%, transparent); }
.vd-pill.backlog  { color: var(--text-tertiary); border-color: var(--border); }

/* US-174 (FLOCK-110): pinned "currently building" highlight above the version list. */
.current-version-banner {
    background: color-mix(in srgb, var(--accent) 8%, var(--surface-2));
    border: 0.5px solid var(--accent);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 14px;
}
.cvb-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.cvb-eyebrow {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.cvb-id {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}
.cvb-date {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.cvb-notes {
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.cvb-meta {
    display: inline-block;
    margin-top: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
}

/* Version-Card */
.version-card {
    background: var(--surface-2);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 12px;
    border-left: 3px solid var(--border-strong);
}
.version-card[data-status="released"] { border-left-color: var(--color-success); }
.version-card[data-status="current"]  { border-left-color: var(--accent); }
.version-card[data-status="next"]     { border-left-color: #5DCAA5; }
.version-card[data-status="planned"]  { border-left-color: var(--color-warning); }
.version-card[data-status="backlog"]  { border-left-color: var(--text-tertiary); }

.version-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 0.5px solid var(--border-subtle);
    cursor: pointer;   /* US-271: the header folds / unfolds the version */
}
/* US-271 (FLOCK-157): collapsible version cards. The chevron rotates; the body folds. */
.version-chevron { font-size: 15px; color: var(--text-tertiary); transition: transform var(--motion-fast) var(--ease-out); }
.version-card.collapsed .version-chevron { transform: rotate(-90deg); }
.version-card.collapsed .version-header { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.version-card.collapsed .version-body { display: none; }
.version-header .version-num {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    color: var(--accent);
    font-weight: 500;
}
.version-header .version-sep { color: var(--border); }
.version-header .version-id {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}
.version-status-pill {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
}
.version-status-pill.released { color: var(--color-success); background: color-mix(in srgb, var(--color-success) 18%, transparent); }
.version-status-pill.current  { color: var(--accent);        background: color-mix(in srgb, var(--accent) 18%, transparent); }
.version-status-pill.next     { color: #5DCAA5;              background: color-mix(in srgb, #5DCAA5 15%, transparent); }
.version-status-pill.planned  { color: var(--color-warning); background: color-mix(in srgb, var(--color-warning) 15%, transparent); }
.version-status-pill.backlog  { color: var(--text-tertiary); background: rgba(255,255,255,0.05); }

.version-card .version-close {
    margin-left: auto;
    background: transparent;
    color: var(--text-tertiary);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 3px 5px;
    cursor: pointer;
}
.version-card .version-close:hover { border-color: var(--color-error); color: var(--color-error); }

.version-features-section {
    margin-top: 14px;
}
.version-features-section > header {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}
.version-features-section .count { color: var(--text-tertiary); font-weight: 400; }

/* Feature-Card (kompakter als Version-Card) */
.feature-card {
    background: var(--surface-1);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 6px;
}
.feature-card .feature-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.feature-card input[type="text"].feature-title {
    flex: 1;
    background: var(--surface-2);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    padding: 5px 8px;
    outline: none;
}
.feature-card .feature-status-select {
    background: var(--surface-2);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 4px 8px;
    outline: none;
}
.feature-card .feature-status-select.s-planned     { color: var(--color-warning); }
.feature-card .feature-status-select.s-in-progress { color: var(--accent); }
.feature-card .feature-status-select.s-done        { color: var(--color-success); }
/* US-57 (FLOCK-017): "move to version" select — same token look as the status-select. */
.feature-card .feature-move {
    background: var(--surface-2);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 4px 8px;
    outline: none;
}
.feature-card .feature-delete {
    background: transparent;
    color: var(--text-tertiary);
    border: 0;
    padding: 4px;
    cursor: pointer;
    border-radius: var(--radius-sm);
}
.feature-card .feature-delete:hover { color: var(--color-error); }
.feature-card .feature-meta-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 8px;
}
.feature-card textarea {
    width: 100%;
    box-sizing: border-box;
    background: var(--surface-2);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 12px;
    padding: 5px 8px;
    outline: none;
    min-height: 38px;
    resize: vertical;
}
.feature-card select.feature-owner {
    background: var(--surface-2);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 12px;
    padding: 5px 8px;
    outline: none;
    width: 100%;
}


/* =====================================================================
 * CASTING RITUAL (US-107..111, ADR-0015) — vendored from iron-labs
 * design-system/loom-shell.css (lines 3041-3868, read 2026-06-12).
 * Tab visibility via body[data-casting-active]; stages render JS-side.
 * ===================================================================== */
[data-section="casting"] .subbar-casting,
[data-section="casting"] .section-casting { display: block; }
[data-section="casting"] .subbar-casting { display: flex; }

/* Casting-Tab in der Top-Bar — nur sichtbar wenn casting aktiv */
.section-tabs a.tab-casting { display: none; }
body[data-casting-active="true"] .section-tabs a.tab-casting {
    display: inline-flex;
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid var(--border);
    color: var(--accent);
    align-items: center;
    gap: 6px;
}
body[data-casting-active="true"] .section-tabs a.tab-casting .ti { color: var(--accent); }
body[data-casting-active="true"] .section-tabs a.tab-casting .casting-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    color: var(--accent);
    padding: 2px 6px;
    border-radius: var(--radius-pill);
    margin-left: 4px;
}
body[data-casting-active="true"] .section-tabs a.tab-casting.paused .casting-badge {
    background: color-mix(in srgb, var(--color-warning) 18%, transparent);
    color: var(--color-warning);
}

/* ---------- Sub-Bar: Stage-Stepper ---------- */
.subbar-casting { display: none; gap: 0; padding: 0 var(--space-4); align-items: stretch; min-height: 44px; }
.casting-stepper { display: flex; gap: 0; align-items: stretch; flex: 1; }
.casting-stepper .step {
    display: flex; align-items: center; gap: 8px;
    padding: 0 var(--space-4);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    color: var(--text-tertiary);
    position: relative;
    border-right: 0.5px solid var(--border-subtle);
}
.casting-stepper .step .step-num {
    display: inline-flex;
    align-items: center; justify-content: center;
    width: 18px; height: 18px;
    background: var(--surface-2);
    color: var(--text-tertiary);
    border-radius: 50%;
    font-size: 10px;
    font-weight: 600;
}
.casting-stepper .step.done { color: var(--text-secondary); }
.casting-stepper .step.done .step-num { background: var(--color-success); color: var(--surface-page); }
.casting-stepper .step.done .ti { color: var(--color-success); }
.casting-stepper .step.active {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.casting-stepper .step.active .step-num { background: var(--accent); color: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.casting-stepper .step:last-child { border-right: 0; }
.subbar-casting .casting-meta {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
    display: flex; align-items: center; gap: 8px;
    padding: 0 var(--space-3);
}

/* ---------- Casting Section Container ---------- */
.section-casting { padding: var(--space-5) var(--space-6); }
.casting-content { max-width: 980px; margin: 0 auto; }
.casting-content .stage-intro {
    margin-bottom: var(--space-4);
}
.casting-content .stage-intro h2 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px 0;
    line-height: 1.2;
}
.casting-content .stage-intro p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0;
}
.casting-content .stage-eyebrow {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.2em;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    display: inline-block;
    margin-bottom: var(--space-3);
}

/* ---------- Pre-Casting Stat Cards ---------- */
.input-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}
.input-stat-card {
    background: var(--surface-1);
    border: 0.5px solid var(--border-subtle);
    border-left: 2px solid var(--text-tertiary);
    border-radius: var(--radius-md);
    padding: var(--space-3);
}
.input-stat-card .label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.input-stat-card .value {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
    color: var(--text-primary);
}
.input-stat-card .hint {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 4px;
}
/* LOOM deviation from the vendored source (US-107 showcase find): the flock status is `active`
   (BEACON-047 / flock-schema) — the mockup's "fresh" was stale wording. Pot classes carry a
   pot- prefix so the pot name can never collide with the .active FILTER-state class. */
.input-stat-card.pot-active     { border-left-color: var(--accent); }
.input-stat-card.pot-active .value { color: var(--accent); }
.input-stat-card.pot-candidates { border-left-color: var(--color-info); }
.input-stat-card.pot-candidates .value { color: var(--color-info); }
.input-stat-card.pot-showcase { border-left-color: var(--color-warning); }
.input-stat-card.pot-showcase .value { color: var(--color-warning); }
.input-stat-card.pot-sticky   { border-left-color: #5DCAA5; }
.input-stat-card.pot-sticky .value { color: #5DCAA5; }
.input-stat-card.pot-backlog  { border-left-color: var(--color-success); }
.input-stat-card.pot-backlog .value { color: var(--color-success); }

/* ---------- Context-Box (Setup-Auszug) ---------- */
.casting-context-box {
    background: var(--surface-1);
    border: 0.5px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-3);
}
.casting-context-box .label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.casting-context-box .text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
}
.casting-context-box .text strong { color: var(--text-primary); }

/* ---------- Last-Minute-Flock-Box ---------- */
.last-chance-box {
    background: color-mix(in srgb, var(--accent) 8%, transparent);
    border: 0.5px solid var(--accent);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    display: flex; align-items: center; gap: var(--space-3);
    margin-bottom: var(--space-4);
}
.last-chance-box .ti { font-size: 16px; color: var(--accent); }
.last-chance-box .text { flex: 1; font-size: 12px; color: var(--text-secondary); }
.last-chance-box .text strong { color: var(--text-primary); }

/* ---------- Stage 1 Cluster-Cards ---------- */
.cluster-card {
    background: var(--surface-1);
    border: 0.5px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-2);
}
.cluster-card.warn { border-left: 2px solid var(--color-warning); }
.cluster-card .cluster-header {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: var(--space-2);
}
.cluster-card .cluster-num {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    padding: 2px 8px;
    border-radius: var(--radius-pill);
}
.cluster-card .cluster-title {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}
.cluster-card .cluster-goal {
    font-family: var(--font-mono);
    font-size: 11px;
    color: #5DCAA5;
    margin-left: 6px;
}
.cluster-card .cluster-goal.warn {
    color: var(--color-warning);
    display: inline-flex; align-items: center; gap: 4px;
}
.cluster-card .cluster-count {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
}
.cluster-card .flock-line {
    font-size: 12px;
    color: var(--text-secondary);
    padding-left: var(--space-3);
    margin-bottom: 3px;
    line-height: 1.5;
}
.cluster-card .flock-line .meta { color: var(--text-tertiary); }
.cluster-card .flock-line .showcase-tag { color: var(--color-warning); margin-left: 6px; }
.cluster-card .more-line { font-size: 12px; color: var(--text-tertiary); padding-left: var(--space-3); }
.btn-split, .btn-secondary-xs {
    background: transparent;
    color: var(--text-secondary);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 3px 9px;
    font-size: 11px;
    cursor: pointer;
    font-family: inherit;
}
.btn-split:hover { color: var(--text-primary); border-color: var(--border-strong); }

/* ---------- Stage 2 Candidate-Cards ---------- */
.candidate-card {
    background: var(--surface-1);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
    position: relative;
    transition: all var(--motion-fast) var(--ease-out);
}
.candidate-card.accepted {
    background: color-mix(in srgb, var(--color-success) 6%, var(--surface-1));
    border-color: color-mix(in srgb, var(--color-success) 40%, var(--border-subtle));
}
.candidate-card.deferred {
    background: color-mix(in srgb, var(--color-warning) 6%, var(--surface-1));
    border-color: color-mix(in srgb, var(--color-warning) 40%, var(--border-subtle));
}
.candidate-card.discarded {
    background: color-mix(in srgb, var(--color-error) 5%, var(--surface-1));
    border-color: color-mix(in srgb, var(--color-error) 30%, var(--border-subtle));
    opacity: 0.7;
}
.candidate-card.split {
    background: color-mix(in srgb, #5DCAA5 6%, var(--surface-1));
    border-color: color-mix(in srgb, #5DCAA5 40%, var(--border-subtle));
}
.candidate-card .candidate-header {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: var(--space-2);
}
.candidate-card .proposal-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.15em;
    background: color-mix(in srgb, var(--accent) 16%, transparent);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: var(--radius-pill);
}
.candidate-card.accepted .proposal-badge {
    background: color-mix(in srgb, var(--color-success) 18%, transparent);
    color: var(--color-success);
}
.candidate-card.deferred .proposal-badge {
    background: color-mix(in srgb, var(--color-warning) 18%, transparent);
    color: var(--color-warning);
}
.candidate-card.discarded .proposal-badge {
    background: color-mix(in srgb, var(--color-error) 18%, transparent);
    color: var(--color-error);
}
.candidate-card.split .proposal-badge {
    background: color-mix(in srgb, #5DCAA5 18%, transparent);
    color: #5DCAA5;
}
.candidate-card .goal-ref {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
}
.candidate-card .candidate-story {
    background: var(--surface-page);
    border-radius: var(--radius-sm);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-3);
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-primary);
}
.candidate-card .candidate-story .role { color: var(--text-tertiary); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; }
.candidate-card .candidate-meta {
    display: flex; gap: var(--space-3);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
    margin-bottom: var(--space-3);
}
.candidate-card .candidate-meta strong { color: var(--text-secondary); font-weight: 500; }
.candidate-card .candidate-actions {
    display: flex; gap: var(--space-2);
    flex-wrap: wrap;
}
.btn-action {
    background: var(--surface-2);
    color: var(--text-primary);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 5px;
    transition: all var(--motion-fast) var(--ease-out);
}
.btn-action:hover { border-color: var(--border-strong); }
.btn-action.btn-accept {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.btn-action.btn-accept:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-action.btn-defer {
    background: color-mix(in srgb, var(--color-warning) 12%, transparent);
    color: var(--color-warning);
    border-color: color-mix(in srgb, var(--color-warning) 35%, transparent);
}
.btn-action.btn-discard {
    background: color-mix(in srgb, var(--color-error) 10%, transparent);
    color: var(--color-error);
    border-color: color-mix(in srgb, var(--color-error) 30%, transparent);
}
.btn-action.btn-undo {
    background: transparent;
    color: var(--text-secondary);
    border: 0;
    text-decoration: underline;
    padding: 6px 4px;
}
.candidate-card .decision-note {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: var(--space-2);
    padding: 8px 12px;
    background: var(--surface-page);
    border-radius: var(--radius-sm);
    border-left: 2px solid var(--text-tertiary);
}
.candidate-card.deferred .decision-note { border-left-color: var(--color-warning); }
.candidate-card.discarded .decision-note { border-left-color: var(--color-error); }

/* ---------- Stage 3 Outcome Summary ---------- */
.outcome-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}
.outcome-card {
    background: var(--surface-1);
    border: 0.5px solid var(--border-subtle);
    border-left: 2px solid var(--text-tertiary);
    border-radius: var(--radius-md);
    padding: var(--space-3);
}
.outcome-card .label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.15em;
    margin-bottom: 4px;
}
.outcome-card .value {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    color: var(--text-primary);
}
.outcome-card .hint {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 4px;
}
.outcome-card.accepted { border-left-color: var(--color-success); }
.outcome-card.accepted .label { color: var(--color-success); }
.outcome-card.split { border-left-color: #5DCAA5; }
.outcome-card.split .label { color: #5DCAA5; }
.outcome-card.deferred { border-left-color: var(--color-warning); }
.outcome-card.deferred .label { color: var(--color-warning); }
.outcome-card.discarded { border-left-color: var(--color-error); }
.outcome-card.discarded .label { color: var(--color-error); }

.outcome-list {
    background: var(--surface-1);
    border: 0.5px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-2);
}
.outcome-list .list-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    color: var(--color-success);
    margin-bottom: 8px;
}
.outcome-list .outcome-row {
    font-size: 12px;
    color: var(--text-primary);
    line-height: 1.7;
    display: flex; align-items: center; gap: 6px;
}
.outcome-list .outcome-row .ti { font-size: 12px; color: var(--color-success); }
.outcome-list .outcome-row.split-line .ti { color: #5DCAA5; }
.outcome-list .outcome-row .size { color: var(--text-tertiary); font-family: var(--font-mono); font-size: 11px; margin-left: 6px; }
.outcome-list .outcome-row.sub { padding-left: 22px; color: var(--text-secondary); }

.deferred-banner {
    background: color-mix(in srgb, var(--color-warning) 8%, transparent);
    border: 0.5px solid var(--color-warning);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-4);
}
.deferred-banner .list-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    color: var(--color-warning);
    margin-bottom: 6px;
}
.deferred-banner .deferred-row {
    font-size: 12px;
    color: var(--text-primary);
    line-height: 1.55;
}
.deferred-banner .deferred-row .reason {
    color: var(--text-tertiary);
    font-style: italic;
    margin-left: 8px;
}

/* ---------- Commit-Banner (Stage 3) ---------- */
.commit-banner {
    background: color-mix(in srgb, var(--color-success) 8%, transparent);
    border: 0.5px solid var(--color-success);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    display: flex; align-items: center; gap: var(--space-3);
}
.commit-banner .commit-text { flex: 1; }
.commit-banner .commit-text .commit-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.commit-banner .commit-text .commit-detail {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.btn-commit {
    background: var(--color-success);
    color: var(--surface-page);
    border: 0;
    border-radius: var(--radius-sm);
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    font-family: inherit;
}
/* US-273: the sticky gate holds the commit shut — visibly, not just server-side. */
.btn-commit[disabled] { opacity: 0.4; cursor: not-allowed; }

/* ---------- Sticky hard-block panel (US-273, loom-prozess §6.1) ---------- */
.sticky-block-panel {
    background: color-mix(in srgb, var(--color-error) 8%, transparent);
    border: 0.5px solid var(--color-error);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
}
.sticky-block-panel .list-label { color: var(--color-error); }
.sticky-block-panel .sticky-block-hint {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: var(--space-2) 0 var(--space-3);
}
.sticky-block-row {
    display: flex; align-items: center; gap: var(--space-2);
    padding: var(--space-2) 0;
    border-top: 0.5px solid var(--border-subtle);
    font-size: 13px;
}
.sticky-block-row .ti-volume { color: var(--color-error); }
.sticky-block-row .sticky-block-id { font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); }
.sticky-block-row .sticky-block-title { flex: 1; color: var(--text-primary); }
.sticky-block-row .sticky-block-meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); }
.sticky-block-row .sticky-block-actions { display: inline-flex; gap: 6px; }
.sticky-cut-form {
    display: flex; gap: var(--space-2); align-items: center;
    padding: 0 0 var(--space-2) 28px;
}
.sticky-cut-form input {
    flex: 1;
    background: var(--surface-1);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 13px;
    color: var(--text-primary);
    font-family: inherit;
}

/* ---------- Stage-Footer (Back / Continue) ---------- */
.stage-footer {
    display: flex; gap: var(--space-2);
    margin-top: var(--space-4);
    align-items: center;
}
.btn-back, .btn-cancel-casting {
    background: transparent;
    color: var(--text-secondary);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 7px 14px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}
.btn-cancel-casting {
    color: var(--color-error);
    border-color: color-mix(in srgb, var(--color-error) 30%, var(--border));
}
.btn-continue {
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: var(--radius-sm);
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex; align-items: center; gap: 6px;
}
.stage-footer .spacer { flex: 1; }
.stage-footer .stage-counter {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
}

/* ---------- Modals: Defer / Split ---------- */
.modal.modal-defer, .modal.modal-split { max-width: 480px; }
.defer-textarea {
    width: 100%;
    background: var(--surface-2);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    padding: 8px 10px;
    min-height: 70px;
    resize: vertical;
    outline: none;
    box-sizing: border-box;
}
.defer-textarea:focus { border-color: var(--accent); }
.defer-char-counter {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 4px;
    text-align: right;
}
.defer-char-counter.warn { color: var(--color-warning); }
.defer-char-counter.over { color: var(--color-error); }
.split-input-row {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 8px;
}
.split-input-row .split-label {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
    min-width: 60px;
}
.split-input-row input {
    flex: 1;
    background: var(--surface-2);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    padding: 6px 10px;
    outline: none;
}
.split-input-row input:focus { border-color: var(--accent); }
.btn-add-split {
    background: transparent;
    color: var(--accent);
    border: 0.5px dashed var(--accent);
    border-radius: var(--radius-sm);
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    margin-top: 4px;
}

/* ---------- Casting-Live-Status (pulse) ---------- */
@keyframes casting-pulse {
    0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 30%, transparent); }
    50%      { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 0%, transparent); }
}
body[data-casting-active="true"] .section-tabs a.tab-casting:not(.paused) .ti {
    animation: casting-pulse 2.4s ease-in-out infinite;
    border-radius: 50%;
}

/* ---------- Responsive (compact) ---------- */
@media (max-width: 980px) {
    .input-stats-grid, .outcome-grid { grid-template-columns: repeat(2, 1fr); }
    .casting-stepper .step { padding: 0 var(--space-2); font-size: 10px; }
}

/* =============================================================
 * CASTING REVISION (ADR-0015 same-day) — Schritt 1
 * Pre-Casting Filter-Pills + Flock-Liste + Stage 1 Intervention
 * ============================================================= */

/* ---------- Pre-Casting: Stat-Cards als Filter-Pills ---------- */
.input-stat-card { cursor: pointer; transition: all var(--motion-fast) var(--ease-out); }
.input-stat-card:hover { border-color: var(--border); }
.input-stat-card.active {
    background: color-mix(in srgb, var(--accent) 12%, var(--surface-1));
    border-color: var(--accent);
}
.input-stat-card.pot-active.active     { background: color-mix(in srgb, var(--accent) 14%, var(--surface-1)); border-color: var(--accent); }
.input-stat-card.pot-candidates.active { background: color-mix(in srgb, var(--color-info) 14%, var(--surface-1)); border-color: var(--color-info); }
.input-stat-card.pot-showcase.active { background: color-mix(in srgb, var(--color-warning) 14%, var(--surface-1)); border-color: var(--color-warning); }
.input-stat-card.pot-sticky.active   { background: color-mix(in srgb, #5DCAA5 14%, var(--surface-1)); border-color: #5DCAA5; }
.input-stat-card.pot-backlog.active  { background: color-mix(in srgb, var(--color-success) 14%, var(--surface-1)); border-color: var(--color-success); }
.input-stat-card .filter-check {
    display: none;
    position: absolute;
    top: 6px; right: 8px;
    font-size: 13px;
    color: var(--accent);
}
.input-stat-card.active .filter-check { display: inline; }
.input-stat-card { position: relative; }

/* Filter-Toolbar (over Liste) */
.pre-filter-toolbar {
    display: flex; align-items: center; gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    margin-bottom: var(--space-2);
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--surface-2);
    border-radius: var(--radius-sm);
}
.pre-filter-toolbar .reset-link {
    color: var(--accent);
    cursor: pointer;
    text-decoration: underline;
    background: transparent; border: 0;
    font-family: inherit; font-size: 12px;
    padding: 0;
}
.pre-filter-toolbar .reset-link:hover { color: var(--accent-hover, var(--accent)); }
/* US-109 (showcase find): the retry button inside a degrade banner — dark chip, not a UA default. */
.casting-context-box .reset-link {
    background: var(--surface-2); color: var(--accent);
    border: 0.5px solid var(--border); border-radius: var(--radius-sm);
    padding: 3px 10px; cursor: pointer; font-family: inherit; font-size: 12px;
}
.casting-context-box .reset-link:hover { border-color: var(--accent); }
.pre-filter-toolbar .count-text { font-family: var(--font-mono); }

/* Flock-Liste in Pre-Casting */
.pre-flock-list {
    background: var(--surface-1);
    border: 0.5px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--space-3);
}
.pre-flock-row {
    display: grid;
    grid-template-columns: 84px 1fr 110px 80px 80px;
    gap: var(--space-2);
    padding: 8px var(--space-3);
    font-size: 12px;
    align-items: center;
    border-bottom: 0.5px solid var(--border-subtle);
}
.pre-flock-row:last-child { border-bottom: 0; }
.pre-flock-row:hover { background: var(--surface-2); }
.pre-flock-row .flock-id {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
}
.pre-flock-row .flock-title {
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pre-flock-row .flock-source { color: var(--text-secondary); }
.pre-flock-row .flock-time {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
}
.pre-flock-row .flock-source-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    padding: 2px 6px;
    border-radius: var(--radius-pill);
}
.pre-flock-row .flock-source-badge.active    { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }   /* status wording per BEACON-047 */
.pre-flock-row .flock-source-badge.candidates { background: color-mix(in srgb, var(--color-info) 14%, transparent); color: var(--color-info); }
.pre-flock-row .flock-source-badge.showcase { background: color-mix(in srgb, var(--color-warning) 14%, transparent); color: var(--color-warning); }
.pre-flock-row .flock-source-badge.sticky   { background: color-mix(in srgb, #5DCAA5 14%, transparent); color: #5DCAA5; }
.pre-flock-row .flock-source-badge.backlog  { background: color-mix(in srgb, var(--color-success) 14%, transparent); color: var(--color-success); }

.pre-flock-empty {
    padding: var(--space-5);
    text-align: center;
    color: var(--text-tertiary);
    font-size: 12px;
    font-style: italic;
}

/* ---------- Stage 1: Cluster-Title Edit ---------- */
.cluster-card .cluster-title { cursor: pointer; padding: 1px 4px; border-radius: 3px; transition: background var(--motion-fast); }
.cluster-card .cluster-title:hover { background: var(--surface-2); }
.cluster-card .cluster-title-input {
    background: var(--surface-2);
    border: 0.5px solid var(--accent);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    padding: 2px 6px;
    outline: none;
    min-width: 200px;
}

/* Cluster Goal-Dropdown */
.cluster-card .cluster-goal-select {
    background: var(--surface-2);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: #5DCAA5;
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 2px 6px;
    outline: none;
}

/* ---------- Stage 1: Flock-Move-Dropdown ---------- */
.cluster-card .flock-line {
    display: flex; align-items: center; gap: 8px;
    padding: 3px var(--space-3);
    border-radius: var(--radius-sm);
}
.cluster-card .flock-line:hover { background: var(--surface-2); }
.cluster-card .flock-line .flock-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cluster-card .flock-line .move-btn {
    background: transparent;
    color: var(--text-tertiary);
    border: 0;
    cursor: pointer;
    padding: 2px 6px;
    font-size: 11px;
    border-radius: var(--radius-sm);
    opacity: 0.5;
    transition: opacity var(--motion-fast);
    display: inline-flex; align-items: center; gap: 3px;
    font-family: inherit;
}
.cluster-card .flock-line:hover .move-btn { opacity: 1; }
.cluster-card .flock-line .move-btn:hover { background: var(--surface-page); color: var(--text-primary); }

/* Move-Menu (overlay) */
.flock-move-menu {
    position: fixed;
    background: var(--surface-1);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 4px;
    z-index: 200;
    min-width: 200px;
}
.flock-move-menu .menu-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.15em;
    color: var(--text-tertiary);
    padding: 6px 10px 4px 10px;
}
.flock-move-menu button {
    display: flex; align-items: center; gap: 8px;
    width: 100%;
    background: transparent;
    border: 0;
    text-align: left;
    padding: 6px 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    border-radius: var(--radius-sm);
}
.flock-move-menu button:hover { background: var(--surface-2); }
.flock-move-menu button.current { color: var(--text-tertiary); cursor: default; }
.flock-move-menu button.current:hover { background: transparent; }

/* ---------- Stage 1: Re-cluster Button ---------- */
.btn-recluster {
    background: var(--surface-2);
    color: var(--accent);
    border: 0.5px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex; align-items: center; gap: 6px;
}
.btn-recluster:hover { background: color-mix(in srgb, var(--accent) 10%, var(--surface-2)); }

/* ---------- Casting-Stepper: 6 statt 4 Steps (kompakter) ---------- */
.casting-stepper .step {
    padding: 0 var(--space-3);
    font-size: 10px;
    letter-spacing: 0.12em;
}
@media (max-width: 1200px) {
    .casting-stepper .step { padding: 0 var(--space-2); }
}


/* =====================================================================
 * CASTING REVISION Schritt 2 (US-109) — vendored from iron-labs
 * design-system/loom-shell.css (lines 3870-4169, read 2026-06-13).
 * Stage-2 inline-edit story box + refinement shell.
 * ===================================================================== */
/* =============================================================
 * CASTING REVISION — Schritt 2: Inline-Edit + Refinement
 * ============================================================= */

/* ---------- Stage 2: Inline-editierbare Story-Box ---------- */
.candidate-card .candidate-story-edit {
    background: var(--surface-page);
    border-radius: var(--radius-sm);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-3);
    border: 0.5px solid var(--border-subtle);
}
.candidate-card .story-line {
    display: flex; align-items: flex-start; gap: 8px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.candidate-card .story-line:last-child { margin-bottom: 0; }
.candidate-card .story-line .story-label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    min-width: 64px;
    padding-top: 2px;
}
.candidate-card .story-line .story-text {
    flex: 1;
    cursor: text;
    padding: 2px 6px;
    border-radius: 3px;
    transition: background var(--motion-fast);
    min-height: 22px;
}
.candidate-card .story-line .story-text:hover { background: var(--surface-1); }
.candidate-card .story-line .story-textarea {
    flex: 1;
    background: var(--surface-1);
    border: 0.5px solid var(--accent);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    padding: 4px 6px;
    line-height: 1.55;
    outline: none;
    resize: none;
    width: 100%;
    box-sizing: border-box;
}

/* Inline dropdowns in candidate-meta + header (LOOM extension: the goal select in the header
   was unstyled — bright UA default in dark theme, US-109 showcase find). */
.candidate-card .candidate-header select,
.candidate-card .candidate-meta select {
    background: var(--surface-2);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 2px 6px;
    margin-left: 4px;
}
.candidate-card .candidate-meta .meta-block {
    display: inline-flex; align-items: center; gap: 4px;
}

/* ---------- Stage 3: Refinement Layout ---------- */
.refinement-shell {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}
.refinement-nav {
    background: var(--surface-1);
    border: 0.5px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-2);
    height: fit-content;
    position: sticky;
    top: var(--space-3);
}
.refinement-nav .nav-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.15em;
    color: var(--text-tertiary);
    padding: 4px 8px 6px 8px;
}
.refinement-nav .nav-item {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
    transition: all var(--motion-fast);
    line-height: 1.4;
}
.refinement-nav .nav-item:hover { background: var(--surface-2); color: var(--text-primary); }
.refinement-nav .nav-item.active {
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    color: var(--accent);
    font-weight: 500;
}
.refinement-nav .nav-item.done { color: var(--text-secondary); }
.refinement-nav .nav-item.done .nav-icon { color: var(--color-success); }
.refinement-nav .nav-item.skipped .nav-icon { color: var(--color-warning); }
.refinement-nav .nav-icon { font-size: 13px; flex-shrink: 0; }
.refinement-nav .nav-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.refinement-main {
    min-width: 0;
}
.refinement-story-card {
    background: var(--surface-1);
    border: 0.5px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
}
.refinement-story-card .story-id {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
    margin-bottom: 4px;
}
.refinement-story-card .story-summary {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.55;
}
.refinement-story-card .story-summary strong { color: var(--accent); }

.refinement-counter {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
    margin-bottom: var(--space-2);
    display: flex; align-items: center; gap: var(--space-2);
}
.refinement-counter .prev-next {
    display: inline-flex; gap: 4px; margin-left: auto;
}
.refinement-counter .prev-next button {
    background: transparent;
    color: var(--text-secondary);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 2px 8px;
    font-size: 11px;
    cursor: pointer;
    font-family: inherit;
}
.refinement-counter .prev-next button:hover { color: var(--text-primary); border-color: var(--border-strong); }
.refinement-counter .prev-next button:disabled { opacity: 0.3; cursor: not-allowed; }

.ac-section {
    background: var(--surface-1);
    border: 0.5px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-4);
}
.ac-section .ac-label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
    display: flex; align-items: center; gap: var(--space-2);
}
.ac-section .ac-label .ac-count {
    background: var(--surface-2);
    color: var(--text-tertiary);
    padding: 1px 6px;
    border-radius: var(--radius-pill);
    font-size: 10px;
}
.ac-section .ac-label .spacer { flex: 1; }

.ki-action.ki-suggest-ac {
    margin: 0 0 var(--space-3) 0;
    width: 100%;
    background: color-mix(in srgb, var(--accent) 8%, transparent);
    border: 0.5px dashed var(--accent);
}
.ki-action.ki-suggest-ac:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }

.ac-list {
    display: flex; flex-direction: column;
    gap: 6px;
    margin-bottom: var(--space-3);
}
.ac-item {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 8px 10px;
    background: var(--surface-page);
    border-radius: var(--radius-sm);
    border-left: 2px solid var(--text-tertiary);
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
}
.ac-item:hover { background: var(--surface-2); }
.ac-item.proposed { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface-page)); }
.ac-item .ac-bullet { color: var(--text-tertiary); font-family: var(--font-mono); flex-shrink: 0; }
.ac-item .ac-text {
    flex: 1;
    cursor: text;
    padding: 1px 4px;
    border-radius: 3px;
}
.ac-item .ac-text:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.ac-item .ac-textarea {
    flex: 1;
    background: var(--surface-1);
    border: 0.5px solid var(--accent);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    line-height: 1.5;
    padding: 4px 8px;
    outline: none;
    resize: none;
    width: 100%;
    box-sizing: border-box;
}
.ac-item .ac-delete {
    background: transparent;
    color: var(--text-tertiary);
    border: 0;
    cursor: pointer;
    padding: 2px 6px;
    opacity: 0.4;
    font-family: inherit;
    transition: all var(--motion-fast);
    border-radius: var(--radius-sm);
}
.ac-item:hover .ac-delete { opacity: 1; }
.ac-item .ac-delete:hover { color: var(--color-error); background: color-mix(in srgb, var(--color-error) 10%, transparent); }

.ac-proposal-actions {
    display: flex; gap: 6px;
    margin-bottom: var(--space-3);
    padding: 8px 10px;
    background: color-mix(in srgb, var(--accent) 6%, transparent);
    border-radius: var(--radius-sm);
    align-items: center;
}
.ac-proposal-actions .proposal-label {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    margin-right: auto;
}

.btn-add-ac {
    background: transparent;
    color: var(--accent);
    border: 0.5px dashed var(--accent);
    border-radius: var(--radius-sm);
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    align-self: flex-start;
}
.btn-add-ac:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }

.refinement-skip-row {
    display: flex; align-items: center; gap: var(--space-2);
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 0.5px solid var(--border-subtle);
    font-size: 12px;
    color: var(--text-secondary);
}
.refinement-skip-row label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.refinement-skip-row input[type="checkbox"] { accent-color: var(--color-warning); }
.refinement-skip-row .skip-hint { color: var(--text-tertiary); font-style: italic; }

.refinement-empty {
    background: var(--surface-1);
    border: 0.5px dashed var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    text-align: center;
    color: var(--text-secondary);
}
.refinement-empty i { font-size: 28px; color: var(--text-tertiary); display: block; margin-bottom: 6px; }

/* ---------- Stage 4: Estimation Layout (US-110, vendored from iron-labs loom-shell.css; reuses refinement-shell grid) ---------- */
.estimation-shell { display: grid; grid-template-columns: 220px 1fr; gap: var(--space-4); margin-bottom: var(--space-4); }
.estimation-main { min-width: 0; }

/* KI-Vorschlag-Card */
.ki-estimation-card {
    background: color-mix(in srgb, var(--accent) 10%, var(--surface-1));
    border: 0.5px solid var(--accent);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-3);
    align-items: start;
}
.ki-estimation-card .ki-icon-block {
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-md);
    padding: var(--space-3);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    min-width: 110px;
}
.ki-estimation-card .ki-icon-block .badge {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    opacity: 0.85;
    margin-bottom: 4px;
}
.ki-estimation-card .ki-icon-block .points {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
}
.ki-estimation-card .ki-icon-block .unit {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    opacity: 0.85;
    margin-top: 4px;
}
.ki-estimation-card .ki-reasoning {
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-primary);
}
.ki-estimation-card .ki-reasoning .ki-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    color: var(--accent);
    margin-bottom: 6px;
    display: block;
}

/* Team-Response-Form */
.team-response {
    background: var(--surface-1);
    border: 0.5px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
}
.team-response .response-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    color: var(--text-secondary);
    margin-bottom: var(--space-3);
}
.team-response .response-actions {
    display: flex; gap: var(--space-2);
    flex-wrap: wrap;
}
.btn-accept-ki {
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex; align-items: center; gap: 6px;
}
.btn-accept-ki:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-counter {
    background: var(--surface-2);
    color: var(--text-primary);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex; align-items: center; gap: 6px;
}
.btn-counter:hover { border-color: var(--border-strong); }
.btn-force-final {
    background: transparent;
    color: var(--text-tertiary);
    border: 0.5px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
}
.btn-force-final:hover { color: var(--color-warning); border-color: var(--color-warning); }

.counter-form {
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 0.5px solid var(--border-subtle);
}
.counter-form .form-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-2) var(--space-3);
    align-items: center;
    margin-bottom: var(--space-3);
}
.counter-form label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    color: var(--text-secondary);
}
.counter-form input[type="number"] {
    background: var(--surface-2);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    padding: 6px 10px;
    width: 100px;
    outline: none;
}
.counter-form input[type="number"]:focus { border-color: var(--accent); }
.counter-form textarea {
    background: var(--surface-2);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    padding: 8px 10px;
    min-height: 60px;
    outline: none;
    resize: vertical;
    box-sizing: border-box;
    width: 100%;
}
.counter-form textarea:focus { border-color: var(--accent); }
.counter-form .form-actions {
    display: flex; gap: var(--space-2);
    justify-content: flex-end;
}
.btn-submit-counter {
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: var(--radius-sm);
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex; align-items: center; gap: 6px;
}
.btn-cancel-counter {
    background: transparent;
    color: var(--text-secondary);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 7px 12px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}

/* Estimation history */
.estimation-history {
    background: var(--surface-1);
    border: 0.5px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-3);
}
.estimation-history .history-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.history-row {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: var(--space-3);
    padding: 8px 0;
    border-bottom: 0.5px solid var(--border-subtle);
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.55;
}
.history-row:last-child { border-bottom: 0; }
.history-row .round { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); letter-spacing: 0.12em; padding-top: 2px; }
.history-row .move { color: var(--text-primary); }
.history-row .move .from-ki { color: var(--accent); font-family: var(--font-mono); font-weight: 700; }
.history-row .move .from-team { color: var(--color-success); font-family: var(--font-mono); font-weight: 700; }
.history-row .move .reason { color: var(--text-tertiary); font-style: italic; display: block; margin-top: 2px; }

/* Final estimation */
.estimation-final {
    background: color-mix(in srgb, var(--color-success) 10%, var(--surface-1));
    border: 0.5px solid var(--color-success);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    display: flex; align-items: center; gap: var(--space-3);
    margin-bottom: var(--space-3);
}
.estimation-final .final-points {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    color: var(--color-success);
}
.estimation-final .final-text { flex: 1; }
.estimation-final .final-title { font-size: 14px; font-weight: 500; color: var(--text-primary); margin-bottom: 2px; }
.estimation-final .final-subtitle { font-size: 12px; color: var(--text-secondary); }
.estimation-final .drift-tag {
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--color-warning) 16%, transparent);
    color: var(--color-warning);
}
.estimation-final .drift-tag.zero { background: var(--surface-2); color: var(--text-tertiary); }
.estimation-final .btn-reopen {
    background: transparent;
    color: var(--text-secondary);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
}

/* Hard-stop after 3 rounds */
.estimation-hardstop {
    background: color-mix(in srgb, var(--color-warning) 8%, transparent);
    border: 0.5px solid var(--color-warning);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-3);
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.55;
}
.estimation-hardstop strong { color: var(--text-primary); }

/* ---------- Stage 5 update: AC + Points + Drift tags in the outcome list (US-111, vendored) ---------- */
.outcome-row .ac-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-tertiary);
    background: var(--surface-2);
    padding: 1px 6px;
    border-radius: var(--radius-pill);
    margin-left: 6px;
}
.outcome-row .points-tag {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--color-success);
    margin-left: 6px;
    font-weight: 500;
}
.outcome-row .points-tag.drift {
    color: var(--color-warning);
}
.outcome-row .drift-delta {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--color-warning);
    margin-left: 4px;
}
.outcome-row .skip-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--color-warning);
    background: color-mix(in srgb, var(--color-warning) 14%, transparent);
    padding: 1px 6px;
    border-radius: var(--radius-pill);
    margin-left: 6px;
}


/* ---------- US-113: comment composer attach + comment attachment link ---------- */
.composer-hints .attach-link {
    background: none;
    border: 0;
    color: var(--text-secondary);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
}
.composer-hints .attach-link:hover { color: var(--accent); }
#comment-attach-chip {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    cursor: pointer;
}
.comment-item .comment-attach {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    text-decoration: none;
}
.comment-item .comment-attach:hover { text-decoration: underline; }

/* ---------- US-114: label management modal ---------- */
#label-rows { margin-top: 4px; }
.label-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 0.5px solid var(--border-subtle);
}
.label-row:last-of-type { border-bottom: 0; }
.label-row .label-name {
    flex: 0 0 150px;
    background: var(--surface-2);
    color: var(--text-primary);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 5px 8px;
    font: inherit;
    font-size: 13px;
    outline: none;
}
.label-row .label-name:focus { border-color: var(--accent); }
.label-row .label-color {
    background: var(--surface-2);
    color: var(--text-primary);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 5px 8px;
    font-family: var(--font-mono);
    font-size: 12px;
}
.label-row .label-slug { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); }
.label-row .label-remove {
    background: none;
    border: 0;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
}
.label-row .label-remove:hover { color: var(--color-error); }

/* ---------- US-115: drawer tag picker ---------- */
.drawer-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.drawer-tags .label-chips { margin: 0; }
.tag-edit-btn {
    background: none;
    border: 0.5px solid var(--border);
    color: var(--text-secondary);
    border-radius: var(--radius-pill);
    padding: 2px 8px;
    font: inherit;
    font-size: 11px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.tag-edit-btn:hover { border-color: var(--accent); color: var(--accent); }
.tag-picker {
    flex-basis: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
    padding: 8px;
    background: var(--surface-1);
    border: 0.5px solid var(--border-subtle);
    border-radius: var(--radius-md);
}
.tag-pick {
    border: 0.5px solid transparent;
    border-radius: var(--radius-pill);
    padding: 2px 9px;
    font-family: var(--font-mono);
    font-size: 11px;
    cursor: pointer;
    opacity: 0.5;
}
.tag-pick:hover { opacity: 0.85; }
.tag-pick.on { opacity: 1; border-color: currentColor; }
.tag-pick.c-info    { background: color-mix(in srgb, var(--color-info) 18%, transparent);    color: var(--color-info); }
.tag-pick.c-accent  { background: color-mix(in srgb, var(--accent) 18%, transparent);        color: var(--accent); }
.tag-pick.c-success { background: color-mix(in srgb, var(--color-success) 18%, transparent); color: var(--color-success); }
.tag-pick.c-warning { background: color-mix(in srgb, var(--color-warning) 18%, transparent); color: var(--color-warning); }
.tag-pick.c-error   { background: color-mix(in srgb, var(--color-error) 18%, transparent);   color: var(--color-error); }
.tag-pick.c-neutral { background: var(--surface-2); color: var(--text-secondary); }

/* US-143 Phase B: Setup-Import review cards (markdown → KI-Extraktion → per-section editor). */
.import-card {
    border: 0.5px solid var(--border); border-radius: var(--radius-md);
    padding: 12px; margin-top: 10px; background: var(--surface-1);
}
.import-card.empty { opacity: 0.55; }
.import-card > header {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); margin-bottom: 8px;
}
.import-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-family: var(--font-mono); font-size: 10px; padding: 2px 7px; border-radius: 999px;
}
.import-badge.ok       { background: color-mix(in srgb, var(--color-success) 16%, transparent); color: var(--color-success); }
.import-badge.degraded { background: color-mix(in srgb, var(--color-warning) 16%, transparent); color: var(--color-warning); }
.import-badge.muted    { background: var(--surface-2); color: var(--text-tertiary); }
.import-field { display: flex; gap: 8px; font-size: 13px; margin: 3px 0; line-height: 1.45; }
.import-field .k { flex-shrink: 0; min-width: 88px; color: var(--text-tertiary); font-family: var(--font-mono); font-size: 11px; padding-top: 1px; }
.import-field .v { color: var(--text-primary); }
.import-count { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); margin-bottom: 4px; }
.import-item { font-size: 13px; color: var(--text-primary); margin: 2px 0; }
.import-raw {
    background: var(--surface-2); border: 0.5px solid var(--border); border-radius: var(--radius-sm);
    padding: 8px 10px; font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary);
    white-space: pre-wrap; max-height: 140px; overflow: auto; margin: 0 0 4px;
}
.import-warn {
    display: flex; align-items: flex-start; gap: 6px; margin: 8px 0 6px;
    font-size: 12px; color: var(--color-warning); line-height: 1.4;
}

/* US-143 Phase B: import paste field spans the drawer; Extract is a present accent action. */
#import-paste {
    width: 100%; box-sizing: border-box; min-height: 200px;
    background: var(--surface-2); color: var(--text-primary);
    border: 0.5px solid var(--border); border-radius: var(--radius-sm);
    padding: 8px 10px; font-family: var(--font-mono); font-size: 12px; resize: vertical; line-height: 1.5;
}
#import-paste:focus { outline: none; border-color: var(--accent); }
.import-extract-btn {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%; margin-top: 10px; padding: 9px 12px;
    background: var(--accent-fill); color: var(--on-accent);
    border: 0; border-radius: var(--radius-sm);
    font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
    transition: opacity var(--motion-fast) var(--ease-out);
}
.import-extract-btn:hover { opacity: 0.9; }

/* US-143 Phase B: collapsible template safety-net (always selectable when clipboard copy is blocked). */
.import-template-details { margin-top: 8px; }
.import-template-details summary {
    font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary);
    cursor: pointer; user-select: none;
}
.import-template-details summary:hover { color: var(--text-secondary); }
#import-template-text {
    width: 100%; box-sizing: border-box; min-height: 150px; margin-top: 6px;
    background: var(--surface-2); color: var(--text-secondary);
    border: 0.5px solid var(--border); border-radius: var(--radius-sm);
    padding: 8px 10px; font-family: var(--font-mono); font-size: 11px; line-height: 1.5; resize: vertical;
}

/* =====================================================================
 * LOOMBACK RITUAL (US-202, Ritual-Dreieck v0.8) — single-screen reflection.
 * AI prepares four sections, the team curates, one click commits a
 * loomback-beacon. Lighter than Casting (reflection, not story-cutting).
 * ===================================================================== */
[data-section="loomback"] .section-loomback { display: block; }
.section-loomback { padding: var(--space-5) var(--space-6); }
.loomback-content { max-width: 880px; margin: 0 auto; }

/* Intro / empty state (before the first prepare) */
.lb-intro { text-align: center; padding: var(--space-6) var(--space-4); }
.lb-intro-icon { font-size: 34px; color: var(--accent); margin-bottom: 8px; }
.lb-intro h2 { margin: 0 0 8px; font-size: 22px; }
.lb-intro-sub { color: var(--text-secondary); max-width: 520px; margin: 0 auto var(--space-5); line-height: 1.6; }

/* Context strip — what the AI read */
.lb-context {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    padding-bottom: var(--space-4); margin-bottom: var(--space-4);
    border-bottom: 0.5px solid var(--border);
}
.lb-context-title { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: var(--text-primary); }
.lb-context-title .ti { color: var(--accent); }
.lb-chip {
    font-size: 12px; padding: 2px 10px; border-radius: var(--radius-pill);
    background: var(--surface-1); border: 0.5px solid var(--border); color: var(--text-secondary);
}
.lb-cycle { font-family: var(--font-mono); font-size: 12px; color: var(--text-tertiary); }
.lb-meta { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); }

/* Section cards */
.lb-sections { display: flex; flex-direction: column; gap: 10px; }
.lb-card { background: var(--surface-1); border: 0.5px solid var(--border); border-radius: var(--radius-lg); padding: 12px 14px; }
.lb-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.lb-card-title { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.lb-add {
    display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
    border: 0.5px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-0);
    color: var(--text-secondary); cursor: pointer;
}
.lb-add:hover { border-color: var(--accent); color: var(--accent); }
.lb-rows { display: flex; flex-direction: column; gap: 6px; }
.lb-row { display: flex; align-items: center; gap: 6px; }
.lb-input {
    flex: 1; padding: 7px 10px; font-size: 13px; line-height: 1.4;
    background: var(--surface-0); color: var(--text-primary);
    border: 0.5px solid var(--border); border-radius: var(--radius-sm);
}
.lb-input:focus { outline: none; border-color: var(--accent); }
.lb-del {
    display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
    border: none; background: transparent; color: var(--text-tertiary); cursor: pointer; border-radius: var(--radius-sm);
}
.lb-del:hover { color: var(--color-error); background: var(--surface-2); }
.lb-empty { color: var(--text-tertiary); font-size: 13px; margin: 2px 0; }
.lb-empty .ti { vertical-align: -2px; }

/* Footer — regenerate + commit */
.lb-footer {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin-top: var(--space-4); padding-top: var(--space-4); border-top: 0.5px solid var(--border);
}
.lb-btn-primary, .lb-btn-secondary {
    display: inline-flex; align-items: center; gap: 6px; font-size: 13px;
    padding: 9px 16px; border-radius: var(--radius-md); cursor: pointer;
}
.lb-btn-primary { background: var(--accent); color: #fff; border: none; }
.lb-btn-primary:hover { filter: brightness(1.05); }
.lb-btn-primary:disabled { opacity: 0.6; cursor: default; }
.lb-btn-secondary { background: var(--surface-0); color: var(--text-secondary); border: 0.5px solid var(--border); }
.lb-btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.lb-spin { animation: lb-spin 0.9s linear infinite; }
@keyframes lb-spin { to { transform: rotate(360deg); } }

/* --- Cycle overview landing (US-203, BEACON-206) --- */
.lb-ov-head { display:flex; align-items:center; gap:10px; margin-bottom:16px; }
.lb-ov-title { display:inline-flex; align-items:center; gap:8px; font-size:18px; font-weight:500; color:var(--text-primary); }
.lb-ov-title .ti { color:var(--accent); }
.lb-ov-cycle { font-size:12px; padding:3px 10px; border-radius:var(--radius-pill); background:color-mix(in srgb, var(--accent) 14%, transparent); color:var(--accent); }
.lb-ov-hint { margin-left:auto; font-size:12px; color:var(--text-tertiary); }

.lb-glance { display:grid; grid-template-columns:repeat(auto-fit, minmax(80px,1fr)); gap:10px; margin-bottom:18px; }
.lb-glance-cell { background:var(--surface-2); border-radius:var(--radius-md); padding:10px 12px; }
.lb-glance-n { font-size:22px; font-weight:500; color:var(--text-primary); }
.lb-glance-l { font-size:12px; color:var(--text-secondary); }

.lb-ov-section { margin-bottom:18px; }
.lb-ov-h { display:flex; align-items:center; gap:7px; font-size:13px; font-weight:500; color:var(--text-primary); margin-bottom:10px; }
.lb-ov-h .ti { color:var(--accent); }
.lb-ov-sub { font-weight:400; color:var(--text-muted); font-size:12px; }

/* Member bars — all one neutral colour, descending. The contrast is the message; LOOM does not grade. */
.lb-mem-list { display:flex; flex-direction:column; gap:9px; }
.lb-mem-row { display:flex; align-items:center; gap:10px; }
.lb-mem-name { width:80px; font-size:13px; color:var(--text-secondary); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.lb-mem-track { flex:1; height:18px; background:var(--surface-2); border-radius:5px; overflow:hidden; }
.lb-mem-bar { height:100%; background:var(--accent); border-radius:5px 0 0 5px; }
.lb-mem-val { width:140px; text-align:right; font-size:12px; color:var(--text-secondary); font-variant-numeric:tabular-nums; }

/* Beacon breakdown — capturable subtypes with counts; a zero is shown dimmed, not hidden. */
.lb-bd-list { display:flex; flex-wrap:wrap; gap:8px; }
.lb-bd-chip { display:inline-flex; align-items:center; gap:6px; font-size:13px; padding:4px 12px; border-radius:var(--radius-pill); background:var(--surface-2); color:var(--text-primary); }
.lb-bd-n { font-weight:500; font-variant-numeric:tabular-nums; }
.lb-bd-zero { color:var(--text-tertiary); }
.lb-bd-zero .lb-bd-n { color:var(--text-tertiary); }

.lb-ov-note { font-size:12px; color:var(--text-muted); }

/* === Showcase ritual (US-205, Ritual-Dreieck v0.8, third corner) ===================== */
[data-section="showcase"] .section-showcase { display: block; }
.section-showcase { padding: var(--space-5) var(--space-6); }
.showcase-content { max-width: 880px; margin: 0 auto; }

/* Head (agenda + close screens) */
.sc-head { display:flex; align-items:center; gap:10px; margin-bottom:16px; }
.sc-title { display:inline-flex; align-items:center; gap:8px; font-size:18px; font-weight:500; color:var(--text-primary); }
.sc-title .ti { color:var(--accent); }
.sc-cycle { font-size:12px; padding:3px 10px; border-radius:var(--radius-pill); background:color-mix(in srgb, var(--accent) 14%, transparent); color:var(--accent); }
.sc-hint { margin-left:auto; font-size:12px; color:var(--text-tertiary); }

/* Glance (agenda) */
.sc-glance { display:grid; grid-template-columns:repeat(auto-fit, minmax(80px,1fr)); gap:10px; margin-bottom:18px; }
.sc-glance-cell { background:var(--surface-2); border-radius:var(--radius-md); padding:10px 12px; }
.sc-glance-n { font-size:22px; font-weight:500; color:var(--text-primary); }
.sc-glance-l { font-size:12px; color:var(--text-secondary); }

/* Agenda + close rows */
.sc-agenda { display:flex; flex-direction:column; gap:8px; }
.sc-agenda-row, .sc-close-row { display:flex; align-items:center; gap:12px; background:var(--surface-1); border:0.5px solid var(--border); border-radius:var(--radius-md); padding:10px 12px; }
.sc-ag-id { font-family:var(--font-mono); font-size:12px; color:var(--text-tertiary); }
.sc-ag-title { flex:1; font-size:14px; font-weight:500; color:var(--text-primary); }
.sc-ag-meta { font-size:12px; color:var(--text-secondary); }
.sc-lane-chip { font-size:11px; padding:3px 8px; border-radius:var(--radius-pill); background:color-mix(in srgb, var(--accent) 14%, transparent); color:var(--accent); }
.sc-close-verdict { font-size:11px; padding:3px 8px; border-radius:var(--radius-pill); color:#fff; }
.sc-close-row .ti { color:var(--text-tertiary); }

/* Empty state */
.sc-empty-state { text-align:center; padding:var(--space-6) var(--space-4); color:var(--text-secondary); }
.sc-empty-state .ti { font-size:34px; color:var(--text-tertiary); margin-bottom:8px; }
.sc-empty-state h3 { margin:0 0 8px; font-size:18px; color:var(--text-primary); font-weight:500; }
.sc-empty-state p { max-width:480px; margin:0 auto; line-height:1.6; }

/* Intro / loading */
.sc-intro { text-align:center; padding:var(--space-6) var(--space-4); }
.sc-intro-icon { font-size:34px; color:var(--accent); margin-bottom:8px; }
.sc-intro-sub { color:var(--text-secondary); }
.sc-spin { animation: lb-spin 0.9s linear infinite; }

/* Walk-through — sidebar + stage */
.sc-walk { display:flex; gap:16px; align-items:flex-start; }
.sc-nav { width:150px; flex-shrink:0; display:flex; flex-direction:column; gap:6px; }
.sc-nav-item { display:flex; align-items:center; gap:6px; font-size:12px; padding:7px 9px; border:none; background:transparent; color:var(--text-secondary); border-radius:var(--radius-sm); cursor:pointer; text-align:left; }
.sc-nav-item:hover { background:var(--surface-1); }
.sc-nav-item.sc-nav-current { background:color-mix(in srgb, var(--accent) 14%, transparent); color:var(--accent); font-weight:500; }
.sc-nav-item.sc-nav-done .ti { color:var(--color-success, #639922); }
.sc-stage { flex:1; min-width:0; }
.sc-stage-title { font-size:15px; font-weight:500; color:var(--text-primary); }
.sc-stage-meta { display:block; font-size:12px; color:var(--text-secondary); margin-top:2px; }
.sc-label { font-size:12px; font-weight:500; color:var(--text-muted); margin:14px 0 6px; }

/* Acceptance-criteria rows + marks */
.sc-ac-list { display:flex; flex-direction:column; gap:6px; }
.sc-ac-row { display:flex; align-items:center; gap:10px; font-size:13px; }
.sc-ac-marks { display:flex; gap:3px; flex-shrink:0; }
.sc-mark { display:inline-flex; align-items:center; justify-content:center; width:26px; height:26px; border:0.5px solid var(--border); background:var(--surface-0); color:var(--text-tertiary); border-radius:var(--radius-sm); cursor:pointer; }
.sc-mark:hover { border-color:var(--accent); }
.sc-mark.sc-mark-on { border-color:transparent; }
.sc-ac-text { flex:1; color:var(--text-primary); }

/* Verdict toggle */
.sc-verdicts { display:flex; gap:6px; }
.sc-verdict { font-size:12px; padding:6px 14px; border:0.5px solid var(--border); background:var(--surface-0); color:var(--text-secondary); border-radius:var(--radius-md); cursor:pointer; }
.sc-verdict:hover { border-color:var(--accent); }
.sc-verdict.sc-verdict-on { border-color:transparent; font-weight:500; }

/* Walk footer — inline capture + nav */
.sc-walk-foot { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:16px; padding-top:14px; border-top:0.5px solid var(--border); }
.sc-capture { display:flex; gap:8px; }
.sc-walk-nav { display:flex; gap:8px; }

/* Info box (close) */
.sc-info { display:flex; gap:8px; font-size:12px; color:var(--text-secondary); line-height:1.5; background:var(--surface-1); border:0.5px solid var(--border); border-radius:var(--radius-md); padding:10px 12px; margin:14px 0; }
.sc-info .ti { color:var(--accent); flex-shrink:0; }

/* Footer + buttons (shared shape with lb-*) */
.sc-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:var(--space-4); padding-top:var(--space-4); border-top:0.5px solid var(--border); }
.sc-note { font-size:12px; color:var(--text-secondary); }
.sc-btn-primary, .sc-btn-secondary, .sc-btn-ghost { display:inline-flex; align-items:center; gap:6px; font-size:13px; padding:9px 16px; border-radius:var(--radius-md); cursor:pointer; }
.sc-btn-primary { background:var(--accent); color:#fff; border:none; }
.sc-btn-primary:hover { filter:brightness(1.05); }
.sc-btn-primary:disabled { opacity:0.6; cursor:default; }
.sc-btn-secondary { background:var(--surface-0); color:var(--text-secondary); border:0.5px solid var(--border); }
.sc-btn-secondary:hover { border-color:var(--accent); color:var(--accent); }
.sc-btn-ghost { padding:7px 12px; background:var(--surface-0); color:var(--text-secondary); border:0.5px solid var(--border); }
.sc-btn-ghost:hover { border-color:var(--accent); color:var(--accent); }
.sc-empty { color:var(--text-tertiary); font-size:13px; }

/* US-317 (BEACON-360): the shared confirm dialog reuses .modal wholesale; only its message
   paragraph is new. The dialog has no textarea unless the caller asks for one. */
.loom-confirm-message {
    margin: 0; padding: 0 16px 4px; font-size: 13px; line-height: 1.55; color: var(--text-secondary);
}
