/*
 * chat-rebuild.css — chat rebuild component styles (CHAT_REBUILD_PLAN.md).
 * M1/T1.4: migrated from the JS-injected <style> in installExecutionTimelineStyles().
 * Rules:
 *   - No !important. No hardcoded color values: every color references an
 *     --rgb-* / --state-* token defined in the authoritative :root block
 *     appended at the end of style.css.
 *   - Load order: after style.css and home-orbit-refine.css.
 */

/* ===== Execution timeline (admin/debug surface; user-facing copy moves to ?debug=1 in M4) ===== */

.execution-timeline-card {
    display: grid;
    gap: 10px;
    min-width: min(560px, 100%);
    padding: 14px;
    border: 1px solid rgba(var(--rgb-cyan-soft), .18);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(var(--rgb-ink-a), .82), rgba(var(--rgb-ink-b), .9));
    color: rgb(var(--rgb-text-soft));
    box-shadow: 0 18px 46px rgba(var(--rgb-black), .28), inset 0 1px 0 rgba(var(--rgb-white), .06);
    backdrop-filter: blur(14px);
}

.execution-timeline-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.execution-timeline-head strong {
    font-size: 14px;
    color: rgb(var(--rgb-text-strong));
}

.execution-timeline-head small {
    color: rgb(var(--rgb-muted-a));
}

.execution-timeline-list {
    display: grid;
    gap: 6px;
}

.execution-event {
    border: 1px solid rgba(var(--rgb-cyan-soft), .14);
    border-radius: 7px;
    background: rgba(var(--rgb-white), .055);
    overflow: hidden;
}

.execution-event summary {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 7px 9px;
    cursor: pointer;
    list-style: none;
}

.execution-event summary:hover {
    background: rgba(var(--rgb-cyan-soft), .055);
}

.execution-event summary::-webkit-details-marker {
    display: none;
}

.execution-event-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: rgb(var(--rgb-muted-c));
    flex: 0 0 auto;
}

.execution-event[data-status="running"] .execution-event-dot {
    background: rgb(var(--rgb-cyan));
    box-shadow: 0 0 0 4px rgba(var(--rgb-cyan), .13), 0 0 16px rgba(var(--rgb-cyan), .35);
}

.execution-event[data-status="done"] .execution-event-dot {
    background: rgb(var(--rgb-ok));
    box-shadow: 0 0 14px rgba(var(--rgb-ok), .25);
}

.execution-event[data-status="warning"] .execution-event-dot {
    background: rgb(var(--rgb-warn));
}

.execution-event[data-status="failed"] .execution-event-dot {
    background: rgb(var(--rgb-fail));
}

.execution-event[data-status="queued"] .execution-event-dot {
    background: rgb(var(--rgb-queued));
}

.execution-event-title {
    font-weight: 700;
    line-height: 1.3;
}

.execution-event-status {
    margin-left: auto;
    font-size: 11px;
    text-transform: uppercase;
    color: rgb(var(--rgb-muted-b));
}

.execution-event-detail {
    padding: 0 9px 9px 26px;
    color: rgb(var(--rgb-detail));
    font-size: 12px;
    line-height: 1.45;
    white-space: pre-wrap;
}

.execution-timeline-card ::selection {
    background: rgba(var(--rgb-cyan-soft), .28);
    color: rgb(var(--rgb-white));
}

/* ===== Workfeed / completion receipt ===== */

.workfeed-card,
.completion-receipt-card {
    display: grid;
    gap: 12px;
    width: min(720px, 100%);
    padding: 15px 16px;
    border: 1px solid rgba(var(--rgb-cyan-soft), .22);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(var(--rgb-ink-c), .9), rgba(var(--rgb-ink-d), .95));
    color: rgb(var(--rgb-text-soft));
    box-shadow: 0 18px 48px rgba(var(--rgb-black), .3), inset 0 1px 0 rgba(var(--rgb-white), .06);
    backdrop-filter: blur(16px);
}

.workfeed-card[data-status="failed"],
.completion-receipt-card[data-status*="review"] {
    border-color: rgba(var(--rgb-warn), .34);
}

