/* Inframodule application shell
 * This layer intentionally overrides the legacy CodioCi theme while the
 * underlying routes are migrated to the infrastructure automation model.
 */

:root {
    --color-bg: #050914;
    --color-bg-secondary: #0b1220;
    --color-bg-tertiary: #111b2e;
    --color-border: #24324a;
    --color-text: #f1f5f9;
    --color-text-secondary: #a3b2c7;
    --color-primary: #0369a1;
    --color-primary-hover: #075985;
    --color-link: #38bdf8;
    --color-link-hover: #7dd3fc;
    --color-success: #16a34a;
    --color-error: #dc2626;
    --color-warning: #d97706;
    --color-running: #0ea5e9;
    --surface-raised: #0e1728;
    --surface-subtle: #0a1020;
    --focus-ring: rgba(56, 189, 248, 0.42);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --font-mono: "Fira Code", ui-monospace, SFMono-Regular, Consolas, monospace;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 18px 45px rgba(0, 0, 0, 0.28);
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
}

/* Self-hosted brand typefaces (SIL OFL; licenses in static/fonts/).
   Latin subsets only; the system stacks below remain the fallback. */
@font-face { font-family: "Fira Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/FiraSans-400.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/FiraSans-500.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/FiraSans-600.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/FiraSans-700.woff2") format("woff2"); }
@font-face { font-family: "Fira Code"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("../fonts/FiraCode-variable.woff2") format("woff2"); }

html {
    color-scheme: dark;
}

body {
    min-width: 320px;
    background:
        radial-gradient(circle at 12% -10%, rgba(14, 165, 233, 0.1), transparent 30rem),
        var(--color-bg);
    color: var(--color-text);
    font-family: "Fira Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
}

.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 1000;
    padding: 10px 14px;
    color: #ffffff;
    background: var(--color-primary);
    border-radius: 8px;
    transform: translateY(-150%);
}

.skip-link:focus {
    transform: translateY(0);
}

a,
button,
input,
select,
textarea {
    touch-action: manipulation;
    transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease, opacity 180ms ease, box-shadow 180ms ease;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #7dd3fc;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--focus-ring);
}

.container {
    width: min(100% - 32px, 1180px);
    max-width: none;
    padding: 0;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0;
    background: rgba(5, 9, 20, 0.94);
    border-bottom: 1px solid rgba(51, 65, 85, 0.74);
    backdrop-filter: blur(16px);
}

.app-header-inner,
.header-nav {
    min-height: 68px;
}

.header-nav {
    position: relative;
    width: 100%;
    gap: 28px;
}

.brand-link {
    flex: 0 0 auto;
    padding: 8px 0;
}

.brand-logo {
    display: block;
    width: 152px;
    height: auto;
}

.nav-links {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 2px;
}

.mobile-nav-toggle {
    display: none;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 11px;
    color: var(--color-text);
    background: var(--surface-raised);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.mobile-nav-toggle:hover,
.mobile-nav-toggle[aria-expanded="true"] {
    color: #e0f2fe;
    background: rgba(14, 165, 233, 0.14);
    border-color: rgba(56, 189, 248, 0.48);
}

.mobile-nav-icon {
    flex: 0 0 auto;
}

.mobile-nav-icon-close {
    display: none;
}

.mobile-nav-toggle[aria-expanded="true"] .mobile-nav-icon-menu {
    display: none;
}

.mobile-nav-toggle[aria-expanded="true"] .mobile-nav-icon-close {
    display: block;
}

.nav-link {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    color: var(--color-text-secondary);
    padding: 8px 11px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--color-text);
    background: rgba(148, 163, 184, 0.1);
}

.nav-link.active {
    color: #e0f2fe;
    background: rgba(14, 165, 233, 0.14);
}

.app-header-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.app-header-actions .user-menu {
    margin-left: 0;
}

.header-cta {
    white-space: nowrap;
}

.user-menu-button {
    min-height: 42px;
    min-width: 42px;
    border-radius: 999px;
}

.user-menu-button:hover {
    background: rgba(148, 163, 184, 0.1);
}

.user-avatar {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #e0f2fe;
    background: rgba(14, 165, 233, 0.16);
    border: 1px solid rgba(56, 189, 248, 0.38);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.user-menu-dropdown {
    top: calc(100% + 10px);
    background: var(--surface-raised);
    border-color: var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.user-menu-item {
    min-height: 42px;
}

.main-content {
    min-height: calc(100vh - 132px);
    padding: 36px 0 56px;
}

.footer {
    background: transparent;
    border-color: rgba(51, 65, 85, 0.5);
    color: var(--color-text-secondary);
    font-size: 13px;
}

.page-header {
    align-items: flex-start;
    margin-bottom: 26px;
    padding-bottom: 0;
    border-bottom: 0;
    gap: 20px;
}

.page-header h1,
.actions-title h1 {
    margin: 0;
    color: var(--color-text);
    font-family: inherit;
    font-size: clamp(26px, 3.4vw, 32px);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    text-wrap: balance;
}

.page-eyebrow {
    margin-bottom: 7px;
    color: var(--color-link);
    font-family: "Fira Code", "SFMono-Regular", Consolas, monospace;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.page-summary,
.actions-subtitle {
    max-width: 720px;
    margin-top: 9px;
    color: var(--color-text-secondary);
    font-size: 15px;
    line-height: 1.6;
}

.header-actions {
    align-items: center;
    flex-wrap: nowrap;
}

.btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 650;
}

.btn-sm,
.btn-small {
    min-height: 38px;
    padding: 7px 12px;
    font-size: 13px;
}

.btn-primary,
.btn.btn-primary {
    background: var(--color-primary);
    border-color: #0284c7;
    color: #ffffff;
    box-shadow: none;
}

.btn-primary:hover,
.btn.btn-primary:hover {
    background: var(--color-primary-hover);
    border-color: #0284c7;
    box-shadow: none;
}

body .btn-login,
body .btn-signup {
    min-height: 44px;
    background: var(--color-primary);
    border-color: #0284c7;
    color: #ffffff;
    font-weight: 650;
}

body .btn-login:hover,
body .btn-signup:hover {
    background: var(--color-primary-hover);
}

.login-box,
.signup-box,
.login-footer,
.signup-footer {
    border-color: var(--color-border) !important;
    border-radius: var(--radius-md) !important;
}

.login-footer a,
.signup-footer a {
    color: var(--color-link);
    font-weight: 650;
}

.btn-secondary {
    background: rgba(15, 23, 42, 0.7);
    border-color: var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-bg-tertiary);
    border-color: #3b4c67;
}

.dashboard-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.stat-card {
    min-width: 0;
    padding: 17px;
    gap: 12px;
    background: linear-gradient(145deg, rgba(17, 27, 46, 0.9), rgba(11, 18, 32, 0.88));
    border-color: rgba(51, 65, 85, 0.72);
    border-radius: var(--radius-md);
}

.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
}

.stat-icon svg {
    width: 20px;
    height: 20px;
}

.stat-value {
    color: var(--color-text);
    font-family: "Fira Code", "SFMono-Regular", Consolas, monospace;
    font-size: 22px;
    font-weight: 600;
}

.stat-label {
    color: var(--color-text-secondary);
    font-size: 12px;
}

.workspace-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 28px 0 12px;
}

.section-title {
    color: var(--color-text);
    font-size: 16px;
    font-weight: 650;
}

