:root {
    --font-ui: "Aptos", "Segoe UI Variable", "Segoe UI", "Helvetica Neue", sans-serif;
    --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
    --font-mono: "Cascadia Mono", "SFMono-Regular", "Consolas", monospace;
    --bg: #f4f3ee;
    --bg-soft: rgba(255, 255, 255, 0.82);
    --panel: rgba(255, 255, 255, 0.74);
    --panel-strong: rgba(255, 255, 255, 0.9);
    --panel-stage: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(250, 252, 255, 0.82));
    --line: rgba(20, 26, 33, 0.07);
    --line-strong: rgba(20, 26, 33, 0.12);
    --text: #15202b;
    --muted: rgba(21, 32, 43, 0.58);
    --muted-strong: rgba(21, 32, 43, 0.76);
    --accent: #1f7a53;
    --accent-soft: rgba(31, 122, 83, 0.12);
    --blue-soft: rgba(66, 122, 255, 0.1);
    --amber-soft: rgba(215, 147, 57, 0.12);
    --rose-soft: rgba(206, 92, 121, 0.12);
    --shadow: 0 28px 80px rgba(103, 122, 148, 0.11);
    --shadow-soft: 0 18px 44px rgba(103, 122, 148, 0.08);
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-pill: 999px;
}

* {
    box-sizing: border-box;
}

/* Global safety net: [hidden] attribute must always hide elements */
[hidden] {
    display: none !important;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    color: var(--text);
    font-family: var(--font-ui);
    background:
        radial-gradient(circle at top left, rgba(145, 199, 255, 0.18), transparent 26%),
        radial-gradient(circle at top right, rgba(144, 231, 212, 0.14), transparent 22%),
        linear-gradient(180deg, #fbfaf7 0%, #eef2f4 100%);
    overflow-x: hidden;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    -webkit-text-size-adjust: 100%;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: auto;
    pointer-events: none;
    z-index: 0;
    filter: blur(40px);
    opacity: 0.85;
}

body::before {
    top: 90px;
    right: 5vw;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(171, 216, 255, 0.2), rgba(171, 216, 255, 0));
}

body::after {
    bottom: 80px;
    left: 4vw;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(178, 236, 219, 0.18), rgba(178, 236, 219, 0));
}

body.sheet-open {
    overflow: hidden;
}

.page-haze {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 20% 12%, rgba(255, 255, 255, 0.78), transparent 28%),
        radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.56), transparent 26%);
    pointer-events: none;
}

.shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1220px;
    margin: 0 auto;
    padding: 22px 18px 56px;
    box-sizing: border-box;
}

.surface {
    background: linear-gradient(180deg, var(--panel-strong), var(--panel));
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    backdrop-filter: blur(24px) saturate(135%);
    -webkit-backdrop-filter: blur(24px) saturate(135%);
}

.surface-shell {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.76));
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 16px 20px;
    border-radius: var(--radius-xl);
    animation: surfaceIn 280ms cubic-bezier(0.22, 1, 0.36, 1);
    animation-fill-mode: backwards;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.brand-mark {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    display: block;
}

.brand-name {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    text-transform: lowercase;
}

.brand-sub {
    color: var(--muted);
    font-size: 0.8rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.topbar-actions::-webkit-scrollbar {
    display: none;
}

.toolbar-button,
.secondary-button,
.sheet-close,
.jobs-run-button,
.prompt-chip {
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.7);
    color: var(--text);
    font: inherit;
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.toolbar-button,
.secondary-button,
.sheet-close,
.primary-button,
.jobs-run-button,
.prompt-chip {
    min-height: 44px;
    border-radius: var(--radius-pill);
}

.toolbar-button,
.secondary-button,
.jobs-run-button {
    padding: 0 14px;
}

.toolbar-button:hover,
.secondary-button:hover,
.sheet-close:hover,
.primary-button:hover,
.jobs-run-button:hover,
.prompt-chip:hover {
    transform: translateY(-1px);
}

.toolbar-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.toolbar-button.is-quiet {
    color: var(--muted);
}

.toolbar-count {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: var(--radius-pill);
    background: rgba(21, 32, 43, 0.06);
    font-size: 0.78rem;
    font-weight: 700;
}

.toolbar-button.is-active {
    border-color: rgba(66, 122, 255, 0.24);
    background: rgba(66, 122, 255, 0.08);
}

.toolbar-button:focus-visible,
.secondary-button:focus-visible,
.primary-button:focus-visible,
.sheet-close:focus-visible,
.jobs-run-button:focus-visible,
.prompt-chip:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 4px rgba(66, 122, 255, 0.14);
}

.live-pill {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.76);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

.live-pill.is-running {
    border-color: rgba(31, 122, 83, 0.18);
}

.live-pill.is-decision {
    border-color: rgba(206, 92, 121, 0.18);
}

.live-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 0 rgba(31, 122, 83, 0.3);
    animation: pulse 1.9s infinite;
}

.live-divider {
    width: 1px;
    height: 14px;
    background: var(--line-strong);
}

.live-label {
    font-weight: 600;
    letter-spacing: 0.06em;
}

.live-detail {
    color: var(--muted);
}

/* Credential management */
.add-cred-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
}

.add-cred-row select,
.add-cred-row input {
    flex: 1;
    padding: 7px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    font-size: 0.8rem;
    font-family: var(--font-ui);
    background: var(--panel);
    color: var(--text);
}

.add-cred-row select:focus,
.add-cred-row input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.home-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(260px, 0.56fr);
    gap: 18px;
    margin-top: 16px;
    align-items: start;
}

.home-shell.has-preview {
    grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1fr) minmax(220px, 0.48fr);
}

.stage-shell {
    display: grid;
    gap: 14px;
}

.current-job-card {
    position: relative;
    display: grid;
    gap: 18px;
    min-height: 330px;
    padding: 30px;
    border-radius: var(--radius-xl);
    background: var(--panel-stage);
    box-shadow: var(--shadow);
    overflow: hidden;
    animation: surfaceIn 280ms cubic-bezier(0.22, 1, 0.36, 1);
    animation-fill-mode: backwards;
    transition: box-shadow 0.4s ease, transform 0.3s ease, border-color 0.4s ease;
    border: 2px solid transparent;
}

/* Dramatic running state — the card comes alive */
.current-job-card.is-running {
    border-color: rgba(31, 122, 83, 0.3);
    box-shadow:
        0 28px 80px rgba(31, 122, 83, 0.14),
        0 0 0 1px rgba(31, 122, 83, 0.08),
        inset 0 1px 0 rgba(31, 122, 83, 0.06);
    transform: scale(1.008);
}

.current-job-card.is-running::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #3fb98c, var(--accent));
    background-size: 200% 100%;
    animation: runningShimmer 2.4s ease infinite;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    z-index: 2;
}

@keyframes runningShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Subtle breathing glow on the card background when running */
.current-job-card.is-running::before {
    background: radial-gradient(circle, rgba(63, 185, 122, 0.2), rgba(63, 185, 122, 0));
    animation: breatheGlow 3s ease-in-out infinite;
}

@keyframes breatheGlow {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.composer-card {
    position: relative;
    display: grid;
    gap: 18px;
    padding: 28px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    animation: surfaceIn 280ms cubic-bezier(0.22, 1, 0.36, 1);
    animation-fill-mode: backwards;
}

.activity-card {
    position: sticky;
    display: grid;
    gap: 18px;
    padding: 24px;
    border-radius: var(--radius-xl);
    align-content: start;
    top: 18px;
    animation: surfaceIn 280ms cubic-bezier(0.22, 1, 0.36, 1);
    animation-fill-mode: backwards;
}

.current-job-card::before,
.composer-card::before {
    content: "";
    position: absolute;
    inset: auto;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    pointer-events: none;
}

.current-job-card::before {
    top: -72px;
    right: -72px;
    background: radial-gradient(circle, rgba(167, 219, 255, 0.24), rgba(167, 219, 255, 0));
}

.composer-card::before {
    bottom: -96px;
    right: -64px;
    background: radial-gradient(circle, rgba(186, 235, 219, 0.2), rgba(186, 235, 219, 0));
}

body[data-has-job="false"] .home-shell {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.42fr);
    max-width: 1120px;
    margin-left: auto;
    margin-right: auto;
}

body[data-has-job="false"] .current-job-card {
    display: none;
}

body[data-has-job="false"] .preview-stage {
    display: none;
}

body[data-has-job="false"] .composer-card {
    align-content: center;
    padding: 36px 32px 28px;
}

body[data-has-job="false"] .activity-card {
    min-height: 200px;
}

body[data-has-job="true"] .composer-card {
    gap: 14px;
    padding: 22px 24px;
}

body[data-has-job="true"] .composer-copy {
    gap: 4px;
}

.section-top,
.reference-top,
.composer-actions,
.sheet-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.eyebrow,
.mini-label {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: auto;
    padding: 0;
    color: rgba(21, 32, 43, 0.46);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.mini-label {
    letter-spacing: 0.14em;
}

.job-title,
.composer-title,
.sheet-title {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 0.95;
    text-wrap: balance;
}

.job-title {
    font-size: clamp(1.6rem, 2.8vw, 2.4rem);
    max-width: none;
}

.composer-title,
.sheet-title {
    font-size: clamp(1.55rem, 2.4vw, 2.35rem);
}

body[data-has-job="false"] .composer-title {
    font-size: clamp(2.8rem, 6vw, 4.8rem);
    max-width: 10ch;
}

body[data-has-job="true"] .composer-title {
    font-size: clamp(1.42rem, 2vw, 1.8rem);
    max-width: 14ch;
}

.job-summary,
.composer-body,
.composer-help,
.sheet-body,
.reference-hint,
.activity-copy,
.sheet-detail,
.jobs-progress,
.job-support {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.job-summary {
    max-width: 50ch;
    color: var(--muted-strong);
    font-size: 1.08rem;
}

.job-next {
    gap: 8px;
    padding-top: 18px;
    border-top: 1px solid rgba(21, 32, 43, 0.08);
}

.job-next:not([hidden]) { display: grid; }

.job-next-text {
    font-size: 1.12rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.28;
}

.job-support {
    font-size: 0.9rem;
    color: rgba(21, 32, 43, 0.52);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 14px;
    border-radius: var(--radius-pill);
    font-size: 0.82rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.status-running {
    background: rgba(31, 122, 83, 0.12);
    border-color: rgba(31, 122, 83, 0.16);
    color: #146a48;
}

.status-queued {
    background: var(--amber-soft);
    border-color: rgba(215, 147, 57, 0.16);
    color: #8d5d12;
}

.status-done {
    background: var(--blue-soft);
    border-color: rgba(66, 122, 255, 0.16);
    color: #265bb7;
}

.status-idle {
    background: rgba(21, 32, 43, 0.05);
    border-color: rgba(21, 32, 43, 0.08);
    color: var(--muted);
}

.status-planned {
    background: rgba(139, 92, 246, 0.10);
    border-color: rgba(139, 92, 246, 0.18);
    color: #6d28d9;
}

.status-blocked, .status-error {
    background: var(--rose-soft);
    border-color: rgba(206, 92, 121, 0.2);
    color: #9e3a55;
}

/* Plan approval bar — shown in current-job-card when status is "planned" */
.plan-approve-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: var(--radius);
    background: rgba(139, 92, 246, 0.06);
    border: 1px solid rgba(139, 92, 246, 0.14);
}
.plan-approve-hint {
    flex: 1;
    font-size: 0.82rem;
    font-weight: 600;
    color: #6d28d9;
}
.btn-approve-plan {
    padding: 7px 18px;
    border-radius: var(--radius-pill);
    border: none;
    background: #6d28d9;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-approve-plan:hover { background: #5b21b6; }
.btn-approve-plan:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-edit-plan {
    padding: 7px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(139, 92, 246, 0.2);
    background: transparent;
    color: #6d28d9;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-edit-plan:hover { background: rgba(139, 92, 246, 0.08); }

/* Execution controls — elapsed timer + pause/cancel */
.exec-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 8px 14px;
    border-radius: var(--radius);
    background: rgba(34, 197, 94, 0.05);
    border: 1px solid rgba(34, 197, 94, 0.12);
}
.exec-elapsed {
    font-variant-numeric: tabular-nums;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent);
    min-width: 44px;
}
.exec-btn {
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    margin-left: auto;
}
.exec-btn-pause {
    border: 1px solid rgba(245, 158, 11, 0.25);
    background: rgba(245, 158, 11, 0.08);
    color: #d97706;
}
.exec-btn-pause:hover { background: rgba(245, 158, 11, 0.15); }
.exec-btn-cancel {
    border: 1px solid rgba(239, 68, 68, 0.2);
    background: rgba(239, 68, 68, 0.06);
    color: #dc2626;
    margin-left: 0;
}
.exec-btn-cancel:hover { background: rgba(239, 68, 68, 0.12); }

/* Live preview frame — for HTML, React, SVG, Mermaid artifacts */
.preview-live-frame {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #fff;
    position: relative;
}
.preview-live-frame.is-fullscreen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999;
    border-radius: 0;
    border: none;
}
.preview-live-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f5f5f5;
    border-bottom: 1px solid var(--border);
    font-size: 0.72rem;
    color: var(--muted);
}
.preview-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
}
.preview-live-label { font-weight: 600; }
.preview-live-fullscreen {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    color: var(--muted);
    padding: 2px 4px;
}
.preview-live-fullscreen:hover { color: var(--text); }
.preview-iframe {
    width: 100%;
    min-height: 400px;
    border: none;
    background: #fff;
}
.preview-live-frame.is-fullscreen .preview-iframe {
    min-height: calc(100vh - 30px);
}
.preview-svg-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    padding: 20px;
    background: #fff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}
.preview-svg-container svg {
    max-width: 100%;
    height: auto;
}

.input-area,
.link-input {
    width: 100%;
    border: 1px solid rgba(21, 32, 43, 0.1);
    background: rgba(255, 255, 255, 0.84);
    color: var(--text);
    font: inherit;
}

