:root {
    color-scheme: dark;
    --bg: #07111f;
    --surface: #0d1a2b;
    --surface-2: #12243a;
    --line: #263952;
    --text: #edf4fc;
    --muted: #9aacc2;
    --accent: #43d9ba;
    --blue: #78aaff;
    --danger: #ff8585;
    --warning: #f0c574;
    font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: radial-gradient(ellipse at 70% -20%, #16314a 0, transparent 40%), var(--bg);
    color: var(--text)
}

button,
input,
select {
    font: inherit
}

button,
a {
    touch-action: manipulation
}

a {
    color: inherit
}

.skip-link {
    position: fixed;
    z-index: 20;
    left: 1rem;
    top: -5rem;
    padding: .7rem 1rem;
    background: #fff;
    color: #08111e;
    border-radius: .4rem
}

.skip-link:focus {
    top: 1rem
}

.boot,
.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem
}

.login-card,
.card {
    background: linear-gradient(145deg, rgba(18, 36, 58, .96), rgba(12, 25, 42, .96));
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 18px 60px #0003
}

.login-card {
    width: min(100%, 460px);
    padding: 2rem
}

.brand {
    display: flex;
    align-items: center;
    gap: .8rem;
    font-weight: 750;
    letter-spacing: .02em
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #43d9ba, #479dff);
    color: #07111f;
    font-weight: 900
}

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

.eyebrow {
    text-transform: uppercase;
    letter-spacing: .13em;
    font-size: .72rem;
    color: var(--accent);
    font-weight: 700
}

h1,
h2,
h3,
p {
    margin-top: 0
}

h1 {
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    line-height: 1.15;
    margin-bottom: .5rem
}

h2 {
    font-size: 1.15rem
}

label {
    display: block;
    font-size: .86rem;
    font-weight: 650;
    margin: .9rem 0 .35rem
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #38516d;
    border-radius: 8px;
    background: #081525;
    color: var(--text);
    padding: .78rem .85rem;
    min-height: 44px
}

textarea {
    min-height: 8rem;
    resize: vertical;
    font: inherit;
}

input[type="checkbox"] {
    width: 1.15rem;
    min-height: 1.15rem;
    margin: 0 .45rem 0 0;
    vertical-align: middle;
}

label:has(input[type="checkbox"]) {
    display: flex;
    align-items: flex-start;
    gap: .3rem;
}

#rbac-panel textarea {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    overflow-wrap: anywhere;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
    outline: 3px solid #43d9ba;
    outline-offset: 2px
}

.btn {
    min-height: 42px;
    border: 1px solid #405976;
    border-radius: 8px;
    background: #172b42;
    color: var(--text);
    padding: .62rem .9rem;
    cursor: pointer;
    font-weight: 650
}

.btn:hover {
    background: #223c59
}

.btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #06151b
}

.btn.danger {
    border-color: #764747;
    color: #ffc2c2
}

.btn:disabled {
    opacity: .55;
    cursor: not-allowed
}

.form-actions {
    display: flex;
    gap: .65rem;
    align-items: center;
    margin-top: 1.2rem;
    flex-wrap: wrap
}

.form-error,
.alert {
    border: 1px solid #814c4c;
    background: #321f28;
    color: #ffd2d2;
    padding: .75rem;
    border-radius: 8px;
    margin: .8rem 0
}

.notice {
    border: 1px solid #806839;
    background: #2e291e;
    color: #f7dfa8;
    padding: .8rem;
    border-radius: 8px;
    margin: 1rem 0
}

.success {
    border: 1px solid #277666;
    background: #102f2c;
    color: #b4fff0;
    padding: .8rem;
    border-radius: 8px;
    margin: 1rem 0
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr)
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid var(--line);
    background: #091524f2;
    padding: 1.1rem .85rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem
}

.sidebar .brand {
    padding: .25rem .4rem
}

.workspace-label {
    padding: 0 .5rem;
    color: var(--muted);
    font-size: .7rem;
    letter-spacing: .12em;
    text-transform: uppercase
}