.section-count {
    margin-left: 7px;
    color: var(--color-text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.repo-search-bar {
    width: min(100%, 320px);
    margin: 0;
    background: var(--surface-subtle);
    border-color: var(--color-border);
    border-radius: 8px;
}

.repo-search-input,
.search-input,
.form-input,
input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
select,
textarea {
    min-height: 42px;
    color: var(--color-text);
    background: var(--surface-subtle);
    border-color: var(--color-border);
    border-radius: 8px;
    font-size: 16px;
}

.repo-search-input::placeholder,
.search-input::placeholder,
input::placeholder,
textarea::placeholder {
    color: #718096;
}

.repo-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.repo-item {
    position: relative;
    margin: 0;
    padding: 20px;
    background: linear-gradient(145deg, rgba(14, 23, 40, 0.98), rgba(10, 16, 32, 0.98));
    border: 1px solid rgba(51, 65, 85, 0.76);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.repo-item:hover {
    border-color: #3b4c67;
    background: linear-gradient(145deg, rgba(17, 29, 50, 0.98), rgba(11, 20, 38, 0.98));
}

.repo-status-indicator {
    top: 0;
    right: 0;
    left: 0;
    width: auto;
    height: 2px;
    border-radius: 0;
}

.repo-header h3 a {
    color: #e0f2fe;
    font-family: "Fira Code", "SFMono-Regular", Consolas, monospace;
    font-size: 17px;
}

.repo-actions {
    align-items: center;
}

.repo-meta {
    color: var(--color-text-secondary);
}

.commit-message {
    min-height: 24px;
    color: #cbd5e1;
}

.repo-pipeline-stats {
    border-color: rgba(51, 65, 85, 0.62);
}

.empty-state {
    padding: 64px 24px;
    background: linear-gradient(145deg, rgba(14, 23, 40, 0.8), rgba(10, 16, 32, 0.82));
    border: 1px dashed #334155;
    border-radius: var(--radius-lg);
}

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

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

.empty-state p {
    max-width: 520px;
    margin: 8px auto 22px;
    color: var(--color-text-secondary);
}

.form-container,
.info-box,
.actions-sidebar,
.actions-main,
.runs-container,
.modal-content {
    background: var(--surface-raised);
    border-color: var(--color-border);
    border-radius: var(--radius-md);
}

.form-container {
    max-width: 760px;
}

.form-container .form {
    padding: 26px;
}

.form-group label {
    color: var(--color-text);
}

.form-help {
    color: var(--color-text-secondary);
}

.optional-label {
    margin-left: 6px;
    color: var(--color-text-secondary);
    font-size: 12px;
    font-weight: 500;
}

.setup-note {
    max-width: 760px;
    display: flex;
    gap: 14px;
    margin-top: 18px;
    padding: 18px 20px;
    color: var(--color-text-secondary);
    background: rgba(14, 165, 233, 0.07);
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: var(--radius-md);
}

.setup-note-icon {
    flex: 0 0 auto;
    color: var(--color-link);
}

.setup-note h2 {
    margin: 0 0 5px;
    color: var(--color-text);
    font-size: 15px;
}

.setup-note p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
}

.info-box {
    margin-top: 22px;
}

.activity-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #64748b;
}

.activity-dot-success { background: #22c55e; }
.activity-dot-failed { background: #ef4444; }
.activity-dot-running { background: #38bdf8; }

.actions-layout {
    gap: 16px;
    margin: 0;
    min-height: calc(100vh - 200px);
}

.actions-sidebar {
    width: 230px;
    min-width: 230px;
    flex-basis: 230px;
    border: 1px solid var(--color-border);
}

.actions-main {
    min-width: 0;
    border: 1px solid var(--color-border);
}

.sidebar-nav-item.active a {
    border-left-color: var(--color-primary);
}

.toast-close,
.close-button,
.modal-close,
.run-view-button,
.run-delete-button,
.workflow-run-button {
    min-width: 40px;
    min-height: 40px;
}

/* Team-scoped control plane */
.team-switcher {
    display: grid;
    gap: 6px;
    min-width: 220px;
}

.team-switcher label,
.stacked-form label,
.inline-create-form label {
    color: var(--color-text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.team-switcher select,
.stacked-form input,
.stacked-form select,
.inline-create-form input {
    min-height: 44px;
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg-secondary);
    color: var(--color-text);
    font: inherit;
    padding: 10px 12px;
    text-overflow: ellipsis;
}

.team-switcher select:focus-visible,
.stacked-form input:focus-visible,
.stacked-form select:focus-visible,
.inline-create-form input:focus-visible {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
    outline: 0;
}

.control-plane-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.78fr);
    gap: 24px;
    align-items: start;
}

.control-plane-main,
.control-plane-panel,
.onboarding-panel {
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-bg-secondary);
    box-shadow: var(--shadow-sm);
}

.control-plane-main {
    min-width: 0;
    padding: 24px;
}

.control-plane-panel {
    position: sticky;
    top: 88px;
    min-width: 0;
    padding: 22px;
}

.control-plane-panel > p,
.section-heading-row p,
.compact-empty-state p {
    color: var(--color-text-secondary);
}

.section-heading-row,
.resource-card,
.member-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.section-heading-row {
    margin-bottom: 20px;
}

.section-heading-row h2,
.section-heading-row p,
.resource-card h3,
.resource-card p {
    margin: 0;
}

.section-heading-row h2,
.control-plane-panel h2,
.audit-section h2 {
    color: var(--color-text);
    font-size: clamp(1.08rem, 2vw, 1.35rem);
    line-height: 1.25;
    text-wrap: balance;
}

.section-heading-row p,
.control-plane-panel > p {
    line-height: 1.5;
}

.role-badge,
.status-pill,
.resource-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    color: var(--color-text-secondary);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 5px 9px;
    text-transform: uppercase;
    white-space: nowrap;
}

.resource-card-list,
.member-list,
.stacked-form,
.inline-create-form {
    display: grid;
    gap: 16px;
}

.resource-card {
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-bg);
    padding: 18px;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.resource-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

.resource-card h3 {
    margin-top: 8px;
}

.resource-uri {
    max-width: 620px;
    margin-top: 6px !important;
    overflow-wrap: anywhere;
}

.resource-card-workspace {
    align-items: flex-start;
}

.resource-facts {
    display: grid;
    gap: 8px;
    min-width: 180px;
    margin: 0;
}

.resource-facts div {
    display: grid;
    gap: 2px;
}

.resource-facts dt {
    color: var(--color-text-secondary);
    font-size: 0.75rem;
}

.resource-facts dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.split-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.onboarding-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    gap: 32px;
    padding: 32px;
}

.compact-empty-state {
    display: grid;
    justify-items: start;
    gap: 10px;
    border: 1px dashed var(--color-border);
    border-radius: 10px;
    padding: 28px;
}

.compact-empty-state h2,
.compact-empty-state h3,
.compact-empty-state p {
    margin: 0;
}

.member-row {
    justify-content: flex-start;
    border-bottom: 1px solid var(--color-border);
    min-height: 64px;
    padding: 10px 0;
}

.member-row > div:nth-child(2) {
    display: grid;
    flex: 1;
}

.member-row span:not(.role-badge) {
    color: var(--color-text-secondary);
    overflow-wrap: anywhere;
}

.audit-section {
    margin-top: 32px;
}

.panel-section {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
}

.panel-section > p,
.form-group small,
.runner-token-panel p {
    color: var(--color-text-secondary);
}

.runner-token-panel {
    display: grid;
    gap: 14px;
    min-width: 0;
    margin-bottom: 18px;
    padding: 18px;
    border: 1px solid rgba(217, 119, 6, 0.55);
    border-radius: 10px;
    background: rgba(217, 119, 6, 0.08);
}

.runner-token-panel h3,
.runner-token-panel p {
    margin: 6px 0 0;
}

.runner-token-value {
    display: block;
    min-inline-size: 0;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
    user-select: all;
}

.runner-token-actions,
.runner-pool-labels {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.runner-token-copy-status {
    color: var(--color-text-secondary);
    font-size: 0.82rem;
}

.runner-pool-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: flex-start;
    gap: 16px;
    min-width: 0;
}

.runner-pool-summary {
    min-width: 0;
}

.runner-pool-summary h3 {
    overflow-wrap: anywhere;
}

.runner-pool-labels {
    margin-top: 12px;
}

.runner-pool-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.runner-diagnostic-history {
    display: grid;
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    gap: 8px;
    margin-top: 4px;
    padding-top: 14px;
    border-top: 1px solid var(--color-border);
}

.runner-diagnostic-row {
    display: grid;
    grid-template-columns: minmax(72px, auto) auto minmax(140px, 1fr) auto;
    align-items: center;
    gap: 10px;
    color: var(--color-text-secondary);
    font-size: 0.82rem;
    min-width: 0;
}

.runner-diagnostic-row > span:not(.status-pill) {
    min-width: 0;
    overflow-wrap: anywhere;
}

.runner-diagnostic-row time {
    white-space: nowrap;
}

.audit-list {
    display: grid;
    gap: 0;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.audit-list li {
    display: grid;
    grid-template-columns: minmax(150px, 0.8fr) minmax(120px, 1fr) auto;
    gap: 12px;
    border-top: 1px solid var(--color-border);
    padding: 12px 0;
}

.audit-action {
    color: var(--color-text);
    font-family: var(--font-mono);
}

.audit-list time {
    color: var(--color-text-secondary);
    font-size: 0.82rem;
}

.control-plane-grid-single {
    grid-template-columns: minmax(0, 1fr);
}

.team-section-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: -8px 0 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
}

.team-section-nav a {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--color-text-secondary);
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
}

.team-section-nav a:hover,
.team-section-nav a.active {
    background: rgba(14, 165, 233, 0.12);
    color: var(--color-text);
}

.audit-heading {
    margin-bottom: 12px;
}

.audit-toolbar {
    display: flex;
    align-items: end;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--surface-subtle);
}

.audit-toolbar > div {
    min-width: 0;
    flex: 1;
}

.audit-toolbar label {
    display: block;
    margin-bottom: 5px;
    color: var(--color-text-secondary);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.audit-toolbar select {
    min-height: 40px;
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg-secondary);
    color: var(--color-text);
    font: inherit;
    padding: 8px 10px;
}

.audit-resource {
    min-width: 0;
    overflow-wrap: anywhere;
}

.audit-pagination {
    min-height: 52px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    border-top: 1px solid var(--color-border);
    padding-top: 12px;
    color: var(--color-text-secondary);
    font-size: 0.82rem;
}

.audit-pagination > :last-child {
    justify-self: end;
}

.audit-empty {
    margin: 18px 0 0;
    color: var(--color-text-secondary);
}

/* Authenticated product guide */
.help-page-header .status-pill {
    flex: 0 0 auto;
}

.help-quick-start {
    margin-bottom: 28px;
    padding: 26px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(14, 165, 233, 0.09), transparent 55%),
        var(--color-bg-secondary);
}

.help-section-heading h2,
.help-section-heading p {
    margin: 6px 0 0;
}

.help-section-heading p,
.help-content > .help-section > p,
.help-footnote {
    max-width: 76ch;
    color: var(--color-text-secondary);
    line-height: 1.7;
}

.help-step-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
}

.help-step-grid li {
    display: grid;
    align-content: start;
    gap: 8px;
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: rgba(5, 9, 20, 0.72);
}

.help-step-grid h3,
.help-step-grid p {
    margin: 0;
}

.help-step-grid p {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    line-height: 1.55;
}

.help-step-grid a {
    width: fit-content;
    margin-top: 4px;
    color: var(--color-link);
    font-weight: 700;
    text-underline-offset: 3px;
}

.help-step-grid a:hover {
    color: var(--color-link-hover);
}

.help-step-number {
    color: var(--color-link);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
}

.help-layout {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.help-topic-nav {
    position: sticky;
    top: 92px;
    display: grid;
    gap: 3px;
    padding: 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg-secondary);
}

