@layer reset, tokens, base, layout, components;

@layer reset {
    *,
    *::before,
    *::after {
        box-sizing: border-box;
    }

    body {
        margin: 0;
    }

    button,
    input,
    textarea,
    select {
        font: inherit;
    }
}

@layer tokens {
    :root {
        color-scheme: light dark;

        /* Palette rule: layout/background neutrals use zero chroma. */
        --bg: oklch(98.5% 0 0);
        --bg-raised: oklch(96% 0 0);
        --bg-subtle: oklch(93% 0 0);
        --line: oklch(82% 0 0);
        --line-strong: oklch(70% 0 0);

        /* Text is near-neutral warm: OKLCH C is kept around 0.01, roughly a 5% saturation intent. */
        --text: oklch(30% 0.012 75);
        --text-strong: oklch(22% 0.012 75);
        --text-muted: oklch(50% 0.01 75);
        --text-faint: oklch(62% 0.008 75);
        --code: oklch(34% 0.012 75);

        --accent: oklch(54% 0.13 230);
        --accent-muted: oklch(54% 0.08 230);
        --success: oklch(48% 0.11 145);
        --warning: oklch(62% 0.12 85);
        --danger: oklch(54% 0.14 25);

        --space-1: 4px;
        --space-2: 8px;
        --space-3: 12px;
        --space-4: 16px;
        --space-5: 24px;
        --space-6: 32px;

        --radius-soft: 8px;
        --radius-panel: 12px;
        --interactive-hover: oklch(94.5% 0 0);
        --interactive-selected: oklch(93% 0.02 230);
        --font-sans:
            Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
            "Segoe UI", sans-serif;
        --font-mono:
            ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
            "Liberation Mono", monospace;
    }

    @media (prefers-color-scheme: dark) {
        :root {
            --bg: oklch(16% 0 0);
            --bg-raised: oklch(21% 0 0);
            --bg-subtle: oklch(26% 0 0);
            --line: oklch(36% 0 0);
            --line-strong: oklch(48% 0 0);

            --text: oklch(87% 0.012 75);
            --text-strong: oklch(95% 0.01 75);
            --text-muted: oklch(70% 0.01 75);
            --text-faint: oklch(58% 0.008 75);
            --code: oklch(84% 0.012 75);

            --accent: oklch(76% 0.12 230);
            --accent-muted: oklch(71% 0.08 230);
            --success: oklch(77% 0.12 145);
            --warning: oklch(82% 0.13 85);
            --danger: oklch(76% 0.14 25);
            --interactive-hover: oklch(29% 0 0);
            --interactive-selected: oklch(30% 0.025 230);
        }
    }
}

@layer base {
    body {
        background: var(--bg);
        color: var(--text);
        font-family: var(--font-sans);
    }

    a {
        color: var(--accent);
    }

    h1,
    h2,
    h3,
    p,
    li,
    dd {
        overflow-wrap: anywhere;
    }

    h1,
    h2,
    h3 {
        color: var(--text-strong);
        margin-top: 0;
    }

    p {
        line-height: 1.55;
    }

    code,
    pre {
        font-family: var(--font-mono);
    }

    code {
        color: var(--code);
    }

    small {
        color: var(--text-muted);
        display: block;
        margin-top: var(--space-1);
    }
}

@layer layout {
    .workspace-layout {
        display: grid;
        grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
        width: 100vw;
        height: 100dvh;
        margin: 0;
        padding: 0;
        overflow: hidden;
        min-width: 0;
    }

    .shell {
        display: flex;
        flex-direction: column;
        gap: var(--space-6);
        min-width: 0;
        min-height: 0;
        overflow-y: auto;
        padding: var(--space-6);
    }

    .grid {
        display: grid;
        gap: var(--space-5);
        grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
        min-width: 0;
    }

    .runtime {
        grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
    }

    .stack {
        display: grid;
        gap: var(--space-4);
    }

    @media (max-width: 760px) {
        .workspace-layout {
            grid-template-columns: 1fr;
            width: 100vw;
            height: auto;
            min-height: 100dvh;
            overflow: visible;
        }

        .shell {
            overflow: visible;
            padding: var(--space-5) var(--space-4);
        }
    }
}