.nav-list {
    display: grid;
    gap: .2rem
}

.nav-list a {
    display: flex;
    gap: .7rem;
    align-items: center;
    text-decoration: none;
    padding: .58rem .65rem;
    border-radius: 8px;
    color: #b9c9dc;
    font-size: .86rem
}

.nav-list a:hover,
.nav-list a[aria-current=page] {
    background: #172a40;
    color: #fff
}

.nav-list a[aria-current=page] {
    box-shadow: inset 3px 0 var(--accent)
}

.nav-icon {
    color: var(--blue);
    width: 1.1rem;
    text-align: center;
    font-size: .9rem
}

.sidebar-bottom {
    margin-top: auto;
    border-top: 1px solid var(--line);
    padding-top: 1rem
}

.account {
    font-size: .83rem;
    padding: .4rem .55rem
}

.account strong {
    display: block
}

.mobile-bar {
    display: none
}

.content {
    min-width: 0;
    padding: 1.5rem clamp(1rem, 3vw, 2.5rem) 3rem
}

.topline {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.8rem;
    color: var(--muted);
    font-size: .82rem
}

.breadcrumbs {
    display: flex;
    gap: .45rem;
    align-items: center
}

.breadcrumbs a {
    color: var(--blue);
    text-decoration: none
}

.page-heading {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1.5rem
}

.page-heading p {
    color: var(--muted);
    max-width: 760px;
    margin-bottom: 0
}

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

.card {
    padding: 1.1rem;
    grid-column: span 12
}

.card.half {
    grid-column: span 6
}

.card.third {
    grid-column: span 4
}

.card h2 {
    margin-bottom: .45rem
}

.state-box {
    border: 1px dashed #3b526c;
    border-radius: 10px;
    padding: 1.05rem;
    color: var(--muted);
    background: #091727a8
}

.state-box strong {
    display: block;
    color: var(--text);
    margin-bottom: .25rem
}

.table-wrap {
    overflow-x: auto
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: .9rem
}

th,
td {
    padding: .72rem .6rem;
    border-bottom: 1px solid var(--line);
    white-space: nowrap
}

th {
    color: var(--muted);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .08em
}

.pill {
    display: inline-flex;
    border: 1px solid #3c596f;
    border-radius: 999px;
    padding: .15rem .55rem;
    color: #b7cce0;
    font-size: .75rem
}

.toolbar {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-wrap: wrap
}

.toolbar select {
    width: auto;
    min-width: 180px
}

.empty-project {
    padding: 2rem;
    text-align: center;
    color: var(--muted)
}

.terminal {
    font: .84rem/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
    background: #050d17;
    border: 1px solid #263a52;
    min-height: 230px;
    max-height: 52vh;
    overflow: auto;
    padding: .85rem;
    border-radius: 8px;
    white-space: pre-wrap;
    word-break: break-word
}

.event-row {
    padding: .35rem .1rem;
    border-bottom: 1px solid #ffffff0c
}

.event-time {
    color: #7189a5
}

.event-kind {
    color: var(--accent)
}

.status-line {
    display: flex;
    align-items: center;
    gap: .5rem
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #8293a7
}

.status-dot.live {
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent)
}

.status-dot.error {
    background: var(--danger)
}

.inline-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .2rem 1rem
}

.inline-form .wide {
    grid-column: span 2
}

.notice-list {
    margin: .5rem 0 0;
    padding-left: 1.2rem;
    color: var(--muted)
}

.login-switch {
    margin-top: 1rem;
    border: 0;
    background: none;
    color: var(--blue);
    cursor: pointer;
    text-decoration: underline;
    padding: .3rem 0
}

.small {
    font-size: .82rem
}

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

footer {
    color: #6f8197;
    font-size: .75rem;
    padding: .8rem .55rem
}

