/* The operator's brand: orange #CC5500, charcoal #1A1A1A, Roboto. */
:root {
    --forge-orange: #CC5500;
    --forge-orange-dark: #A04400;
    --forge-orange-light: #FF7A1A;
    --forge-orange-tint: #fff7f0;
    --forge-charcoal: #1A1A1A;

    --bs-primary: var(--forge-orange);
    --bs-primary-rgb: 204, 85, 0;
    --bs-link-color: var(--forge-orange-dark);
    --bs-link-color-rgb: 160, 68, 0;
    --bs-link-hover-color: var(--forge-orange);
    --bs-body-font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --bs-body-bg: #F8F9FA;
}

.btn-primary {
    --bs-btn-bg: var(--forge-orange);
    --bs-btn-border-color: var(--forge-orange);
    --bs-btn-hover-bg: var(--forge-orange-dark);
    --bs-btn-hover-border-color: var(--forge-orange-dark);
    --bs-btn-active-bg: var(--forge-orange-dark);
    --bs-btn-active-border-color: var(--forge-orange-dark);
    --bs-btn-disabled-bg: var(--forge-orange);
    --bs-btn-disabled-border-color: var(--forge-orange);
}

.btn-outline-primary {
    --bs-btn-color: var(--forge-orange);
    --bs-btn-border-color: var(--forge-orange);
    --bs-btn-hover-bg: var(--forge-orange);
    --bs-btn-hover-border-color: var(--forge-orange);
    --bs-btn-active-bg: var(--forge-orange-dark);
    --bs-btn-active-border-color: var(--forge-orange-dark);
}

.text-forge { color: var(--forge-orange) !important; }
.bg-forge-tint { background: var(--forge-orange-tint) !important; }

.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: var(--forge-orange-light);
    box-shadow: 0 0 0 0.25rem rgba(204, 85, 0, 0.2);
}

.form-check-input:checked {
    background-color: var(--forge-orange);
    border-color: var(--forge-orange);
}

/* Navigation */
.forge-navbar {
    background: var(--forge-charcoal);
}

    .forge-navbar .nav-link.active {
        color: var(--forge-orange-light) !important;
    }

.forge-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: var(--forge-orange);
    color: #fff;
}

.forge-brand-sub {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
}

/* Page furniture */
.forge-page {
    padding-top: 2rem;
    padding-bottom: 3rem;
}

.forge-hero {
    background: linear-gradient(135deg, var(--forge-charcoal) 0%, #2f2f2f 60%, var(--forge-orange-dark) 140%);
    color: #fff;
    padding: 4rem 0;
}

.card {
    border-color: #e5e7eb;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.card-selectable {
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

    .card-selectable:hover, .card-selectable.selected {
        border-color: var(--forge-orange);
        box-shadow: 0 0 0 0.2rem rgba(204, 85, 0, 0.15);
    }

/* Onboarding stepper */
.forge-step {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: 0.75rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    margin-bottom: 1rem;
}

.forge-step-icon {
    flex: 0 0 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    background: #eef0f2;
    color: #6c757d;
}

.forge-step.done .forge-step-icon { background: #d1e7dd; color: #0f5132; }
.forge-step.current { border-color: var(--forge-orange); }
.forge-step.current .forge-step-icon { background: var(--forge-orange); color: #fff; }

/* Chat */
.forge-chat {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 13rem);
    min-height: 26rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
}

.forge-chat-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1.25rem;
}

.forge-chat-input {
    border-top: 1px solid #e5e7eb;
    padding: 0.75rem;
}

.forge-bubble {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    margin-bottom: 0.75rem;
    overflow-wrap: anywhere;
}

    .forge-bubble p:last-child { margin-bottom: 0; }
    .forge-bubble pre { white-space: pre-wrap; background: rgba(0, 0, 0, 0.05); padding: 0.5rem; border-radius: 0.5rem; }

.forge-bubble-user {
    margin-left: auto;
    background: var(--forge-orange);
    color: #fff;
    border-bottom-right-radius: 0.25rem;
    white-space: pre-wrap;
}

.forge-bubble-assistant {
    background: #f1f3f5;
    border-bottom-left-radius: 0.25rem;
}

.forge-system-note {
    text-align: center;
    font-size: 0.85rem;
    color: #6c757d;
    margin: 0.5rem 0 1rem;
}

.forge-steps {
    font-size: 0.85rem;
    color: #6c757d;
    margin: -0.25rem 0 0.75rem 0.25rem;
}

.forge-typing span {
    display: inline-block;
    width: 0.45rem;
    height: 0.45rem;
    margin-right: 0.2rem;
    border-radius: 50%;
    background: #adb5bd;
    animation: forge-blink 1.2s infinite both;
}

    .forge-typing span:nth-child(2) { animation-delay: 0.2s; }
    .forge-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes forge-blink {
    0%, 80%, 100% { opacity: 0.25; }
    40% { opacity: 1; }
}

.invite-link {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.85rem;
    word-break: break-all;
}

/* Blazor defaults */
h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 1.5rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "Something went wrong."
    }

/* Work session workspace: chat, with the app's activity beside it (the app itself runs in its own tab) */
.forge-workspace-page {
    padding-top: 1.25rem;
    max-width: 1800px;
}

.forge-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(300px, 34%, 480px);
    gap: 1rem;
    height: calc(100vh - 12rem);
    min-height: 32rem;
}

    .forge-workspace .forge-chat {
        height: 100%;
        min-height: 0;
    }

    .forge-workspace .forge-bubble {
        max-width: min(92%, 52rem);
    }