.workfeed-head,
.completion-receipt-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.workfeed-cancel-btn {
    appearance: none;
    -webkit-appearance: none;
    flex: 0 0 auto;
    min-height: 32px;
    padding: 0 14px;
    border: 1px solid rgba(var(--rgb-periwinkle), .28);
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(var(--rgb-white), .08), rgba(var(--rgb-white), .035)),
        rgba(var(--rgb-ink-b), .86);
    color: rgba(var(--rgb-text-stronger), .9);
    box-shadow: inset 0 1px 0 rgba(var(--rgb-white), .08);
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.workfeed-cancel-btn:hover {
    border-color: rgba(var(--rgb-kicker), .42);
    background:
        linear-gradient(180deg, rgba(var(--rgb-cyan-soft), .11), rgba(var(--rgb-indigo-soft), .08)),
        rgba(var(--rgb-ink-b), .9);
    color: rgb(var(--rgb-text-stronger));
}

.workfeed-pulse {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: rgb(var(--rgb-cyan));
    box-shadow: 0 0 0 5px rgba(var(--rgb-cyan), .12), 0 0 18px rgba(var(--rgb-cyan), .34);
}

.workfeed-card[data-status="running"] .workfeed-pulse {
    animation: workfeedPulseBreathe 1.45s ease-in-out infinite;
}

.workfeed-card[data-status="done"] .workfeed-pulse,
.completion-receipt-badge {
    background: rgba(var(--rgb-ok), .16);
    color: var(--state-ok);
}

.workfeed-card[data-status="failed"] .workfeed-pulse {
    background: rgb(var(--rgb-fail));
    box-shadow: 0 0 0 5px rgba(var(--rgb-fail), .12), 0 0 18px rgba(var(--rgb-fail), .32);
}

.workfeed-title {
    display: grid;
    gap: 2px;
    flex: 1 1 auto;
    min-width: 0;
}

.workfeed-title strong,
.completion-receipt-title {
    margin: 0;
    color: rgb(var(--rgb-text-stronger));
    font-size: 15px;
    font-weight: 850;
    line-height: 1.35;
}

.workfeed-title small,
.completion-receipt-summary,
.completion-receipt-meta,
.completion-receipt-areas p {
    margin: 0;
    color: rgb(var(--rgb-detail));
    font-size: 12px;
    line-height: 1.45;
}

.workfeed-steps {
    display: grid;
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.workfeed-step {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    min-height: 32px;
}

.workfeed-dot {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid rgba(var(--rgb-periwinkle), .24);
    background: rgba(var(--rgb-white), .055);
    color: rgb(var(--rgb-muted-b));
    font-size: 9px;
    font-weight: 900;
}

.workfeed-step[data-status="running"] .workfeed-dot {
    background: rgba(var(--rgb-cyan-soft), .13);
    color: rgb(var(--rgb-kicker));
    border-top-color: rgb(var(--rgb-cyan));
    color: transparent;
    animation: workfeedSpin 0.85s linear infinite, workfeedStepGlow 1.5s ease-in-out infinite;
}

.workfeed-step[data-status="running"] .workfeed-dot::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgb(var(--rgb-cyan));
}

.workfeed-step[data-status="done"] .workfeed-dot {
    background: rgba(var(--rgb-ok), .16);
    color: var(--state-ok);
}

.workfeed-step[data-status="failed"] .workfeed-dot,
.workfeed-step[data-status="warning"] .workfeed-dot,
.workfeed-step[data-status="skipped"] .workfeed-dot {
    background: rgba(var(--rgb-warn), .15);
    color: rgb(var(--rgb-warn));
}

.workfeed-step[data-status="skipped"] .workfeed-step-line strong {
    color: rgba(var(--rgb-text-stronger), .82);
}

.workfeed-step[data-status="skipped"] .workfeed-step-main small {
    color: rgba(var(--rgb-warn), .86);
}

@keyframes workfeedPulseBreathe {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 4px rgba(var(--rgb-cyan), .1), 0 0 16px rgba(var(--rgb-cyan), .28);
    }
    50% {
        transform: scale(1.18);
        box-shadow: 0 0 0 8px rgba(var(--rgb-cyan), .05), 0 0 24px rgba(var(--rgb-cyan), .44);
    }
}

@keyframes workfeedSpin {
    to { transform: rotate(360deg); }
}