@media(max-width:900px) {
    .app-shell {
        grid-template-columns: 1fr
    }

    .sidebar {
        position: fixed;
        z-index: 10;
        left: 0;
        top: 58px;
        width: min(310px, 88vw);
        height: calc(100vh - 58px);
        transform: translateX(-102%);
        transition: transform .2s ease;
        box-shadow: 16px 0 40px #0008
    }

    .sidebar.open {
        transform: translateX(0)
    }

    .mobile-bar {
        height: 58px;
        display: flex;
        position: sticky;
        z-index: 11;
        top: 0;
        align-items: center;
        justify-content: space-between;
        background: #091524f2;
        border-bottom: 1px solid var(--line);
        padding: 0 1rem
    }

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

    .content {
        padding-top: 1rem
    }

    .card.third {
        grid-column: span 6
    }
}

@media(max-width:620px) {
    .content {
        padding-left: .9rem;
        padding-right: .9rem
    }

    .topline {
        margin-bottom: 1rem
    }

    .page-heading {
        display: block
    }

    .page-heading>.btn {
        margin-top: 1rem
    }

    .card.half,
    .card.third {
        grid-column: span 12
    }

    .inline-form {
        grid-template-columns: 1fr
    }

    .inline-form .wide {
        grid-column: span 1
    }

    .login-card {
        padding: 1.35rem
    }

    .toolbar select {
        width: 100%
    }
}

@media(prefers-reduced-motion:reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important
    }
}

/* Actionable Remediation & Live Verification Hub */
.remediation-section {
    margin-top: 1.5rem;
}

.remediation-toolbar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    padding: 0.85rem 1rem;
    background: rgba(13, 26, 43, 0.75);
    border: 1px solid var(--line);
    border-radius: 10px;
}