.forge-workspace-chat,
.forge-workspace-side {
    min-height: 0;
    display: flex;
    flex-direction: column;
}

    .forge-workspace-chat > .forge-chat {
        flex: 1 1 auto;
    }

.forge-workspace-side-title {
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem 0.75rem 0 0;
    color: var(--forge-charcoal);
    font-weight: 500;
}

.forge-workspace-side-body {
    flex: 1 1 auto;
    min-height: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-top: 0;
    border-radius: 0 0 0.75rem 0.75rem;
    overflow: hidden;
}

.forge-workspace-pane {
    height: 100%;
}

.forge-workspace-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

    .forge-workspace-tabs button {
        flex: 1 1 0;
        border: 1px solid #e5e7eb;
        background: #fff;
        border-radius: 0.5rem;
        padding: 0.4rem 0.5rem;
        font-size: 0.9rem;
        color: #495057;
    }

        .forge-workspace-tabs button.active {
            border-color: var(--forge-orange);
            color: var(--forge-orange-dark);
            font-weight: 500;
        }

@media (max-width: 991.98px) {
    .forge-workspace {
        grid-template-columns: minmax(0, 1fr);
        height: calc(100vh - 14rem);
    }

        .forge-workspace[data-pane="chat"] .forge-workspace-side,
        .forge-workspace:not([data-pane="chat"]) .forge-workspace-chat {
            display: none;
        }

    .forge-workspace-side-body {
        border-top: 1px solid #e5e7eb;
        border-radius: 0.75rem;
    }
}

/* The client's app (runs in its own tab): a slim bar above the chat box */
.forge-appbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    padding: 0.4rem 0.6rem;
    margin-bottom: 0.5rem;
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

.forge-appbar-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1 1 14rem;
    min-width: 0;
    color: #495057;
}

.forge-appbar-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.forge-appbar-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: #adb5bd;
    flex: none;
}

.forge-appbar-dot-running {
    background: #198754;
}