@keyframes workfeedStepGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(var(--rgb-cyan), .08); }
    50% { box-shadow: 0 0 0 5px rgba(var(--rgb-cyan), .05); }
}

.workfeed-step-main,
.workfeed-step-line {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.workfeed-step-line {
    grid-template-columns: minmax(0, max-content) minmax(0, 1fr);
    align-items: baseline;
    column-gap: 8px;
}

.workfeed-step-line strong {
    color: rgb(var(--rgb-text-strong));
    font-size: 13px;
}

.workfeed-step-line em {
    color: rgb(var(--rgb-muted-b));
    font-size: 11px;
    font-style: normal;
}

.workfeed-step-main small {
    color: rgb(var(--rgb-muted-a));
    font-size: 12px;
    line-height: 1.4;
}

.chat-history.is-generating .chat-message.bot:has(.workfeed-card) {
    width: 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    margin-left: auto;
    margin-right: auto;
}

.chat-history.is-generating .chat-message.bot:has(.workfeed-card) .chat-content-wrap,
.chat-history.is-generating .chat-message.bot:has(.workfeed-card) .chat-bubble {
    width: 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
}

.chat-history.is-generating .chat-message.bot:has(.workfeed-card) .chat-bubble {
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.chat-history.is-generating .workfeed-card {
    width: min(720px, calc(100vw - 64px));
    margin-left: auto;
    margin-right: auto;
}

.completion-receipt-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.completion-receipt-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.completion-receipt-btn {
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid rgba(var(--rgb-periwinkle), .26);
    border-radius: 999px;
    background: rgba(var(--rgb-white), .055);
    color: rgba(var(--rgb-action-text), .9);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.completion-receipt-btn.primary {
    border-color: rgba(var(--rgb-kicker), .42);
    background: linear-gradient(180deg, rgba(var(--rgb-cyan-soft), .16), rgba(var(--rgb-indigo-soft), .09));
    color: rgb(var(--rgb-text-stronger));
}

.completion-receipt-details {
    color: rgb(var(--rgb-muted-a));
    font-size: 12px;
}

.completion-receipt-details summary {
    cursor: pointer;
    font-weight: 800;
}

.completion-receipt-details pre {
    margin: 8px 0 0;
    max-height: 180px;
    overflow: auto;
    white-space: pre-wrap;
    color: rgb(var(--rgb-detail));
}

/* ===== Decision card ===== */

.decision-card {
    display: grid;
    gap: 14px;
    box-sizing: border-box;
    width: min(760px, 100%);
    min-width: 0;
    padding: 16px;
    border: 1px solid rgba(var(--rgb-cyan-soft), .20);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(var(--rgb-ink-c), .88), rgba(var(--rgb-ink-d), .94));
    color: rgb(var(--rgb-text-soft));
    box-shadow: 0 22px 62px rgba(var(--rgb-black), .34), 0 0 34px rgba(var(--rgb-blue-glow), .10), inset 0 1px 0 rgba(var(--rgb-white), .07);
    backdrop-filter: blur(18px) saturate(132%);
}

.decision-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.decision-card-title {
    font-size: 17px;
    font-weight: 850;
    color: rgb(var(--rgb-text-stronger));
    line-height: 1.35;
}

.decision-card-options {
    display: grid;
    gap: 10px;
    width: min(560px, 100%);
}

.decision-option {
    box-sizing: border-box;
    width: 100%;
    min-height: 88px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    text-align: left;
    border: 1px solid rgba(var(--rgb-periwinkle), .22);
    background: linear-gradient(180deg, rgba(var(--rgb-white), .075), rgba(var(--rgb-white), .035));
    border-radius: 10px;
    padding: 14px 16px;
    cursor: pointer;
    color: rgb(var(--rgb-option-text));
    box-shadow: inset 0 1px 0 rgba(var(--rgb-white), .06);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background .18s ease;
}

.decision-option:hover,
.decision-option:focus-visible {
    border-color: rgba(var(--rgb-kicker), .74);
    outline: none;
    background: linear-gradient(180deg, rgba(var(--rgb-cyan-soft), .12), rgba(var(--rgb-indigo-soft), .07));
    box-shadow: 0 0 0 1px rgba(var(--rgb-cyan-soft), .10), 0 0 24px rgba(var(--rgb-blue-glow), .16), inset 0 1px 0 rgba(var(--rgb-white), .09);
    transform: translateY(-1px);
}

.decision-option.selected {
    border-color: rgba(var(--rgb-kicker), .88);
    box-shadow: 0 0 0 1px rgba(var(--rgb-kicker), .16), 0 0 28px rgba(var(--rgb-blue-glow), .20);
}

.decision-option-index {
    min-width: 18px;
    font-size: 18px;
    line-height: 1.25;
    font-weight: 950;
    color: rgb(var(--rgb-kicker));
    text-shadow: 0 0 14px rgba(var(--rgb-blue-glow), .32);
}

.decision-option-main {
    display: grid;
    gap: 3px;
}

.decision-option-main strong {
    color: rgb(var(--rgb-option-strong));
    font-size: 18px;
    line-height: 1.25;
}

.decision-option-main small {
    color: rgba(var(--rgb-lavender), .68);
    line-height: 1.38;
    font-weight: 600;
}

.decision-recommended {
    margin-left: 4px;
    font-size: 10px;
    text-transform: uppercase;
    color: rgb(var(--rgb-ok));
    font-weight: 950;
    letter-spacing: .04em;
    text-shadow: 0 0 12px rgba(var(--rgb-ok), .24);
}

.decision-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.decision-card-actions input {
    min-height: 38px;
    border: 1px solid rgba(var(--rgb-periwinkle), .22);
    border-radius: 9px;
    padding: 0 11px;
    flex: 1 1 220px;
    background: rgba(var(--rgb-ink-e), .42);
    color: rgb(var(--rgb-text-stronger));
    outline: none;
}

.decision-card-actions input::placeholder {
    color: rgba(var(--rgb-lavender), .42);
}

.decision-card-actions input:focus {
    border-color: rgba(var(--rgb-kicker), .62);
    box-shadow: 0 0 0 3px rgba(var(--rgb-blue-glow), .10);
}

.decision-card-actions button {
    min-height: 38px;
    border: 1px solid rgba(var(--rgb-periwinkle), .24);
    border-radius: 9px;
    background: rgba(var(--rgb-white), .055);
    color: rgba(var(--rgb-action-text), .86);
    padding: 0 12px;
    cursor: pointer;
}

.decision-card-actions button:hover {
    border-color: rgba(var(--rgb-kicker), .56);
    background: rgba(var(--rgb-cyan-soft), .09);
    color: rgb(var(--rgb-white));
}

.decision-card-actions .decision-more-options {
    flex: 1 0 100%;
    justify-content: center;
    min-height: 40px;
    margin-top: 2px;
    border-style: dashed;
    background: linear-gradient(180deg, rgba(var(--rgb-cyan-soft), .075), rgba(var(--rgb-indigo-soft), .045));
    color: rgba(var(--rgb-text-soft), .78);
    font-weight: 800;
    letter-spacing: .02em;
}

.decision-card-actions .decision-more-options:hover {
    border-style: solid;
    background: linear-gradient(180deg, rgba(var(--rgb-cyan-soft), .13), rgba(var(--rgb-indigo-soft), .075));
    box-shadow: 0 0 20px rgba(var(--rgb-blue-glow), .12);
}

/* ===== Collapse / reopen (T1.2): Esc folds the card, never destroys it ===== */

.decision-reopen {
    display: none;
    align-items: center;
    min-height: 32px;
    padding: 0 14px;
    border: 1px solid rgba(var(--rgb-periwinkle), .24);
    border-radius: 999px;
    background: rgba(var(--rgb-white), .055);
    color: rgba(var(--rgb-action-text), .86);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.decision-reopen:hover {
    border-color: rgba(var(--rgb-kicker), .56);
    background: rgba(var(--rgb-cyan-soft), .09);
    color: rgb(var(--rgb-white));
}

.decision-card.is-collapsed {
    gap: 0;
}

.decision-card.is-collapsed .decision-card-options,
.decision-card.is-collapsed .decision-card-actions {
    display: none;
}

.decision-card.is-collapsed .decision-reopen {
    display: inline-flex;
}

/* ===== Responsive ===== */

@media (max-width: 640px) {

    .decision-card {
        width: 100%;
        padding: 14px;
    }

    .decision-card-options {
        width: 100%;
    }

    .decision-option {
        min-height: 82px;
    }

    .decision-option-main strong {
        font-size: 16px;
    }

    .decision-option-main small {
        font-size: 13px;
    }

    .decision-card-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .decision-card-actions input,
    .decision-card-actions button {
        width: 100%;
    }
}

/* ===== Edit receipt card (M2 T2.3/T2.4) ===== */

.edit-receipt-card {
    display: grid;
    gap: 8px;
    padding: 14px 16px;
    border: 1px solid rgba(var(--rgb-ok), .26);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(var(--rgb-ink-c), .88), rgba(var(--rgb-ink-d), .94));
    color: rgb(var(--rgb-text-soft));
    box-shadow: 0 16px 44px rgba(var(--rgb-black), .3), inset 0 1px 0 rgba(var(--rgb-white), .06);
    backdrop-filter: blur(16px);
}

.edit-receipt-card.is-revert {
    border-color: rgba(var(--rgb-periwinkle), .3);
}

.edit-receipt-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.edit-receipt-badge {
    font-size: 12px;
    font-weight: 850;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--state-ok);
}

.edit-receipt-card.is-revert .edit-receipt-badge {
    color: rgb(var(--rgb-kicker));
}

.edit-receipt-duration {
    color: rgb(var(--rgb-muted-b));
    font-size: 11px;
}

.edit-receipt-headline {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: rgb(var(--rgb-text-stronger));
    line-height: 1.4;
}

.edit-receipt-changes {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 4px;
}

.edit-receipt-changes li {
    display: flex;
    gap: 8px;
    font-size: 12px;
    line-height: 1.45;
    color: rgb(var(--rgb-detail));
}

.edit-receipt-area {
    flex: none;
    min-width: 64px;
    font-weight: 800;
    color: rgb(var(--rgb-kicker));
}

.edit-receipt-untouched {
    margin: 0;
    font-size: 12px;
    color: rgb(var(--rgb-muted-a));
}

.edit-receipt-areas {
    display: grid;
    gap: 3px;
}

.edit-receipt-areas p,
.edit-receipt-meta {
    margin: 0;
    color: rgb(var(--rgb-detail));
    font-size: 12px;
    line-height: 1.45;
}

.edit-receipt-areas strong {
    color: rgb(var(--rgb-kicker));
}

.edit-receipt-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 2px;
}