.help-topic-nav strong {
    margin: 0 10px 8px;
    color: var(--color-text);
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.help-topic-nav a {
    min-height: 38px;
    display: flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
}

.help-topic-nav a:hover,
.help-topic-nav a:focus-visible {
    color: var(--color-text);
    background: rgba(14, 165, 233, 0.1);
}

.help-content {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.help-section {
    scroll-margin-top: 94px;
    min-width: 0;
    padding: 26px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-bg-secondary);
}

.help-section > :last-child {
    margin-bottom: 0;
}

.help-definition-list {
    display: grid;
    gap: 0;
    margin: 22px 0;
}

.help-definition-list div {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 18px;
    padding: 14px 0;
    border-top: 1px solid var(--color-border);
}

.help-definition-list dt {
    color: var(--color-text);
    font-weight: 700;
}

.help-definition-list dd {
    margin: 0;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.help-note,
.help-warning {
    margin-top: 20px;
    padding: 16px 18px;
    border-radius: var(--radius-md);
}

.help-note {
    border: 1px solid rgba(56, 189, 248, 0.3);
    background: rgba(14, 165, 233, 0.07);
}

.help-warning {
    border: 1px solid rgba(217, 119, 6, 0.55);
    background: rgba(217, 119, 6, 0.08);
}

.help-note p,
.help-warning p {
    margin: 5px 0 0;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.help-ordered-list,
.help-check-list {
    display: grid;
    gap: 12px;
    max-width: 82ch;
    margin: 20px 0 0;
    color: var(--color-text-secondary);
    line-height: 1.65;
}

.help-ordered-list {
    padding-left: 24px;
}

.help-ordered-list li::marker {
    color: var(--color-link);
    font-family: var(--font-mono);
    font-weight: 700;
}

.help-lifecycle {
    display: grid;
    gap: 0;
    margin: 22px 0;
    padding: 0;
    list-style: none;
}

.help-lifecycle li {
    position: relative;
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 18px;
    padding: 0 0 20px 26px;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.help-lifecycle li:not(:last-child)::before {
    position: absolute;
    top: 10px;
    bottom: -2px;
    left: 6px;
    width: 1px;
    background: var(--color-border);
    content: "";
}

.help-lifecycle li::after {
    position: absolute;
    top: 7px;
    left: 2px;
    width: 9px;
    height: 9px;
    border: 2px solid var(--color-bg-secondary);
    border-radius: 999px;
    background: var(--color-link);
    box-shadow: 0 0 0 1px var(--color-link);
    content: "";
}

.help-lifecycle strong {
    color: var(--color-text);
}

.help-concept-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 22px;
}

.help-concept-grid article {
    padding: 18px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg);
}

.help-concept-grid h3,
.help-concept-grid p {
    margin: 0;
}

.help-concept-grid p {
    margin-top: 8px;
    color: var(--color-text-secondary);
    font-size: 0.92rem;
    line-height: 1.6;
}

.help-table-wrap {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin-top: 20px;
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.help-role-table {
    width: 100%;
    min-width: 580px;
    border-collapse: collapse;
    background: var(--color-bg);
}

.help-role-table caption {
    padding: 14px 16px;
    color: var(--color-text-secondary);
    font-size: 0.82rem;
    text-align: left;
}

.help-role-table th,
.help-role-table td {
    padding: 14px 16px;
    border-top: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
}

.help-role-table thead th,
.help-role-table tbody th {
    color: var(--color-text);
}

.help-role-table thead th {
    background: var(--surface-raised);
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.help-role-table tbody th {
    width: 120px;
}

.help-role-table td {
    color: var(--color-text-secondary);
    line-height: 1.55;
}

.help-check-list {
    padding: 0;
    list-style: none;
}

.help-check-list li {
    position: relative;
    padding-left: 24px;
}

.help-check-list li::before {
    position: absolute;
    top: 0.65em;
    left: 2px;
    width: 7px;
    height: 7px;
    border-radius: 2px;
    background: var(--color-success);
    content: "";
}

.help-disclosures {
    display: grid;
    gap: 10px;
    margin-top: 20px;
}

.help-disclosures details {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg);
}

.help-disclosures summary {
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--color-text);
    cursor: pointer;
    font-weight: 700;
}

.help-disclosures details[open] summary {
    border-bottom: 1px solid var(--color-border);
}

.help-disclosures details p {
    margin: 0;
    padding: 15px 16px 17px;
    color: var(--color-text-secondary);
    line-height: 1.65;
}

@media (min-width: 1024px) and (max-width: 1279px) {
    .header-nav {
        gap: 14px;
    }

    .brand-logo {
        width: 132px;
    }

    .nav-link {
        padding: 8px 8px;
        font-size: 13px;
    }

    .user-name {
        display: none;
    }
}

@media (max-width: 1023px) {
    .header-nav {
        gap: 10px;
    }

    .mobile-nav-toggle {
        display: inline-flex;
        margin-left: auto;
    }

    .nav-links {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        left: 0;
        z-index: 1001;
        display: none;
        max-height: calc(100dvh - 96px);
        margin: 0;
        padding: 8px;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 4px;
        overflow-y: auto;
        background: var(--surface-raised);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-lg);
    }

    .nav-links.is-open {
        display: flex;
    }

    .nav-link {
        width: 100%;
        min-height: 44px;
        padding: 10px 13px;
    }

    .user-name,
    .dropdown-arrow,
    .header-cta {
        display: none;
    }

}

@media (max-width: 960px) {

    .dashboard-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .repo-list {
        grid-template-columns: 1fr;
    }

    .control-plane-grid,
    .onboarding-panel {
        grid-template-columns: 1fr;
    }

    .help-step-grid,
    .help-concept-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .help-layout {
        grid-template-columns: 1fr;
    }

    .help-topic-nav {
        position: static;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .help-topic-nav strong {
        grid-column: 1 / -1;
    }

    .control-plane-panel {
        position: static;
    }
}

@media (max-width: 640px) {
    .container {
        width: min(100% - 24px, 1180px);
    }

    .app-header-inner,
    .header-nav {
        min-height: 60px;
    }

    .header-nav {
        flex-wrap: nowrap;
        padding: 9px 0 7px;
    }

    .brand-logo {
        width: 148px;
    }

    .app-header-actions {
        margin-left: 0;
    }

    .nav-link {
        min-height: 44px;
        padding-inline: 11px;
    }

    .main-content {
        padding-top: 26px;
    }

    .page-header,
    .workspace-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .header-actions .btn {
        flex: 1 1 auto;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .repo-search-bar {
        width: 100%;
    }

    .repo-header {
        align-items: flex-start;
        gap: 12px;
    }

    .repo-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .actions-layout {
        display: block;
    }

    .actions-sidebar {
        margin-bottom: 16px;
    }

    .team-switcher {
        width: 100%;
    }

    .resource-card,
    .resource-card-workspace,
    .section-heading-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .resource-facts,
    .split-fields {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .runner-pool-actions {
        justify-content: flex-start;
        width: 100%;
    }

    .runner-diagnostic-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .audit-list li {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .help-step-grid,
    .help-concept-grid,
    .help-topic-nav {
        grid-template-columns: 1fr;
    }

    .help-quick-start,
    .help-section {
        padding: 20px;
    }

    .help-definition-list div,
    .help-lifecycle li {
        grid-template-columns: 1fr;
        gap: 5px;
    }
}

/* Overview: live tenant operations snapshot */
.overview-context-row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.overview-team-switcher {
    min-width: min(100%, 360px);
}

.overview-team-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.overview-team-control select {
    min-width: 220px;
}

.overview-snapshot-time {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: 0.78rem;
}

.overview-snapshot-time time {
    color: var(--color-text);
    font-family: var(--font-mono);
}

.overview-section-heading {
    margin-bottom: 14px;
}

.overview-section-heading p,
.overview-panel-heading p {
    margin: 4px 0 0;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

.overview-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.overview-stat-card {
    min-height: 148px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--surface-raised);
    color: var(--color-text);
    padding: 18px;
    text-decoration: none;
}

.overview-stat-card:hover {
    border-color: #475569;
    background: var(--color-bg-tertiary);
    color: var(--color-text);
}

.overview-stat-card:focus-visible {
    border-color: var(--color-link);
}

.overview-stat-icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    border-radius: 9px;
    background: var(--color-bg-secondary);
}

.overview-stat-active .overview-stat-icon {
    color: #7dd3fc;
    border-color: rgba(56, 189, 248, 0.36);
}

.overview-stat-waiting .overview-stat-icon {
    color: #fde68a;
    border-color: rgba(251, 191, 36, 0.36);
}

.overview-stat-attention .overview-stat-icon {
    color: #fca5a5;
    border-color: rgba(248, 113, 113, 0.36);
}

.overview-stat-runners .overview-stat-icon {
    color: #bbf7d0;
    border-color: rgba(74, 222, 128, 0.36);
}

.overview-stat-copy {
    min-width: 0;
    display: grid;
}

.overview-stat-copy strong {
    margin: 6px 0 4px;
    color: var(--color-text);
    font-size: clamp(1.8rem, 3vw, 2.35rem);
    line-height: 1;
}

.overview-stat-copy strong small {
    color: var(--color-text-secondary);
    font-size: 0.52em;
    font-weight: 600;
}

.overview-stat-label {
    color: var(--color-text);
    font-size: 0.84rem;
    font-weight: 700;
}

.overview-stat-copy > span:last-child {
    color: var(--color-text-secondary);
    font-size: 0.76rem;
    line-height: 1.4;
}

.overview-stat-arrow {
    align-self: center;
    color: var(--color-text-secondary);
}

.overview-operations-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.8fr);
    gap: 18px;
    margin-top: 20px;
}

.overview-panel,
.overview-workspaces {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg-secondary);
    box-shadow: var(--shadow-sm);
}

.overview-panel {
    min-width: 0;
    padding: 20px;
}

.overview-panel-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
}