@layer components {
    .workspace-sidebar {
        align-self: stretch;
        min-width: 0;
        min-height: 0;
        overflow-y: auto;
        padding: var(--space-6) var(--space-5);
    }

    .sidebar-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: var(--space-4);
        margin-bottom: var(--space-6);
        min-width: 0;
    }

    .workspace-label {
        display: grid;
        gap: var(--space-1);
        min-width: 0;
    }

    .workspace-sidebar h1 {
        margin: 0;
        font-size: 1.05rem;
        line-height: 1.25;
    }

    .workspace-status {
        margin: 0;
        color: var(--text-muted);
        font-size: 0.78rem;
        line-height: 1.35;
    }

    .workspace-status.error,
    .section-state.error,
    .error {
        color: var(--danger);
    }

    .settings-button {
        flex: 0 0 auto;
        display: grid;
        place-items: center;
        width: 32px;
        height: 32px;
        border: 0;
        border-radius: var(--radius-soft);
        background: var(--bg-subtle);
        color: var(--text-muted);
        cursor: not-allowed;
    }

    .sidebar-sections {
        display: grid;
        gap: var(--space-5);
        min-width: 0;
    }

    .nav-section {
        display: grid;
        gap: var(--space-2);
    }

    .section-heading-row,
    .section-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: var(--space-3);
    }

    .section-heading-row h2,
    .section-header,
    .eyebrow {
        color: var(--text-faint);
        font-size: 0.72rem;
        font-weight: 750;
        letter-spacing: 0.11em;
        text-transform: uppercase;
    }

    .section-heading-row h2 {
        margin: 0;
    }

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

    .section-count {
        color: var(--text-muted);
        font-size: 0.72rem;
        line-height: 1;
    }

    .nav-list {
        display: grid;
        gap: var(--space-1);
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .nav-item,
    .objective-link {
        display: grid;
        gap: 3px;
        min-width: 0;
        margin-inline: calc(-1 * var(--space-2));
        padding: var(--space-2) var(--space-3);
        border-radius: var(--radius-soft);
        color: inherit;
        text-align: left;
        text-decoration: none;
        transition:
            background-color 140ms ease,
            color 140ms ease;
    }

    a.nav-item:hover,
    a.nav-item:focus-visible,
    a.objective-link:hover,
    a.objective-link:focus-visible {
        background: var(--interactive-hover);
    }

    a.nav-item.active,
    a.objective-link.active {
        background: var(--interactive-selected);
    }

    a.nav-item.active .item-title,
    a.objective-link.active .item-title {
        color: var(--accent);
    }

    .item-title,
    .item-meta {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .item-title {
        color: var(--text-strong);
        font-weight: 650;
    }

    .worker-nav-item {
        gap: 2px;
    }

    .worker-title-row {
        display: grid;
        grid-template-columns: minmax(0, max-content) minmax(0, 1fr);
        align-items: baseline;
        gap: var(--space-2);
        min-width: 0;
    }

    .worker-task-title {
        overflow: hidden;
        color: var(--text-muted);
        font-size: 0.82rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .item-meta,
    .section-note,
    .section-state,
    .muted {
        color: var(--text-muted);
        font-size: 0.82rem;
    }

    .section-note,
    .section-state {
        margin: 0;
        line-height: 1.45;
    }

    .card {
        min-width: 0;
        padding: 0;
    }

    .runtime-card {
        padding: 0;
    }

    .objective-list {
        display: flex;
        flex-direction: column;
        gap: var(--space-2);
        margin-top: var(--space-4);
    }

    .objective-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) max-content;
        align-items: start;
        gap: var(--space-4);
        padding: var(--space-3) var(--space-4);
        border-radius: var(--radius-panel);
        background: var(--bg-raised);
        color: inherit;
        text-decoration: none;
        transition: background-color 140ms ease;
    }

    .objective-row:hover,
    .objective-row:focus-visible {
        background: var(--interactive-hover);
    }

    .objective-row.selected {
        background: var(--interactive-selected);
    }

    .objective-row.selected .objective-title {
        color: var(--accent);
    }

    .objective-main {
        display: grid;
        gap: var(--space-1);
        min-width: 0;
    }

    .objective-title-row {
        display: flex;
        align-items: baseline;
        gap: var(--space-2);
        min-width: 0;
    }

    .objective-title {
        min-width: 0;
        overflow: hidden;
        color: var(--text-strong);
        font-weight: 700;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .state-pill {
        flex: 0 0 auto;
        color: var(--success);
        font-size: 0.76rem;
        font-weight: 700;
        letter-spacing: 0.05em;
        text-transform: uppercase;
    }

    .objective-summary {
        margin: 0;
        color: var(--text-muted);
        font-size: 0.88rem;
        line-height: 1.4;
    }

    .objective-meta {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: var(--space-2);
        color: var(--text-faint);
        font-size: 0.78rem;
        line-height: 1.35;
        text-align: right;
        white-space: nowrap;
    }

    @media (max-width: 900px) {
        .objective-row {
            grid-template-columns: 1fr;
            gap: var(--space-2);
        }

        .objective-meta {
            justify-content: flex-start;
            text-align: left;
            white-space: normal;
        }
    }

    .runtime-heading,
    .detail-heading {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: var(--space-3);
        margin-bottom: var(--space-3);
    }

    .runtime-heading span {
        color: var(--success);
    }

    .runtime-heading span.warn {
        color: var(--warning);
    }

    .detail-heading h3 {
        margin: 0;
    }

    .detail-heading span {
        color: var(--text-muted);
        font-size: 0.8rem;
    }

    dl {
        display: grid;
        gap: var(--space-1);
        margin: 0;
    }

    dl > div {
        display: grid;
        grid-template-columns: minmax(6.5rem, 10rem) minmax(0, 1fr);
        align-items: baseline;
        gap: var(--space-3);
        min-width: 0;
    }

    dt {
        color: var(--text-faint);
        font-size: 0.72rem;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        white-space: nowrap;
    }

    dd {
        min-width: 0;
        margin: 0;
    }

    dd small {
        display: inline;
        margin-top: 0;
        margin-left: var(--space-2);
    }

    .table-wrap {
        overflow-x: auto;
    }

    table {
        width: 100%;
        border-collapse: collapse;
    }

    th,
    td {
        border-bottom: 1px solid var(--line);
        padding: 10px 8px;
        text-align: left;
        vertical-align: top;
    }

    th {
        color: var(--text-faint);
        font-size: 0.78rem;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .diagnostics {
        margin-top: var(--space-4);
    }

    .diagnostics li {
        display: grid;
        gap: var(--space-1);
        margin-bottom: var(--space-3);
    }

    .record-body {
        overflow-x: auto;
        padding: var(--space-4) 0 0;
        border-top: 1px solid var(--line);
        color: var(--text);
        white-space: pre-wrap;
    }
}

.console-shell {
    gap: 1rem;
}

.console-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.console-status {
    display: grid;
    justify-items: end;
    gap: 0.25rem;
    min-width: 10rem;
    padding: 0.75rem 0.9rem;
    border-radius: 16px;
    background: var(--bg-raised);
    border: 1px solid var(--line);
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.78rem;
}

.console-status small {
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-muted);
    font-weight: 600;
}

.console-status[data-state='busy'] {
    background: var(--bg-raised);
    border-color: var(--line);
    color: var(--warning);
}

.console-status[data-state='error'],
.console-status[data-state='timeout'] {
    background: var(--bg-raised);
    border-color: var(--line);
    color: var(--danger);
}

.console-status[data-state='cancelled'],
.console-status[data-state='rejected'] {
    background: var(--bg-raised);
    border-color: var(--line);
    color: var(--text-muted);
}

.console-transport {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 0.75rem;
}

.console-transport div {
    display: grid;
    gap: 0.15rem;
}

.console-transport dt {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.console-transport dd {
    margin: 0;
    color: var(--text-strong);
    font-weight: 700;
}

.console-transport p {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--text-muted);
    line-height: 1.5;
}

.console-diagnostics {
    display: grid;
    gap: 0.4rem;
}

.diagnostic {
    margin: 0;
    padding: 0.55rem 0.7rem;
    border-radius: 10px;
    background: var(--bg-raised);
    color: var(--accent);
    font-size: 0.86rem;
}

.diagnostic.warning,
.diagnostic.warn {
    background: var(--bg-raised);
    color: var(--warning);
}

.diagnostic.error {
    background: var(--bg-raised);
    color: var(--danger);
}

.console-card,
.composer-card {
    display: grid;
    gap: 1rem;
}

.empty-state {
    margin: 0;
    padding: 1rem;
    border-radius: 14px;
    background: var(--bg-raised);
    color: var(--text-muted);
}

.composer-card label {
    font-weight: 800;
    color: var(--text-strong);
}

.composer-card textarea {
    width: 100%;
    min-height: 8rem;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    font: inherit;
    color: var(--text-strong);
    background: var(--bg);
}

.composer-card textarea:disabled {
    background: var(--bg-raised);
    color: var(--text-muted);
}

.composer-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.7rem;
}