.edit-receipt-btn {
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid rgba(var(--rgb-periwinkle), .26);
    border-radius: 999px;
    background: rgba(var(--rgb-white), .055);
    color: rgba(var(--rgb-action-text), .9);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease;
}

.edit-receipt-btn:hover {
    border-color: rgba(var(--rgb-kicker), .56);
    background: rgba(var(--rgb-cyan-soft), .09);
    color: rgb(var(--rgb-white));
}

.edit-receipt-btn.primary {
    border-color: rgba(var(--rgb-ok), .4);
    background: var(--state-ok-dim);
    color: var(--state-ok);
}

.edit-receipt-btn.primary:hover {
    border-color: rgba(var(--rgb-ok), .6);
    background: rgba(var(--rgb-ok), .2);
}

.edit-receipt-files {
    font-size: 11px;
    color: rgb(var(--rgb-muted-a));
}

.edit-receipt-files summary {
    cursor: pointer;
    font-weight: 700;
    color: rgb(var(--rgb-muted-b));
}

.edit-receipt-files ul {
    margin: 6px 0 0;
    padding-left: 16px;
    display: grid;
    gap: 2px;
}

.edit-receipt-note {
    margin: 0;
    font-size: 11px;
    color: rgb(var(--rgb-warn));
}

/* Target chip (T2.5): the inferred edit target, visible and overridable */