.overview-panel-heading h2,
.overview-panel-heading p {
    margin-top: 0;
}

.overview-panel-heading h2 {
    margin-bottom: 0;
    font-size: 1rem;
}

.overview-panel-heading > a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.overview-run-list {
    margin: 14px -20px -20px;
}

.overview-run-row {
    min-height: 68px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 16px;
    border-top: 1px solid var(--color-border);
    color: var(--color-text);
    padding: 11px 20px;
    text-decoration: none;
}

.overview-run-row:hover {
    background: var(--surface-subtle);
    color: var(--color-text);
}

.overview-run-identity {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.overview-run-identity strong,
.overview-run-identity span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.overview-run-identity strong {
    font-family: var(--font-mono);
    font-size: 0.84rem;
}

.overview-run-identity span,
.overview-run-row time {
    color: var(--color-text-secondary);
    font-size: 0.78rem;
}

.overview-run-row time {
    font-family: var(--font-mono);
    white-space: nowrap;
}

.overview-success-rate {
    display: grid;
    justify-items: center;
    gap: 5px;
    margin: 24px 0;
}

.overview-success-rate strong {
    color: var(--color-text);
    font-size: clamp(2.7rem, 6vw, 4rem);
    line-height: 1;
}

.overview-success-rate span,
.overview-outcome-note {
    color: var(--color-text-secondary);
    font-size: 0.82rem;
}

.overview-outcome-facts {
    display: grid;
    gap: 0;
    margin: 0;
}

.overview-outcome-facts div {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--color-border);
}

.overview-outcome-facts dt {
    color: var(--color-text-secondary);
}

.overview-outcome-facts dd {
    margin: 0;
    color: var(--color-text);
    font-family: var(--font-mono);
    font-weight: 700;
}

.overview-outcome-facts .outcome-success {
    color: #86efac;
}

.overview-outcome-facts .outcome-failed {
    color: #fca5a5;
}

.overview-outcome-note {
    margin: 16px 0 0;
    line-height: 1.5;
}

.overview-panel-empty {
    min-height: 150px;
    display: grid;
    align-content: center;
    justify-items: start;
    gap: 12px;
    border-top: 1px solid var(--color-border);
    margin: 14px -20px -20px;
    padding: 24px 20px;
}

.overview-panel-empty p {
    margin: 0;
    color: var(--color-text-secondary);
}

.overview-workspaces {
    margin-top: 20px;
    padding: 20px;
}

.overview-workspace-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.overview-workspace-card {
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
    border: 1px solid var(--color-border);
    border-radius: 9px;
    background: var(--color-bg);
    color: var(--color-text);
    padding: 16px;
    text-decoration: none;
}

.overview-workspace-card:hover {
    border-color: var(--color-primary);
    color: var(--color-text);
}

.overview-workspace-card strong {
    margin-top: 2px;
}

.overview-workspace-card > span:not(.resource-kicker) {
    color: var(--color-text-secondary);
    font-size: 0.8rem;
    overflow-wrap: anywhere;
}

.overview-empty-state {
    min-height: 340px;
    align-content: center;
    justify-items: center;
    text-align: center;
}

.overview-empty-state > svg {
    color: var(--color-link);
}

@media (max-width: 960px) {
    .overview-stat-grid,
    .overview-workspace-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .overview-operations-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .overview-context-row,
    .overview-panel-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .overview-context-row {
        gap: 14px;
    }

    .overview-team-control,
    .overview-team-control select {
        width: 100%;
    }

    .overview-stat-grid,
    .overview-workspace-grid {
        grid-template-columns: 1fr;
    }

    .overview-run-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px 12px;
    }

    .overview-run-row time {
        grid-column: 1 / -1;
    }
}

.run-card-list {
    display: grid;
    gap: 16px;
}

.run-card {
    padding: 18px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg);
}

.run-card-heading,
.run-actions,
.plan-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.run-card-heading {
    justify-content: space-between;
}

.run-card-heading h3 {
    margin: 8px 0 0;
}

.run-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 18px 0;
}

.digest-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.plan-summary {
    padding: 12px;
    border-radius: var(--radius-sm);
    background: rgba(15, 23, 42, 0.42);
    color: var(--color-text-secondary);
}

.run-actions {
    margin-top: 16px;
}

.run-workflow {
    margin-top: 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--surface-subtle);
    overflow: hidden;
}

.run-workflow summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 14px;
    cursor: pointer;
    color: var(--color-text);
    transition: background-color 180ms ease;
}

.run-workflow summary:hover {
    background: rgba(56, 189, 248, 0.06);
}

.run-workflow summary:focus-visible {
    outline: 2px solid #7dd3fc;
    outline-offset: -3px;
    box-shadow: inset 0 0 0 4px var(--focus-ring);
}

.run-workflow-heading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    white-space: nowrap;
}

.run-workflow-heading svg {
    color: var(--color-running);
    flex: 0 0 auto;
}

.run-workflow-latest {
    color: var(--color-text-secondary);
    font-size: 0.86rem;
    line-height: 1.35;
    text-align: right;
}

.run-workflow-timeline {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 4px 14px 14px;
    list-style: none;
}

.workflow-step {
    position: relative;
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr) auto;
    gap: 10px;
    min-width: 0;
    padding: 9px 0;
}

.workflow-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 23px;
    bottom: -5px;
    left: 6px;
    width: 2px;
    background: var(--color-border);
}

.workflow-step-marker {
    position: relative;
    z-index: 1;
    width: 12px;
    height: 12px;
    margin-top: 4px;
    border: 2px solid var(--color-text-secondary);
    border-radius: 50%;
    background: var(--surface-subtle);
}

.workflow-step-active .workflow-step-marker {
    border-color: #38bdf8;
    background: #38bdf8;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.14);
}

.workflow-step-complete .workflow-step-marker,
.workflow-step-success .workflow-step-marker {
    border-color: #4ade80;
    background: #4ade80;
}

.workflow-step-failed .workflow-step-marker {
    border-color: #f87171;
    background: #f87171;
}

.workflow-step div {
    min-width: 0;
}

.workflow-step strong,
.workflow-step div span {
    display: block;
    line-height: 1.4;
}

.workflow-step strong {
    color: var(--color-text);
    font-size: 0.9rem;
}

.workflow-step div span,
.workflow-step time {
    color: var(--color-text-secondary);
    font-size: 0.8rem;
}

.workflow-step time {
    padding-top: 2px;
    font-family: var(--font-mono);
    white-space: nowrap;
}

.status-planned,
.status-approved,
.status-succeeded {
    color: #bbf7d0;
    border-color: rgba(74, 222, 128, 0.42);
    background: rgba(22, 163, 74, 0.12);
}

.status-plan-queued,
.status-apply-queued,
.status-needs-attention {
    color: #fde68a;
    border-color: rgba(251, 191, 36, 0.45);
    background: rgba(217, 119, 6, 0.12);
}

.run-title-link {
    color: inherit;
    text-decoration: none;
}

.run-title-link:hover {
    color: var(--color-link-hover);
}

.run-detail-back {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: -8px 0 14px;
    color: var(--color-link);
    font-weight: 700;
    text-decoration: none;
}

.run-detail-back:hover {
    color: var(--color-link-hover);
}

.run-detail-header {
    align-items: center;
    margin-bottom: 18px;
}

.run-detail-header .status-pill {
    flex: 0 0 auto;
}

.run-detail-overview,
.run-detail-panel {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--surface-raised);
}

.run-detail-overview {
    margin-bottom: 18px;
    padding: 16px 20px;
}

.run-detail-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px 20px;
    margin: 0;
}

.run-detail-facts div,
.run-context-list div {
    min-width: 0;
}

.run-detail-facts dt,
.run-context-list dt {
    margin-bottom: 5px;
    color: var(--color-text-secondary);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.run-detail-facts dd,
.run-context-list dd {
    margin: 0;
    color: var(--color-text);
    font-weight: 600;
}

.run-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 330px);
    gap: 18px;
    align-items: start;
    min-width: 0;
}

.run-detail-primary,
.run-detail-sidebar {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.run-detail-panel {
    min-width: 0;
    padding: 20px;
}

.run-detail-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.run-detail-panel-heading h2 {
    margin: 4px 0 2px;
}

.run-detail-panel-heading p {
    margin: 0;
    color: var(--color-text-secondary);
}

.live-state,
.stream-state,
.event-count {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #bae6fd;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.live-state > span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #38bdf8;
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.45);
    animation: live-run-pulse 1.8s ease-out infinite;
}

.live-state.is-complete {
    color: #bbf7d0;
}

.live-state.is-complete > span {
    background: #4ade80;
    animation: none;
}

.stream-state,
.event-count {
    flex: 0 0 auto;
    padding-top: 3px;
    color: var(--color-text-secondary);
}

@keyframes live-run-pulse {
    0% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.4); }
    70%, 100% { box-shadow: 0 0 0 7px rgba(56, 189, 248, 0); }
}

.run-detail-timeline {
    display: grid;
    margin: 0;
    padding: 0;
    list-style: none;
}

.run-detail-timeline .workflow-step {
    padding: 11px 0;
}

.workflow-step-active .workflow-step-marker {
    animation: active-step-pulse 1.8s ease-in-out infinite;
}

@keyframes active-step-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.11); }
    50% { box-shadow: 0 0 0 7px rgba(56, 189, 248, 0.2); }
}