.composer-actions span {
    margin-right: auto;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.composer-actions button {
    border: 0;
    border-radius: 999px;
    padding: 0.65rem 1rem;
    background: var(--accent);
    color: var(--bg);
    font-weight: 800;
    cursor: pointer;
}

.composer-actions button.secondary {
    background: var(--bg-raised);
    color: var(--text-strong);
}

.composer-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.inline-link,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    border-radius: 999px;
    border: 1px solid var(--line);
    padding: 0.4rem 0.75rem;
    background: var(--bg);
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.secondary-button:hover,
.inline-link:hover {
    border-color: var(--line-strong);
    background: var(--bg-raised);
}

.worker-console-shell {
    min-height: 100dvh;
    padding-bottom: 0;
}

.worker-console-shell > .console-body {
    flex: 1 1 auto;
    min-height: 0;
}

.console-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
}

.console-status-pill {
    min-width: 14rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--bg-raised);
    color: var(--text-muted);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.76rem;
    text-align: right;
}

.console-status-pill.warn {
    color: var(--warning);
}

.console-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    min-height: 0;
}

.console-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
}

.console-log {
    display: grid;
    align-content: start;
    gap: var(--space-2);
    max-height: none;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
}

.console-log li {
    display: grid;
    gap: var(--space-1);
    padding: 0.2rem 0;
    background: transparent;
}