.remediation-toolbar select {
    min-height: 38px;
    padding: 0.45rem 0.75rem;
    width: auto;
    font-size: 0.88rem;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.task-card {
    background: linear-gradient(145deg, #0f2136 0%, #0a1727 100%);
    border: 1px solid #233a54;
    border-radius: 12px;
    padding: 1.25rem 1.4rem;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.task-card:hover {
    border-color: #3b5f88;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.6rem;
}

.task-title-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.task-title {
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.task-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.task-badge.schema {
    background: #2b1f48;
    color: #cb9fff;
    border: 1px solid #4a347b;
}

.task-badge.meta {
    background: #193245;
    color: #76c5ff;
    border: 1px solid #2a5373;
}

.task-badge.technical {
    background: #1c3834;
    color: #5eead4;
    border: 1px solid #276359;
}

.task-badge.onpage {
    background: #3b2f1e;
    color: #fcd34d;
    border: 1px solid #6b5128;
}

.task-badge.critical {
    background: #451a1a;
    color: #fca5a5;
    border: 1px solid #7f2828;
}

.task-badge.high {
    background: #3c2415;
    color: #fdba74;
    border: 1px solid #7c3f1d;
}

.task-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 750;
    letter-spacing: 0.03em;
}

.task-pill.verified {
    background: #0f3d32;
    color: #4ade80;
    border: 1px solid #166534;
}

.task-pill.deployed {
    background: #172a4f;
    color: #93c5fd;
    border: 1px solid #1e40af;
}

.task-pill.pending {
    background: #3b2c17;
    color: #fde047;
    border: 1px solid #854d0e;
}

.task-pill.failed {
    background: #421c1c;
    color: #f87171;
    border: 1px solid #991b1b;
}

.task-target-url {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.84rem;
    color: var(--muted);
    margin-bottom: 0.75rem;
    display: block;
    word-break: break-all;
}

.task-desc {
    color: #c9d6e4;
    font-size: 0.92rem;
    line-height: 1.5;
    margin-bottom: 0.85rem;
}

.code-box-wrap {
    margin: 0.85rem 0;
    background: #060e18;
    border: 1px solid #24354a;
    border-radius: 8px;
    overflow: hidden;
}

.code-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.75rem;
    background: #0a1726;
    border-bottom: 1px solid #1c2b3d;
    font-size: 0.78rem;
    color: var(--muted);
}

.code-box-pre {
    margin: 0;
    padding: 0.85rem 1rem;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.85rem;
    color: #7dd3fc;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 250px;
    overflow-y: auto;
}

.probe-banner {
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    font-size: 0.84rem;
    margin: 0.75rem 0;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.probe-banner.pass {
    background: #0d2822;
    border: 1px solid #10b981;
    color: #6ee7b7;
}

.probe-banner.fail {
    background: #2b1414;
    border: 1px solid #ef4444;
    color: #fca5a5;
}

.task-actions {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.copy-btn {
    background: #14283e;
    border: 1px solid #284462;
    color: #e2e8f0;
    padding: 0.25rem 0.55rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
}

.copy-btn:hover {
    background: #1e3a5a;
}

/* ==========================================================================
   Autonomous Campaign Hub & Feasibility Engine
   ========================================================================== */

.autonomous-hub {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.milestone-card {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.milestone-card.completed {
    border-color: #238636;
}

.milestone-card.in-progress {
    border-color: #388bfd;
    box-shadow: 0 0 12px rgba(56, 139, 253, 0.15);
}

.milestone-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.6rem;
}

.milestone-phase-num {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent);
    letter-spacing: 0.5px;
}

.milestone-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: #f0f6fc;
    margin: 0.2rem 0 0.5rem;
    line-height: 1.35;
}

.milestone-progress-track {
    height: 6px;
    background: #21262d;
    border-radius: 3px;
    overflow: hidden;
    margin: 0.4rem 0 0.8rem;
}

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

.milestone-progress-fill.green {
    background: #238636;
}

.milestone-progress-fill.blue {
    background: #388bfd;
}

.milestone-deliverable-item {
    font-size: 0.8rem;
    color: #8b949e;
    margin-bottom: 0.35rem;
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
}

.badge-p1 {
    background: #490202;
    color: #ff7b72;
    border: 1px solid #da3633;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
}

.badge-p2 {
    background: #382402;
    color: #e3b341;
    border: 1px solid #d29922;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
}

.badge-p3 {
    background: #0d2822;
    color: #7ee787;
    border: 1px solid #238636;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
}

/* ==========================================================================
   Universal Global Floating Voice Assistant ("Ziya Everywhere")
   ========================================================================== */

.floating-voice-orb {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 50px;
    background: linear-gradient(135deg, #0d2f2b 0%, #162430 100%);
    border: 1.5px solid var(--accent);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(39, 118, 102, 0.4), 0 0 10px rgba(78, 222, 196, 0.2);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.floating-voice-orb:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 10px 30px rgba(39, 118, 102, 0.6), 0 0 15px rgba(78, 222, 196, 0.4);
}

.floating-voice-orb:active {
    transform: scale(0.97);
}

.voice-orb-icon {
    font-size: 1.25rem;
    animation: voiceOrbFloat 3s ease-in-out infinite alternate;
}

@keyframes voiceOrbFloat {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-2px);
    }
}

.floating-voice-modal {
    position: fixed;
    bottom: 84px;
    right: 24px;
    z-index: 9999;
    width: 420px;
    max-width: calc(100vw - 32px);
    background: rgba(13, 17, 23, 0.96);
    backdrop-filter: blur(20px);
    border: 1px solid #30363d;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 0 20px rgba(39, 118, 102, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: voiceModalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-voice-modal[hidden],
.floating-voice-modal.hidden {
    display: none !important;
}

@keyframes voiceModalSlideUp {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.voice-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #161b22;
    border-bottom: 1px solid #30363d;
}

.voice-modal-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 480px;
    overflow-y: auto;
}

.voice-waveform {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 32px;
}

.wave-bar {
    width: 4px;
    height: 8px;
    background: var(--accent);
    border-radius: 2px;
    transition: height 0.15s ease;
}

.voice-waveform.listening .wave-bar {
    animation: wavePulse 0.8s ease-in-out infinite alternate;
}

.voice-waveform.listening .wave-bar:nth-child(2) {
    animation-delay: 0.1s;
}

.voice-waveform.listening .wave-bar:nth-child(3) {
    animation-delay: 0.2s;
}

.voice-waveform.listening .wave-bar:nth-child(4) {
    animation-delay: 0.3s;
}

.voice-waveform.listening .wave-bar:nth-child(5) {
    animation-delay: 0.2s;
}

.voice-waveform.listening .wave-bar:nth-child(6) {
    animation-delay: 0.1s;
}

@keyframes wavePulse {
    0% {
        height: 6px;
    }

    100% {
        height: 26px;
    }
}

.voice-transcript-box {
    background: #0d1117;
    border: 1px solid #21262d;
    border-radius: 8px;
    padding: 10px 12px;
    min-height: 40px;
    font-size: 0.86rem;
    color: #c9d1d9;
    line-height: 1.4;
}

.voice-response-card {
    background: #111a24;
    border: 1px solid #1f364d;
    border-radius: 8px;
    padding: 12px;
}

.voice-telemetry-pill {
    background: #1f2937;
    border: 1px solid #374151;
    color: #9ca3af;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.74rem;
}

.voice-telemetry-pill strong {
    color: #e5e7eb;
}

/* 35-Agent Autonomous Swarm Fleet Cockpit Styles */
.swarm-telemetry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding: 1.1rem 1.4rem;
    background: rgba(18, 22, 28, 0.9);
    border: 1px solid #30363d;
    border-radius: 12px;
}

.swarm-phase-pipeline {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.swarm-phase-chip {
    flex: 1;
    min-width: 220px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 10px 14px;
    position: relative;
    transition: all 0.2s ease;
}

.swarm-phase-chip.completed {
    border-color: #238636;
    background: rgba(35, 134, 54, 0.08);
}

.swarm-phase-chip.in-progress {
    border-color: #388bfd;
    background: rgba(56, 139, 253, 0.08);
    box-shadow: 0 0 10px rgba(56, 139, 253, 0.15);
}

.swarm-phase-chip.failed {
    border-color: #da3633;
    background: rgba(218, 54, 51, 0.08);
    box-shadow: 0 0 10px rgba(218, 54, 51, 0.15);
}

.swarm-phase-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #f0f6fc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.swarm-phase-bar {
    height: 4px;
    background: #21262d;
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.swarm-phase-bar-fill {
    height: 100%;
    background: #388bfd;
    border-radius: 2px;
    transition: width 0.35s ease;
}

.swarm-phase-chip.completed .swarm-phase-bar-fill {
    background: #238636;
}

.swarm-fleet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 1.1rem;
    margin-bottom: 1.5rem;
}

.division-card {
    background: rgba(13, 17, 23, 0.95);
    border: 1px solid #21262d;
    border-radius: 10px;
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.division-card:hover {
    transform: translateY(-2px);
    border-color: #388bfd;
}

.division-card.active {
    border-color: var(--accent);
    box-shadow: 0 0 16px rgba(39, 118, 102, 0.3);
}

.division-card.completed {
    border-color: #238636;
}

.division-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
}

.division-title {
    font-size: 0.94rem;
    font-weight: 700;
    color: #e6edf3;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.division-agent-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.6rem;
}

.agent-pill {
    font-size: 0.72rem;
    background: #161b22;
    border: 1px solid #30363d;
    color: #8b949e;
    padding: 2px 7px;
    border-radius: 4px;
    font-family: monospace;
    transition: all 0.15s ease;
}

.agent-pill.busy {
    border-color: #238636;
    color: #7ee787;
    background: rgba(35, 134, 54, 0.18);
    animation: agentPulse 1.5s infinite;
}

@keyframes agentPulse {
    0% {
        opacity: 0.8;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.8;
    }
}

.division-telemetry {
    font-size: 0.82rem;
    color: #8b949e;
    min-height: 2.4rem;
    margin: 0.4rem 0;
    line-height: 1.4;
}

/* Dual-Mode Website Audit — Mission Control mode selection & results */
.field-label {
    display: block;
    font-size: .86rem;
    font-weight: 650;
    margin: .9rem 0 .35rem
}

.audit-mode-toggle {
    display: inline-flex;
    flex-wrap: wrap;
    gap: .3rem;
    padding: .28rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #081525
}

.audit-mode-option {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    margin: 0;
    padding: .5rem .85rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 650;
    color: var(--muted);
    transition: background .15s ease, color .15s ease
}

.audit-mode-option input {
    width: auto;
    min-height: 0;
    margin: 0
}

.audit-mode-option:has(input:checked) {
    background: #123a52;
    color: var(--text);
    box-shadow: inset 0 0 0 1px var(--accent)
}

.keyword-row[hidden] {
    display: none
}

.audit-view-card {
    margin-top: 1rem
}

.audit-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    border-bottom: 1px solid var(--line);
    padding-bottom: .6rem;
    margin-bottom: 1rem
}