.composer-copy {
    display: grid;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.prompt-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.prompt-chip {
    padding: 0 14px;
    min-height: 40px;
    font-size: 0.88rem;
    font-weight: 700;
    transition:
        transform 180ms ease,
        border-color 180ms ease,
        background 180ms ease,
        box-shadow 180ms ease;
    will-change: transform, box-shadow;
}

.prompt-chip:hover {
    border-color: rgba(66, 122, 255, 0.22);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 10px 22px rgba(103, 122, 148, 0.08);
}

body[data-has-job="true"] .prompt-chip-row {
    display: none;
}

.composer-input-shell {
    display: grid;
    gap: 14px;
    padding: 18px;
    border-radius: 30px;
    border: 1px solid rgba(21, 32, 43, 0.08);
    background: rgba(255, 255, 255, 0.82);
    position: relative;
    z-index: 1;
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.composer-input-shell:focus-within {
    border-color: rgba(66, 122, 255, 0.2);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 18px 34px rgba(103, 122, 148, 0.1);
}
.composer-input-shell.is-dragover {
    border-color: var(--accent);
    background: rgba(31, 122, 83, 0.04);
}
.composer-attachments {
    padding: 0 4px;
}
.composer-attachments[hidden] {
    display: none;
}

.input-area {
    min-height: 210px;
    padding: 6px 0 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    resize: none;
    overflow: hidden;
    line-height: 1.65;
}

body[data-has-job="true"] .input-area {
    min-height: 136px;
}

body[data-has-job="false"] .input-area {
    font-size: 1.02rem;
}

body[data-has-job="true"] .composer-body {
    max-width: 36ch;
    font-size: 0.98rem;
}

.input-area:focus,
.link-input:focus {
    outline: none;
}

.input-area::placeholder,
.link-input::placeholder {
    color: rgba(21, 32, 43, 0.42);
}

.reference-block {
    display: grid;
    gap: 12px;
    padding: 14px 16px 16px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(21, 32, 43, 0.06);
    animation: surfaceIn 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.reference-entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.link-input {
    min-height: 44px;
    padding: 0 14px;
    border-radius: var(--radius-pill);
}

.asset-dropzone {
    display: grid;
    place-items: center;
    min-height: 72px;
    padding: 14px;
    border-radius: 20px;
    border: 1px dashed rgba(66, 122, 255, 0.22);
    background: rgba(249, 251, 255, 0.72);
    color: var(--muted);
    text-align: center;
    transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.asset-dropzone.is-active {
    border-color: rgba(31, 122, 83, 0.32);
    background: rgba(244, 252, 248, 0.92);
    transform: scale(1.01);
}

.asset-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.asset-chip,
.drop-file {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    max-width: 100%;
    padding: 0 12px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(21, 32, 43, 0.08);
}

.asset-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.asset-chip button {
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 1rem;
}

.composer-footer {
    display: grid;
    gap: 12px;
}

.composer-actions {
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Quick chat button */
.composer-chat-btn {
    padding: 7px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    font-weight: 600;
}

/* Quick chat response panel */
.quick-chat-response {
    margin-top: 12px;
    padding: 0;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: var(--bg);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
}
.quick-chat-header {
    display: flex;
    align-items: center;
    padding: 8px 14px;
    background: rgba(34, 197, 94, 0.06);
    border-bottom: 1px solid var(--line);
}
.quick-chat-label {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--accent);
}
.quick-chat-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: var(--muted);
    padding: 0 4px;
}
.quick-chat-close:hover { color: var(--text); }
.quick-chat-body {
    padding: 14px 16px;
    font-size: 0.88rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.autonomy-select {
    padding: 7px 28px 7px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--line);
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--muted-strong);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}
.autonomy-select:focus {
    outline: none;
    border-color: var(--accent);
}

.composer-meta {
    color: var(--muted);
    font-size: 0.76rem;
    font-family: var(--font-mono);
    letter-spacing: -0.01em;
    flex: 1 1 auto;
    min-width: 0;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}
.composer-meta:not(:empty) {
    opacity: 1;
}

.primary-button {
    padding: 0 20px;
    border: 0;
    background: linear-gradient(135deg, #18232e, #243445);
    color: #f8fbfd;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
    box-shadow: 0 16px 28px rgba(21, 32, 43, 0.12);
    will-change: transform, box-shadow;
}

.primary-button:hover {
    box-shadow: 0 18px 34px rgba(21, 32, 43, 0.16);
}

/* New button system: .btn-primary, .btn-secondary, .btn-danger, .btn-ghost */
.btn-primary {
    padding: 0 20px;
    border: 0;
    background: linear-gradient(135deg, #18232e, #243445);
    color: #f8fbfd;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
    box-shadow: 0 16px 28px rgba(21, 32, 43, 0.12);
    min-height: 44px;
    border-radius: var(--radius-pill);
}

.btn-primary:hover {
    box-shadow: 0 18px 34px rgba(21, 32, 43, 0.16);
    transform: translateY(-1px);
}

.btn-primary:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 4px rgba(66, 122, 255, 0.14);
}

.btn-secondary {
    padding: 0 16px;
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.7);
    color: var(--text);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
    min-height: 44px;
    border-radius: var(--radius-pill);
}

.btn-secondary:hover {
    transform: translateY(-1px);
    border-color: var(--text);
    background: rgba(255, 255, 255, 0.85);
}

.btn-secondary:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 4px rgba(66, 122, 255, 0.14);
}

.btn-danger {
    padding: 0 16px;
    border: 1px solid rgba(162, 71, 91, 0.3);
    background: rgba(255, 255, 255, 0.7);
    color: #a2475b;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
    min-height: 44px;
    border-radius: var(--radius-pill);
}

.btn-danger:hover {
    transform: translateY(-1px);
    background: rgba(162, 71, 91, 0.08);
    border-color: rgba(162, 71, 91, 0.5);
}

.btn-danger:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 4px rgba(162, 71, 91, 0.14);
}

.btn-ghost {
    padding: 0 12px;
    border: none;
    background: transparent;
    color: var(--accent);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: transform 180ms ease, color 180ms ease;
    min-height: 44px;
    border-radius: var(--radius-pill);
}

.btn-ghost:hover {
    color: var(--text);
    transform: translateY(-1px);
}

.btn-ghost:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 4px rgba(66, 122, 255, 0.14);
}

.secondary-button.is-active {
    border-color: rgba(66, 122, 255, 0.24);
    background: rgba(66, 122, 255, 0.08);
}

.composer-status {
    min-height: 1.4rem;
    color: var(--muted);
    font-size: 0.92rem;
}

body[data-has-job="true"] .composer-help {
    display: none;
}

.composer-status.is-error {
    color: #a2475b;
}

.composer-status.is-success {
    color: #186c49;
}

.activity-feed {
    display: grid;
    gap: 0;
    position: relative;
    padding-left: 18px;
    contain: content;
}

.sheet-list {
    display: grid;
    gap: 12px;
    contain: content;
}

.activity-feed::before {
    content: "";
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 4px;
    width: 1px;
    background: linear-gradient(180deg, rgba(21, 32, 43, 0.16), rgba(21, 32, 43, 0.04));
}

.sheet-item,
.sheet-empty {
    display: grid;
    gap: 10px;
    padding: 18px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.52);
    border: 1px solid rgba(21, 32, 43, 0.06);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.sheet-item:hover {
    transform: translateY(-1px);
    border-color: rgba(21, 32, 43, 0.1);
    box-shadow: 0 16px 30px rgba(103, 122, 148, 0.08);
}

.sheet-item.is-decision {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(206, 92, 121, 0.08));
}

.sheet-item.is-running {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(31, 122, 83, 0.08));
}

.sheet-item.is-queued {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(215, 147, 57, 0.08));
}

.activity-item {
    position: relative;
    display: grid;
    gap: 6px;
    padding: 16px 0 16px 14px;
    border-top: 1px solid rgba(21, 32, 43, 0.08);
}

.activity-item:first-child {
    padding-top: 0;
    border-top: 0;
}

.activity-item::before {
    content: "";
    position: absolute;
    left: -1px;
    top: 20px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(21, 32, 43, 0.22);
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.92);
}

.activity-item:first-child::before {
    top: 4px;
}

.activity-item.is-running::before {
    background: rgba(31, 122, 83, 0.9);
}

.activity-item.is-queued::before {
    background: rgba(215, 147, 57, 0.9);
}

.activity-item.is-decision::before {
    background: rgba(206, 92, 121, 0.9);
}

/* Error items get a subtle background so they don't disappear */
.activity-item.is-error {
    background: rgba(206, 92, 121, 0.05);
    border-radius: 8px;
    padding-left: 18px;
    margin-left: -4px;
}

.activity-item.is-error::before {
    background: rgba(206, 92, 121, 0.9);
}