.run-event-stream {
    max-height: 440px;
    margin: 0;
    padding: 0;
    overflow: auto;
    border: 1px solid rgba(51, 65, 85, 0.82);
    border-radius: var(--radius-sm);
    background: #030712;
    list-style: none;
}

.run-event-row {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr) minmax(150px, 210px);
    gap: 14px;
    min-width: 0;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(36, 50, 74, 0.72);
}

.run-event-row:last-child {
    border-bottom: 0;
}

.run-event-row.is-new {
    animation: run-event-arrival 280ms ease-out both;
}

@keyframes run-event-arrival {
    from { opacity: 0; transform: translateY(5px); background: rgba(56, 189, 248, 0.08); }
    to { opacity: 1; transform: translateY(0); background: transparent; }
}

.run-event-row time,
.run-event-row code {
    color: #7f8ea5;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.45;
}

.run-event-row div {
    min-width: 0;
}

.run-event-row strong,
.run-event-row div span {
    display: block;
    line-height: 1.42;
}

.run-event-row strong {
    color: var(--color-text);
    font-size: 0.86rem;
}

.run-event-row div span {
    margin-top: 2px;
    color: var(--color-text-secondary);
    font-size: 0.8rem;
}

.run-event-row code {
    overflow-wrap: anywhere;
    text-align: right;
}

.run-output-note {
    margin: 12px 0 0;
    color: var(--color-text-secondary);
    font-size: 0.8rem;
    line-height: 1.5;
}