.console-log li.error-line {
    color: var(--danger);
}

.message-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 750;
}

.message-heading.streaming-heading {
    justify-content: flex-start;
}

.message-heading small {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
}

.console-log pre {
    max-width: 100%;
    margin: 0;
    overflow-x: auto;
    white-space: pre-wrap;
    color: var(--code);
}

.message-detail,
.metadata-details {
    color: var(--text-muted);
    font-size: 0.84rem;
}

.message-detail summary,
.metadata-details summary {
    cursor: pointer;
    font-weight: 800;
}

.console-side-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    display: grid;
    align-content: start;
    gap: var(--space-4);
    width: min(32rem, 100vw);
    padding: var(--space-6);
    overflow-y: auto;
    border-left: 1px solid var(--line);
    background: var(--bg);
}

.side-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.console-side-panel dl,
.console-side-panel ul {
    display: grid;
    gap: var(--space-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

.console-side-panel dt {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.console-side-panel dd {
    margin: 0;
    color: var(--text-strong);
    font-weight: 700;
}

.console-composer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: grid;
    gap: var(--space-3);
    margin-inline: calc(-1 * var(--space-6));
    padding: var(--space-3) var(--space-6) var(--space-4);
    background: var(--bg);
}

.console-composer textarea {
    width: 100%;
    min-height: 7rem;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    font: inherit;
    color: var(--text-strong);
}

.console-composer textarea:disabled {
    background: var(--bg-raised);
    color: var(--text-muted);
}

@media (max-width: 960px) {
    .console-header {
        flex-direction: column;
    }

    .console-status-pill {
        width: 100%;
        text-align: left;
    }
}

.settings-button {
    text-decoration: none;
    cursor: pointer;
}

.settings-button:hover,
.settings-button:focus-visible,
.settings-button.active {
    background: var(--interactive-selected);
    color: var(--accent);
}

.settings-shell {
    gap: var(--space-5);
}

.settings-hero,
.settings-notice,
.settings-section-header,
.settings-patterns {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
}

.hero-copy {
    max-width: 54rem;
    margin: 0;
    color: var(--text-muted);
}

.badge {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 0.35rem 0.65rem;
    background: var(--bg-subtle);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.badge.warning {
    color: var(--warning);
}

.badge.success {
    color: var(--success);
}

.settings-notice {
    border-left: 4px solid var(--warning);
    padding-left: var(--space-4);
}

.settings-diagnostic {
    display: grid;
    gap: var(--space-1);
    max-width: 24rem;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--line);
    border-radius: var(--radius-panel);
    background: var(--bg-raised);
    color: var(--text-muted);
}

.settings-diagnostic strong {
    color: var(--text-strong);
}

.settings-nav-card {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.settings-nav-link {
    display: grid;
    gap: var(--space-1);
    min-width: min(16rem, 100%);
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--line);
    border-radius: var(--radius-panel);
    background: var(--bg-raised);
    color: inherit;
    text-decoration: none;
}

.settings-nav-link:hover,
.settings-nav-link:focus-visible {
    background: var(--interactive-hover);
}

.settings-nav-link span {
    color: var(--text-strong);
    font-weight: 800;
}

.settings-grid,
.settings-pattern-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr));
}