.edit-target-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: rgb(var(--rgb-muted-a));
}

.edit-target-chip select {
    min-height: 30px;
    border: 1px solid rgba(var(--rgb-periwinkle), .26);
    border-radius: 999px;
    background: rgba(var(--rgb-ink-e), .42);
    color: rgb(var(--rgb-text-soft));
    font-size: 12px;
    font-weight: 700;
    padding: 0 10px;
    cursor: pointer;
}

.edit-target-chip select:focus {
    outline: none;
    border-color: rgba(var(--rgb-kicker), .62);
}

/* ===== Inline flow error / queued cards (C7/C8) ===== */

.flow-error-card,
.flow-queued-card {
    display: grid;
    gap: 10px;
    width: min(720px, 100%);
    padding: 15px 16px;
    border: 1px solid rgba(var(--rgb-warn), .28);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(var(--rgb-ink-c), .88), rgba(var(--rgb-ink-d), .94));
    color: rgb(var(--rgb-text-soft));
    box-shadow: 0 18px 48px rgba(var(--rgb-black), .3), inset 0 1px 0 rgba(var(--rgb-white), .06);
    backdrop-filter: blur(16px);
}

.flow-queued-card {
    border-color: rgba(var(--rgb-warn), .36);
}

.flow-error-title,
.flow-queued-title {
    margin: 0;
    color: rgb(var(--rgb-text-stronger));
    font-size: 15px;
    font-weight: 850;
    line-height: 1.35;
}