.resource-result-summary {
    max-width: min(100%, 520px);
    color: var(--color-text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.45;
    text-align: right;
}

.run-diagnostics:empty {
    display: none;
}

.run-diagnostics {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

.run-diagnostic {
    min-width: 0;
    padding: 13px 14px;
    border: 1px solid rgba(248, 113, 113, 0.42);
    border-left: 3px solid #f87171;
    border-radius: var(--radius-sm);
    background: rgba(127, 29, 29, 0.14);
}

.run-diagnostic-warning {
    border-color: rgba(251, 191, 36, 0.4);
    border-left-color: #fbbf24;
    background: rgba(120, 53, 15, 0.13);
}

.run-diagnostic.is-new {
    animation: run-event-arrival 280ms ease-out both;
}

.run-diagnostic div {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
}

.run-diagnostic div span {
    flex: 0 0 auto;
    color: #fca5a5;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.run-diagnostic-warning div span {
    color: #fcd34d;
}

.run-diagnostic strong {
    min-width: 0;
    color: var(--color-text);
    font-size: 0.88rem;
    overflow-wrap: anywhere;
}

.run-diagnostic code,
.run-diagnostic p {
    display: block;
    margin: 8px 0 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.run-diagnostic code {
    color: #cbd5e1;
    font-size: 0.76rem;
}

.run-diagnostic p {
    color: var(--color-text-secondary);
    font-size: 0.8rem;
    line-height: 1.55;
}

.resource-result-list {
    display: grid;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(51, 65, 85, 0.82);
    border-radius: var(--radius-sm);
    background: #070b14;
    list-style: none;
    overflow: hidden;
}

.resource-result-row {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) minmax(76px, auto) minmax(92px, auto);
    gap: 12px;
    align-items: center;
    min-width: 0;
    padding: 13px 14px;
    border-bottom: 1px solid rgba(36, 50, 74, 0.72);
}

.resource-result-row:last-child {
    border-bottom: 0;
}

.resource-state-marker {
    width: 9px;
    height: 9px;
    border: 2px solid #64748b;
    border-radius: 50%;
}

.resource-state-succeeded .resource-state-marker,
.resource-state-unchanged .resource-state-marker {
    border-color: #4ade80;
    background: #4ade80;
}

.resource-state-failed .resource-state-marker {
    border-color: #f87171;
    background: #f87171;
    border-radius: 2px;
}

.resource-state-running .resource-state-marker {
    border-color: #38bdf8;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.13);
    animation: active-step-pulse 1.8s ease-in-out infinite;
}

.resource-state-not-started .resource-state-marker {
    border-style: dashed;
}

.resource-result-identity {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.resource-result-identity code {
    color: #e2e8f0;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.resource-result-identity > span {
    color: var(--color-text-secondary);
    font-size: 0.73rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.resource-result-identity .resource-result-id {
    color: #94a3b8;
    font-family: var(--font-mono);
}

.resource-action {
    justify-self: end;
    padding: 4px 7px;
    border: 1px solid rgba(100, 116, 139, 0.52);
    border-radius: 999px;
    color: #cbd5e1;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.035em;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
}

.resource-action-create { border-color: rgba(74, 222, 128, 0.4); color: #86efac; }
.resource-action-update,
.resource-action-read { border-color: rgba(56, 189, 248, 0.42); color: #7dd3fc; }
.resource-action-delete,
.resource-action-replace { border-color: rgba(248, 113, 113, 0.45); color: #fca5a5; }

.resource-result-state {
    display: grid;
    justify-items: end;
    gap: 2px;
    min-width: 0;
}

.resource-result-state strong {
    color: var(--color-text);
    font-size: 0.76rem;
    white-space: nowrap;
}

.resource-state-failed .resource-result-state strong { color: #fca5a5; }
.resource-state-succeeded .resource-result-state strong { color: #86efac; }
.resource-state-running .resource-result-state strong { color: #7dd3fc; }

.resource-result-state span {
    color: var(--color-text-secondary);
    font-family: var(--font-mono);
    font-size: 0.7rem;
}

.run-change-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.run-change-grid div {
    display: grid;
    gap: 3px;
    padding: 13px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--surface-subtle);
}

.run-change-grid strong {
    color: var(--color-text);
    font-size: 1.35rem;
}

.run-change-grid span {
    color: var(--color-text-secondary);
    font-size: 0.78rem;
}

.run-detail-sidebar .control-plane-panel {
    position: static;
}

.run-detail-actions,
.run-detail-actions form {
    display: grid;
    gap: 10px;
    margin: 0;
}

.run-detail-actions .btn {
    width: 100%;
}

.run-action-state {
    display: block;
    padding: 11px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
    background: var(--surface-subtle);
    font-size: 0.86rem;
    line-height: 1.4;
}

.run-context-list {
    display: grid;
    gap: 0;
    margin: 14px 0 0;
}

.run-context-list div {
    display: grid;
    grid-template-columns: minmax(90px, 0.8fr) minmax(0, 1.2fr);
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    border-top: 1px solid var(--color-border);
}

.run-context-list dt {
    margin: 0;
}

.run-context-list dd {
    text-align: right;
    overflow-wrap: anywhere;
}

.run-input-list div {
    display: block;
}

.run-input-list dd {
    margin-top: 7px;
    text-align: left;
}

.run-input-list code {
    display: block;
    color: #cbd5e1;
    font-size: 0.75rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.run-audit-list {
    display: grid;
    gap: 0;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

.run-audit-list li {
    display: grid;
    gap: 4px;
    padding: 10px 0;
    border-top: 1px solid var(--color-border);
}

.run-audit-list code {
    color: var(--color-text);
    font-size: 0.76rem;
    overflow-wrap: anywhere;
}

.run-audit-list time {
    color: var(--color-text-secondary);
    font-size: 0.76rem;
}

@media (max-width: 960px) {
    .run-detail-grid {
        grid-template-columns: 1fr;
    }

    .run-detail-sidebar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .run-card-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .run-facts {
        grid-template-columns: 1fr;
    }

    .run-workflow summary {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .run-workflow-latest {
        padding-left: 26px;
        text-align: left;
    }

    .workflow-step {
        grid-template-columns: 14px minmax(0, 1fr);
    }

    .workflow-step time {
        grid-column: 2;
    }

    .run-detail-header {
        align-items: flex-start;
    }

    .run-detail-facts,
    .run-change-grid,
    .run-detail-sidebar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .run-detail-panel,
    .run-detail-overview {
        padding: 15px;
    }

    .run-detail-panel-heading {
        display: grid;
        gap: 8px;
    }

    .run-event-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 5px;
        padding: 11px;
    }

    .run-event-row time,
    .run-event-row code {
        grid-column: 1;
        text-align: left;
    }

    .resource-result-summary {
        text-align: left;
    }

    .resource-result-row {
        grid-template-columns: 12px minmax(0, 1fr) auto;
        gap: 9px;
        padding: 12px 11px;
    }

    .resource-action {
        align-self: start;
    }

    .resource-result-state {
        grid-column: 2 / -1;
        grid-row: 2;
        display: flex;
        justify-content: flex-start;
        gap: 8px;
    }

    .run-diagnostic div {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .run-detail-sidebar .control-plane-panel {
        grid-column: 1 / -1;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* Drift and infrastructure health */
.operations-switchers {
    display: flex;
    align-items: end;
    gap: 12px;
    flex-wrap: wrap;
}

.operations-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.operations-summary > div {
    min-width: 0;
    padding: 16px 18px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg-secondary);
}

.operations-summary span,
.operations-summary strong {
    display: block;
}

.operations-summary span {
    color: var(--color-text-secondary);
    font-size: 0.78rem;
}

.operations-summary strong {
    margin-top: 5px;
    color: var(--color-text);
    font-family: var(--font-mono);
    font-size: 1.15rem;
}

.operations-card-list {
    display: grid;
    gap: 12px;
}

.operation-card {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--surface-subtle);
}

.operation-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.operation-card h3 {
    margin: 8px 0 0;
    overflow-wrap: anywhere;
    color: var(--color-text);
    font-family: var(--font-mono);
    font-size: 0.95rem;
}

.operation-card p {
    margin: 12px 0 0;
    color: var(--color-text-secondary);
    line-height: 1.55;
}

.operation-card form {
    margin-top: 14px;
}

.operation-target code {
    white-space: normal;
    overflow-wrap: anywhere;
}

.operations-history-heading {
    margin-top: 30px;
}

.responsive-table {
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.operations-table {
    width: 100%;
    min-width: 580px;
    border-collapse: collapse;
}

.operations-table th,
.operations-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.operations-table th {
    color: var(--color-text-secondary);
    background: rgba(15, 23, 42, 0.65);
    font-size: 0.76rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.operations-table td {
    color: var(--color-text);
    font-size: 0.88rem;
}

.operations-table tbody tr:last-child td {
    border-bottom: 0;
}

.checkbox-row {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-text);
}

.checkbox-row input {
    width: 20px;
    height: 20px;
}

.inline-notice {
    padding: 16px;
    border: 1px solid rgba(56, 189, 248, 0.28);
    border-radius: var(--radius-md);
    background: rgba(14, 165, 233, 0.08);
}

.inline-notice p {
    color: var(--color-text-secondary);
}

.status-critical,
.status-high,
.status-unhealthy,
.status-error,
.status-drifted,
.status-failed {
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.45);
    background: rgba(220, 38, 38, 0.12);
}

.status-medium,
.status-update,
.status-replace {
    color: #fde68a;
    border-color: rgba(251, 191, 36, 0.45);
    background: rgba(217, 119, 6, 0.12);
}

.status-healthy,
.status-clean {
    color: #bbf7d0;
    border-color: rgba(74, 222, 128, 0.42);
    background: rgba(22, 163, 74, 0.12);
}

.status-queued,
.status-leased {
    color: #bae6fd;
    border-color: rgba(56, 189, 248, 0.42);
    background: rgba(14, 165, 233, 0.12);
}

.status-cancelled {
    color: var(--color-text-secondary);
    border-color: var(--color-border);
    background: rgba(100, 116, 139, 0.12);
}

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

.policy-flow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
    padding: 18px 20px;
    border: 1px solid rgba(56, 189, 248, 0.28);
    border-radius: var(--radius-md);
    background: rgba(14, 165, 233, 0.07);
}

.policy-flow h2,
.policy-flow p {
    margin: 6px 0 0;
}

.policy-flow h2 {
    font-size: 1rem;
}

.policy-flow p {
    max-width: 68ch;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    line-height: 1.55;
}

.policy-layout {
    grid-template-columns: minmax(0, 2fr) minmax(280px, 0.72fr);
}

.policy-set-list {
    display: grid;
    gap: 18px;
}

.policy-set-card {
    scroll-margin-top: 92px;
    min-width: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--surface-subtle);
    overflow: hidden;
}

.policy-set-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 20px;
    background: rgba(15, 23, 42, 0.48);
}

.policy-set-heading h3,
.policy-set-heading p {
    margin: 7px 0 0;
}

.policy-set-heading p {
    max-width: 68ch;
    color: var(--color-text-secondary);
    line-height: 1.55;
}

.policy-subsection {
    min-width: 0;
    padding: 20px;
    border-top: 1px solid var(--color-border);
}

.policy-subsection-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.policy-subsection-heading h4,
.policy-subsection-heading span {
    margin: 0;
}

.policy-subsection-heading span,
.policy-muted {
    color: var(--color-text-secondary);
    font-size: 0.84rem;
}

.policy-version-table-wrap {
    min-width: 0;
}

.policy-version-table {
    min-width: 780px;
}

.policy-version-table th[scope="row"] {
    color: var(--color-text);
    font-family: var(--font-mono);
    white-space: nowrap;
}

.policy-version-table td small {
    display: block;
    max-width: 220px;
    margin-top: 6px;
    color: var(--color-text-secondary);
    overflow-wrap: anywhere;
}

.policy-version-actions {
    min-width: 178px;
}

.policy-version-actions form {
    margin: 0;
}

.policy-validation-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.policy-validation-form select,
.policy-binding-form select,
.stacked-form textarea {
    min-height: 44px;
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg-secondary);
    color: var(--color-text);
    font: inherit;
    padding: 10px 12px;
}

.policy-validation-form select {
    min-width: 112px;
    max-width: 180px;
}

.policy-validation-form select:focus-visible,
.policy-binding-form select:focus-visible,
.stacked-form textarea:focus-visible {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
    outline: 0;
}

.stacked-form textarea {
    resize: vertical;
}

.policy-editor {
    margin-top: 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg);
}

.policy-editor summary {
    min-height: 46px;
    display: flex;
    align-items: center;
    padding: 11px 14px;
    color: var(--color-link);
    cursor: pointer;
    font-weight: 700;
}

.policy-editor[open] summary {
    border-bottom: 1px solid var(--color-border);
}

.policy-editor .stacked-form {
    padding: 18px;
}

.policy-editor textarea {
    min-height: 230px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.55;
    tab-size: 2;
}

.policy-binding-list {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.policy-binding-list li {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid var(--color-border);
    padding: 10px 0;
}

.policy-binding-list li > div {
    display: grid;
    min-width: 0;
}

.policy-binding-list li > div span {
    color: var(--color-text-secondary);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    overflow-wrap: anywhere;
}

.policy-binding-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
    margin-top: 16px;
}

.policy-binding-form .form-group {
    margin: 0;
}

.policy-binding-form label {
    display: block;
    margin-bottom: 6px;
    color: var(--color-text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

@media (max-width: 960px) {
    .policy-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .operations-switchers,
    .operation-card-heading,
    .policy-flow,
    .policy-set-heading,
    .policy-binding-list li {
        align-items: stretch;
        flex-direction: column;
    }

    .operations-summary {
        grid-template-columns: 1fr;
    }

    .policy-binding-form {
        grid-template-columns: 1fr;
    }
}

/* Cross-page density and responsive polish */
.health-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.run-fact-workspace dd {
    font-weight: 600;
}

@media (max-width: 1100px) and (min-width: 961px) {
    .runner-pool-card {
        grid-template-columns: minmax(0, 1fr);
    }

    .runner-pool-actions,
    .runner-diagnostic-history {
        grid-column: 1;
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    body.primary-navigation-open {
        overflow: hidden;
    }

    .nav-links.is-open {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .main-content {
        padding-top: 22px;
        padding-bottom: 40px;
    }

    .page-header {
        gap: 16px;
        margin-bottom: 22px;
    }

    .page-header h1,
    .actions-title h1 {
        font-size: clamp(1.55rem, 9vw, 1.9rem);
    }

    .page-summary,
    .actions-subtitle {
        margin-top: 7px;
        font-size: 0.92rem;
        line-height: 1.5;
    }

    .control-plane-main,
    .control-plane-panel,
    .overview-panel,
    .overview-workspaces {
        padding: 16px;
    }

    .control-plane-grid {
        gap: 16px;
    }

    .section-heading-row {
        gap: 10px;
        margin-bottom: 16px;
    }

    .team-section-nav {
        margin-top: -4px;
        overflow-x: auto;
    }

    .team-section-nav a {
        flex: 1 0 auto;
        justify-content: center;
    }

    .runner-pool-card {
        grid-template-columns: minmax(0, 1fr);
        padding: 14px;
    }

    .runner-pool-actions,
    .runner-diagnostic-history {
        grid-column: 1;
    }

    .runner-pool-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .runner-pool-actions form,
    .runner-pool-actions .btn {
        width: 100%;
    }

    .audit-toolbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
    }

    .audit-toolbar > div {
        grid-column: 1 / -1;
    }

    .audit-list li {
        padding: 10px 0;
    }

    .audit-action {
        font-size: 0.82rem;
    }

    .overview-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .overview-stat-card {
        min-height: 112px;
        grid-template-columns: 32px minmax(0, 1fr);
        gap: 9px;
        padding: 13px;
    }

    .overview-stat-icon {
        width: 32px;
        height: 32px;
    }

    .overview-stat-icon svg {
        width: 18px;
        height: 18px;
    }

    .overview-stat-copy strong {
        margin: 5px 0 0;
        font-size: 1.65rem;
    }

    .overview-stat-copy > span:last-child,
    .overview-stat-arrow {
        display: none;
    }

    .overview-run-list,
    .overview-panel-empty {
        margin-right: -16px;
        margin-left: -16px;
    }

    .overview-run-row {
        padding-right: 16px;
        padding-left: 16px;
    }

    .run-card-list {
        gap: 12px;
    }

    .run-card {
        padding: 14px;
    }

    .run-card-heading {
        align-items: flex-start;
        flex-direction: row;
    }

    .run-card-heading h3 {
        margin-top: 6px;
        font-size: 1rem;
    }

    .run-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px 12px;
        margin: 14px 0;
    }

    .run-fact-workspace {
        grid-column: 1 / -1;
    }

    .plan-summary {
        gap: 7px 10px;
        padding: 10px;
        font-size: 0.82rem;
    }

    .run-workflow {
        margin-top: 12px;
    }

    .health-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* --- Review polish (2026-10-13) ------------------------------------------- */

/* Toasts: a quiet fade-and-rise instead of a bouncing slide from off-screen. */
.toast {
    transform: translateY(8px);
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.toast-show {
    transform: translateY(0);
}

.toast-hide {
    transform: translateY(8px);
}

/* Plan summary chips on the runs list: only non-zero actions, colour-coded. */
.plan-summary {
    gap: 8px;
    padding: 10px 12px;
}

.plan-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 28px;
    padding: 3px 10px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    font-size: 0.82rem;
    color: var(--color-text-secondary);
    background: rgba(15, 23, 42, 0.6);
}

.plan-chip strong {
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}

.plan-chip-total {
    color: var(--color-text);
    border-color: rgba(148, 163, 184, 0.45);
}

.plan-chip-create { color: #86efac; border-color: rgba(34, 197, 94, 0.45); background: rgba(34, 197, 94, 0.1); }
.plan-chip-update { color: #fcd34d; border-color: rgba(245, 158, 11, 0.45); background: rgba(245, 158, 11, 0.1); }
.plan-chip-replace { color: #c4b5fd; border-color: rgba(139, 92, 246, 0.45); background: rgba(139, 92, 246, 0.12); }
.plan-chip-delete { color: #fca5a5; border-color: rgba(239, 68, 68, 0.45); background: rgba(239, 68, 68, 0.1); }

.plan-chip-create strong,
.plan-chip-update strong,
.plan-chip-replace strong,
.plan-chip-delete strong {
    color: inherit;
}

.plan-chip-muted {
    opacity: 0.75;
}

/* Run detail change tiles: zero counts recede, the total leads. */
.run-change-grid .is-zero strong {
    color: var(--color-text-secondary);
}

.run-change-grid .run-change-total-changed strong {
    color: #e0f2fe;
}

/* Audit trail: readable label first, machine action second. */
.audit-action {
    display: grid;
    gap: 2px;
    font-family: inherit;
}

.audit-action code,
.audit-resource code {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--color-text-secondary);
}

.audit-resource-type {
    text-transform: capitalize;
}

/* Scroll regions contain their positioned descendants (an absolutely placed
   visually-hidden label inside a scrolling table was widening the document on
   phones instead of staying inside the region). */
.responsive-table {
    position: relative;
}

/* Native form controls pick up the brand accent. */
input[type="checkbox"],
input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--color-primary);
}

/* The run-actions fallback is a status line, not a disabled input. */
.run-action-state {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 2px 0;
    border: 0;
    background: transparent;
}

.run-action-state::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-text-secondary);
    flex: 0 0 auto;
}

/* Data tables become stacked cards on phones; each cell carries its header. */
@media (max-width: 640px) {
    .responsive-table {
        overflow: visible;
        border: 0;
        border-radius: 0;
    }

    .operations-table,
    .operations-table tbody,
    .operations-table tr {
        display: block;
        min-width: 0;
        width: 100%;
    }

    .operations-table thead {
        display: none;
    }

    .operations-table tr {
        margin-bottom: 10px;
        padding: 4px 14px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-md);
        background: rgba(15, 23, 42, 0.42);
    }

    .operations-table tr:last-child {
        margin-bottom: 0;
    }

    .operations-table th[scope="row"],
    .operations-table td {
        display: grid;
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 12px;
        align-items: start;
        padding: 10px 0;
        border-bottom: 1px solid rgba(51, 65, 85, 0.5);
        text-align: left;
    }

    .operations-table tr > :last-child {
        border-bottom: 0;
    }

    .operations-table th[scope="row"] {
        grid-template-columns: minmax(0, 1fr);
        font-size: 0.95rem;
        font-weight: 700;
    }

    .operations-table td::before {
        content: attr(data-label);
        padding-top: 3px;
        color: var(--color-text-secondary);
        font-size: 0.72rem;
        font-weight: 600;
        letter-spacing: 0.05em;
        text-transform: uppercase;
    }

    .operations-table td > * {
        grid-column: 2;
        min-width: 0;
    }

    .operations-table td code,
    .operations-table td small {
        overflow-wrap: anywhere;
    }

    .policy-validation-form {
        flex-wrap: wrap;
    }
}

/* --- Execution steps with streamed logs (run detail) ----------------------- */
.run-panel-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.exec-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.exec-step details {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.42);
    overflow: hidden;
}

.exec-step summary {
    display: grid;
    grid-template-columns: 22px auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 8px 14px;
    cursor: pointer;
    list-style: none;
    color: var(--color-text);
    font-size: 0.92rem;
    transition: background-color 0.15s ease;
}

.exec-step summary::-webkit-details-marker {
    display: none;
}

.exec-step summary:hover {
    background: rgba(148, 163, 184, 0.06);
}

.exec-step summary:focus-visible {
    outline: 2px solid #7dd3fc;
    outline-offset: -2px;
}

.exec-step-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid rgba(148, 163, 184, 0.45);
    color: #0b1220;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

.exec-step-success .exec-step-icon {
    border-color: #22c55e;
    background: #22c55e;
}

.exec-step-success .exec-step-icon::before {
    content: "\2713";
}

.exec-step-failed .exec-step-icon {
    border-color: #ef4444;
    background: #ef4444;
}

.exec-step-failed .exec-step-icon::before,
.exec-step-cancelled .exec-step-icon::before {
    content: "\2715";
}

.exec-step-cancelled .exec-step-icon {
    border-color: #f59e0b;
    background: #f59e0b;
}

.exec-step-active .exec-step-icon {
    border-color: rgba(56, 189, 248, 0.35);
    border-top-color: #38bdf8;
    animation: exec-step-spin 0.9s linear infinite;
}

.exec-step-skipped .exec-step-icon {
    border-style: dashed;
    opacity: 0.6;
}

@keyframes exec-step-spin {
    to { transform: rotate(360deg); }
}

.exec-step-phase {
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.exec-step-label {
    min-width: 0;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.exec-step-skipped .exec-step-label,
.exec-step-pending .exec-step-label {
    color: var(--color-text-secondary);
    font-weight: 500;
}

.exec-step-meta {
    display: inline-flex;
    gap: 14px;
    color: var(--color-text-secondary);
    font-family: var(--font-mono);
    font-size: 0.74rem;
    white-space: nowrap;
}

.exec-log-wrap {
    max-height: 440px;
    overflow: auto;
    border-top: 1px solid var(--color-border);
    background: #05080f;
}

.exec-log {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}

.exec-log li {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
    padding: 0 14px 0 0;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.6;
}

.exec-log li:hover {
    background: rgba(148, 163, 184, 0.06);
}

.exec-log-no {
    text-align: right;
    color: rgba(148, 163, 184, 0.55);
    user-select: none;
}

.exec-log-text {
    color: #cbd5e1;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.exec-log-empty,
.exec-log-truncated,
.exec-steps-empty {
    margin: 0;
    padding: 12px 14px;
    color: var(--color-text-secondary);
    font-size: 0.84rem;
}

.exec-log-truncated {
    border-top: 1px dashed var(--color-border);
    color: #fcd34d;
}

.run-events-details > summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    cursor: pointer;
    list-style: none;
}

.run-events-details > summary::-webkit-details-marker {
    display: none;
}

.run-events-details > summary h2::before {
    content: "\25B8";
    display: inline-block;
    margin-right: 8px;
    color: var(--color-text-secondary);
    transition: transform 0.15s ease;
}

.run-events-details[open] > summary h2::before {
    transform: rotate(90deg);
}

.run-events-details > summary p {
    margin: 4px 0 0;
}

.run-events-details .run-event-stream {
    margin-top: 16px;
}

@media (max-width: 640px) {
    .exec-step summary {
        grid-template-columns: 22px minmax(0, 1fr);
        row-gap: 4px;
    }

    .exec-step-icon {
        grid-row: 1;
    }

    .exec-step-phase,
    .exec-step-label,
    .exec-step-meta {
        grid-column: 2;
    }

    .exec-step-phase {
        justify-self: start;
    }

    .exec-log li {
        grid-template-columns: 40px minmax(0, 1fr);
        gap: 8px;
    }
}

/* --- Runner presence (Team → Runner pools) --------------------------------- */
.runner-list {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    margin-top: 6px;
    padding-top: 14px;
    border-top: 1px solid var(--color-border);
}

.runner-list-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.runner-list-summary {
    color: var(--color-text-secondary);
    font-size: 0.82rem;
}

.runner-rows {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
}

.runner-row {
    display: grid;
    grid-template-columns: 12px minmax(140px, 1fr) auto minmax(160px, 1.2fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: rgba(15, 23, 42, 0.42);
    font-size: 0.86rem;
}

.runner-identity {
    display: grid;
    min-width: 0;
}

.runner-identity strong {
    overflow-wrap: anywhere;
}

.runner-meta,
.runner-activity,
.runner-seen {
    color: var(--color-text-secondary);
    font-size: 0.78rem;
}

.runner-activity code {
    font-family: var(--font-mono);
    font-size: 0.74rem;
}

.runner-seen {
    white-space: nowrap;
    font-family: var(--font-mono);
}

.runner-presence-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #64748b;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
}

.runner-state-online .runner-presence-dot {
    background: #22c55e;
    animation: runner-pulse 2.4s ease-out infinite;
}

.runner-state-stale .runner-presence-dot {
    background: #f59e0b;
}

.runner-state-offline .runner-presence-dot {
    background: #ef4444;
}

.runner-state-disabled .runner-presence-dot {
    background: #475569;
}

@keyframes runner-pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45); }
    70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.runner-presence-pill {
    text-transform: capitalize;
}

.runner-presence-online { color: #86efac; border-color: rgba(34, 197, 94, 0.45); background: rgba(34, 197, 94, 0.1); }
.runner-presence-stale { color: #fcd34d; border-color: rgba(245, 158, 11, 0.45); background: rgba(245, 158, 11, 0.1); }
.runner-presence-offline { color: #fca5a5; border-color: rgba(239, 68, 68, 0.45); background: rgba(239, 68, 68, 0.1); }
.runner-presence-disabled { color: var(--color-text-secondary); }

.runner-list-empty {
    margin: 0;
    padding: 12px 14px;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
    font-size: 0.84rem;
}

@media (max-width: 640px) {
    .runner-row {
        grid-template-columns: 12px minmax(0, 1fr) auto;
    }

    .runner-activity,
    .runner-seen {
        grid-column: 2 / -1;
    }
}

/* Native disclosure markers are replaced by the step icon and heading chevron. */
.exec-step summary::marker,
.run-events-details > summary::marker {
    content: "";
    display: none;
}

/* The global details > summary::before chevron would occupy a grid column. */
.exec-step summary::before,
.run-events-details > summary::before {
    content: none;
    display: none;
}

/* --- GitHub push trigger (Workspaces) and run trigger badge ---------------- */
.push-trigger {
    grid-column: 1 / -1;
    flex-basis: 100%;
    width: 100%;
    min-width: 0;
    margin-top: 6px;
    padding-top: 14px;
    border-top: 1px solid var(--color-border);
    display: grid;
    gap: 10px;
}

.push-trigger-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.push-trigger-summary,
.push-trigger-empty {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: 0.86rem;
    line-height: 1.5;
}

.push-trigger-summary code,
.push-trigger-url code,
.push-trigger-enable code {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--color-text);
}

.push-trigger-url {
    margin: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: baseline;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

.push-trigger-url code {
    overflow-wrap: anywhere;
}

.push-delivery-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
}

.push-delivery {
    display: grid;
    grid-template-columns: 10px auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    color: var(--color-text-secondary);
}

.push-delivery-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #64748b;
}

.push-delivery-queued .push-delivery-dot { background: #22c55e; }
.push-delivery-error .push-delivery-dot { background: #ef4444; }
.push-delivery-ping .push-delivery-dot { background: #38bdf8; }

.push-delivery-outcome {
    color: var(--color-text);
    white-space: nowrap;
}

.push-delivery-detail {
    min-width: 0;
    overflow-wrap: anywhere;
}

.push-delivery time {
    white-space: nowrap;
    font-family: var(--font-mono);
    font-size: 0.74rem;
}

.push-trigger-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.push-trigger-enable {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 10px;
    align-items: center;
}

.push-trigger-enable label {
    grid-column: 1 / -1;
    color: var(--color-text-secondary);
    font-size: 0.84rem;
}

.push-trigger-enable select {
    min-height: 40px;
}

.hook-reveal-panel {
    margin-bottom: 16px;
}

.hook-reveal-fields {
    display: grid;
    gap: 10px;
    margin: 12px 0 0;
}

.hook-reveal-fields div {
    display: grid;
    gap: 4px;
}

.hook-reveal-fields dt {
    color: var(--color-text-secondary);
    font-size: 0.74rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hook-reveal-fields code {
    display: block;
    overflow-wrap: anywhere;
    font-family: var(--font-mono);
    font-size: 0.82rem;
}

.run-card-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.trigger-badge {
    padding: 3px 9px;
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 999px;
    color: #7dd3fc;
    background: rgba(14, 165, 233, 0.1);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.muted-note {
    color: var(--color-text-secondary);
    font-size: 0.82rem;
}

@media (max-width: 640px) {
    .push-delivery {
        grid-template-columns: 10px minmax(0, 1fr);
    }

    .push-delivery-detail,
    .push-delivery time {
        grid-column: 2;
    }

    .push-trigger-enable {
        grid-template-columns: 1fr;
    }
}

/* Workspace cards wrap so the push-trigger block takes its own full row;
   below 641px the card is already a single column. */
@media (min-width: 641px) {
    .resource-card-workspace {
        flex-wrap: wrap;
    }
}

/* Phone: delivery labels wrap and the trigger block never dictates card width. */
.push-trigger,
.push-trigger > *,
.push-delivery,
.push-delivery > * {
    min-width: 0;
}

@media (max-width: 640px) {
    .push-delivery-outcome,
    .push-delivery time {
        white-space: normal;
    }

    .push-trigger-url {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .push-trigger-enable select,
    .push-trigger-enable button {
        width: 100%;
    }
}

/* --- Policy checks on the run page ------------------------------------------ */
.policy-gate {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.policy-gate-open { color: #86efac; border: 1px solid rgba(34, 197, 94, 0.45); background: rgba(34, 197, 94, 0.1); }
.policy-gate-closed { color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.45); background: rgba(239, 68, 68, 0.1); }

.policy-check-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.policy-check {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.42);
    padding: 12px 14px;
}

.policy-check-heading {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}

.policy-check-identity {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.policy-check-identity span {
    color: var(--color-text-secondary);
    font-size: 0.8rem;
    overflow-wrap: anywhere;
}

.policy-check-icon {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #64748b;
}

.policy-check-passed .policy-check-icon { background: #22c55e; }
.policy-check-warned .policy-check-icon { background: #f59e0b; }
.policy-check-denied .policy-check-icon,
.policy-check-failed .policy-check-icon,
.policy-check-no_active_version .policy-check-icon { background: #ef4444; }
.policy-check-queued .policy-check-icon { background: #38bdf8; animation: runner-pulse 2.4s ease-out infinite; }

.policy-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    color: var(--color-text-secondary);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.policy-pill-passed { color: #86efac; border-color: rgba(34, 197, 94, 0.45); background: rgba(34, 197, 94, 0.1); }
.policy-pill-warned { color: #fcd34d; border-color: rgba(245, 158, 11, 0.45); background: rgba(245, 158, 11, 0.1); }
.policy-pill-denied,
.policy-pill-failed,
.policy-pill-no_active_version { color: #fca5a5; border-color: rgba(239, 68, 68, 0.45); background: rgba(239, 68, 68, 0.1); }
.policy-pill-queued { color: #7dd3fc; border-color: rgba(56, 189, 248, 0.45); background: rgba(14, 165, 233, 0.1); }

.policy-check-note {
    margin: 10px 0 0 26px;
    color: var(--color-text-secondary);
    font-size: 0.84rem;
}

.policy-finding-list {
    list-style: none;
    margin: 12px 0 0 26px;
    padding: 0;
    display: grid;
    gap: 8px;
}

.policy-finding {
    padding: 10px 12px;
    border-left: 3px solid #64748b;
    border-radius: 6px;
    background: rgba(2, 6, 23, 0.55);
}

.policy-finding-deny { border-left-color: #ef4444; }
.policy-finding-warn { border-left-color: #f59e0b; }
.policy-finding-info { border-left-color: #38bdf8; }

.policy-finding-heading {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.policy-level {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.policy-finding-deny .policy-level { color: #fca5a5; }
.policy-finding-warn .policy-level { color: #fcd34d; }
.policy-finding-info .policy-level { color: #7dd3fc; }

.policy-finding-heading code,
.policy-addresses code {
    font-family: var(--font-mono);
    font-size: 0.78rem;
}

.policy-excepted {
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(34, 197, 94, 0.45);
    color: #86efac;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.policy-finding p {
    margin: 6px 0 0;
    font-size: 0.86rem;
    line-height: 1.5;
}

.policy-remediation {
    color: var(--color-text-secondary);
}

.policy-addresses {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.policy-addresses code {
    padding: 2px 6px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
}

.policy-exception {
    margin-top: 10px;
}

.policy-exception summary {
    cursor: pointer;
    color: var(--color-link);
    font-size: 0.82rem;
}

.policy-exception-form {
    display: grid;
    gap: 6px;
    margin-top: 8px;
    max-width: 520px;
}

.policy-exception-form label {
    color: var(--color-text-secondary);
    font-size: 0.76rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.policy-exception-form textarea,
.policy-exception-form select {
    width: 100%;
}

.policy-evaluate-form {
    margin-top: 12px;
}

.run-action-blocked {
    color: #fca5a5;
}

.run-action-blocked::before {
    background: #ef4444;
}

/* --- Notifications and approval policy ---------------------------------------- */
.notification-section {
    margin-top: 28px;
}

.notification-channel-list,
.notification-delivery-list {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.notification-channel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: rgba(15, 23, 42, 0.42);
}

.notification-channel.is-disabled {
    opacity: 0.7;
}

.notification-channel-identity {
    display: grid;
    gap: 2px;
    min-width: 0;
    font-size: 0.86rem;
}

.notification-channel-identity code {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    overflow-wrap: anywhere;
}

.notification-channel-identity span {
    color: var(--color-text-secondary);
    font-size: 0.78rem;
}

.notification-channel-actions {
    display: flex;
    gap: 6px;
}

.notification-delivery {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    color: var(--color-text-secondary);
}

.notification-delivery-subject {
    color: var(--color-text);
    min-width: 0;
    overflow-wrap: anywhere;
}

.notification-delivery-state {
    text-transform: capitalize;
}

.notification-delivery-sent .push-delivery-dot { background: #22c55e; }
.notification-delivery-failed .push-delivery-dot { background: #ef4444; }
.notification-delivery-queued .push-delivery-dot { background: #38bdf8; }

.notification-delivery time {
    white-space: nowrap;
    font-family: var(--font-mono);
    font-size: 0.74rem;
}

.panel-subsection {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-border);
}

.checkbox-group {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    display: grid;
    gap: 4px;
}

.checkbox-group legend {
    padding: 0 4px;
    color: var(--color-text-secondary);
    font-size: 0.76rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.approval-policy {
    grid-column: 1 / -1;
    flex-basis: 100%;
    width: 100%;
    min-width: 0;
    margin-top: 6px;
    padding-top: 14px;
    border-top: 1px solid var(--color-border);
    display: grid;
    gap: 10px;
}

.approval-policy-form {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 12px;
    font-size: 0.84rem;
}

.approval-policy-form label {
    color: var(--color-text-secondary);
}

.approval-policy-form select {
    min-height: 36px;
}

.approval-progress {
    margin: 0 0 8px;
    color: var(--color-text-secondary);
    font-size: 0.84rem;
}

@media (max-width: 640px) {
    .notification-channel,
    .notification-delivery {
        grid-template-columns: minmax(0, 1fr);
    }

    .approval-policy-form {
        grid-template-columns: 1fr;
    }
}