/* Activity feed filters */
.activity-filters {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.activity-filter {
    background: none;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    padding: 4px 12px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.activity-filter:hover {
    border-color: var(--line-strong);
    color: var(--text);
}

.activity-filter.is-active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

.activity-item.is-update::before {
    background: rgba(66, 122, 255, 0.78);
}

.activity-item.is-done::before {
    background: rgba(31, 157, 85, 0.9);
}

.activity-item.is-fail::before,
.activity-item.is-error::before {
    background: rgba(180, 71, 94, 0.9);
}

.activity-item.is-new::before {
    animation: dotAppear 0.4s ease;
}

@keyframes dotAppear {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.activity-head,
.sheet-item-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.activity-label {
    color: rgba(21, 32, 43, 0.48);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.activity-copy,
.sheet-detail {
    font-size: 0.98rem;
}

.activity-time {
    font-size: 0.7rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    flex-shrink: 0;
}

.activity-feed:empty::after {
    content: "Activity will show here once work begins.";
    display: block;
    padding: 24px 14px;
    font-size: 0.82rem;
    color: var(--muted);
    text-align: center;
    font-style: italic;
}

.sheet {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 30;
    width: min(420px, 100%);
    height: 100vh;
    height: 100dvh;
    padding: 24px 18px 28px;
    display: grid;
    align-content: start;
    gap: 16px;
    background: linear-gradient(180deg, rgba(253, 253, 252, 0.96), rgba(246, 248, 250, 0.92));
    border-left: 1px solid rgba(21, 32, 43, 0.08);
    box-shadow: -24px 0 80px rgba(91, 113, 137, 0.16);
    backdrop-filter: blur(28px) saturate(140%);
    -webkit-backdrop-filter: blur(28px) saturate(140%);
    transform: translateX(100%);
    transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1), opacity 280ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform, opacity;
    contain: layout style;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.sheet[aria-hidden="false"] {
    transform: translateX(0);
}

.sheet-scrim {
    position: fixed;
    inset: 0;
    z-index: 20;
    background: rgba(18, 26, 33, 0.18);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.sheet-close {
    padding: 0 14px;
    color: var(--muted);
}

.sheet-item-title,
.jobs-title {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.3;
}

.sheet-item-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(21, 32, 43, 0.48);
}

.sheet-recommendation {
    margin: 0;
    color: var(--muted-strong);
    font-size: 0.92rem;
    font-weight: 600;
}

.decision-resolve-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.decision-option-btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(31, 122, 83, 0.3);
    background: rgba(31, 122, 83, 0.08);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 180ms ease;
    white-space: nowrap;
}

.decision-option-btn:hover:not(:disabled) {
    background: rgba(31, 122, 83, 0.16);
    border-color: rgba(31, 122, 83, 0.5);
    transform: translateY(-1px);
}

.decision-option-btn:active:not(:disabled) {
    transform: translateY(0);
}

.decision-option-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.decision-resolve-input {
    flex: 1;
    min-width: 160px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.6);
    font-family: var(--font-ui);
    font-size: 0.9rem;
    transition: all 180ms ease;
}

.decision-resolve-input:focus {
    outline: none;
    border-color: rgba(31, 122, 83, 0.5);
    background: rgba(255, 255, 255, 0.9);
}

.decision-resolve-btn {
    padding: 10px 18px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(31, 122, 83, 0.3);
    background: rgba(31, 122, 83, 0.12);
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
    transition: all 180ms ease;
    white-space: nowrap;
}

.decision-resolve-btn:hover:not(:disabled) {
    background: rgba(31, 122, 83, 0.2);
    border-color: rgba(31, 122, 83, 0.5);
}

.decision-resolve-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.jobs-run-button {
    justify-self: start;
    border: 0;
    background: linear-gradient(135deg, #18232e, #243445);
    color: #f8fbfd;
    font-weight: 700;
    box-shadow: 0 12px 24px rgba(21, 32, 43, 0.14);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip to content link — visible on focus */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    padding: 10px 20px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: top 0.15s ease;
}

.skip-link:focus {
    top: 10px;
}

/* Global focus-visible fallback for interactive elements */
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[role="button"]:focus-visible {
    outline: 2px solid rgba(66, 122, 255, 0.5);
    outline-offset: 2px;
}

.is-fresh {
    animation: refreshFade 500ms ease;
}

@media (max-width: 1040px) {
    .home-shell {
        grid-template-columns: 1fr;
    }

    .home-shell.has-preview {
        grid-template-columns: 1fr;
    }

    .activity-card {
        position: static;
    }
}

@media (max-width: 760px) {
    .shell {
        width: 100%;
        margin: 0 auto;
        padding: 8px 6px 0;
        gap: 8px;
        box-sizing: border-box;
    }

    /* --- Topbar: compact with scrollable nav --- */
    .topbar {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 14px;
        gap: 10px;
        border-radius: 20px;
    }

    .brand {
        gap: 10px;
    }

    .brand-mark {
        width: 34px;
        height: 34px;
    }

    .brand-name { font-size: 0.9rem; }
    .brand-sub { font-size: 0.7rem; }

    .topbar-actions {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        gap: 6px;
        padding-bottom: 2px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .topbar-actions::-webkit-scrollbar {
        display: none;
    }

    .live-pill {
        flex: 0 0 auto;
        min-width: max-content;
    }

    .toolbar-button {
        flex: 0 0 auto;
        min-width: max-content;
        white-space: nowrap;
    }

    .toolbar-kbd { display: none; }

    .version-tag {
        flex: 0 0 auto;
        min-width: max-content;
    }

    .credit-display {
        flex: 0 0 auto;
        min-width: max-content;
    }

    /* --- Cards: tighter padding --- */
    .current-job-card,
    .composer-card,
    .activity-card {
        padding: 16px 14px;
        border-radius: 20px;
    }

    body[data-has-job="false"] .composer-card {
        min-height: auto;
        padding: 20px 14px;
    }

    /* --- Typography: fluid sizing --- */
    .job-title {
        max-width: none;
        font-size: clamp(1.6rem, 8vw, 2.4rem);
        line-height: 1.15;
    }

    .composer-title,
    .sheet-title {
        font-size: clamp(1.4rem, 7vw, 2rem);
    }

    body[data-has-job="false"] .composer-title {
        font-size: clamp(1.8rem, 10vw, 2.8rem);
    }

    .eyebrow {
        font-size: 0.65rem;
    }

    /* --- Layout: stack grids --- */
    .reference-entry,
    .composer-actions,
    .sheet-top,
    .section-top {
        grid-template-columns: 1fr;
        display: grid;
    }

    .composer-actions {
        align-items: stretch;
    }

    /* --- Buttons: full-width within composer, touch-friendly --- */
    .primary-button,
    .secondary-button,
    .jobs-run-button {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    .prompt-chip {
        min-height: 40px;
        padding: 8px 14px;
    }

    /* --- Activity feed --- */
    .activity-feed {
        padding-left: 10px;
    }

    /* --- Confidence meter --- */
    .confidence-meter {
        padding: 10px 12px;
    }

    .confidence-label {
        font-size: 0.75rem;
    }

    /* --- Cost ticker --- */
    .cost-ticker {
        font-size: 1.8rem;
    }

    /* --- Composer input --- */
    .input-area {
        min-height: 100px;
        font-size: 1rem;
    }

    .composer-input-shell {
        border-radius: 16px;
        padding: 14px;
    }

    /* --- Onboarding: tighter on mobile --- */
    .onboarding-modal {
        width: calc(100% - 20px);
        max-height: calc(100vh - 40px);
        padding: 24px 18px;
    }

    .onboarding-features-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    /* --- Sheets / modals: full-width on mobile --- */
    .sheet,
    .sheet-wide {
        width: 100%;
        max-height: 85vh;
        border-radius: 20px 20px 0 0;
    }

    .mission-detail-modal {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    /* --- Search panel --- */
    .search-container {
        max-width: 100%;
    }

    /* --- Settings --- */
    .settings-grid {
        grid-template-columns: 1fr;
    }

    /* --- Preview panel --- */
    .preview-panel {
        width: 100%;
        border-radius: 20px;
    }

    /* --- Kanban board --- */
    .kanban-board {
        grid-template-columns: 1fr;
    }

    /* --- Spec confirm --- */
    .spec-confirm {
        padding: 16px;
        border-radius: 16px;
    }

    /* --- Detail modal: stack sections --- */
    .mission-detail-body {
        display: grid;
        grid-template-columns: 1fr;
    }

    .detail-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    /* --- Shortcuts modal --- */
    .shortcuts-modal {
        width: calc(100% - 20px);
        padding: 20px;
    }

    .shortcut-row {
        font-size: 0.85rem;
    }

    /* --- Kanban: horizontal scroll on mobile --- */
    .kanban-board {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* === Extra-small screens (< 400px) === */
@media (max-width: 400px) {
    .shell {
        padding: 6px 4px 0;
        box-sizing: border-box;
    }

    .topbar {
        padding: 10px 10px;
        border-radius: 16px;
    }

    .current-job-card,
    .composer-card,
    .activity-card {
        padding: 14px 10px;
        border-radius: 16px;
    }

    .stats-strip {
        gap: 6px;
    }

    .stat-card {
        padding: 10px 8px;
    }

    .job-title {
        font-size: clamp(1.4rem, 7vw, 2rem);
    }

    body[data-has-job="false"] .composer-title {
        font-size: clamp(1.5rem, 8vw, 2.2rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(31, 122, 83, 0.28);
    }

    70% {
        box-shadow: 0 0 0 12px rgba(31, 122, 83, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(31, 122, 83, 0);
    }
}

@keyframes surfaceIn {
    0% {
        opacity: 0;
        transform: translateY(6px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes refreshFade {
    0% {
        opacity: 0.85;
    }

    100% {
        opacity: 1;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(106, 99, 255, 0.2); }
    50% { box-shadow: 0 0 0 6px rgba(106, 99, 255, 0); }
}

/* ===== UX Improvements — Transitions ===== */
.view-panel {
    animation: fadeIn 0.3s ease;
}

.mission-mini-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mission-mini-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(16, 24, 32, 0.08);
}

.action-button {
    transition: all 0.2s ease;
}

.action-button:active {
    transform: scale(0.97);
}

/* ===== Kanban Board ===== */
.sheet-wide {
    width: min(90vw, 1100px);
}

.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 8px 0;
    min-height: 300px;
    overflow-x: auto;
}

.kanban-col {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 10px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kanban-col-header {
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 4px 6px 8px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 4px;
}

.kanban-col[data-status="running"] .kanban-col-header { color: #427aff; }
.kanban-col[data-status="completed"] .kanban-col-header { color: var(--accent); }
.kanban-col[data-status="failed"] .kanban-col-header { color: #b4475e; }

.kanban-col-tasks {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 60px;
}

.kanban-col-tasks.drag-over {
    background: var(--accent-soft);
    border-radius: 10px;
    outline: 2px dashed var(--accent);
    outline-offset: -2px;
}

.kanban-card {
    background: var(--panel-strong);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    cursor: grab;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
}

.kanban-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 24, 32, 0.08);
}

.kanban-card.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

.kanban-card-title {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 4px;
    color: var(--text);
}

.kanban-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
    color: var(--muted);
}

.kanban-card-role {
    display: inline-block;
    padding: 1px 6px;
    border-radius: var(--radius-pill);
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--accent-soft);
    color: var(--accent);
}

.kanban-card-type {
    display: inline-block;
    padding: 1px 6px;
    border-radius: var(--radius-pill);
    font-size: 0.62rem;
    font-weight: 600;
    background: var(--blue-soft);
    color: #427aff;
}

.kanban-card-cost {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.64rem;
}

.kanban-empty {
    font-size: 0.75rem;
    color: var(--muted);
    text-align: center;
    padding: 20px 8px;
    opacity: 0.6;
}

@media (max-width: 768px) {
    .kanban-board {
        grid-template-columns: 1fr;
    }
    .sheet-wide {
        width: 100%;
    }
}

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--line) 0%, rgba(255,255,255,0.4) 50%, var(--line) 100%);
    background-size: 400px 100%;
    animation: shimmer 1.5s ease infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

/* Live pulse indicator */
.live-dot {
    animation: pulseGlow 2s ease infinite;
}

/* Status text colours */
.status-running { color: var(--blue); }
.status-queued { color: var(--yellow); }
.status-done { color: var(--green); }
.status-idle { color: var(--muted); }

/* ===== Mission Detail Modal ===== */
.mission-detail-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(16, 24, 32, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.mission-detail-overlay.is-open {
    display: flex;
}

.mission-detail-modal {
    width: min(1100px, 96%);
    max-height: 92vh;
    overflow-y: auto;
    padding: 32px 36px;
    border-radius: var(--radius-lg);
    will-change: transform;
    contain: layout style;
}

/* Two-panel layout */
.detail-two-panel {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
    margin-bottom: 20px;
}

.detail-context-panel {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(255, 252, 245, 0.4);
    overflow: hidden;
    align-self: start;
}

.context-section { border-bottom: 1px solid var(--line); }
.context-section:last-child { border-bottom: none; }

.context-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 14px;
    cursor: pointer;
    user-select: none;
    transition: background 0.12s;
}
.context-section-header:hover { background: rgba(45, 106, 79, 0.04); }

.context-toggle-icon {
    font-size: 0.55rem;
    color: var(--muted);
    width: 12px;
    text-align: center;
    flex-shrink: 0;
}

.context-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--fg);
}

.context-section-meta {
    font-size: 0.7rem;
    color: var(--muted);
    margin-left: auto;
}

.context-section-body { padding: 0 14px 12px; }

.context-field-text {
    font-size: 0.8rem;
    line-height: 1.55;
    color: var(--fg);
    margin: 0 0 6px;
    opacity: 0.85;
}

.context-criteria { display: flex; flex-direction: column; gap: 3px; }
.context-criteria-item { font-size: 0.76rem; color: var(--muted); padding: 1px 0; }

.context-edit-area {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: transparent;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--fg);
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}
.context-edit-area:focus { outline: none; border-color: var(--accent, #2d6a4f); }

.context-save-btn { margin-top: 6px; font-size: 0.7rem; padding: 3px 10px; }

.detail-progress-panel {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}

@media (max-width: 820px) {
    .detail-two-panel { grid-template-columns: 1fr; }
    .mission-detail-modal { width: 100%; max-height: 100vh; border-radius: 0; }
}

.mission-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.mission-detail-header .sheet-title {
    font-size: 1.4rem;
    line-height: 1.3;
}

.mission-detail-body {}

.mission-detail-meta {
    display: grid;
    gap: 16px;
    margin-bottom: 24px;
}

/* Stats area — no longer a grid of cards */
.mission-detail-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
}

/* Summary strip — inline pills */
.detail-summary-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.detail-status-pill {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 3px 12px;
    border-radius: var(--radius-pill);
    background: var(--line);
    color: var(--fg);
}
.detail-status--done { background: rgba(60, 191, 123, 0.15); color: var(--green-dark, #1a7a4a); }
.detail-status--running { background: rgba(35, 116, 216, 0.15); color: var(--blue, #2374d8); }
.detail-status--planned { background: rgba(139, 92, 246, 0.12); color: #6d28d9; }
.detail-status--error { background: rgba(201, 107, 122, 0.15); color: var(--red, #b4475e); }
.detail-status--idle { background: var(--line); }

.detail-summary-stat {
    font-size: 0.8rem;
    color: var(--muted);
}

/* Agent workers strip — shows active agents as avatar pills */
.agent-workers-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    margin: 8px 0 4px;
    border-radius: var(--radius);
    background: rgba(35, 116, 216, 0.05);
    border: 1px solid rgba(35, 116, 216, 0.1);
}
.agent-strip-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--blue, #2374d8);
    white-space: nowrap;
}
.agent-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.agent-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px 3px 3px;
    border-radius: var(--radius-pill);
    background: rgba(35, 116, 216, 0.08);
    border: 1px solid rgba(35, 116, 216, 0.12);
    font-size: 0.72rem;
    color: var(--text);
    animation: pulseGlow 2s ease-in-out infinite;
}
.agent-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--blue, #2374d8);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.03em;
}
.agent-task-label {
    font-weight: 500;
    color: var(--muted-strong);
}
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(35, 116, 216, 0); }
    50% { box-shadow: 0 0 6px 1px rgba(35, 116, 216, 0.15); }
}

.detail-intent {
    font-size: 0.9rem;
    color: var(--fg);
    line-height: 1.6;
    margin: 4px 0 0;
    opacity: 0.75;
}

/* Step cards */
.mission-detail-tasks {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 28px;
}

.detail-task-card {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    background: rgba(255, 252, 245, 0.6);
    border: 1px solid var(--line);
    transition: border-color 0.15s;
}

.detail-task-card.done { border-left: 3px solid var(--green); }
.detail-task-card.blocked { border-left: 3px solid var(--red); }
.detail-task-card.running { border-left: 3px solid var(--blue); }
.detail-task-card.queued { border-left: 3px solid var(--line-strong); }

.detail-task-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-step-icon {
    font-size: 0.85rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}
.detail-step-icon.done { color: var(--green); }
.detail-step-icon.blocked { color: var(--red); }
.detail-step-icon.running { color: var(--blue); }
.detail-step-icon.queued { color: var(--muted); }

.detail-task-header strong {
    flex: 1;
    font-size: 0.92rem;
}

.detail-step-status {
    font-size: 0.72rem;
    color: var(--muted);
    flex-shrink: 0;
}

.detail-task-desc {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 6px 0 0 30px;
    line-height: 1.5;
}

.detail-task-output, .detail-task-error {
    margin: 8px 0 0 30px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.detail-task-output {
    background: rgba(60, 191, 123, 0.06);
    border: 1px solid rgba(60, 191, 123, 0.15);
}

.detail-task-error {
    background: rgba(201, 107, 122, 0.06);
    border: 1px solid rgba(201, 107, 122, 0.15);
}

/* Task logs toggle button */
.task-logs-toggle {
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 4px 6px;
    cursor: pointer;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}
.task-logs-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text);
}
.task-logs-toggle svg {
    transition: transform 0.2s ease;
}
.task-logs-toggle.is-open svg {
    transform: rotate(-90deg);
}

/* Task logs panel */
.task-logs-panel {
    margin: 12px 0 0 30px;
    border-radius: var(--radius-sm);
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    animation: slideDown 0.2s ease;
}
@keyframes slideDown {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 300px; }
}

.task-logs-content {
    font-family: "Monaco", "Menlo", "Ubuntu Mono", "Courier New", monospace;
    font-size: 0.75rem;
    line-height: 1.6;
    max-height: 200px;
    overflow-y: auto;
    color: #e0e0e0;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.task-log-entry {
    display: flex;
    gap: 12px;
    white-space: pre-wrap;
    word-break: break-word;
}

.task-log-time {
    color: #888;
    flex-shrink: 0;
    font-size: 0.7rem;
    min-width: 60px;
}

.task-log-type {
    flex-shrink: 0;
    padding: 0 6px;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 600;
    min-width: 50px;
    text-align: center;
}

.task-log-type-info {
    background: rgba(88, 166, 255, 0.2);
    color: #58a6ff;
}

.task-log-type-progress {
    background: rgba(88, 166, 255, 0.2);
    color: #79c0ff;
}

.task-log-type-error {
    background: rgba(248, 113, 113, 0.2);
    color: #ff7b72;
}

.task-log-type-output {
    background: rgba(60, 191, 123, 0.2);
    color: #3fb97a;
}

.task-log-message {
    flex: 1;
    color: #e0e0e0;
}

.task-logs-spinner {
    padding: 12px;
    color: #888;
    font-size: 0.8rem;
}

.task-logs-empty {
    padding: 12px;
    color: #888;
    font-size: 0.8rem;
    text-align: center;
}

.task-logs-error {
    padding: 12px;
    color: #ff7b72;
    font-size: 0.8rem;
    text-align: center;
}

.detail-empty {
    font-size: 0.85rem;
    color: var(--muted);
    padding: 8px 0;
}

/* Notes section (inside tasks area) */
.detail-notes-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

/* Advanced accordion */
.detail-advanced-section {
    margin-top: 20px;
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

.detail-advanced-toggle {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    cursor: pointer;
    padding: 6px 0;
    list-style: none;
    user-select: none;
}
.detail-advanced-toggle::-webkit-details-marker { display: none; }
.detail-advanced-toggle::before {
    content: "▸ ";
    display: inline;
}
details[open] > .detail-advanced-toggle::before {
    content: "▾ ";
}

.detail-advanced-content {
    padding-top: 16px;
}

/* Advanced step management rows */
.adv-task-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.8rem;
}
.adv-task-name { flex: 1; }
.adv-status-select {
    font-size: 0.72rem;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--fg);
}
.adv-task-meta {
    font-size: 0.7rem;
    color: var(--muted);
}

/* Actions bar */
.mission-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.action-button-danger {
    color: var(--red);
    border-color: var(--red);
}

/* ===== Mission Chat ===== */
.detail-chat-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.chat-messages {
    max-height: 280px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 0;
}
.chat-messages:empty::after {
    content: "No messages yet. Chat with the agent while it works.";
    color: var(--muted);
    font-size: 0.8rem;
    text-align: center;
    padding: 20px 0;
}

.chat-msg {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    font-size: 0.82rem;
    line-height: 1.5;
}
.chat-msg--user {
    align-self: flex-end;
}
.chat-msg--system, .chat-msg--agent {
    align-self: flex-start;
}

.chat-msg-role {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: 2px;
    padding: 0 10px;
}

.chat-msg-text {
    padding: 7px 12px;
    border-radius: 14px;
    color: var(--fg);
    word-break: break-word;
}
.chat-msg--user .chat-msg-text {
    background: var(--accent, #2d6a4f);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.chat-msg--user .chat-msg-role { text-align: right; color: var(--accent, #2d6a4f); }
.chat-msg--system .chat-msg-text,
.chat-msg--agent .chat-msg-text {
    background: rgba(21, 32, 43, 0.06);
    border-bottom-left-radius: 4px;
}
.chat-msg--system .chat-msg-role { color: var(--blue, #2374d8); }
.chat-msg--agent .chat-msg-role { color: var(--blue, #2374d8); }

.chat-msg-time {
    font-size: 0.6rem;
    color: var(--muted);
    padding: 0 10px;
    margin-top: 1px;
}
.chat-msg--user .chat-msg-time { text-align: right; }

/* Inline artifact previews in chat */
.chat-artifact-ref {
    color: var(--accent);
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    font-weight: 600;
}
.chat-artifact-ref:hover { text-decoration-style: solid; }
.chat-file-ref {
    font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
    font-size: 0.82em;
    background: rgba(0,0,0,0.06);
    padding: 1px 4px;
    border-radius: 3px;
}
.chat-code-block {
    margin: 6px 0;
    padding: 8px 10px;
    background: rgba(0,0,0,0.04);
    border-radius: 6px;
    font-size: 0.78rem;
    overflow-x: auto;
    white-space: pre;
}
.chat-inline-preview {
    margin: 6px 0 2px;
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}
.chat-inline-iframe {
    width: 100%;
    min-height: 200px;
    max-height: 350px;
    border: none;
}
.chat-inline-img {
    max-width: 100%;
    max-height: 300px;
    display: block;
}

.chat-input-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 9px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: transparent;
    font-size: 0.85rem;
    color: var(--fg);
    font-family: inherit;
    transition: border-color 0.15s;
}
.chat-input:focus {
    outline: none;
    border-color: var(--accent, #2d6a4f);
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.08);
}
.chat-input::placeholder { color: var(--muted); }

.chat-send-btn {
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    border: none;
    background: var(--accent, #2d6a4f);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
}
.chat-send-btn:hover { background: #245a3d; }
.chat-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.chat-redirect-btn {
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(180, 83, 9, 0.2);
    background: transparent;
    color: #b45309;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
}
.chat-redirect-btn:hover { background: rgba(180, 83, 9, 0.06); }
.chat-redirect-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Escalation cards in detail modal */
.detail-escalations-strip {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 12px 0 8px;
    padding: 14px;
    border-radius: var(--radius);
    background: rgba(180, 83, 9, 0.04);
    border: 1px solid rgba(180, 83, 9, 0.12);
}
.detail-escalation-card {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(180, 83, 9, 0.1);
}
.esc-urgency {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}
.esc-urgency--critical { color: #dc2626; }
.esc-urgency--high { color: #b45309; }
.esc-urgency--medium { color: #8d5d12; }
.esc-urgency--low { color: var(--muted); }
.esc-question {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 6px;
}
.esc-recommendation {
    font-size: 0.78rem;
    color: var(--muted-strong);
    margin: 0 0 8px;
    font-style: italic;
}
.esc-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.esc-option-btn {
    padding: 5px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(180, 83, 9, 0.2);
    background: rgba(180, 83, 9, 0.06);
    color: #92400e;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.esc-option-btn:hover { background: rgba(180, 83, 9, 0.12); }
.esc-option-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.esc-text-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    background: transparent;
    color: var(--fg);
}
.esc-resolve-btn {
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    border: none;
    background: #b45309;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}
.esc-resolve-btn:hover { background: #92400e; }

/* Decision badge on job card */
.job-decision-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    background: rgba(215, 147, 57, 0.12);
    border: 1px solid rgba(215, 147, 57, 0.2);
    color: #8d5d12;
    font-size: 0.72rem;
    font-weight: 700;
    margin-left: 8px;
    animation: pulse 2s ease-in-out infinite;
}

.chat-live-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent, #2d6a4f);
    margin-left: 6px;
    animation: pulse 2s ease-in-out infinite;
}

/* ===== Artifacts / Outputs ===== */
.detail-artifacts-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.artifact-count {
    font-size: 0.75rem;
    color: var(--muted);
}

.artifact-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 0;
}

.artifact-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(255, 252, 245, 0.4);
}

.artifact-type-badge {
    font-size: 0.68rem;
    font-weight: 700;
    font-family: "Azeret Mono", monospace;
    color: var(--muted);
    background: var(--line);
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.artifact-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.artifact-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--fg);
}

.artifact-meta {
    font-size: 0.72rem;
    color: var(--muted);
}

.artifact-action {
    font-size: 0.75rem;
    color: var(--accent, #2d6a4f);
    text-decoration: none;
    padding: 2px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}
.artifact-action:hover {
    background: rgba(45, 106, 79, 0.08);
}

/* ===== Settings View ===== */
.settings-layout {
    max-width: 960px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 24px;
}

.settings-card {
    padding: 24px;
}

.settings-status {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 8px 0;
}

.settings-status.status-green { color: var(--green); }
.settings-status.status-red { color: var(--red); }
.settings-status.status-amber { color: var(--yellow); }

.settings-test-result {
    margin-top: 12px;
    font-size: 0.85rem;
    min-height: 20px;
}

.settings-test-result.status-green { color: var(--green-dark); }
.settings-test-result.status-red { color: var(--red); }

/* ===== Execution Log Viewer ===== */
.detail-log-section {
    margin-bottom: 24px;
}

.detail-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.detail-log-output {
    background: var(--near-black);
    color: #a8e6cf;
    font-family: "Azeret Mono", monospace;
    font-size: 0.72rem;
    line-height: 1.6;
    padding: 16px;
    border-radius: var(--radius-sm);
    max-height: 240px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.action-button-small {
    font-size: 0.65rem;
    padding: 4px 12px;
}

/* ===== Template Strip ===== */
.template-strip {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.template-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--line-strong);
    background: rgba(255, 252, 245, 0.7);
    font-family: "Poppins", sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.template-chip:hover {
    background: rgba(106, 99, 255, 0.08);
    border-color: var(--purple);
    color: var(--purple);
}

.template-icon {
    font-size: 1rem;
}

.template-chip--advanced {
    border-color: var(--purple);
    background: rgba(106, 99, 255, 0.05);
}

.template-chip--advanced:hover {
    background: rgba(106, 99, 255, 0.14);
}

.template-badge {
    font-size: 0.65rem;
    background: var(--purple);
    color: white;
    padding: 1px 6px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ===== Execution Plan Visualization ===== */
.detail-exec-plan {
    margin-bottom: 24px;
}

.exec-plan-waves {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 16px 0;
}

.exec-wave {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 80px;
}

.exec-wave-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: center;
}

.exec-wave-tasks {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.exec-wave-task {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: rgba(35, 116, 216, 0.1);
    border: 1px solid rgba(35, 116, 216, 0.15);
    font-family: "Azeret Mono", monospace;
    font-size: 0.68rem;
    text-align: center;
    color: var(--blue);
}

.exec-wave-task.critical {
    background: rgba(216, 167, 65, 0.12);
    border-color: rgba(216, 167, 65, 0.2);
    color: var(--orange);
    font-weight: 600;
}

.exec-wave-arrow {
    color: var(--muted);
    font-size: 1.2rem;
    flex-shrink: 0;
    opacity: 0.5;
}

/* ===== Responsive ===== */
/* ===== Version Tag ===== */
.credit-display {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: var(--radius-pill);
    background: rgba(45, 106, 79, 0.08);
    color: var(--accent, #2d6a4f);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font-ui);
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.version-tag {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 10px;
    border-radius: var(--radius-pill);
    background: rgba(21, 32, 43, 0.04);
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ===== Stats Strip ===== */
.stats-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid rgba(21, 32, 43, 0.06);
}

.stats-strip:empty {
    display: none;
}

.stat-card {
    display: grid;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(21, 32, 43, 0.05);
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.stat-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(21, 32, 43, 0.44);
}

.stat-detail {
    font-size: 0.76rem;
    color: var(--muted);
}

.stat-card.tone-green .stat-value { color: #146a48; }
.stat-card.tone-blue .stat-value { color: #265bb7; }
.stat-card.tone-amber .stat-value { color: #8d5d12; }
.stat-card.tone-neutral .stat-value { color: var(--text); }

/* Cost ticker */
.cost-ticker {
    align-items: baseline;
    gap: 12px;
    padding: 10px 0 2px;
    border-top: 1px solid var(--line);
}

.cost-ticker:not([hidden]) { display: flex; }
    margin-top: 8px;
}
.cost-ticker-amount {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.02em;
}
.cost-ticker-detail {
    font-size: 0.78rem;
    color: var(--muted);
    display: flex;
    gap: 6px;
    align-items: center;
}
.cost-ticker-sep {
    opacity: 0.4;
}

/* ===== Settings Sheet Items ===== */
.settings-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.settings-test-result {
    min-height: 1.2rem;
    margin-top: 8px;
    font-size: 0.88rem;
    color: var(--muted);
}

.settings-test-result.is-success { color: #146a48; }
.settings-test-result.is-error { color: #a2475b; }

.settings-item {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.52);
    border: 1px solid rgba(21, 32, 43, 0.06);
    align-items: center;
}

.settings-item-label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(21, 32, 43, 0.46);
    margin-bottom: 4px;
}

.settings-item-desc {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 2px;
    line-height: 1.4;
}

.settings-item-value {
    font-size: 1rem;
    font-weight: 700;
}

.settings-item-value.is-ok { color: #146a48; }
.settings-item-value.is-warn { color: #8d5d12; }
.settings-item-value.is-error { color: #a2475b; }

/* ===== Keyboard Shortcut Hint ===== */
.kbd-hint {
    position: fixed;
    bottom: 18px;
    right: 18px;
    z-index: 5;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    background: rgba(21, 32, 43, 0.06);
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    opacity: 0.6;
    transition: opacity 200ms;
    pointer-events: none;
}

body[data-has-job="false"] .stats-strip {
    display: none;
}

/* ===== CRUD Controls ===== */
.inline-edit-input {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid rgba(66, 122, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    font: inherit;
    font-weight: 700;
    outline: none;
    box-shadow: 0 0 0 3px rgba(66, 122, 255, 0.1);
}

.editable-title:hover,
.editable-task-title:hover {
    background: rgba(66, 122, 255, 0.06);
    border-radius: 6px;
    padding: 2px 6px;
    margin: -2px -6px;
}

.task-status-select {
    appearance: none;
    -webkit-appearance: none;
    padding: 2px 8px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.8);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    color: var(--muted);
}

.task-status-select:focus {
    outline: none;
    border-color: rgba(66, 122, 255, 0.4);
}

.task-delete-btn {
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    opacity: 0.4;
    transition: opacity 180ms, color 180ms;
}

.task-delete-btn:hover {
    opacity: 1;
    color: #a2475b;
}

.add-task-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 12px 0 0;
    border-top: 1px solid rgba(21, 32, 43, 0.06);
}

.add-task-input {
    width: 100%;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid rgba(21, 32, 43, 0.1);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.84);
    font: inherit;
    color: var(--text);
}

.add-task-input:focus {
    outline: none;
    border-color: rgba(66, 122, 255, 0.3);
    box-shadow: 0 0 0 3px rgba(66, 122, 255, 0.08);
}

.detail-danger-btn {
    color: #a2475b !important;
    border-color: rgba(162, 71, 91, 0.3) !important;
}

.detail-danger-btn:hover {
    background: rgba(162, 71, 91, 0.08) !important;
}

/* ===== IDE Composer Enhancements ===== */
.composer-card.is-dragover {
    border-color: rgba(31, 122, 83, 0.3);
    background: linear-gradient(180deg, rgba(244, 252, 248, 0.94), var(--panel));
    box-shadow: 0 0 0 3px rgba(31, 122, 83, 0.08), var(--shadow-soft);
}

.composer-card.is-dragover .asset-dropzone {
    border-color: rgba(31, 122, 83, 0.4);
    background: rgba(244, 252, 248, 0.92);
    transform: scale(1.01);
}

/* ===== Search Overlay ===== */
.search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(18, 26, 33, 0.18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: flex-start;
    justify-content: center;
    padding: 80px 24px 24px;
}

.search-overlay.is-open {
    display: flex;
}

.search-modal {
    width: min(720px, 100%);
    max-height: 70vh;
    overflow-y: auto;
    padding: 24px;
    border-radius: var(--radius-xl);
    animation: surfaceIn 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.search-header {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.search-input {
    flex: 1;
    min-height: 48px;
    padding: 0 18px;
    border: 1px solid rgba(21, 32, 43, 0.1);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.9);
    font: inherit;
    font-size: 1.05rem;
    color: var(--text);
}

.search-input:focus {
    outline: none;
    border-color: rgba(66, 122, 255, 0.3);
    box-shadow: 0 0 0 3px rgba(66, 122, 255, 0.08);
}

.search-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.search-filter-chip {
    padding: 6px 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.7);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--muted);
    transition: all 180ms ease;
}

.search-filter-chip.is-active {
    border-color: rgba(66, 122, 255, 0.24);
    background: rgba(66, 122, 255, 0.08);
    color: var(--text);
}

.search-results {
    display: grid;
    gap: 10px;
}

.search-result-item {
    display: grid;
    gap: 6px;
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.52);
    border: 1px solid rgba(21, 32, 43, 0.06);
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease;
}

.search-result-item:hover {
    transform: translateY(-1px);
    border-color: rgba(21, 32, 43, 0.12);
}

.search-result-title {
    font-weight: 700;
    font-size: 1rem;
}

.search-result-meta {
    font-size: 0.78rem;
    color: var(--muted);
}

/* ===== Connector Store ===== */
.connector-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.connector-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(255, 252, 245, 0.5);
    transition: border-color 0.12s;
}
.connector-card:hover {
    border-color: var(--line-strong, #b0b0a8);
}

.connector-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
    color: white;
}

.connector-info {
    flex: 1;
    min-width: 0;
}
.connector-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--fg);
}
.connector-desc {
    font-size: 0.72rem;
    color: var(--muted);
    margin-top: 1px;
}

.connector-status {
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}
.connector-status--connected {
    color: var(--green, #059669);
}
.connector-status--not {
    color: var(--muted);
}

.connector-action {
    font-size: 0.75rem;
    padding: 5px 14px;
    border-radius: var(--radius-pill, 100px);
    border: 1px solid var(--line);
    background: transparent;
    color: var(--fg);
    cursor: pointer;
    flex-shrink: 0;
    font-family: inherit;
    transition: background 0.12s;
}
.connector-action:hover {
    background: rgba(0, 0, 0, 0.04);
}
.connector-action--connected {
    border-color: var(--green, #059669);
    color: var(--green, #059669);
}

.connector-menu {
    font-size: 1rem;
    color: var(--muted);
    cursor: pointer;
    padding: 2px 6px;
    border: none;
    background: none;
    border-radius: 4px;
    flex-shrink: 0;
}
.connector-menu:hover {
    background: rgba(0, 0, 0, 0.06);
}

/* Connect modal */
.connector-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(16, 24, 32, 0.4);
    backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
}
.connector-modal:not([hidden]) {
    display: flex;
}

.connector-modal-inner {
    background: var(--surface, #f5f3ee);
    border-radius: var(--radius-lg, 16px);
    padding: 28px 32px;
    width: min(420px, 90%);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.connector-modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.connector-modal-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.connector-modal-header strong {
    flex: 1;
    font-size: 1.05rem;
}

.connector-modal-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: transparent;
    font-size: 0.88rem;
    color: var(--fg);
    font-family: inherit;
    box-sizing: border-box;
    margin-bottom: 14px;
}
.connector-modal-input:focus {
    outline: none;
    border-color: var(--accent, #2d6a4f);
}

.connector-modal-actions {
    display: flex;
    gap: 8px;
}
.connector-modal-actions .primary-button {
    flex: 1;
}

.connector-modal-result {
    margin-top: 10px;
    font-size: 0.8rem;
    min-height: 18px;
}

/* Connector dropdown menu */
.connector-dropdown {
    background: var(--surface, #f5f3ee);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-width: 160px;
}
.connector-dropdown-item {
    display: block;
    width: 100%;
    padding: 9px 14px;
    border: none;
    background: none;
    font-size: 0.82rem;
    font-family: inherit;
    color: var(--fg);
    text-align: left;
    cursor: pointer;
    transition: background 0.1s;
}
.connector-dropdown-item:hover { background: rgba(0, 0, 0, 0.05); }
.connector-dropdown-danger { color: var(--red, #b4475e); }
.connector-dropdown-danger:hover { background: rgba(180, 71, 94, 0.08); }

/* ===== Audit Log ===== */
.settings-section {
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid var(--line);
}
.settings-section:first-child {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}

.audit-log-list {
    display: grid;
    gap: 6px;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 10px;
}

.audit-entry {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(21, 32, 43, 0.04);
    font-size: 0.82rem;
}

.audit-time {
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    white-space: nowrap;
}

.audit-action {
    font-weight: 600;
}

/* ===== Analytics Cards ===== */
.analytics-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.agents-list,
.webhooks-list {
    display: grid;
    gap: 6px;
    max-height: 250px;
    overflow-y: auto;
    margin-top: 10px;
}

.webhook-add-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin-top: 10px;
}

/* ===== Toast Notifications ===== */
.toast-notification {
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    font-size: 0.88rem;
    font-weight: 600;
    opacity: 0;
    transform: translateY(10px);
    transition: all 300ms cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 12px 32px rgba(21, 32, 43, 0.16);
    white-space: nowrap;
    max-width: 90vw;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toast-notification.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.toast-notification.is-success {
    background: #146a48;
    color: white;
}

.toast-notification.is-error {
    background: #a2475b;
    color: white;
}

.toast-notification.is-info {
    background: rgba(21, 32, 43, 0.9);
    color: white;
}

@media (max-width: 700px) {
    .mission-detail-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .settings-grid {
        grid-template-columns: 1fr;
    }
    .template-strip {
        gap: 6px;
    }
    .template-chip {
        font-size: 0.72rem;
        padding: 5px 10px;
    }
    .stats-strip {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* === Progress Bar === */
.progress-bar-container {
    position: relative;
    width: 100%;
    height: 32px;
    background: var(--line);
    border-radius: var(--radius-pill);
    overflow: hidden;
    margin-bottom: 12px;
}
.progress-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: var(--radius-pill);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0;
}
.progress-bar--active .progress-bar-fill {
    background: linear-gradient(90deg, var(--accent), #2ea87a);
    animation: progress-pulse 2s ease-in-out infinite;
}
.progress-bar--done .progress-bar-fill {
    background: var(--accent);
}
@keyframes progress-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}
.progress-bar-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font: 600 0.75rem/1 var(--font-ui);
    color: var(--text);
    mix-blend-mode: difference;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    pointer-events: none;
}
/* Legacy — no longer used, kept for compat */
.detail-stats-row {
    display: flex;
    gap: 8px;
}

/* === File upload chips === */
.drop-file {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: var(--blue-soft);
    font: 0.78rem/1.3 var(--font-ui);
    color: var(--text);
}
.drop-file.is-uploaded {
    background: var(--accent-soft);
}
.drop-file-status {
    font-size: 0.7rem;
    color: var(--muted);
}
.drop-file button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--muted);
    padding: 0 2px;
    line-height: 1;
}
.drop-file button:hover {
    color: var(--text);
}

/* === Timeline === */
.timeline-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 8px;
}
.timeline-event {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 8px;
    font: 0.78rem/1.4 var(--font-ui);
}
.timeline-event.tone-green { background: var(--accent-soft); }
.timeline-event.tone-rose { background: var(--rose-soft); }
.timeline-event.tone-amber { background: var(--amber-soft); }
.timeline-icon {
    flex-shrink: 0;
    width: 18px;
    text-align: center;
    font-size: 0.85rem;
    margin-top: 1px;
}
.timeline-content {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.timeline-time {
    font-size: 0.68rem;
    color: var(--muted);
}
.timeline-detail {
    color: var(--text);
    word-break: break-word;
}
.timeline-meta {
    font-size: 0.68rem;
    color: var(--muted);
}

/* === Activity feed real-time === */
.activity-time {
    font-size: 0.68rem;
    color: var(--muted);
    flex-shrink: 0;
}
.activity-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

/* === Live pill active pulse === */
.live-pill.is-active .live-dot {
    animation: pulse-dot 0.6s ease-in-out 3;
}
@keyframes pulse-dot {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.6); }
}

/* === Drag-to-reorder tasks === */
.detail-task-card {
    cursor: grab;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.detail-task-card.is-dragging {
    opacity: 0.4;
    transform: scale(0.97);
}
.detail-task-card.drag-over {
    box-shadow: inset 0 -2px 0 0 var(--accent);
}

/* === Notes / Comments === */
.note-entry {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
}
.note-entry:last-child {
    border-bottom: none;
}
.note-content {
    font-size: 0.82rem;
    color: var(--text);
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}
.note-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    font-size: 0.68rem;
    color: var(--muted);
}
.note-delete-btn {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0 4px;
    margin-left: auto;
}
.note-delete-btn:hover {
    color: #ce5c79;
}
.add-note-input {
    flex: 1;
    font-family: var(--font-ui);
    font-size: 0.82rem;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--bg-soft);
    color: var(--text);
    resize: vertical;
    min-height: 36px;
}
.add-note-input:focus {
    outline: none;
    border-color: var(--accent);
}
.add-task-row:has(.add-note-input) {
    align-items: flex-start;
}

/* === Status badges === */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.status-badge--draft { background: var(--line); color: var(--muted-strong); }
.status-badge--active { background: var(--accent-soft); color: var(--accent); }
.status-badge--paused { background: var(--amber-soft); color: #a07030; }
.status-badge--completed { background: rgba(31, 122, 83, 0.15); color: #1a6847; }
.status-badge--failed { background: var(--rose-soft); color: #b4475e; }
.status-badge--cancelled { background: var(--line); color: var(--muted); }

/* === Jobs action row === */
.jobs-actions-row {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}
.jobs-pause-button,
.jobs-resume-button,
.jobs-archive-button {
    font-family: var(--font-ui);
    font-size: 0.72rem;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: var(--bg-soft);
    color: var(--muted-strong);
    cursor: pointer;
}
.jobs-pause-button:hover { border-color: #a07030; color: #a07030; }
.jobs-resume-button:hover { border-color: var(--accent); color: var(--accent); }
.jobs-archive-button:hover { border-color: var(--muted); color: var(--muted); }

/* === Editable meta fields in detail modal === */
.detail-meta-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 12px;
    background: var(--bg-soft);
    border-radius: 8px;
    border: 1px solid var(--line);
}
.detail-meta-field .mini-label {
    font-size: 0.68rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.editable-field {
    font-size: 0.82rem;
    color: var(--text);
    line-height: 1.5;
    margin: 2px 0 0;
    cursor: text;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background 0.15s ease;
}
.editable-field:hover {
    background: rgba(31, 122, 83, 0.06);
}
.inline-edit-textarea {
    font-family: var(--font-ui);
    font-size: 0.82rem;
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--accent);
    border-radius: 6px;
    background: white;
    color: var(--text);
    resize: vertical;
    line-height: 1.5;
}
.inline-edit-textarea:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-soft);
}

/* === Task dependency chips === */
.dep-chain {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px 0 2px;
}
.dep-label {
    font-size: 0.68rem;
    color: var(--muted);
    margin-right: 2px;
}
.dep-chip {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 500;
    background: var(--line);
    color: var(--muted-strong);
}
.dep-chip--completed { background: rgba(31, 122, 83, 0.12); color: #1a6847; }
.dep-chip--running { background: var(--amber-soft); color: #a07030; }
.dep-chip--failed { background: var(--rose-soft); color: #b4475e; }
.dep-chip--pending { background: var(--line); color: var(--muted); }

/* ===== Execution Log (live stream in current job card) ===== */
.execution-log {
    margin-top: 12px;
    border-top: 1px solid var(--line);
    padding-top: 10px;
}
.execution-log-entries {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 240px;
    overflow-y: auto;
    scroll-behavior: smooth;
}
.exec-entry {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 5px 10px;
    border-radius: 6px;
    font: 0.78rem/1.4 var(--font-ui);
    color: var(--text);
    animation: exec-entry-in 0.25s ease-out;
}
@keyframes exec-entry-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
.exec-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 5px;
    background: var(--muted);
}
.exec-dot.is-thinking {
    background: var(--accent);
    animation: exec-dot-pulse 1.2s ease-in-out infinite;
}
.exec-dot.is-done { background: #1f7a53; }
.exec-dot.is-fail { background: #ce5c79; }
.exec-dot.is-claim { background: #7b68ee; }
@keyframes exec-dot-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}
.exec-text {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}
.exec-meta {
    flex-shrink: 0;
    font-size: 0.68rem;
    color: var(--muted);
    text-align: right;
    white-space: nowrap;
}

/* v1.2.8: Exec log relative timestamps */
.exec-time {
    flex-shrink: 0;
    font-size: 0.62rem;
    color: var(--muted);
    opacity: 0.6;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    min-width: 42px;
    text-align: right;
}

/* v1.2.8: Copy button for code blocks in detail modal */
.copy-code-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.65rem;
    font-family: var(--font-ui);
    cursor: pointer;
    opacity: 0;
    transition: opacity 150ms ease;
}

.copy-code-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    color: var(--text);
}

.copy-code-btn.is-copied {
    color: var(--accent);
}

pre:hover .copy-code-btn,
.code-block-wrapper:hover .copy-code-btn {
    opacity: 1;
}

/* v1.2.8: Code block wrapper for relative positioning */
.code-block-wrapper {
    position: relative;
}

/* v1.2.8: Stat card ETA styling */
.stat-value.is-eta {
    font-size: 0.88rem;
    color: var(--muted-strong);
}

/* === Deliverable Cards in Activity Feed === */
.activity-deliverable {
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    margin-bottom: 6px;
}
.activity-deliverable .deliverable-title {
    font: 600 0.82rem/1.3 var(--font-ui);
    color: var(--text);
    margin-bottom: 4px;
}
.activity-deliverable .deliverable-output {
    font: 0.78rem/1.5 var(--font-ui);
    color: var(--muted-strong);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 120px;
    overflow: hidden;
    position: relative;
}
.activity-deliverable .deliverable-output.is-expanded {
    max-height: none;
}
.activity-deliverable .deliverable-meta {
    display: flex;
    gap: 10px;
    margin-top: 6px;
    font-size: 0.68rem;
    color: var(--muted);
}
.deliverable-expand {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font: 600 0.72rem/1 var(--font-ui);
    padding: 2px 0;
    margin-top: 4px;
}
.deliverable-expand:hover {
    text-decoration: underline;
}

/* =========================================================================
   INTERROGATION UI — Clarifying Questions Panel
   ========================================================================= */

.interrogation-panel {
    margin-top: 16px;
    padding: 16px 20px;
    background: var(--bg-soft);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md);
    animation: surfaceIn 0.3s ease backwards;
}
.interrogation-panel .interrogation-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.interrogation-panel .interrogation-icon {
    font-size: 1.1rem;
}
.interrogation-panel .interrogation-title {
    font: 600 0.85rem/1.3 var(--font-ui);
    color: var(--text);
}
.interrogation-panel .interrogation-subtitle {
    font: 400 0.75rem/1.4 var(--font-ui);
    color: var(--muted);
    margin-bottom: 16px;
}
.interrogation-question {
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}
.interrogation-question:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.interrogation-question .q-label {
    font: 500 0.8rem/1.4 var(--font-ui);
    color: var(--text);
    margin-bottom: 4px;
}
.interrogation-question .q-why {
    font: 400 0.7rem/1.3 var(--font-ui);
    color: var(--muted);
    margin-bottom: 8px;
}
.interrogation-question .q-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}
.interrogation-question .q-option {
    padding: 5px 12px;
    font: 400 0.75rem/1.2 var(--font-ui);
    background: var(--panel-strong);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all 0.15s ease;
}
.interrogation-question .q-option:hover,
.interrogation-question .q-option.is-selected {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}
.interrogation-question .q-input {
    width: 100%;
    padding: 8px 12px;
    font: 400 0.78rem/1.4 var(--font-ui);
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel-strong);
    color: var(--text);
    resize: none;
}
.interrogation-question .q-input:focus {
    outline: none;
    border-color: var(--accent);
}
.interrogation-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    justify-content: flex-end;
}
.interrogation-actions .skip-btn {
    padding: 6px 14px;
    font: 500 0.78rem/1.2 var(--font-ui);
    background: none;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    color: var(--muted-strong);
    cursor: pointer;
    transition: all 0.15s ease;
}
.interrogation-actions .skip-btn:hover {
    border-color: var(--muted-strong);
    color: var(--text);
}
.interrogation-actions .proceed-btn {
    padding: 6px 16px;
    font: 500 0.78rem/1.2 var(--font-ui);
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: var(--radius-pill);
    color: white;
    cursor: pointer;
    transition: all 0.15s ease;
}
.interrogation-actions .proceed-btn:hover {
    opacity: 0.9;
}

/* =========================================================================
   ROLE BADGES — Agent Role Indicators
   ========================================================================= */

.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font: 500 0.65rem/1.2 var(--font-ui);
    border-radius: var(--radius-pill);
    white-space: nowrap;
}
.role-badge.role-planner {
    background: rgba(147, 51, 234, 0.1);
    color: #7c3aed;
}
.role-badge.role-researcher {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}
.role-badge.role-builder {
    background: rgba(234, 88, 12, 0.1);
    color: #c2410c;
}
.role-badge.role-reviewer {
    background: rgba(14, 165, 233, 0.1);
    color: #0284c7;
}
.role-badge.role-synthesizer {
    background: rgba(168, 85, 247, 0.1);
    color: #7e22ce;
}
.role-badge.role-verifier {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

/* =========================================================================
   HEALTH INDICATORS
   ========================================================================= */

.health-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font: 500 0.7rem/1.2 var(--font-ui);
    border-radius: var(--radius-pill);
}
.health-indicator.health-healthy {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}
.health-indicator.health-degraded {
    background: rgba(234, 179, 8, 0.1);
    color: #ca8a04;
}
.health-indicator.health-unhealthy {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}
.health-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* =========================================================================
   CLARITY METER — Visual quality score
   ========================================================================= */

.clarity-meter {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}
.clarity-bar {
    flex: 1;
    height: 4px;
    background: var(--line);
    border-radius: 2px;
    overflow: hidden;
}
.clarity-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
}
.clarity-fill.clarity-low { background: #ef4444; }
.clarity-fill.clarity-medium { background: #eab308; }
.clarity-fill.clarity-high { background: #22c55e; }
.clarity-label {
    font: 500 0.65rem/1.2 var(--font-ui);
    color: var(--muted);
    white-space: nowrap;
}

/* =========================================================================
   AGENT CARD — For execution log entries
   ========================================================================= */

.agent-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 8px;
    animation: surfaceIn 0.2s ease backwards;
}
.agent-card .agent-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 1px;
}
.agent-card .agent-info {
    flex: 1;
    min-width: 0;
}
.agent-card .agent-name {
    font: 600 0.78rem/1.3 var(--font-ui);
    color: var(--text);
}
.agent-card .agent-task {
    font: 400 0.72rem/1.4 var(--font-ui);
    color: var(--muted-strong);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.agent-card .agent-status {
    font: 500 0.65rem/1.2 var(--font-ui);
    color: var(--muted);
    margin-top: 2px;
}
.agent-card .agent-status.is-running {
    color: var(--accent);
}
.agent-card .agent-status.is-completed {
    color: #16a34a;
}
.agent-card .agent-status.is-failed {
    color: #dc2626;
}

/* =========================================================================
   DRIFT SIGNAL BADGES
   ========================================================================= */

.drift-signal {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    font: 500 0.65rem/1.2 var(--font-ui);
    border-radius: var(--radius-pill);
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
    margin: 2px 4px 2px 0;
}
.drift-signal.drift-medium {
    background: rgba(234, 179, 8, 0.1);
    color: #ca8a04;
}

/* ===== WORKSPACE — Three-File System ===== */
.workspace-section { margin-top: 12px; }

.workspace-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
    overflow-x: auto;
}

.ws-tab {
    padding: 6px 12px;
    border: none;
    background: transparent;
    font: 500 0.72rem/1.2 var(--font-mono);
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.ws-tab:hover { color: var(--text); background: rgba(0,0,0,0.03); }
.ws-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.workspace-editor {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: auto;
    max-height: 320px;
}

.workspace-file-content {
    font: 400 0.72rem/1.5 var(--font-mono);
    color: var(--text);
    padding: 12px;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.workspace-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    justify-content: flex-end;
}

/* ===== MISSION HEALTH DASHBOARD ===== */
.health-dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 8px 0;
}

.health-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px;
}

.health-card .health-title {
    font: 600 0.68rem/1.2 var(--font-ui);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.health-score {
    display: flex;
    align-items: center;
    gap: 8px;
}

.health-score-value {
    font: 700 1.8rem/1 var(--font-display);
    color: var(--text);
}

.health-score-label {
    font: 500 0.7rem/1.2 var(--font-ui);
    color: var(--text-secondary);
}

.health-bar {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}

.health-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.health-bar-fill.green { background: #22c55e; }
.health-bar-fill.amber { background: #eab308; }
.health-bar-fill.red { background: #ef4444; }

.drift-signals-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.back-pressure-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font: 500 0.72rem/1.2 var(--font-ui);
    padding: 6px 0;
}
.back-pressure-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.back-pressure-dot.ok { background: #22c55e; }
.back-pressure-dot.warn { background: #eab308; }
.back-pressure-dot.block { background: #ef4444; }

/* ===== MODE SELECTORS ===== */
.mode-selectors {
    display: flex;
    gap: 4px;
}

.mode-select {
    font: 500 0.68rem/1.2 var(--font-ui);
    color: var(--text-secondary);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 6px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='6'%3E%3Cpath d='M0 0l4 6 4-6z' fill='%239ca3af'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 5px center;
    padding-right: 16px;
    transition: border-color 0.15s ease;
}
.mode-select:hover { border-color: var(--accent); }
.mode-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.15); }

/* ===== REPAIR LOOPS ===== */
.repair-actions {
    display: flex;
    gap: 4px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed var(--border);
}

.repair-btn {
    font: 500 0.65rem/1.2 var(--font-ui);
    padding: 3px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--accent);
    cursor: pointer;
    transition: all 0.15s ease;
}
.repair-btn:hover {
    background: rgba(139, 92, 246, 0.08);
    border-color: var(--accent);
}
.repair-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== MEMORY BROWSER ===== */
.memory-list { max-height: 300px; overflow-y: auto; }

.memory-entry {
    padding: 6px 8px;
    border-bottom: 1px solid var(--border);
}
.memory-entry:last-child { border-bottom: none; }

.memory-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
}

.memory-layer-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.memory-layer-label {
    font: 600 0.6rem/1 var(--font-ui);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

.memory-key {
    font: 400 0.65rem/1.2 var(--font-mono);
    color: var(--text-secondary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.memory-time {
    font: 400 0.6rem/1.2 var(--font-ui);
    color: var(--text-secondary);
    opacity: 0.7;
}

.memory-content {
    font: 400 0.7rem/1.4 var(--font-ui);
    color: var(--text);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.mem-tab {
    padding: 4px 10px;
    border: none;
    background: transparent;
    font: 500 0.68rem/1.2 var(--font-ui);
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
}
.mem-tab:hover { color: var(--text); }
.mem-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ===== Deploy Button Feedback ===== */
.deploy-progress {
    padding: 16px 0 8px;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.deploy-progress:not([hidden]) {
    display: flex;
}

.deploy-progress-steps {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: var(--muted);
}

.deploy-step {
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0.35;
    transition: opacity 0.5s ease, color 0.5s ease;
}

.deploy-step.is-active {
    opacity: 1;
    color: var(--accent);
    font-weight: 600;
}

.deploy-step.is-done {
    opacity: 0.6;
    color: var(--accent);
}

.deploy-step-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.deploy-step.is-active .deploy-step-dot {
    animation: deployDotPulse 1.2s ease-in-out infinite;
}

.deploy-step-line {
    width: 16px;
    height: 1px;
    background: var(--line);
}

@keyframes deployDotPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.6); opacity: 0.6; }
}

.deploy-progress-text {
    font-size: 0.82rem;
    color: var(--muted);
    animation: gentlePulse 2s ease-in-out infinite;
}

.primary-button.is-deploying {
    position: relative;
    color: transparent;
}

.primary-button.is-deploying::after {
    content: "Deploying...";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: inherit;
}

@keyframes pulse-text {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ===== Decision Badge/Notification (Improvement #3) ===== */
.toolbar-button.has-decisions {
    position: relative;
    border-color: rgba(206, 92, 121, 0.18);
    background: linear-gradient(180deg, rgba(206, 92, 121, 0.08), rgba(206, 92, 121, 0.04));
}

.toolbar-button.has-decisions::after {
    content: "";
    position: absolute;
    top: -6px;
    right: -6px;
    width: 10px;
    height: 10px;
    background: #ce5c79;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(206, 92, 121, 0.2);
    animation: pulseGlow 2s ease infinite;
}

/* ===== Credit Display Visibility and Styling (Improvement #4) ===== */
.credit-display {
    display: inline-flex !important;
    align-items: center;
    min-height: 44px;
    padding: 0 14px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(31, 122, 83, 0.18);
    background: rgba(31, 122, 83, 0.08);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-ui);
    gap: 6px;
    animation: fadeIn 400ms ease;
}

.credit-display.is-low {
    border-color: rgba(215, 147, 57, 0.18);
    background: rgba(215, 147, 57, 0.08);
    color: #a07030;
}

/* ===== Activity Feed Clarity (Improvement #5) ===== */
.activity-item-icon {
    font-size: 0.95rem;
    width: 16px;
    display: inline-block;
    margin-right: 4px;
}

.activity-item-time {
    display: inline-block;
    font-size: 0.72rem;
    color: var(--muted);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.activity-copy {
    word-break: break-word;
}

/* Spec confirmation styles moved to bottom (v1.2.0 enhanced version) */

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   PREVIEW STAGE
   ============================================ */
.preview-stage {
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 100px);
    flex-direction: column;
    border-radius: var(--radius-xl);
    background: var(--panel-stage);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--line);
    overflow: hidden;
    animation: surfaceIn 280ms cubic-bezier(0.22, 1, 0.36, 1);
    animation-fill-mode: backwards;
    animation-delay: 60ms;
}

.preview-stage:not([hidden]) { display: flex; }

.preview-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px 10px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}
.preview-header .eyebrow {
    flex-shrink: 0;
}
.preview-file-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    flex: 1;
    scrollbar-width: none;
}
.preview-file-tabs::-webkit-scrollbar { display: none; }

.preview-file-tab {
    padding: 3px 10px;
    font-size: 0.72rem;
    font-family: var(--font-mono);
    border-radius: var(--radius-pill);
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all 160ms ease;
}
.preview-file-tab:hover {
    background: var(--accent-soft);
    color: var(--text);
}
.preview-file-tab.is-active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.preview-close {
    flex-shrink: 0;
    margin-left: auto;
}

.preview-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px;
    min-height: 200px;
    scroll-behavior: smooth;
}

.preview-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    text-align: center;
    color: var(--muted);
    gap: 10px;
    padding: 40px 20px;
}
.preview-empty-icon {
    font-size: 2.4rem;
    opacity: 0.4;
    animation: gentlePulse 3s ease-in-out infinite;
}
.preview-empty p {
    font-size: 0.82rem;
    max-width: 240px;
    line-height: 1.5;
}

/* Live activity feed in preview while waiting for artifacts */
.preview-live-feed {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 320px;
    width: 100%;
}

.preview-live-event {
    font: 400 0.75rem/1.4 var(--font-ui);
    color: var(--muted-strong);
    padding: 4px 10px;
    background: var(--panel-strong);
    border-radius: var(--radius-sm);
    border-left: 2px solid var(--line);
    animation: fadeSlideIn 200ms ease backwards;
}

.preview-live-event.success {
    border-left-color: var(--green);
}

.preview-live-event.running {
    border-left-color: var(--accent);
}

.preview-live-event.error {
    border-left-color: var(--red);
}

.preview-live-event.stream {
    border-left-color: rgba(139, 92, 246, 0.5);
    font-family: var(--font-mono, "SF Mono", "Consolas", monospace);
    font-size: 0.72rem;
    opacity: 0.85;
}

/* Preview content area polish */
.preview-content pre {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.preview-content img {
    max-width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
}

.preview-content iframe {
    width: 100%;
    min-height: 400px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

/* Staging bar polish */
.preview-staging-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    border-top: 1px solid var(--line);
    background: var(--accent-soft);
    flex-shrink: 0;
    gap: 12px;
}

.staging-filename {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
}

.staging-state {
    font-size: 0.72rem;
    color: var(--muted);
}

.staging-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes gentlePulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.5; }
}

.preview-content {
    font-size: 0.85rem;
    line-height: 1.6;
    contain: content;
}

/* Code preview */
.preview-content pre {
    background: rgba(20, 26, 33, 0.04);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    line-height: 1.55;
    white-space: pre;
    tab-size: 4;
}

/* Markdown preview */
.preview-content h1, .preview-content h2, .preview-content h3 {
    font-family: var(--font-display);
    margin: 1.2em 0 0.4em;
}
.preview-content h1 { font-size: 1.3rem; }
.preview-content h2 { font-size: 1.1rem; }
.preview-content h3 { font-size: 0.95rem; }
.preview-content p { margin: 0.6em 0; }
.preview-content ul, .preview-content ol { padding-left: 1.4em; }
.preview-content a { color: var(--accent); }
.preview-content code {
    background: rgba(20, 26, 33, 0.06);
    padding: 2px 5px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.82em;
}
.preview-content blockquote {
    border-left: 3px solid var(--accent);
    margin: 0.8em 0;
    padding: 0.4em 1em;
    color: var(--muted-strong);
    background: rgba(31, 122, 83, 0.04);
    border-radius: 0 8px 8px 0;
}
.preview-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    margin: 0.8em 0;
}
.preview-content th, .preview-content td {
    padding: 6px 10px;
    border: 1px solid var(--line);
    text-align: left;
}
.preview-content th {
    background: rgba(20, 26, 33, 0.04);
    font-weight: 600;
}

/* Image preview */
.preview-image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}
.preview-image-gallery img {
    width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    cursor: pointer;
    transition: transform 200ms ease;
}
.preview-image-gallery img:hover {
    transform: scale(1.03);
}

/* Data table preview */
.preview-data-table {
    overflow-x: auto;
}
.preview-data-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    font-family: var(--font-mono);
}
.preview-data-table th, .preview-data-table td {
    padding: 5px 8px;
    border: 1px solid var(--line);
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.preview-data-table th {
    background: var(--accent-soft);
    font-weight: 600;
    position: sticky;
    top: 0;
}

/* Staging bar */
.preview-staging-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
    gap: 12px;
}
.staging-info {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    min-width: 0;
}
.staging-filename {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.staging-state {
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}
.staging-state[data-state="staged"] {
    background: var(--amber-soft);
    color: #a06612;
}
.staging-state[data-state="applied"] {
    background: var(--accent-soft);
    color: var(--accent);
}
.staging-state[data-state="rejected"] {
    background: var(--rose-soft);
    color: #a03050;
}
.staging-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.staging-actions .primary-button,
.staging-actions .secondary-button {
    padding: 5px 14px;
    font-size: 0.75rem;
}

/* Reject feedback modal */
.reject-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(16, 24, 32, 0.4);
    backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
}
.reject-modal:not([hidden]) {
    display: flex;
}
.reject-modal-inner {
    background: var(--surface, #f5f3ee);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}
.reject-modal-inner h3 {
    margin: 0 0 12px;
    font-size: 1rem;
}
.reject-modal-inner textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    font-family: var(--font-ui);
    font-size: 0.85rem;
    resize: vertical;
    margin-bottom: 12px;
}
.reject-modal-inner .staging-actions {
    justify-content: flex-end;
}

/* ====== CONFIDENCE METER ====== */
.confidence-meter {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--line);
}

.confidence-bar {
    height: 6px;
    background: rgba(21, 32, 43, 0.08);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.confidence-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 600ms cubic-bezier(0.22, 1, 0.36, 1), background 400ms ease;
    background: var(--accent);
}

.confidence-fill.is-high { background: #1f9d55; }
.confidence-fill.is-medium { background: #d79339; }
.confidence-fill.is-low { background: #c04e54; }

.confidence-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
}

.confidence-score {
    font-weight: 700;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.confidence-text {
    color: var(--muted);
    font-size: 0.75rem;
}

.confidence-meter.is-high .confidence-score { color: #1f9d55; }
.confidence-meter.is-medium .confidence-score { color: #d79339; }
.confidence-meter.is-low .confidence-score { color: #c04e54; }

/* ====== ONBOARDING OVERLAY ====== */
.onboarding-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 20, 25, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 300ms ease;
}

.onboarding-overlay[hidden] { display: none; }

.onboarding-modal {
    max-width: 520px;
    width: calc(100% - 32px);
    padding: 40px 36px;
    border-radius: var(--radius-xl);
    text-align: center;
    animation: sheetIn 400ms cubic-bezier(0.22, 1, 0.36, 1);
}

.onboarding-step[hidden] { display: none; }

.onboarding-icon {
    font-size: 2.4rem;
    margin-bottom: 16px;
    line-height: 1;
}

.onboarding-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 12px;
    letter-spacing: -0.02em;
}

.onboarding-body {
    color: var(--muted-strong);
    font-size: 0.92rem;
    line-height: 1.6;
    margin: 0 0 20px;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.onboarding-visual {
    margin: 20px 0;
    padding: 18px;
    background: rgba(31, 122, 83, 0.05);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(31, 122, 83, 0.1);
}

.onboarding-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.onboarding-flow-step {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-pill);
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid var(--line);
}

.onboarding-flow-arrow {
    color: var(--accent);
    font-size: 1.2rem;
    font-weight: 700;
}

.onboarding-hint {
    margin: 16px 0;
    padding: 12px 16px;
    background: var(--blue-soft);
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    color: var(--muted-strong);
    font-style: italic;
    text-align: left;
}

.onboarding-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 16px 0;
    text-align: left;
}

.onboarding-feature {
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    border: 1px solid var(--line);
    line-height: 1.4;
}

.onboarding-feature strong {
    display: block;
    margin-bottom: 2px;
    font-size: 0.78rem;
}

.onboarding-next {
    margin-top: 8px;
    width: 100%;
    max-width: 280px;
}

.onboarding-skip {
    display: block;
    margin: 12px auto 0;
    padding: 8px;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 0.78rem;
    cursor: pointer;
    font-family: var(--font-ui);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.onboarding-skip:hover {
    color: var(--text);
}

/* ====== ENHANCED SPEC CONFIRMATION ====== */
.spec-confirm {
    margin-top: 14px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(31, 122, 83, 0.06), rgba(66, 122, 255, 0.04));
    border: 1px solid rgba(31, 122, 83, 0.15);
    border-radius: var(--radius-lg);
    animation: fadeSlideIn 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.spec-confirm-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.spec-confirm-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.spec-confirm-title {
    font-size: 0.88rem;
    font-weight: 700;
    margin: 0;
    color: var(--accent);
}

.spec-confirm-intent {
    font: 400 0.82rem/1.55 var(--font-ui);
    color: var(--text);
    margin-bottom: 14px;
    padding: 10px 14px;
    background: var(--panel-strong);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--accent);
}

.spec-confirm-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.spec-confirm-section {
    font-size: 0.78rem;
    line-height: 1.5;
}

.spec-section-label {
    font-weight: 600;
    color: var(--muted-strong);
    margin-bottom: 4px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.spec-section-item {
    color: var(--muted-strong);
    padding-left: 12px;
    border-left: 2px solid var(--line);
    margin-bottom: 3px;
}

.spec-task-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    color: var(--muted-strong);
    margin-bottom: 3px;
    font-size: 0.78rem;
}

.spec-task-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--accent);
    background: rgba(31, 122, 83, 0.1);
    border-radius: 50%;
    flex-shrink: 0;
}

.spec-confirm-meta {
    font: 500 0.7rem/1.3 var(--font-mono);
    color: var(--muted);
    letter-spacing: -0.01em;
    margin-bottom: 14px;
    text-transform: capitalize;
}

.spec-confirm-meta:empty {
    display: none;
}

.spec-confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.spec-confirm-actions .primary-button {
    flex: 0 0 auto;
}

.spec-confirm-actions .secondary-button {
    flex: 0 0 auto;
}

/* ====== OUTCOMES GRID (v1.8 redesign) ====== */
.outcomes-section {
    display: grid;
    gap: 14px;
    grid-column: 1 / -1;
}

.outcomes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
}

.outcomes-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.outcomes-filter {
    appearance: none;
    -webkit-appearance: none;
    padding: 4px 28px 4px 10px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-pill);
    background-color: rgba(255, 255, 255, 0.7);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted-strong);
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2315202b' opacity='.3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.outcomes-count {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--muted);
    letter-spacing: 0.04em;
}

.outcomes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
}

.outcomes-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    text-align: center;
    color: var(--muted);
}

.outcomes-empty-icon {
    font-size: 2.4rem;
    margin-bottom: 8px;
    opacity: 0.5;
}

.outcomes-empty p {
    max-width: 280px;
    font-size: 0.85rem;
    line-height: 1.5;
}

.outcome-card {
    display: grid;
    gap: 10px;
    padding: 18px 20px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(21, 32, 43, 0.06);
    background: var(--panel);
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.outcome-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
    border-color: rgba(21, 32, 43, 0.1);
}

.outcome-card.is-running {
    border-color: rgba(63, 185, 122, 0.25);
    box-shadow: 0 8px 24px rgba(63, 185, 122, 0.06);
}

.outcome-card.is-done {
    opacity: 0.8;
}

.outcome-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.outcome-card-time {
    font-size: 0.7rem;
    color: var(--muted);
    white-space: nowrap;
}

.outcome-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.outcome-card-detail {
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.outcome-card-progress {
    display: grid;
    gap: 5px;
}

.outcome-card-bar {
    height: 4px;
    border-radius: 2px;
    background: rgba(21, 32, 43, 0.06);
    overflow: hidden;
}

.outcome-card-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 400ms ease;
}

.outcome-card-fill--running { background: var(--accent); }
.outcome-card-fill--done { background: var(--accent); }
.outcome-card-fill--queued { background: #d7aa39; }
.outcome-card-fill--blocked, .outcome-card-fill--error, .outcome-card-fill--failed { background: #b4475e; }
.outcome-card-fill--idle { background: rgba(21, 32, 43, 0.15); }

.outcome-card-meta {
    font-size: 0.7rem;
    color: var(--muted);
    font-weight: 600;
}

.outcome-card-actions {
    display: flex;
    gap: 8px;
    padding-top: 4px;
}

.outcome-card-btn {
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.7);
    color: var(--text);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: background 120ms ease, transform 120ms ease;
}

.outcome-card-btn:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.9);
}

.outcome-card-run {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.outcome-card-run:hover {
    background: #369e69;
}

.outcome-card-approve {
    background: #6d28d9;
    color: #fff;
    border-color: #6d28d9;
}
.outcome-card-approve:hover {
    background: #5b21b6;
}

/* ====== DARK MODE ====== */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #161b22;
        --bg-soft: rgba(22, 27, 34, 0.92);
        --panel: rgba(30, 37, 46, 0.85);
        --panel-strong: rgba(35, 43, 54, 0.95);
        --panel-stage: linear-gradient(180deg, rgba(35, 43, 54, 0.96), rgba(25, 31, 40, 0.9));
        --line: rgba(255, 255, 255, 0.08);
        --line-strong: rgba(255, 255, 255, 0.14);
        --text: #e6edf3;
        --muted: rgba(230, 237, 243, 0.52);
        --muted-strong: rgba(230, 237, 243, 0.72);
        --accent: #3fb97a;
        --accent-soft: rgba(63, 185, 122, 0.14);
        --blue-soft: rgba(88, 166, 255, 0.12);
        --amber-soft: rgba(215, 170, 57, 0.14);
        --rose-soft: rgba(220, 100, 130, 0.14);
        --rose-bright: #e06080;
        --shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
        --shadow-soft: 0 18px 44px rgba(0, 0, 0, 0.25);
    }

    body {
        background:
            radial-gradient(circle at top left, rgba(40, 80, 140, 0.15), transparent 26%),
            radial-gradient(circle at top right, rgba(40, 130, 100, 0.1), transparent 22%),
            linear-gradient(180deg, #0d1117 0%, #161b22 100%);
    }

    body::before {
        background: radial-gradient(circle, rgba(40, 80, 160, 0.12), transparent);
    }

    body::after {
        background: radial-gradient(circle, rgba(40, 130, 100, 0.1), transparent);
    }

    .page-haze {
        background:
            radial-gradient(circle at 20% 12%, rgba(0, 0, 0, 0.3), transparent 28%),
            radial-gradient(circle at 80% 0%, rgba(0, 0, 0, 0.2), transparent 26%);
    }

    .surface {
        background: linear-gradient(180deg, var(--panel-strong), var(--panel));
        border-color: var(--line);
    }

    .surface-shell {
        background: linear-gradient(180deg, rgba(30, 37, 46, 0.95), rgba(25, 31, 40, 0.85));
    }

    .toolbar-button,
    .secondary-button,
    .sheet-close,
    .jobs-run-button,
    .prompt-chip {
        background: rgba(255, 255, 255, 0.06);
        border-color: var(--line-strong);
        color: var(--text);
    }

    .toolbar-button:hover,
    .secondary-button:hover,
    .sheet-close:hover,
    .jobs-run-button:hover,
    .prompt-chip:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    .toolbar-button.is-active {
        background: rgba(88, 166, 255, 0.1);
        border-color: rgba(88, 166, 255, 0.2);
    }

    .primary-button {
        background: var(--accent);
        color: #fff;
    }

    .input-area,
    .connector-modal-input,
    .decision-resolve-input,
    .search-input {
        background: rgba(255, 255, 255, 0.05);
        border-color: var(--line-strong);
        color: var(--text);
    }

    .input-area:focus,
    .search-input:focus {
        border-color: rgba(63, 185, 122, 0.4);
        background: rgba(255, 255, 255, 0.08);
    }

    .sheet {
        background: linear-gradient(180deg, rgba(30, 37, 46, 0.98), rgba(22, 27, 34, 0.98));
        border-color: var(--line);
    }

    .sheet-scrim {
        background: rgba(0, 0, 0, 0.5);
    }

    .search-overlay {
        background: rgba(0, 0, 0, 0.6);
    }

    .search-modal {
        background: linear-gradient(180deg, rgba(35, 43, 54, 0.98), rgba(22, 27, 34, 0.98));
    }

    .mission-detail-modal {
        background: linear-gradient(180deg, rgba(35, 43, 54, 0.98), rgba(22, 27, 34, 0.98));
    }

    .connector-modal-inner {
        background: rgba(30, 37, 46, 0.98);
    }

    .kanban-card {
        background: rgba(255, 255, 255, 0.05);
        border-color: var(--line);
    }

    .kanban-card:hover {
        background: rgba(255, 255, 255, 0.08);
    }

    .stat-card {
        background: rgba(255, 255, 255, 0.04);
        border-color: var(--line);
    }

    .stat-label {
        color: rgba(230, 237, 243, 0.5);
    }

    .stat-card.tone-green .stat-value { color: #3fb97a; }
    .stat-card.tone-blue .stat-value { color: #58a6ff; }
    .stat-card.tone-amber .stat-value { color: #d29922; }
    .stat-card.tone-rose .stat-value { color: #e06080; }

    .stats-strip {
        border-top-color: var(--line);
    }

    .toast-notification {
        background: rgba(35, 43, 54, 0.95);
        color: var(--text);
        border-color: var(--line-strong);
    }

    .confidence-meter {
        background: rgba(255, 255, 255, 0.04);
        border-color: var(--line);
    }

    .confidence-bar {
        background: rgba(255, 255, 255, 0.08);
    }

    .onboarding-modal {
        background: linear-gradient(180deg, rgba(35, 43, 54, 0.98), rgba(22, 27, 34, 0.98));
    }

    .onboarding-visual {
        background: rgba(63, 185, 122, 0.06);
        border-color: rgba(63, 185, 122, 0.12);
    }

    .onboarding-flow-step {
        background: rgba(255, 255, 255, 0.08);
        border-color: var(--line);
    }

    .onboarding-hint {
        background: rgba(88, 166, 255, 0.1);
    }

    .onboarding-feature {
        background: rgba(255, 255, 255, 0.04);
        border-color: var(--line);
    }

    .spec-confirm {
        background: linear-gradient(135deg, rgba(63, 185, 122, 0.08), rgba(88, 166, 255, 0.05));
        border-color: rgba(63, 185, 122, 0.18);
    }

    .spec-confirm-intent {
        background: rgba(255, 255, 255, 0.04);
        border-left-color: var(--accent);
    }

    .spec-task-num {
        background: rgba(63, 185, 122, 0.15);
    }

    .exec-entry {
        border-color: var(--line);
    }

    .activity-label {
        color: rgba(230, 237, 243, 0.52);
    }

    .activity-item {
        border-top-color: var(--line);
    }

    .activity-item.is-error {
        background: rgba(220, 100, 130, 0.08);
    }

    .activity-deliverable {
        background: rgba(255, 255, 255, 0.04);
        border-color: var(--line);
    }

    .preview-stage {
        background: linear-gradient(180deg, rgba(35, 43, 54, 0.96), rgba(25, 31, 40, 0.9));
    }

    .composer-input-shell {
        background: rgba(255, 255, 255, 0.06);
        border-color: var(--line-strong);
    }

    .composer-input-shell:focus-within {
        background: rgba(255, 255, 255, 0.09);
        border-color: rgba(63, 185, 122, 0.3);
        box-shadow: 0 18px 34px rgba(0, 0, 0, 0.2);
    }

    .input-area::placeholder,
    .link-input::placeholder {
        color: rgba(230, 237, 243, 0.35);
    }

    .composer-title,
    .job-title {
        color: var(--text);
    }

    .prompt-chip {
        background: rgba(255, 255, 255, 0.06);
        border-color: var(--line-strong);
        color: var(--muted-strong);
    }

    .prompt-chip:hover {
        background: rgba(255, 255, 255, 0.1);
        color: var(--text);
    }

    .current-job-card::before {
        background: radial-gradient(circle, rgba(60, 120, 200, 0.1), transparent);
    }

    .current-job-card.is-running {
        border-color: rgba(63, 185, 122, 0.35);
        box-shadow:
            0 28px 80px rgba(63, 185, 122, 0.12),
            0 0 0 1px rgba(63, 185, 122, 0.1),
            inset 0 1px 0 rgba(63, 185, 122, 0.08);
    }

    .current-job-card.is-running::before {
        background: radial-gradient(circle, rgba(63, 185, 122, 0.14), transparent);
    }

    .composer-card::before {
        background: radial-gradient(circle, rgba(63, 185, 122, 0.08), transparent);
    }

    .version-tag {
        color: var(--muted);
        border-color: var(--line);
    }

    .live-pill {
        background: rgba(255, 255, 255, 0.06);
        border-color: var(--line);
    }

    .status-pill {
        border-color: var(--line);
    }

    .status-planned {
        background: rgba(167, 139, 250, 0.12);
        border-color: rgba(167, 139, 250, 0.2);
        color: #a78bfa;
    }

    .plan-approve-bar {
        background: rgba(167, 139, 250, 0.08);
        border-color: rgba(167, 139, 250, 0.16);
    }
    .plan-approve-hint { color: #a78bfa; }
    .btn-approve-plan { background: #7c3aed; }
    .btn-approve-plan:hover { background: #6d28d9; }
    .btn-edit-plan {
        border-color: rgba(167, 139, 250, 0.2);
        color: #a78bfa;
    }
    .btn-edit-plan:hover { background: rgba(167, 139, 250, 0.1); }
    .exec-controls {
        background: rgba(34, 197, 94, 0.08);
        border-color: rgba(34, 197, 94, 0.16);
    }
    .exec-elapsed { color: #4ade80; }
    .exec-btn-pause { color: #fbbf24; border-color: rgba(251, 191, 36, 0.25); background: rgba(251, 191, 36, 0.1); }
    .exec-btn-cancel { color: #f87171; border-color: rgba(248, 113, 113, 0.2); background: rgba(248, 113, 113, 0.08); }

    .eyebrow {
        color: var(--muted);
    }

    .sheet-item,
    .sheet-empty {
        background: rgba(255, 255, 255, 0.06);
        border-color: var(--line);
    }

    .sheet-item.is-decision {
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(220, 100, 130, 0.08));
    }

    .sheet-item.is-running {
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(63, 185, 122, 0.08));
    }

    .sheet-item.is-queued {
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(215, 170, 57, 0.08));
    }

    .search-result-item {
        background: rgba(255, 255, 255, 0.06);
        border-color: var(--line);
    }

    .search-result-item:hover {
        border-color: var(--line-strong);
    }

    .decision-resolve-input {
        background: rgba(255, 255, 255, 0.05);
        border-color: var(--line-strong);
        color: var(--text);
    }

    .search-filter-chip {
        background: rgba(255, 255, 255, 0.06);
        border-color: var(--line-strong);
    }

    .search-filter-chip.is-active {
        background: rgba(88, 166, 255, 0.12);
        border-color: rgba(88, 166, 255, 0.24);
    }

    .context-section {
        border-color: var(--line);
    }

    .context-edit-area {
        background: rgba(255, 255, 255, 0.05);
        border-color: var(--line-strong);
        color: var(--text);
    }

    .toolbar-kbd {
        background: rgba(255, 255, 255, 0.06);
        border-color: var(--line-strong);
        color: var(--muted);
    }

    .toolbar-count-pulse.has-pending {
        background: rgba(220, 100, 130, 0.2);
        color: #e06080;
    }

    .field-error {
        color: #e06080;
    }

    .skeleton {
        background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.03) 25%,
            rgba(255, 255, 255, 0.07) 50%,
            rgba(255, 255, 255, 0.03) 75%);
        background-size: 200% 100%;
    }

    .cost-ticker {
        border-color: var(--line);
        background: rgba(255, 255, 255, 0.03);
    }

    .cost-ticker.is-warning .cost-ticker-amount {
        color: #d7aa39;
    }

    .cost-ticker.is-danger .cost-ticker-amount {
        color: #e06080;
    }

    .empty-state { color: var(--muted); }

    .settings-tabs {
        background: rgba(255, 255, 255, 0.04);
        border-color: var(--line);
    }

    .settings-tab.is-active {
        background: rgba(255, 255, 255, 0.1);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }

    .detail-task-card {
        background: rgba(255, 255, 255, 0.05);
        border-color: var(--line);
    }

    .detail-task-card.done { border-left-color: #3fb97a; }
    .detail-task-card.blocked { border-left-color: #e06080; }
    .detail-task-card.running { border-left-color: #58a6ff; }

    .detail-context-panel {
        background: rgba(255, 255, 255, 0.04);
        border-color: var(--line);
    }

    .context-section-header {
        border-color: var(--line);
    }

    .add-task-input,
    .add-note-input,
    .chat-input {
        background: rgba(255, 255, 255, 0.06);
        border-color: var(--line-strong);
        color: var(--text);
    }

    .add-task-row {
        border-top-color: var(--line);
    }

    .detail-task-output {
        background: rgba(255, 255, 255, 0.03);
        border-color: var(--line);
    }

    .detail-task-error {
        background: rgba(220, 100, 130, 0.06);
        border-color: rgba(220, 100, 130, 0.15);
        color: #e06080;
    }

    .task-logs-toggle {
        color: var(--muted);
    }
    .task-logs-toggle:hover {
        background: rgba(255, 255, 255, 0.1);
        color: var(--text);
    }

    .task-logs-panel {
        background: #0d1117;
        border-color: rgba(255, 255, 255, 0.1);
    }

    .detail-status--done { color: #3fb97a; }
    .detail-status--running { color: #58a6ff; }
    .detail-status--error { color: #e06080; }

    .progress-bar-container {
        background: rgba(255, 255, 255, 0.1);
    }

    .repair-btn {
        background: rgba(255, 255, 255, 0.08);
        border-color: var(--line-strong);
        color: var(--text);
    }

    .note-entry {
        border-bottom-color: var(--line);
    }

    .search-highlight {
        background: rgba(215, 170, 57, 0.25);
    }

    /* v1.3.0 dark mode additions */
    .kanban-col-count {
        background: rgba(255, 255, 255, 0.08);
    }

    .kanban-col[data-status="running"] .kanban-col-count {
        background: rgba(88, 144, 255, 0.15);
        color: #6ba3ff;
    }

    .kanban-col[data-status="completed"] .kanban-col-count {
        background: rgba(63, 185, 122, 0.15);
        color: #4fc98a;
    }

    .kanban-col[data-status="failed"] .kanban-col-count {
        background: rgba(220, 100, 130, 0.15);
        color: #e06080;
    }

    .kanban-col-progress {
        background: rgba(255, 255, 255, 0.06);
    }

    .activity-empty {
        color: var(--muted);
    }

    .empty-state-action {
        color: var(--accent-light, #4fc98a);
    }

    /* v1.8 — outcomes grid dark mode */
    .outcomes-filter {
        background-color: rgba(255, 255, 255, 0.08);
        border-color: var(--line-strong);
        color: var(--muted-strong);
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23e6edf3' opacity='.4'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 8px center;
    }

    .outcome-card {
        background: rgba(255, 255, 255, 0.05);
        border-color: var(--line);
    }

    .outcome-card:hover {
        background: rgba(255, 255, 255, 0.08);
        border-color: var(--line-strong);
    }

    .outcome-card.is-running {
        border-color: rgba(63, 185, 122, 0.3);
        box-shadow: 0 8px 24px rgba(63, 185, 122, 0.08);
    }

    .outcome-card-bar {
        background: rgba(255, 255, 255, 0.08);
    }

    .outcome-card-btn {
        background: rgba(255, 255, 255, 0.08);
        border-color: var(--line-strong);
    }

    .outcome-card-btn:hover {
        background: rgba(255, 255, 255, 0.12);
    }

    .outcome-card-fill--idle { background: rgba(255, 255, 255, 0.12); }

    /* v1.7.1 — remaining dark mode fixes */
    .reference-block {
        background: rgba(255, 255, 255, 0.06);
        border-color: var(--line);
    }

    .asset-chip,
    .drop-file {
        background: rgba(255, 255, 255, 0.08);
        border-color: var(--line);
    }

    .asset-dropzone {
        background: rgba(255, 255, 255, 0.03);
        border-color: rgba(88, 166, 255, 0.18);
    }

    .asset-dropzone.is-active {
        background: rgba(63, 185, 122, 0.06);
        border-color: rgba(63, 185, 122, 0.3);
    }

    .btn-secondary {
        background: rgba(255, 255, 255, 0.08);
        border-color: var(--line-strong);
    }

    .btn-secondary:hover {
        background: rgba(255, 255, 255, 0.12);
        border-color: var(--muted);
    }

    .btn-danger {
        background: rgba(220, 100, 130, 0.08);
        border-color: rgba(220, 100, 130, 0.25);
        color: #e06080;
    }

    .btn-danger:hover {
        background: rgba(220, 100, 130, 0.14);
        border-color: rgba(220, 100, 130, 0.4);
    }

    .activity-item::before {
        background: rgba(230, 237, 243, 0.2);
        box-shadow: 0 0 0 6px var(--bg);
    }

    .activity-item.is-running::before {
        background: rgba(63, 185, 122, 0.8);
    }

    .settings-item {
        background: rgba(255, 255, 255, 0.05);
        border-color: var(--line);
    }

    .settings-item-label {
        color: var(--muted);
    }

    .settings-item-value.is-ok { color: #3fb97a; }
    .settings-item-value.is-warn { color: #d29922; }
    .settings-item-value.is-error { color: #e06080; }

    .settings-test-result.is-success { color: #3fb97a; }
    .settings-test-result.is-error { color: #e06080; }

    .inline-edit-input {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(88, 166, 255, 0.3);
        color: var(--text);
        box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.08);
    }

    .task-status-select {
        background: rgba(255, 255, 255, 0.08);
        border-color: var(--line-strong);
        color: var(--muted-strong);
    }

    .audit-entry {
        background: rgba(255, 255, 255, 0.04);
        border-color: var(--line);
    }

    .preview-staging-bar {
        background: rgba(30, 37, 46, 0.9);
        border-top-color: var(--line);
    }

    .inline-edit-textarea {
        background: rgba(255, 255, 255, 0.06);
        border-color: var(--line-strong);
        color: var(--text);
    }

    .inline-edit-textarea:focus {
        border-color: rgba(88, 166, 255, 0.3);
        background: rgba(255, 255, 255, 0.08);
    }

    .editable-title:hover,
    .editable-task-title:hover {
        background: rgba(88, 166, 255, 0.08);
    }

    .kbd-hint {
        background: rgba(255, 255, 255, 0.06);
    }

    img { filter: brightness(0.92); }
}

/* ====== UTILITY CLASSES (extracted from inline styles) ====== */
.flex-row { display: flex; gap: 6px; }
.flex-row-center { display: flex; gap: 6px; align-items: center; }
.flex-row-wrap { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-compact { padding: 4px 10px; font-size: 0.7rem; }
.btn-compact-sm { font-size: 0.75rem; }
.text-hint { margin-bottom: 8px; font-size: 0.75rem; opacity: 0.6; }
.mt-sm { margin-top: 6px; }
.mt-md { margin-top: 8px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 12px; }
.settings-admin-section { border-top: 2px solid var(--rose-soft); padding-top: 16px; margin-top: 16px; }
.eyebrow-admin { color: var(--rose-bright, #b4475e); }
.debug-output { font-size: 0.75rem; color: var(--muted); margin-bottom: 8px; }
.btn-danger-outline { color: var(--rose-bright, #b4475e); border-color: var(--rose-bright, #b4475e); }

/* ====== v1.2.7 — TOOLBAR KBD HINT ====== */
.toolbar-kbd {
    display: none;
    padding: 1px 5px;
    margin-left: 2px;
    border-radius: 4px;
    background: rgba(21, 32, 43, 0.06);
    border: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--muted);
    vertical-align: middle;
}

/* ====== v1.2.7 — DECISION COUNT PULSE ====== */
.toolbar-count-pulse.has-pending {
    background: rgba(206, 92, 121, 0.15);
    color: #b4475e;
    animation: countPulse 2.5s ease-in-out infinite;
}

@keyframes countPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ====== v1.2.7 — FORM VALIDATION / ERROR STATES ====== */
.input-area.is-invalid,
.connector-modal-input.is-invalid,
.decision-resolve-input.is-invalid {
    border-color: rgba(192, 78, 84, 0.5) !important;
    box-shadow: 0 0 0 3px rgba(192, 78, 84, 0.1);
}

.field-error {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
    color: #c04e54;
    animation: fadeSlideIn 200ms ease;
}

.form-group { margin-bottom: 12px; }

.form-label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted-strong);
}

/* ====== v1.2.7 — EMPTY STATE IMPROVEMENTS ====== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    text-align: center;
    color: var(--muted);
}

.empty-state-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    opacity: 0.4;
}

.empty-state-text {
    font-size: 0.85rem;
    line-height: 1.5;
    max-width: 280px;
}

.empty-state-hint {
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--muted);
    opacity: 0.7;
}

/* ====== v1.4.5 — KEYBOARD SHORTCUTS MODAL ====== */
.shortcuts-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(21, 32, 43, 0.4);
    backdrop-filter: blur(6px);
    animation: fadeIn 200ms ease;
}

/* hidden attribute is overridden by display:flex — force it */
.shortcuts-overlay[hidden] {
    display: none !important;
}

.shortcuts-modal {
    width: min(420px, 90vw);
    padding: 28px;
    border-radius: var(--radius-lg);
    background: var(--panel-strong);
    box-shadow: var(--shadow);
}

.shortcuts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.shortcuts-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.shortcuts-grid {
    display: grid;
    gap: 10px;
}

.shortcut-row {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.92rem;
}

.shortcut-row kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid var(--line-strong);
    background: rgba(21, 32, 43, 0.04);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted-strong);
    flex-shrink: 0;
}

.shortcuts-hint {
    margin-top: 16px;
    font-size: 0.78rem;
    color: var(--muted);
    text-align: center;
}

/* ====== v1.2.7 — LOADING SKELETON ====== */
.skeleton {
    background: linear-gradient(90deg,
        rgba(21, 32, 43, 0.04) 25%,
        rgba(21, 32, 43, 0.08) 50%,
        rgba(21, 32, 43, 0.04) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-line {
    height: 12px;
    margin-bottom: 8px;
    border-radius: 6px;
}

.skeleton-line:last-child { width: 60%; }

/* ====== v1.2.7 — INLINE STATUS BADGES ====== */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.status-dot.is-running { background: #1f9d55; animation: dotPulse 1.5s ease infinite; }
.status-dot.is-pending { background: #d79339; }
.status-dot.is-done { background: rgba(31, 157, 85, 0.5); }
.status-dot.is-failed { background: #c04e54; }

@keyframes dotPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ====== v1.2.7 — COST TICKER ENHANCEMENTS ====== */
.cost-ticker-amount {
    font-variant-numeric: tabular-nums;
}

.cost-ticker.is-warning .cost-ticker-amount {
    color: #d79339;
}

.cost-ticker.is-danger .cost-ticker-amount {
    color: #c04e54;
}

/* ====== v1.2.9 — SETTINGS TABS ====== */
.settings-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    margin: 0 0 16px;
    border-radius: var(--radius-pill);
    background: rgba(21, 32, 43, 0.04);
    border: 1px solid var(--line);
}

.settings-tab {
    flex: 1;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-pill);
    background: transparent;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: all 200ms ease;
}

.settings-tab:hover {
    color: var(--text);
}

.settings-tab.is-active {
    background: rgba(255, 255, 255, 0.9);
    color: #15202b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

@media (prefers-color-scheme: dark) {
    .settings-tab.is-active {
        background: rgba(255, 255, 255, 0.12);
        color: #e6edf3;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }
}

.settings-tab-panel[hidden] { display: none; }

/* ====== v1.2.9 — DETAIL TASK OUTPUT FORMATTING ====== */
.detail-task-output {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.78rem;
    line-height: 1.55;
    color: var(--muted-strong);
    padding: 10px 12px;
    background: rgba(21, 32, 43, 0.03);
    border-radius: 10px;
    border: 1px solid var(--line);
    margin-top: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.detail-task-error {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.78rem;
    line-height: 1.55;
    color: #c04e54;
    padding: 10px 12px;
    background: rgba(192, 78, 84, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(192, 78, 84, 0.12);
    margin-top: 8px;
    max-height: 150px;
    overflow-y: auto;
}

/* ====== v1.2.9 — SEARCH RESULT HIGHLIGHT ====== */
.search-highlight {
    background: rgba(215, 170, 57, 0.2);
    border-radius: 2px;
    padding: 0 1px;
}

/* ====== v1.3.0 — KANBAN BOARD POLISH ====== */
.kanban-col-header {
    display: flex;
    align-items: center;
    gap: 6px;
}

.kanban-col-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--radius-pill);
    font-size: 0.62rem;
    font-weight: 700;
    background: var(--line);
    color: var(--muted);
    line-height: 1;
}

.kanban-col[data-status="running"] .kanban-col-count {
    background: rgba(66, 122, 255, 0.12);
    color: #427aff;
}

.kanban-col[data-status="completed"] .kanban-col-count {
    background: rgba(45, 106, 79, 0.12);
    color: var(--accent);
}

.kanban-col[data-status="failed"] .kanban-col-count {
    background: rgba(180, 71, 94, 0.12);
    color: #b4475e;
}

.kanban-col {
    transition: border-color 0.2s ease;
}

.kanban-col[data-status="running"] {
    border-color: rgba(66, 122, 255, 0.2);
}

.kanban-col[data-status="completed"] {
    border-color: rgba(45, 106, 79, 0.2);
}

.kanban-col[data-status="failed"] {
    border-color: rgba(180, 71, 94, 0.2);
}

/* Card enter animation */
.kanban-card {
    animation: kanbanCardEnter 200ms ease both;
}

@keyframes kanbanCardEnter {
    from { opacity: 0; transform: translateY(6px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.kanban-card:nth-child(1) { animation-delay: 0ms; }
.kanban-card:nth-child(2) { animation-delay: 40ms; }
.kanban-card:nth-child(3) { animation-delay: 80ms; }
.kanban-card:nth-child(4) { animation-delay: 120ms; }
.kanban-card:nth-child(5) { animation-delay: 160ms; }

/* Running card pulse indicator */
.kanban-card.is-running {
    border-left: 3px solid #427aff;
}

.kanban-card.is-completed {
    border-left: 3px solid var(--accent);
    opacity: 0.85;
}

.kanban-card.is-failed {
    border-left: 3px solid #b4475e;
}

/* Better kanban empty state */
.kanban-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.kanban-empty-icon {
    font-size: 1.2rem;
    opacity: 0.35;
}

/* ====== v1.3.0 — MISSION DETAIL MODAL IMPROVEMENTS ====== */
.mission-detail-overlay.is-open .mission-detail-modal {
    animation: modalSlideUp 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.mission-detail-overlay.is-open {
    animation: overlayFadeIn 200ms ease both;
}

@keyframes overlayFadeIn {
    from { background: rgba(16, 24, 32, 0); backdrop-filter: blur(0); }
    to { background: rgba(16, 24, 32, 0.5); backdrop-filter: blur(8px); }
}

/* Context section body smooth expand */
.context-section-body {
    transition: opacity 0.15s ease;
}

.context-section[data-collapsed="true"] .context-section-body {
    opacity: 0;
}

/* Task card stagger in detail modal */
.detail-task-card {
    animation: fadeSlideIn 200ms ease both;
}

.detail-task-card:nth-child(1) { animation-delay: 0ms; }
.detail-task-card:nth-child(2) { animation-delay: 30ms; }
.detail-task-card:nth-child(3) { animation-delay: 60ms; }
.detail-task-card:nth-child(4) { animation-delay: 90ms; }
.detail-task-card:nth-child(5) { animation-delay: 120ms; }
.detail-task-card:nth-child(6) { animation-delay: 150ms; }

/* Mobile detail modal improvements */
@media (max-width: 820px) {
    .mission-detail-modal {
        padding: 20px 16px;
    }

    .mission-detail-header {
        margin-bottom: 12px;
    }

    .detail-context-panel {
        max-height: 260px;
        overflow-y: auto;
    }

    .detail-task-card {
        padding: 10px;
    }

    .detail-summary-strip {
        flex-wrap: wrap;
        gap: 8px;
    }
}

@media (max-width: 400px) {
    .mission-detail-modal {
        padding: 14px 10px;
    }

    .detail-two-panel {
        gap: 12px;
    }

    .detail-context-panel {
        max-height: 200px;
    }
}

/* ====== v1.3.0 — RICHER EMPTY STATES ====== */
.empty-state-action {
    margin-top: 12px;
    font-size: 0.78rem;
    color: var(--accent, #2d6a4f);
    cursor: pointer;
    border: none;
    background: none;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.empty-state-action:hover {
    opacity: 0.8;
}

/* Specific empty states */
.kanban-empty {
    font-style: italic;
}

.activity-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px;
    text-align: center;
    color: var(--muted);
}

.activity-empty-icon {
    font-size: 1.6rem;
    margin-bottom: 8px;
    opacity: 0.35;
}

.activity-empty-text {
    font-size: 0.82rem;
    line-height: 1.5;
    max-width: 240px;
}

.activity-empty-hint {
    margin-top: 6px;
    font-size: 0.72rem;
    opacity: 0.6;
}

/* ====== v1.3.0 — SHEET OPEN/CLOSE ANIMATION POLISH ====== */
.sheet {
    opacity: 0;
}

.sheet[aria-hidden="false"] {
    opacity: 1;
}

/* Smooth scrim fade */
.sheet-scrim {
    transition: opacity 200ms ease;
    opacity: 0;
}

.sheet-scrim.is-visible {
    opacity: 1;
}

/* ====== v1.3.0 — KANBAN CARD STATUS TOOLTIP ====== */
.kanban-card[title] {
    position: relative;
}

/* ====== v1.3.0 — PROGRESS BAR FOR KANBAN COLUMNS ====== */
.kanban-col-progress {
    height: 3px;
    border-radius: 2px;
    background: var(--line);
    margin-top: 4px;
    overflow: hidden;
}

.kanban-col-progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.4s ease;
}

.kanban-col[data-status="pending"] .kanban-col-progress-fill {
    background: var(--muted);
}

.kanban-col[data-status="running"] .kanban-col-progress-fill {
    background: #427aff;
}

.kanban-col[data-status="completed"] .kanban-col-progress-fill {
    background: var(--accent);
}

.kanban-col[data-status="failed"] .kanban-col-progress-fill {
    background: #b4475e;
}

/* ====== ANIMATION ADDITIONS ====== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Real-time update animations */
@keyframes statusPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.02); }
}

@keyframes statusGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(31, 122, 83, 0.3); }
    50% { box-shadow: 0 0 0 6px rgba(31, 122, 83, 0); }
}

@keyframes progressWave {
    0% { background-position: 0 0; }
    100% { background-position: 40px 0; }
}

@keyframes numberCounter {
    from { opacity: 0.6; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Status elements that are updating */
.job-status.is-updating,
.task-status.is-updating,
.outcome-status.is-updating {
    animation: statusPulse 0.4s ease-out;
}

.confidence-meter-value.is-updating {
    animation: numberCounter 0.3s ease-out;
}

.outcome-progress.is-updating {
    animation: statusGlow 0.6s ease-out;
}

/* Smooth transitions for status changes */
.job-status,
.task-status,
.outcome-status {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-block;
}

/* Tone-specific status colors */
.tone-running {
    color: #427aff;
    font-weight: 600;
}

.tone-completed,
.tone-positive {
    color: var(--accent);
    font-weight: 600;
}

.tone-failed,
.tone-error {
    color: #b4475e;
    font-weight: 600;
}

.tone-neutral {
    color: var(--muted-strong);
}

/* Progress bar smooth animation */
.outcome-progress,
.detail-progress-bar {
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: linear-gradient(
        90deg,
        var(--accent) 0%,
        rgba(31, 122, 83, 0.8) 50%,
        var(--accent) 100%
    );
    background-size: 200% 100%;
}

.outcome-progress.active-progress {
    animation: progressWave 1.5s ease-in-out infinite;
}

/* Activity feed slide-in */
.activity-item {
    animation: fadeSlideIn 0.4s ease-out;
}

/* Fresh panel pulse (on full re-render) */
.current-job-card.is-fresh,
.composer-card.is-fresh,
.activity-card.is-fresh {
    animation: fadeIn 0.5s ease-out;
}