.audit-tab {
    border: 1px solid transparent;
    background: #0c1c2e;
    color: var(--muted);
    border-radius: 8px 8px 0 0;
    padding: .55rem .9rem;
    cursor: pointer;
    font-weight: 650
}

.audit-tab:hover {
    color: var(--text);
    background: #12283f
}

.audit-tab.active {
    color: var(--text);
    background: #123a52;
    border-color: var(--line);
    box-shadow: inset 0 -2px var(--accent)
}

.audit-mode-filter {
    display: inline-flex;
    gap: .3rem;
    margin-bottom: .9rem
}

.audit-filter {
    border: 1px solid var(--line);
    background: #081525;
    color: var(--muted);
    border-radius: 999px;
    padding: .3rem .8rem;
    cursor: pointer;
    font-weight: 650;
    font-size: .82rem
}

.audit-filter.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #06151b
}

.audit-empty {
    color: var(--muted)
}

.site-health-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.1rem
}

.site-health-score {
    display: flex;
    align-items: baseline;
    gap: .6rem
}

.site-health-score strong {
    font-size: 2.4rem;
    line-height: 1;
    color: var(--accent)
}

.site-health-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .4rem;
    text-align: right
}

.site-health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: .85rem;
    margin: .6rem 0 1.3rem
}