.settings-section,
.settings-patterns,
.settings-pattern {
    display: grid;
    gap: var(--space-4);
}

.settings-section ul,
.settings-patterns ul {
    margin: 0;
    padding-left: 1.2rem;
}

.settings-section li + li {
    margin-top: var(--space-2);
}

.settings-identity-list {
    padding-top: var(--space-3);
    border-top: 1px solid var(--line);
}

.settings-pattern {
    padding: var(--space-4);
    border-radius: var(--radius-panel);
    background: var(--bg-raised);
}

.settings-pattern h3,
.settings-pattern p {
    margin: 0;
}

.status-message {
    margin: 0;
    color: var(--text-muted);
}

@media (max-width: 760px) {
    .settings-hero,
    .settings-notice,
    .settings-section-header,
    .settings-patterns {
        display: grid;
    }
}

.section-heading-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-action {
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-strong);
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  cursor: pointer;
}

.worker-new-form {
  display: grid;
  gap: 0.65rem;
  margin: 0.6rem 0 0.75rem;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
}

.worker-new-form label,
.settings-runtime-form label {
  display: grid;
  gap: 0.25rem;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.worker-new-form input,
.worker-new-form select,
.worker-new-form textarea,
.settings-runtime-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: var(--bg-raised);
  color: var(--text-strong);
  padding: 0.45rem 0.55rem;
  font: inherit;
}

.worker-new-form textarea {
  resize: vertical;
}

.worker-new-form button,
.settings-runtime-form button,
.settings-action-row button {
  border: 0;
  border-radius: 0.6rem;
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
}

.worker-new-form button:disabled,
.settings-runtime-form button:disabled,
.settings-action-row button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.settings-runtime-form,
.settings-runtime-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.settings-runtime-form {
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
}

.settings-runtime-card {
  display: grid;
  gap: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem;
  background: var(--bg-raised);
}

.settings-runtime-card header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.settings-runtime-card.inactive {
  opacity: 0.86;
}

.settings-identity-list.compact {
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
}

.settings-action-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.settings-action-row .danger {
  background: var(--danger);
  color: var(--bg);
}

.settings-diagnostics-list {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.settings-diagnostics-list li {
  display: grid;
  gap: 0.15rem;
  border-radius: 0.6rem;
  border: 1px solid var(--line);
  padding: 0.55rem 0.65rem;
  color: var(--text-muted);
}

.settings-diagnostics-list li.error {
  border-color: rgba(255, 99, 99, 0.55);
}

.settings-diagnostics-list li.warning {
  border-color: rgba(255, 205, 86, 0.55);
}

.settings-test-result {
  display: grid;
  gap: 0.3rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.75rem;
}