.flow-error-message,
.flow-queued-message,
.flow-queued-status {
    margin: 0;
    color: rgb(var(--rgb-detail));
    font-size: 13px;
    line-height: 1.45;
}

.flow-error-actions,
.flow-queued-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.flow-card-btn {
    min-height: 36px;
    padding: 0 13px;
    border: 1px solid rgba(var(--rgb-periwinkle), .28);
    border-radius: 999px;
    background: rgba(var(--rgb-white), .055);
    color: rgba(var(--rgb-action-text), .9);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.flow-card-btn:hover {
    border-color: rgba(var(--rgb-kicker), .56);
    background: rgba(var(--rgb-cyan-soft), .09);
    color: rgb(var(--rgb-white));
}

.flow-card-btn.primary {
    border-color: rgba(var(--rgb-kicker), .42);
    background: linear-gradient(180deg, rgba(var(--rgb-cyan-soft), .16), rgba(var(--rgb-indigo-soft), .09));
    color: rgb(var(--rgb-text-stronger));
}

.flow-queued-input {
    min-height: 38px;
    flex: 1 1 220px;
    min-width: 0;
    border: 1px solid rgba(var(--rgb-periwinkle), .24);
    border-radius: 999px;
    padding: 0 13px;
    background: rgba(var(--rgb-ink-e), .42);
    color: rgb(var(--rgb-text-stronger));
    outline: none;
}

.flow-queued-input:focus {
    border-color: rgba(var(--rgb-kicker), .62);
    box-shadow: 0 0 0 3px rgba(var(--rgb-blue-glow), .10);
}

.flow-error-details {
    color: rgb(var(--rgb-muted-a));
    font-size: 12px;
}

.flow-error-details summary {
    cursor: pointer;
    font-weight: 800;
}

.flow-error-details pre {
    margin: 8px 0 0;
    max-height: 160px;
    overflow: auto;
    white-space: pre-wrap;
    color: rgb(var(--rgb-detail));
}

.ai-plan-summary {
    position: relative;
    overflow: visible;
}

.ai-plan-summary.is-collapsed {
    max-height: var(--ai-plan-collapsed-height, 420px);
    overflow: hidden;
}

.ai-plan-summary.is-collapsed::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 72px;
    pointer-events: none;
    border-radius: 0 0 12px 12px;
    background: linear-gradient(180deg, rgba(var(--rgb-ink-e), 0), rgba(var(--rgb-ink-e), .96));
}

.ai-plan-summary.is-expanded {
    max-height: none;
    overflow: visible;
}

.ai-plan-show-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    margin: 2px 0 8px;
    padding: 0 15px;
    border: 1px solid rgba(var(--rgb-kicker), .32);
    border-radius: 999px;
    background: rgba(var(--rgb-ink-b), .78);
    color: rgb(var(--rgb-text-stronger));
    font-size: 12px;
    font-weight: 850;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(var(--rgb-black), .24);
}

.ai-plan-show-more:hover {
    border-color: rgba(var(--rgb-kicker), .58);
    background: rgba(var(--rgb-cyan-soft), .1);
    color: rgb(var(--rgb-white));
}