.site-health-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: linear-gradient(145deg, #0f2136 0%, #0a1727 100%);
    padding: .85rem 1rem
}

.site-health-card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    font-size: .82rem;
    color: var(--muted);
    text-transform: capitalize
}

.site-health-card-score {
    font-size: 1.7rem;
    font-weight: 750;
    margin: .3rem 0 .15rem
}

.grade-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.1rem;
    height: 2.1rem;
    border-radius: 8px;
    font-weight: 800;
    font-size: 1rem;
    border: 1px solid #3c596f;
    background: #12243a;
    color: #b7cce0
}

.grade-badge.grade-a {
    background: #0f3d32;
    color: #4ade80;
    border-color: #166534
}

.grade-badge.grade-b {
    background: #123a52;
    color: #7ee0ff;
    border-color: #1e5a7a
}

.grade-badge.grade-c {
    background: #3b2c17;
    color: #fde047;
    border-color: #854d0e
}

.grade-badge.grade-d {
    background: #3c2415;
    color: #fdba74;
    border-color: #7c3f1d
}

.grade-badge.grade-f {
    background: #451a1a;
    color: #fca5a5;
    border-color: #7f2828
}

.comparison-summary {
    display: flex;
    align-items: center;
    gap: .7rem;
    margin: .4rem 0 .9rem
}

.comparison-score {
    font-size: 1.15rem;
    font-weight: 700
}

.delta {
    display: inline-block;
    padding: .1rem .5rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
    min-width: 2.6rem;
    text-align: center
}

.delta-up {
    background: #0f3d32;
    color: #4ade80
}

.delta-down {
    background: #421c1c;
    color: #f87171
}

.delta-flat {
    background: #1c2b3d;
    color: var(--muted)
}

.loading-state {
    display: flex;
    align-items: center;
    gap: .6rem
}

.spinner {
    width: 14px;
    height: 14px;
    border: 2px solid #2b445f;
    border-top-color: var(--accent);
    border-radius: 50%;
    display: inline-block;
    animation: auditSpin .8s linear infinite
}

@keyframes auditSpin {
    to {
        transform: rotate(360deg)
    }
}