/* App activity */
.forge-activity {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.forge-activity-toolbar {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.forge-activity-list {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0.75rem;
}

.forge-problem {
    border: 1px solid #e5e7eb;
    border-left: 4px solid #ffc107;
    border-radius: 0.5rem;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.6rem;
    background: #fff;
}

    .forge-problem.is-error {
        border-left-color: #dc3545;
    }

.forge-activity-detail {
    white-space: pre-wrap;
    font-size: 0.78rem;
    max-height: 18rem;
    overflow: auto;
    background: #f8f9fa;
    border-radius: 0.4rem;
    padding: 0.5rem;
    margin: 0.4rem 0 0;
}

.forge-activity-line {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.75rem;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0.05rem 0;
}

.min-w-0 {
    min-width: 0;
}

/* Assistant questions, plans and to-do list */
.forge-ask {
    border: 1px solid var(--forge-orange-light);
    background: var(--forge-orange-tint);
    border-radius: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.forge-checklist {
    font-size: 0.85rem;
    color: #495057;
    margin: 0 0 0.75rem 0.25rem;
}

    .forge-checklist ul {
        list-style: none;
        padding-left: 0;
        margin-bottom: 0;
    }

    .forge-checklist input[type=checkbox] {
        margin-right: 0.4rem;
    }

/* App page board (wwwroot/js/change-board.js): changes moving from "Working on" to "Live" */
.forge-board {
    width: 100%;
    min-height: 240px;
}

    .forge-board svg {
        display: block;
        overflow: visible;
    }

    .forge-board text {
        font-family: var(--bs-body-font-family);
    }

.fb-lane-bg { fill: #eef0f3; }
.fb-lane-title { font-size: 15px; font-weight: 700; fill: var(--forge-charcoal); }
.fb-lane-hint { font-size: 12px; fill: #6c757d; }
.fb-lane-count rect { fill: #fff; }
.fb-lane-count text { font-size: 12px; font-weight: 700; fill: #495057; }
.fb-empty { font-size: 13px; fill: #9aa1a8; font-style: italic; }

.fb-node { cursor: pointer; outline: none; }
.fb-card { fill: #fff; stroke: #e1e5ea; stroke-width: 1; transition: stroke 0.15s, filter 0.15s; }
.fb-node:hover .fb-card { stroke: #c2c8cf; filter: drop-shadow(0 4px 10px rgba(26, 26, 26, 0.10)); }
.fb-node:focus-visible .fb-card,
.fb-node:focus-visible .fb-row,
.fb-selected .fb-card { stroke: var(--forge-orange); stroke-width: 2; }
.fb-card-new { fill: rgba(255, 255, 255, 0.55); stroke: #c4c9cf; stroke-dasharray: 6 4; }
.fb-node:hover .fb-card-new { fill: #fff; stroke: var(--forge-orange-light); }
.fb-new-plus-bg { fill: var(--forge-orange-tint); stroke: #ffd9bf; }
.fb-new-plus { stroke: var(--forge-orange); stroke-width: 2.5; stroke-linecap: round; fill: none; }

.fb-title { font-size: 14px; font-weight: 500; fill: var(--forge-charcoal); }
.fb-sub { font-size: 12px; fill: #6c757d; }
.fb-chip-text { font-size: 11.5px; font-weight: 500; }
.fb-when { font-size: 11px; fill: #8a9199; }
.fb-journey-line { stroke: #dee2e6; stroke-width: 2; }
.fb-step-todo, .fb-step-done, .fb-step-active { stroke-width: 2; }
.fb-step-active { animation: fb-pulse 1.4s ease-in-out infinite; }

.fb-check { stroke: #fff; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.fb-row { fill: transparent; transition: fill 0.15s; }
.fb-node:hover .fb-row, .fb-selected .fb-row { fill: #fff; }
.fb-row-stem { stroke: #d5dade; stroke-width: 2; }
.fb-row-text { font-size: 12.5px; fill: #343a40; }
.fb-more { font-size: 12px; fill: var(--forge-orange-dark); }

.fb-link { fill: none; stroke: #c5ccd6; stroke-width: 2; stroke-dasharray: 4 5; }
.fb-link-active { stroke: #f2a66c; stroke-dasharray: none; stroke-width: 2.5; }
.fb-link-flow { stroke: var(--forge-orange); stroke-dasharray: 8 6; animation: fb-flow 0.9s linear infinite; }

.fb-gate-circle { stroke: #fff; stroke-width: 3; filter: drop-shadow(0 3px 8px rgba(204, 85, 0, 0.25)); }
.fb-gate-idle .fb-gate-circle { filter: none; }
.fb-gate-ring { opacity: 0.35; transform-box: fill-box; transform-origin: center; animation: fb-ring 1.8s ease-out infinite; }
.fb-gate-arrow { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.fb-gate-label { font-size: 13px; font-weight: 700; fill: var(--forge-charcoal); }
.fb-gate-detail { font-size: 11.5px; fill: #6c757d; }
.fb-gate-text { font-size: 14px; font-weight: 700; }
.fb-gate-node:hover .fb-gate-circle, .fb-gate-node:focus-visible .fb-gate-circle,
.fb-gate-node:focus-visible .fb-gate-pill { stroke: var(--forge-charcoal); }

.fb-pulse { animation: fb-pulse 1.4s ease-in-out infinite; }

@keyframes fb-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes fb-flow { to { stroke-dashoffset: -14; } }
@keyframes fb-ring { from { transform: scale(1); opacity: 0.35; } to { transform: scale(1.55); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
    .fb-pulse, .fb-step-active, .fb-link-flow, .fb-gate-ring { animation: none; }
}

/* Side panel for a change or release picked on the board */
.forge-side-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(420px, 100vw);
    z-index: 1045;
    background: #fff;
    box-shadow: -8px 0 24px rgba(26, 26, 26, 0.12);
    display: flex;
    flex-direction: column;
}

    .forge-side-panel-header {
        display: flex;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1.25rem 1.25rem 0.75rem;
        border-bottom: 1px solid #eef0f3;
    }

    .forge-side-panel-body {
        padding: 1.25rem;
        overflow-y: auto;
        flex: 1;
    }

    .forge-side-panel-footer {
        padding: 1rem 1.25rem;
        border-top: 1px solid #eef0f3;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

/* A change's steps, as a vertical line of dots */
.forge-journey {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .forge-journey li {
        position: relative;
        padding: 0 0 1.25rem 2rem;
    }

        .forge-journey li::before {
            content: "";
            position: absolute;
            left: 0.55rem;
            top: 1.4rem;
            bottom: 0.1rem;
            width: 2px;
            background: #dee2e6;
        }

        .forge-journey li:last-child::before { display: none; }
        .forge-journey li.done::before { background: var(--journey-color, #198754); }

    .forge-journey-dot {
        position: absolute;
        left: 0;
        top: 0.15rem;
        width: 1.2rem;
        height: 1.2rem;
        border-radius: 50%;
        border: 2px solid #ced4da;
        background: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.7rem;
        color: #fff;
    }

    .forge-journey li.done .forge-journey-dot {
        background: var(--journey-color, #198754);
        border-color: var(--journey-color, #198754);
    }

    .forge-journey li.current .forge-journey-dot {
        border-color: var(--journey-color, var(--forge-orange));
        box-shadow: 0 0 0 4px rgba(204, 85, 0, 0.15);
    }

    .forge-journey li.attention .forge-journey-dot {
        border-color: #dc3545;
        background: #dc3545;
    }

    .forge-journey-title { font-weight: 500; }
    .forge-journey li.todo .forge-journey-title { color: #8a9199; }

/* Admin client workspace: a branded header, a rail with the client's sections and apps, and the picked panel */
.adm-hero {
    background:
        radial-gradient(circle at 92% -30%, rgba(255, 122, 26, 0.35), transparent 45%),
        linear-gradient(120deg, var(--forge-charcoal) 0%, #262626 55%, #3a2414 100%);
    color: #fff;
    padding: 1.5rem 0 1.25rem;
    border-bottom: 3px solid var(--forge-orange);
}

    .adm-hero a { color: rgba(255, 255, 255, 0.7); text-decoration: none; }
    .adm-hero a:hover { color: #fff; }

.adm-crumbs {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 0.75rem;
}

.adm-avatar {
    flex: none;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0.02em;
    color: #fff;
    background: linear-gradient(135deg, var(--forge-orange-light), var(--forge-orange-dark));
    box-shadow: 0 6px 18px rgba(204, 85, 0, 0.35);
}

    .adm-avatar.sm { width: 2.25rem; height: 2.25rem; font-size: 0.85rem; border-radius: 0.6rem; box-shadow: none; }
    .adm-avatar.muted { background: #e9ecef; color: #495057; }

.adm-hero-title { font-size: 1.6rem; font-weight: 700; margin: 0; line-height: 1.2; }
.adm-hero-sub { color: rgba(255, 255, 255, 0.65); font-size: 0.9rem; }

.adm-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.adm-kpi {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 0.7rem 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

    .adm-kpi i {
        flex: none;
        width: 2.2rem;
        height: 2.2rem;
        border-radius: 0.6rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: rgba(204, 85, 0, 0.22);
        color: var(--forge-orange-light);
        font-size: 1.05rem;
    }

.adm-kpi-value { font-size: 1.15rem; font-weight: 700; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-kpi-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255, 255, 255, 0.55); }

.adm-hero .btn-outline-light { --bs-btn-border-color: rgba(255, 255, 255, 0.35); }

/* Layout */
.adm-layout {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 991.98px) {
    .adm-layout { grid-template-columns: minmax(0, 1fr); }
    .adm-rail { position: static !important; }
}

.adm-rail {
    position: sticky;
    top: 1rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.9rem;
    padding: 0.75rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.adm-rail-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8a9199;
    padding: 0.5rem 0.6rem 0.35rem;
}

.adm-rail-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
    border-radius: 0.55rem;
    color: #343a40;
    text-decoration: none;
    font-size: 0.92rem;
    border-left: 3px solid transparent;
    transition: background 0.12s, color 0.12s;
}

    .adm-rail-link:hover { background: #f4f5f7; color: var(--forge-charcoal); }
    .adm-rail-link > i { color: #8a9199; font-size: 1rem; width: 1.1rem; text-align: center; }

    .adm-rail-link.active {
        background: var(--forge-orange-tint);
        color: var(--forge-orange-dark);
        border-left-color: var(--forge-orange);
        font-weight: 500;
    }

        .adm-rail-link.active > i { color: var(--forge-orange); }

.adm-rail-app { align-items: flex-start; }
.adm-rail-app-name { font-weight: 500; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-rail-divider { border-top: 1px solid #eef0f3; margin: 0.5rem 0.25rem; }

.adm-app-icon {
    flex: none;
    width: 2rem;
    height: 2rem;
    border-radius: 0.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f3f5;
    color: #495057;
    font-size: 0.95rem;
}

.adm-rail-link.active .adm-app-icon,
.adm-app-card:hover .adm-app-icon { background: var(--forge-orange); color: #fff; }

/* Status dots */
.adm-dot {
    display: inline-block;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: #adb5bd;
    flex: none;
}

    .adm-dot.ok { background: #198754; }
    .adm-dot.busy { background: #f0ad00; animation: fb-pulse 1.4s ease-in-out infinite; }
    .adm-dot.bad { background: #dc3545; }
    .adm-dot.off { background: transparent; border: 1.5px solid #adb5bd; }

.adm-mini-stages {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.72rem;
    color: #8a9199;
    margin-top: 0.15rem;
}

    .adm-mini-stages .adm-mini-line { width: 0.6rem; height: 1px; background: #ced4da; }

/* Panels */
.adm-panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin-bottom: 1.25rem;
}

    .adm-panel-head h2 { font-size: 1.35rem; font-weight: 700; margin: 0; color: var(--forge-charcoal); }

.adm-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.9rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    margin-bottom: 1.25rem;
}

.adm-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 1.15rem;
    border-bottom: 1px solid #eef0f3;
}

    .adm-card-head h3 { font-size: 1rem; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 0.5rem; }
    .adm-card-head h3 i { color: var(--forge-orange); }

.adm-card-body { padding: 1rem 1.15rem; }
.adm-card-body > :last-child { margin-bottom: 0; }

.adm-hint { font-size: 0.85rem; color: #6c757d; }

/* What a step does: Done by, Changes, Check */
.adm-facts {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 0.35rem 0.85rem;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

    .adm-facts dt { font-weight: 600; color: #6c757d; }
    .adm-facts dd { margin: 0; }
    .adm-facts ul { margin: 0; padding-left: 1rem; }

@media (max-width: 575.98px) {
    .adm-facts { grid-template-columns: minmax(0, 1fr); }
}

/* Small stat tiles inside panels */
.adm-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.adm-stat {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 0.75rem 0.9rem;
    min-width: 0;
}

.adm-stat-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: #8a9199; }
.adm-stat-value { font-size: 1.05rem; font-weight: 700; color: var(--forge-charcoal); display: flex; align-items: center; gap: 0.4rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-stat-value i { color: var(--forge-orange); }

/* Tabs */
/* Tabs wrap onto a second line rather than scroll, so none is hidden off the edge. */
.adm-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1.25rem;
}

    .adm-tabs button,
    .adm-tabs a {
        text-decoration: none;
        border: 0;
        background: none;
        padding: 0.6rem 0.9rem;
        color: #6c757d;
        font-weight: 500;
        border-bottom: 2px solid transparent;
        margin-bottom: -1px;
        white-space: nowrap;
    }

        .adm-tabs button:hover, .adm-tabs a:hover { color: var(--forge-charcoal); }
        .adm-tabs button.active, .adm-tabs a.active { color: var(--forge-orange-dark); border-bottom-color: var(--forge-orange); }
        .adm-tabs .badge { font-weight: 500; }

/* Stage pipeline: newest version -> stages -> Live */
.adm-pipeline {
    display: flex;
    align-items: stretch;
    overflow-x: auto;
    padding: 0.25rem 0.1rem 0.5rem;
}

.adm-node {
    flex: 1 1 0;
    min-width: 190px;
    background: #fff;
    border: 1px solid #e1e5ea;
    border-top: 4px solid #ced4da;
    border-radius: 0.75rem;
    padding: 0.85rem 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.85rem;
}

    .adm-node.ok { border-top-color: #198754; }
    .adm-node.busy { border-top-color: #f0ad00; }
    .adm-node.bad { border-top-color: #dc3545; }
    .adm-node.live { border-top-color: var(--forge-orange); background: linear-gradient(180deg, var(--forge-orange-tint), #fff 60%); }
    .adm-node.source { background: #fafbfc; border-style: dashed; border-top-style: solid; }

.adm-node-kicker { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: #8a9199; font-weight: 700; }
.adm-node-title { font-size: 1.05rem; font-weight: 700; color: var(--forge-charcoal); display: flex; align-items: center; gap: 0.4rem; }
.adm-node-version { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.82rem; background: #f1f3f5; border-radius: 0.35rem; padding: 0.1rem 0.4rem; color: #343a40; }
.adm-node-foot { margin-top: auto; padding-top: 0.4rem; display: flex; flex-wrap: wrap; gap: 0.35rem; }

.adm-connector {
    flex: 0 0 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .adm-connector svg { width: 100%; height: 20px; overflow: visible; }
    .adm-connector line { stroke: #ced4da; stroke-width: 2; }
    .adm-connector path { fill: #ced4da; }
    .adm-connector.ready line { stroke: #f2a66c; }
    .adm-connector.ready path { fill: #f2a66c; }
    .adm-connector.flowing line { stroke: var(--forge-orange); stroke-dasharray: 6 5; animation: fb-flow 0.9s linear infinite; }
    .adm-connector.flowing path { fill: var(--forge-orange); }

@media (max-width: 767.98px) {
    .adm-pipeline { flex-direction: column; }
    .adm-node { min-width: 0; }
    .adm-connector { flex-basis: 1.75rem; }
    .adm-connector svg { transform: rotate(90deg); width: 1.75rem; }
}

/* Timeline for builds and publishes */
.adm-timeline { list-style: none; padding: 0; margin: 0; }

    .adm-timeline > li {
        position: relative;
        padding: 0 0 1rem 2.4rem;
        font-size: 0.85rem;
    }

        .adm-timeline > li::before {
            content: "";
            position: absolute;
            left: 0.85rem;
            top: 1.8rem;
            bottom: 0.15rem;
            width: 2px;
            background: #eef0f3;
        }

        .adm-timeline > li:last-child { padding-bottom: 0; }
        .adm-timeline > li:last-child::before { display: none; }

.adm-tl-icon {
    position: absolute;
    left: 0;
    top: 0;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    background: #e9ecef;
    color: #6c757d;
}

    .adm-tl-icon.ok { background: #d1e7dd; color: #0f5132; }
    .adm-tl-icon.bad { background: #f8d7da; color: #842029; }
    .adm-tl-icon.busy { background: #fff3cd; color: #997404; }
    .adm-tl-icon.live { background: var(--forge-orange); color: #fff; }

.adm-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: #f1f3f5;
    color: #495057;
    border: 1px solid #e5e7eb;
    white-space: nowrap;
}

    .adm-chip.orange { background: var(--forge-orange-tint); color: var(--forge-orange-dark); border-color: #ffd9bf; }

/* Resource tiles and choice cards */
.adm-resources {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 0.6rem;
}

.adm-resource {
    border: 1px solid #e5e7eb;
    border-radius: 0.7rem;
    padding: 0.6rem 0.75rem;
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    min-width: 0;
    font-size: 0.83rem;
}

    .adm-resource > i { font-size: 1.15rem; color: #adb5bd; margin-top: 0.05rem; }
    .adm-resource.done > i { color: #198754; }
    .adm-resource.working > i { color: #f0ad00; }
    .adm-resource.failed > i { color: #dc3545; }
    .adm-resource code { font-size: 0.75rem; word-break: break-all; }

.adm-choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.6rem;
}

.adm-choice {
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 0.7rem 0.8rem;
    background: #fff;
    text-align: left;
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    font-size: 0.85rem;
    color: #343a40;
    transition: border-color 0.12s, box-shadow 0.12s;
}

    .adm-choice > i { font-size: 1.2rem; color: #8a9199; }
    .adm-choice:hover:not(:disabled) { border-color: var(--forge-orange-light); }
    .adm-choice.selected { border-color: var(--forge-orange); box-shadow: 0 0 0 0.2rem rgba(204, 85, 0, 0.15); }
    .adm-choice.selected > i { color: var(--forge-orange); }
    .adm-choice:disabled { opacity: 0.5; }
    .adm-choice strong { display: block; color: var(--forge-charcoal); }

/* Stage names as a chain */
.adm-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.adm-chain .bi-chevron-right { color: #ced4da; font-size: 0.8rem; }

/* App cards on the client overview */
.adm-app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.9rem;
}

.adm-app-card {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.9rem;
    padding: 1rem;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

    .adm-app-card:hover {
        border-color: var(--forge-orange);
        box-shadow: 0 6px 18px rgba(26, 26, 26, 0.08);
        transform: translateY(-1px);
        color: inherit;
    }

.adm-stage-strip { display: flex; gap: 0.35rem; }

    .adm-stage-strip > div {
        flex: 1 1 0;
        min-width: 0;
        border-radius: 0.45rem;
        background: #f4f5f7;
        padding: 0.3rem 0.45rem;
        font-size: 0.72rem;
        border-top: 3px solid #ced4da;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

        .adm-stage-strip > div.ok { border-top-color: #198754; }
        .adm-stage-strip > div.busy { border-top-color: #f0ad00; }
        .adm-stage-strip > div.bad { border-top-color: #dc3545; }

.adm-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: #8a9199;
}

    .adm-empty > i { font-size: 2rem; color: #ced4da; display: block; margin-bottom: 0.5rem; }

.adm-person { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0; border-top: 1px solid #f1f3f5; }
.adm-person:first-child { border-top: 0; padding-top: 0; }

@media (prefers-reduced-motion: reduce) {
    .adm-dot.busy, .adm-connector.flowing line { animation: none; }
}

/* Identities & access (admin) */
.adm-session-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.9rem;
    background: #f8f9fa;
}

    .adm-session-banner.live { background: #f0faf4; border-color: #b7e4c7; }
    .adm-session-banner.live.ending { background: #fff8e6; border-color: #ffe08a; }

.adm-session-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex: none;
    background: #e9ecef;
    color: #6c757d;
    font-size: 1.05rem;
}

    .adm-session-banner.live .adm-session-icon { background: #198754; color: #fff; }
    .adm-session-banner.live.ending .adm-session-icon { background: #f0ad00; }

.adm-session-left { font-weight: 400; color: #495057; }
.adm-session-banner.ending .adm-session-left { color: #9a6700; font-weight: 600; }

.adm-count {
    display: inline-block;
    min-width: 1.4rem;
    padding: 0 0.35rem;
    margin-left: 0.2rem;
    border-radius: 999px;
    background: #f1f3f5;
    color: #495057;
    font-size: 0.72rem;
    text-align: center;
}

.adm-count-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.78rem;
    color: #495057;
    min-width: 2.6rem;
}

    .adm-count-pill i { color: #8a9199; }

.adm-risk {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    border: 1px solid transparent;
    white-space: nowrap;
}

.adm-risk-narrow { background: #eef6f1; color: #146c43; border-color: #cfe8da; }
.adm-risk-broad { background: #fff6e0; color: #8a5a00; border-color: #ffe3a3; }
.adm-risk-high { background: #fdecee; color: #b02a37; border-color: #f5c2c7; }

.adm-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

.adm-toolbar-search { max-width: 26rem; flex: 1 1 16rem; }

.adm-filter {
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 999px;
    padding: 0.15rem 0.65rem;
    font-size: 0.8rem;
    color: #495057;
}

    .adm-filter:hover { border-color: var(--forge-orange-light); }
    .adm-filter.active { background: var(--forge-orange-tint); border-color: var(--forge-orange); color: var(--forge-orange-dark); }
    .adm-filter.active.danger { background: #fdecee; border-color: #dc3545; color: #b02a37; }

.adm-identity-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.7rem 1.15rem;
    border: 0;
    border-top: 1px solid #f1f3f5;
    background: #fff;
    text-align: left;
    color: inherit;
    font-size: 0.9rem;
}

    .adm-identity-row:first-child { border-top: 0; }
    .adm-identity-row:last-child { border-radius: 0 0 0.9rem 0.9rem; }
    .adm-identity-row:hover { background: #fafbfc; }
    .adm-identity-row.active { background: var(--forge-orange-tint); }

.adm-identity-env {
    flex: none;
    width: 4.75rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-align: center;
    padding: 0.2rem 0.3rem;
    border-radius: 0.4rem;
    background: #f1f3f5;
    color: #495057;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

    .adm-identity-env.live { background: var(--forge-orange); color: #fff; }
    .adm-identity-env.forge { background: var(--forge-charcoal); color: #fff; }

.adm-picker {
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 1rem;
    background: #fcfcfd;
}

.adm-picker-list {
    max-height: 18rem;
    overflow-y: auto;
    border: 1px solid #eef0f3;
    border-radius: 0.5rem;
    background: #fff;
}

.adm-picker-group {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8f9fa;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
    padding: 0.3rem 0.6rem;
    border-bottom: 1px solid #eef0f3;
}

.adm-picker-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    border: 0;
    border-bottom: 1px solid #f4f5f7;
    background: #fff;
    padding: 0.45rem 0.6rem;
    text-align: left;
}

    .adm-picker-item:hover:not(:disabled) { background: var(--forge-orange-tint); }
    .adm-picker-item:disabled { opacity: 0.55; }

.adm-picker-detail {
    border: 1px solid #eef0f3;
    border-radius: 0.5rem;
    background: #fff;
    padding: 0.6rem 0.75rem;
}

.adm-grant-list { display: flex; flex-direction: column; gap: 0.5rem; }

.adm-grant {
    border: 1px solid #e5e7eb;
    border-radius: 0.6rem;
    padding: 0.55rem 0.7rem;
    background: #fff;
    transition: opacity 0.15s;
}

    .adm-grant.pending { opacity: 0.55; }
    .adm-grant.locked { background: #fafbfc; }

.adm-confirm {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    max-width: 18rem;
    text-align: right;
}

/* Admin tables, and rows that say where something stands */
.adm-table { font-size: 0.875rem; }
.adm-table > thead th {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8a9199;
    white-space: nowrap;
    border-bottom-color: #eef0f3;
    padding: 0.6rem 0.75rem;
}
.adm-table > tbody td { padding: 0.6rem 0.75rem; border-bottom-color: #f1f3f5; }
.adm-table > tbody tr:last-child td { border-bottom: 0; }

.adm-check {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    padding: 0.7rem 1.15rem;
    border-top: 1px solid #f1f3f5;
    font-size: 0.9rem;
}
.adm-check:first-child { border-top: 0; }
.adm-check > i:first-child { flex: none; font-size: 1.1rem; color: #adb5bd; }
.adm-check.ok > i:first-child { color: #198754; }
.adm-check.warn > i:first-child { color: #d29500; }
.adm-check.bad > i:first-child { color: #dc3545; }
.adm-check.busy > i:first-child { color: #f0ad00; }
.adm-check.info > i:first-child { color: var(--forge-orange); }

.adm-check > .min-w-0 { flex: 1 1 16rem; }

.adm-check-box { border: 1px solid #e5e7eb; border-radius: 0.6rem; padding: 0.6rem 0.8rem; }
.adm-check-box:first-child { border-top: 1px solid #e5e7eb; }
.adm-check-box.ok { background: #f0faf4; border-color: #cfe8da; }
.adm-check-box.warn { background: #fff8e6; border-color: #ffe3a3; }
.adm-check-box.bad { background: #fdecee; border-color: #f5c2c7; }
.adm-check-box.info { background: var(--forge-orange-tint); border-color: #ffd9bf; }
.adm-todo { display: flex; flex-direction: column; gap: 0.5rem; }

.adm-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8a9199;
    margin: 0 0 0.5rem;
}

.adm-section { border-top: 1px solid #eef0f3; padding: 0.6rem 0; }
.adm-section > summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    list-style: none;
    font-size: 0.9rem;
}
.adm-section > summary::-webkit-details-marker { display: none; }
.adm-section > summary > .bi-chevron-right { color: #8a9199; font-size: 0.8rem; transition: transform 0.12s; }
.adm-section[open] > summary { margin-bottom: 0.6rem; }
.adm-section[open] > summary > .bi-chevron-right { transform: rotate(90deg); }
.adm-section-link { border-top: 1px solid #eef0f3; padding: 0.6rem 0; }

.adm-card-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    border-top: 1px solid #eef0f3;
    padding-top: 0.6rem;
}

.adm-list-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    padding: 0.7rem 1.15rem;
    border-top: 1px solid #f1f3f5;
}
.adm-list-row:first-child { border-top: 0; }

.adm-picker-list-tall { max-height: none; }
.adm-picker-item .min-w-0 { flex: 1 1 auto; }

/* Client overview: where everything stands, then the system map */
.adm-health {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    padding: 0.9rem 1.15rem;
    margin-bottom: 1.25rem;
    border: 1px solid #e5e7eb;
    border-left-width: 5px;
    border-radius: 0.9rem;
    background: #fff;
}
.adm-health-icon { font-size: 1.6rem; line-height: 1; color: #8a9199; }
.adm-health-title { font-size: 1.15rem; font-weight: 700; color: var(--forge-charcoal); }
.adm-health.ok { border-left-color: #198754; background: #f4fbf7; }
.adm-health.ok .adm-health-icon { color: #198754; }
.adm-health.warn { border-left-color: #e07b00; background: #fff9ed; }
.adm-health.warn .adm-health-icon { color: #e07b00; }
.adm-health.bad { border-left-color: #dc3545; background: #fdf1f2; }
.adm-health.bad .adm-health-icon { color: #dc3545; }
.adm-health.busy { border-left-color: #d99a00; }
.adm-health.busy .adm-health-icon { color: #d99a00; }

.adm-stat-note { font-size: 0.75rem; color: #6c757d; margin-top: 0.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-budget { height: 0.35rem; margin-top: 0.35rem; }

.adm-map-card {
    --fm-ok: #198754;
    --fm-asleep: #5b7c99;
    --fm-idle: #adb5bd;
    --fm-busy: #d99a00;
    --fm-warn: #e07b00;
    --fm-bad: #dc3545;
    --fm-unknown: #8a9199;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.9rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
}
.adm-map-card.full {
    position: fixed;
    inset: 0;
    z-index: 1040;
    border-radius: 0;
    border: 0;
}
.forge-side-panel { --fm-ok: #198754; --fm-asleep: #5b7c99; --fm-idle: #adb5bd; --fm-busy: #d99a00; --fm-warn: #e07b00; --fm-bad: #dc3545; --fm-unknown: #8a9199; }

.adm-map-toolbar { padding: 0.6rem 1.15rem; border-bottom: 1px solid #eef0f3; }
.adm-map-dot { display: inline-block; width: 0.55rem; height: 0.55rem; border-radius: 50%; flex: none; }
.adm-map-state { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; font-weight: 600; }

.adm-map-layer {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 999px;
    padding: 0.15rem 0.65rem;
    font-size: 0.8rem;
    color: #8a9199;
}
.adm-map-layer > span { display: inline-block; width: 1.1rem; height: 0; border-top: 2px solid #ced4da; }
.adm-map-layer.on { color: #343a40; background: #f8f9fa; }
.adm-map-layer.on.deploy > span { border-top: 2px dashed #6c757d; }
.adm-map-layer.on.event > span { border-top-color: #CC5500; }
.adm-map-layer.on.link > span { border-top-color: #3366cc; }
.adm-map-layer.on.uses > span { border-top: 2px dotted #adb5bd; }

.adm-map-stage { position: relative; flex: 1 1 auto; min-height: 620px; background: #fbfbfc; border-radius: 0 0 0.9rem 0.9rem; overflow: hidden; }
.adm-map-canvas { position: absolute; inset: 0; }
.adm-map-zoom { position: absolute; top: 0.75rem; right: 0.75rem; }
.adm-map-legend {
    position: absolute;
    left: 0.75rem;
    bottom: 0.6rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    padding: 0.25rem 0.6rem;
    font-size: 0.72rem;
    color: #6c757d;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #eef0f3;
    border-radius: 0.5rem;
}
.adm-map-legend > span { display: inline-flex; align-items: center; gap: 0.3rem; }

.adm-map-lines { list-style: none; padding: 0; margin: 0; font-size: 0.83rem; }
.adm-map-lines li { padding: 0.35rem 0 0.35rem 0.6rem; border-left: 3px solid #ced4da; margin-bottom: 0.35rem; }
.adm-map-lines li.deploy { border-left-color: #6c757d; }
.adm-map-lines li.event { border-left-color: #CC5500; }
.adm-map-lines li.link { border-left-color: #3366cc; }
.adm-map-lines li.bad { border-left-color: #dc3545; color: #b02a37; }
.adm-map-lines li.warn { border-left-color: #e07b00; }

.fm-svg { display: block; width: 100%; height: 100%; cursor: grab; font-family: inherit; }
.fm-svg:active { cursor: grabbing; }

.fm-lane-box { fill: #f3f4f6; stroke: #e5e7eb; }
.fm-lane.live .fm-lane-box { fill: var(--forge-orange-tint); stroke: #ffd9bf; }
.fm-lane-title { font-size: 13px; font-weight: 700; fill: var(--forge-charcoal); }
.fm-lane-state { font-size: 11px; fill: #6c757d; }
.fm-lane-empty { font-size: 12px; fill: #8a9199; }
.fm-column { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; fill: #8a9199; }

.fm-node { cursor: pointer; outline: none; transition: opacity 0.12s; }
.fm-node.dim { opacity: 0.25; }
.fm-card { fill: #fff; stroke: #dfe3e8; stroke-width: 1; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.05)); }
.fm-node[data-kind="external"] .fm-card { fill: #f8f9fa; stroke-dasharray: 4 3; }
.fm-node:hover .fm-card, .fm-node:focus-visible .fm-card { stroke: var(--forge-orange-light); stroke-width: 1.5; }
.fm-node.selected .fm-card { stroke: var(--forge-orange); stroke-width: 2.5; }
.fm-node.problem .fm-card { stroke-width: 2; }
.fm-icon { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border-radius: 6px; background: #f1f3f5; color: #495057; font-size: 14px; }
.fm-title { font-size: 13px; font-weight: 700; fill: var(--forge-charcoal); }
.fm-subtitle { font-size: 10.5px; fill: #6c757d; }
.fm-state { font-size: 11px; font-weight: 600; }
.fm-cost { font-size: 11px; font-weight: 600; fill: #343a40; }
.fm-metric { font-size: 10.5px; fill: #6c757d; }
.fm-problems rect { fill: #dc3545; }
.fm-problems text { font-size: 10px; font-weight: 700; fill: #fff; }

.fm-edge { transition: opacity 0.12s; }
.fm-edge.dim { opacity: 0.08; }
.fm-edge-hit { fill: none; stroke: transparent; stroke-width: 12; }
.fm-edge-line { fill: none; stroke-width: 1.5; pointer-events: none; }
.fm-edge-deploy .fm-edge-line { stroke-dasharray: 5 4; opacity: 0.7; }
.fm-edge-uses .fm-edge-line { stroke-dasharray: 2 4; opacity: 0.8; }
.fm-edge-event .fm-edge-line, .fm-edge-link .fm-edge-line { stroke-width: 1.8; }
.fm-edge:hover .fm-edge-line, .fm-edge.lit .fm-edge-line { stroke-width: 2.5; opacity: 1; stroke-dasharray: 7 5; animation: fm-flow 0.8s linear infinite; }
.fm-edge-label { display: none; pointer-events: none; }
.fm-edge-label rect { fill: #fff; stroke: #e5e7eb; }
.fm-edge-label text { font-size: 10px; fill: #495057; }
.fm-near .fm-edge-label, .fm-edge.lit .fm-edge-label { display: block; }
.fm-state-bad .fm-edge-label text { fill: #b02a37; font-weight: 600; }

.fm-far .fm-subtitle, .fm-far .fm-metric, .fm-far .fm-cost, .fm-far .fm-column { display: none; }
.fm-far .fm-title { font-size: 16px; }
.fm-far .fm-state { font-size: 14px; }

@keyframes fm-flow { to { stroke-dashoffset: -12; } }

@media (prefers-reduced-motion: reduce) {
    .fm-edge:hover .fm-edge-line, .fm-edge.lit .fm-edge-line { animation: none; }
}

/* A copy's Log tab, and the red count of its recent problems (CopyLog.razor). */
.adm-count.bad { background: #dc3545; color: #fff; font-weight: 600; }
.adm-count.warn { background: #fd7e14; color: #fff; font-weight: 600; }
.adm-log {
    max-height: 32rem;
    overflow: auto;
    background: #0f1419;
    color: #d6dde4;
    border-radius: 0.4rem;
    padding: 0.5rem 0.75rem;
    font-family: var(--bs-font-monospace);
    font-size: 0.78rem;
}
.adm-log-empty { background: #f8f9fa; color: #6c757d; font-family: inherit; }
.adm-log-entry { display: flex; gap: 0.75rem; padding: 0.1rem 0; border-left: 3px solid transparent; padding-left: 0.4rem; }
.adm-log-entry.warn { border-left-color: #f0ad4e; background: rgba(240, 173, 78, 0.08); }
.adm-log-entry.bad { border-left-color: #dc3545; background: rgba(220, 53, 69, 0.12); }
.adm-log-time { color: #7d8790; flex: 0 0 auto; }
.adm-log-text { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: inherit; color: inherit; font-family: var(--bs-font-monospace); }
.adm-log-problem { border-left: 3px solid #f0ad4e; padding: 0.25rem 0 0.25rem 0.6rem; margin-bottom: 0.6rem; }
.adm-log-problem.bad { border-left-color: #dc3545; }
.adm-log-problem .adm-log-text { font-size: 0.78rem; max-height: 8rem; overflow: auto; }
.adm-known-problem { display: flex; gap: 0.4rem; align-items: flex-start; padding: 0.35rem 0.5rem; border-radius: 0.375rem;
                     background: rgba(240, 173, 78, 0.12); white-space: normal; font-family: inherit; }
.adm-failure-details summary { cursor: pointer; }