.btn.small {
    min-height: 30px;
    padding: .3rem .7rem;
    font-size: .78rem
}

#audit-progress {
    display: flex;
    align-items: center;
    gap: .7rem;
    flex-wrap: wrap
}

@media(max-width:620px) {
    .site-health-meta {
        align-items: flex-start;
        text-align: left
    }

    .audit-tabs {
        gap: .25rem
    }
}

.report-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin: 1rem 0
}

.report-fieldset {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #091727a8;
    padding: .9rem 1rem 1rem;
    margin: 0
}

.report-fieldset legend {
    color: var(--accent);
    font-weight: 700;
    font-size: .78rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 0 .35rem
}

.report-option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .7rem;
    margin: .45rem 0
}

.report-option-row label {
    color: var(--muted);
    font-size: .84rem
}

.report-option-row select,
.report-option-row input {
    width: auto;
    min-width: 150px;
    max-width: 60%;
    box-sizing: border-box
}

.report-option-row input[type=color] {
    min-width: 52px;
    width: 52px;
    height: 30px;
    padding: 0
}

.report-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: .3rem .8rem
}

.report-check {
    display: flex;
    align-items: center;
    gap: .45rem;
    color: var(--muted);
    font-size: .84rem
}

.report-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    flex-wrap: wrap
}

.report-severity-legend {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap
}

.severity-badge {
    display: inline-block;
    padding: .12rem .55rem;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 700;
    border: 1px solid transparent;
    line-height: 1.35
}

.severity-critical {
    background: #421c1c;
    color: #f87171;
    border-color: #7f2828
}

.severity-high {
    background: #3c2a14;
    color: #f0c574;
    border-color: #6b521f
}

.severity-medium {
    background: #12283f;
    color: var(--blue);
    border-color: #2b4666
}

.severity-low {
    background: #0f3d32;
    color: #4ade80;
    border-color: #277666
}

/* ==========================================================================
   Per-project Settings modal (Portfolio row → ⚙️ Settings)
   ========================================================================== */
.row-actions {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: clamp(1rem, 4vh, 3rem) 1rem;
    overflow-y: auto;
    background: rgba(3, 8, 15, .72);
    backdrop-filter: blur(4px);
    animation: settingsFadeIn .18s ease
}

.modal-overlay[hidden] {
    display: none !important
}

@keyframes settingsFadeIn {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

.modal-card {
    width: min(100%, 760px);
    background: linear-gradient(145deg, rgba(18, 36, 58, .98), rgba(12, 25, 42, .98));
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 18px 60px #0008;
    padding: 1.3rem 1.4rem 1.6rem;
    animation: settingsSlideUp .22s cubic-bezier(.16, 1, .3, 1)
}

@keyframes settingsSlideUp {
    from {
        opacity: 0;
        transform: translateY(14px) scale(.98)
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1)
    }
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--line);
    padding-bottom: .7rem;
    margin-bottom: .6rem
}

.modal-head h2 {
    margin: 0
}

.modal-card h3 {
    margin: 1.3rem 0 .45rem;
    font-size: 1rem
}

.modal-card #project-settings-ga form {
    display: grid;
    gap: .2rem 1rem
}

.modal-card #project-settings-form {
    display: grid;
    gap: .45rem 1rem
}

.modal-card #project-settings-form label {
    display: block;
    margin-top: .4rem;
    font-size: .85rem
}

.modal-card #project-settings-form input,
.modal-card #project-settings-form select,
.modal-card #project-settings-form textarea {
    width: 100%
}

.modal-card #project-settings-integrations .state-box {
    display: flex;
    align-items: baseline;
    gap: .35rem
}

.modal-card .form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-top: .8rem
}

#project-settings-message.success small,
.success.small {
    color: #b4fff0
}

.form-error.small {
    color: #ffd2d2
}

.settings-danger {
    margin-top: 1.4rem;
    border: 1px solid #764747;
    border-radius: 12px;
    background: #2a1a1d59;
    padding: 1rem 1.1rem
}

.settings-danger h3 {
    margin-top: 0;
    color: #ffc2c2
}