:root {
    color-scheme: dark;

    --background: #02070c;
    --background-soft: #061019;
    --surface: rgba(9, 20, 30, 0.76);
    --surface-strong: rgba(11, 24, 35, 0.94);
    --surface-light: rgba(255, 255, 255, 0.035);

    --border: rgba(170, 215, 240, 0.14);
    --border-strong: rgba(190, 225, 245, 0.29);

    --text: #f6fafc;
    --muted: #8495a3;

    --white-glow: rgba(255, 248, 230, 0.72);
    --blue: #63b9ff;
    --green: #4ce090;
    --yellow: #ffce6e;
    --purple: #b091ff;
    --red: #ff7783;

    --shadow:
        0 28px 80px rgba(0, 0, 0, 0.42);

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

/* SAMaleph operations center */
:root { --surface:#07111a; --surface-raised:#0b1823; --border:rgba(137,184,207,.16); --text-primary:#eef7fa; --text-secondary:#89a4b2; --accent:#70d7e8; --success:#65d6a2; --warning:#e4b968; --danger:#ef7182; --info:#79aef2; }
.workspace-sidebar{width:218px}.workspace-content{padding:28px 34px 70px}.workspace-nav{overflow:auto;max-height:calc(100vh - 220px)}.workspace-nav-item{font-size:12px;letter-spacing:.04em}.ops-heading,.policy-banner,.entity-card header,.proposal-card header,.proposal-card footer{display:flex;align-items:center;justify-content:space-between;gap:14px}.ops-heading{margin-bottom:22px}.ops-metrics{display:grid;grid-template-columns:repeat(6,1fr);gap:10px;margin-bottom:14px}.ops-metrics article,.ops-panel,.entity-card,.proposal-card,.health-item,.ask-sam-console,.policy-banner,.detail-drawer{border:1px solid var(--border);background:linear-gradient(145deg,rgba(12,29,41,.9),rgba(5,15,23,.82));border-radius:14px}.ops-metrics article{padding:14px}.ops-metrics span,.panel-label,.detail-grid span{display:block;color:var(--text-secondary);font-size:10px;letter-spacing:.15em}.ops-metrics strong{display:block;font-size:24px;margin-top:8px}.ops-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.ops-panel{padding:18px;min-height:116px}.core-mini-state{display:flex;align-items:center;gap:12px;margin:18px 0}.core-mini-state i{width:18px;height:18px;border-radius:50%;background:var(--accent);box-shadow:0 0 24px rgba(112,215,232,.55)}.ask-sam-console{display:grid;grid-template-columns:1fr 180px 120px 90px;align-items:end;gap:14px;padding:16px;margin-top:14px}.ask-sam-console input,.ask-sam-console select,.command-palette input{width:100%;border:1px solid var(--border);background:#050d14;color:var(--text-primary);padding:12px;border-radius:8px}.ask-sam-console span,.ask-sam-console label{font-size:10px;letter-spacing:.12em;color:var(--text-secondary)}.ask-sam-console button,.filter-row button,.settings-grid button,.proposal-card button{border:1px solid var(--border);background:rgba(112,215,232,.07);color:var(--text-primary);padding:11px;border-radius:8px}.entity-grid,.health-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.entity-card,.proposal-card{padding:18px}.entity-card dl{display:grid;grid-template-columns:1fr 1fr;gap:6px;color:var(--text-secondary)}.entity-card dd{text-align:right;color:var(--text-primary)}.state-box{min-height:70px}.view-state{display:flex;flex-direction:column;justify-content:center;min-height:64px;color:var(--text-secondary)}.view-state strong{color:var(--text-primary)}.view-state small{margin-top:6px}.backend-unavailable,.view-state.backend-unavailable{color:var(--warning)}.status-badge{display:inline-flex;padding:4px 7px;border:1px solid currentColor;border-radius:999px;font-size:9px;letter-spacing:.09em}.status-green,.status-idle,.status-configured,.status-operational,.status-passed{color:var(--success)}.status-red,.status-failed,.status-error{color:var(--danger)}.status-unknown,.status-blocked,.status-controlled{color:var(--warning)}.entity-row,.agent-card{width:100%;text-align:left}.detail-drawer{padding:18px;margin-top:14px;display:none}.detail-drawer.open{display:block}.detail-drawer nav,.workflow-strip{color:var(--text-secondary);font-size:11px;line-height:1.8;margin:10px 0 18px}.detail-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}.tag-list{display:flex;flex-wrap:wrap;gap:6px}.tag-list span,.tag-list button{border:1px solid var(--border);background:transparent;color:var(--accent);padding:6px 9px;border-radius:6px}.filter-row{display:flex;gap:7px;flex-wrap:wrap;margin-bottom:16px}.filter-row button.active{border-color:var(--accent);color:var(--accent)}.activity-stream{max-height:62vh;overflow:auto}.activity-row{display:grid;grid-template-columns:160px 180px 1fr auto;gap:14px;align-items:center;padding:12px;border-bottom:1px solid var(--border)}.activity-row time{color:var(--text-secondary);font-size:11px}.health-grid{grid-template-columns:repeat(2,1fr)}.health-item{display:flex;gap:12px;padding:14px}.health-item small{display:block;color:var(--text-secondary);margin-top:4px}.safety-console{display:flex;gap:8px;flex-wrap:wrap;margin-top:16px}.safety-console span,.safety-console strong{padding:8px 11px;border:1px solid var(--border);border-radius:7px;font-size:10px}.policy-banner{padding:16px;margin-bottom:14px}.policy-banner small{color:var(--text-secondary)}#notification-rules{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;border:1px solid var(--border);padding:18px;border-radius:14px;margin:14px 0}.settings-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:16px}.command-palette{width:min(720px,90vw);border:1px solid var(--border);background:#06101a;color:var(--text-primary);border-radius:14px;padding:0}.command-palette::backdrop{background:rgba(0,5,9,.76);backdrop-filter:blur(6px)}.command-palette header{display:flex;gap:10px;padding:14px;border-bottom:1px solid var(--border)}#global-search-results{display:grid;max-height:55vh;overflow:auto;padding:10px}#global-search-results button{display:flex;gap:12px;text-align:left;background:transparent;color:var(--text-primary);border:0;padding:12px;border-radius:7px}#global-search-results button:hover{background:rgba(112,215,232,.08)}#global-search-results button span{color:var(--accent);font-size:10px}.proposal-card{margin-bottom:12px}.proposal-card footer{justify-content:flex-end}.trading-domains p{display:flex;justify-content:space-between}
@media(max-width:1100px){.ops-metrics{grid-template-columns:repeat(3,1fr)}.ops-grid,.entity-grid{grid-template-columns:repeat(2,1fr)}.ask-sam-console{grid-template-columns:1fr 160px}.workspace-sidebar{width:190px}}
@media(max-width:760px){.workspace-sidebar{width:74px}.workspace-nav-item{font-size:0}.workspace-nav-item span{font-size:17px}.workspace-content{padding:18px}.ops-grid,.entity-grid,.health-grid{grid-template-columns:1fr}.ask-sam-console{grid-template-columns:1fr}.activity-row{grid-template-columns:1fr}.ops-metrics{grid-template-columns:repeat(2,1fr)}}

/* Command Center V1: restrained hierarchy over the existing visual system. */
.command-center{max-width:1500px;margin:0 auto}.command-topbar{display:grid;grid-template-columns:auto auto auto auto 1fr auto;align-items:center;gap:18px;margin:-8px 0 18px;padding:12px 16px;border:1px solid var(--border);border-radius:12px;background:rgba(4,13,20,.88);color:var(--text-secondary);font-size:11px}.command-topbar .glass-button{justify-self:end}.sam-top-status{display:flex;align-items:center;gap:8px;color:var(--text-primary);font-weight:650}.event-button,.section-kicker button,.approval-link,.snapshot-grid button{border:0;background:transparent;color:var(--accent);cursor:pointer}.approval-alert{margin-bottom:14px;border:1px solid rgba(228,185,104,.38);border-radius:10px;background:rgba(228,185,104,.08)}.approval-alert button{display:flex;width:100%;justify-content:space-between;padding:12px 16px;border:0;background:transparent;color:var(--warning);cursor:pointer}.command-hero{padding:34px 38px;margin-bottom:18px;border:1px solid var(--border);border-radius:16px;background:#07121b}.hero-status{display:flex;align-items:center;gap:14px}.hero-status h3{margin:0;font-size:44px;letter-spacing:.08em}.command-hero>p{color:var(--text-secondary)}.command-hero label{display:block;margin:24px 0 9px;font-size:21px;color:var(--text-primary)}.command-input{display:grid;grid-template-columns:1fr auto;gap:10px}.command-input input{min-height:58px;padding:0 18px;border:1px solid var(--border-strong);border-radius:10px;background:#040b11;color:var(--text-primary)}.command-input button{padding:0 22px;border:1px solid var(--border);border-radius:10px;background:rgba(112,215,232,.06);color:var(--text-secondary)}.command-hero small{display:block;margin-top:9px;color:var(--text-secondary)}.command-main-grid{display:grid;grid-template-columns:minmax(0,2fr) minmax(260px,1fr);gap:14px;margin-bottom:24px}.mission-focus{min-height:230px}.section-kicker{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px;color:var(--text-secondary);font-size:10px;letter-spacing:.14em}.mission-card header,.decision-card header{display:flex;align-items:center;gap:12px}.mission-card header strong{font-size:21px}.mission-facts{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:18px}.mission-facts p,.decision-card dl{margin:0;padding:10px;border-top:1px solid var(--border)}.mission-facts span,.decision-card dt,.metric-card span,.snapshot-grid span{display:block;color:var(--text-secondary);font-size:9px;letter-spacing:.12em}.pulse-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:10px;margin-bottom:24px}.metric-card{padding:15px;border:1px solid var(--border);border-radius:10px;background:var(--surface)}.metric-card strong{display:block;margin-top:8px;font-size:19px}.command-secondary-grid{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(320px,1fr);gap:14px;margin-bottom:14px}.compact-activity{max-height:310px;overflow:auto}.compact-activity .activity-row{grid-template-columns:110px 120px 1fr auto;padding:9px 4px}.snapshot-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px}.snapshot-grid button{padding:16px;text-align:left;border:1px solid var(--border);border-radius:10px;background:rgba(112,215,232,.035)}.snapshot-grid strong{display:block;margin-top:6px;color:var(--text-primary);font-size:25px}.decision-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.decision-card{padding:15px;border:1px solid var(--border);border-radius:10px;background:rgba(3,11,17,.5)}.decision-card dl{display:grid;grid-template-columns:1fr auto;gap:8px;margin-top:12px}.decision-card dd{margin:0;text-align:right}.decision-card small{color:var(--text-secondary)}.mission-create{margin-top:24px}.status-busy,.status-running,.status-active,.status-live{color:var(--info)}.status-degraded,.status-warning,.status-waiting_approval,.status-block,.status-watch,.status-watch_only{color:var(--warning)}.status-blocked,.status-cancelled{color:var(--danger)}
@media(max-width:1100px){.command-topbar{grid-template-columns:repeat(3,auto)}.command-topbar .glass-button{justify-self:start}.pulse-grid{grid-template-columns:repeat(3,1fr)}.command-secondary-grid{grid-template-columns:1fr}.mission-facts{grid-template-columns:repeat(2,1fr)}}
@media(max-width:760px){.command-topbar{grid-template-columns:1fr 1fr;gap:10px}.command-topbar .glass-button{justify-self:stretch}.command-main-grid,.decision-grid{grid-template-columns:1fr}.command-hero{padding:24px 18px}.hero-status h3{font-size:34px}.pulse-grid{grid-template-columns:repeat(2,1fr)}.mission-facts{grid-template-columns:1fr}.compact-activity .activity-row{grid-template-columns:1fr}.mission-create{display:none}}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    min-width: 320px;
    margin: 0;
    overflow-x: hidden;
    color: var(--text);
    background: var(--background);
}

button,
input {
    font: inherit;
}

button {
    color: inherit;
}

.space-background {
    position: fixed;
    inset: 0;
    z-index: -10;
    overflow: hidden;
    background:
        radial-gradient(
            circle at 50% 42%,
            rgba(35, 61, 82, 0.16),
            transparent 43%
        ),
        linear-gradient(
            180deg,
            #02070c,
            #010408
        );
}

.stars {
    position: absolute;
    inset: -20%;
    opacity: 0.55;
    background-repeat: repeat;
    animation: starDrift 150s linear infinite;
}

.stars-near {
    background-image:
        radial-gradient(
            circle,
            rgba(255, 255, 255, 0.78) 0 1px,
            transparent 1.3px
        );
    background-size: 137px 137px;
}

.stars-far {
    opacity: 0.28;
    background-image:
        radial-gradient(
            circle,
            rgba(170, 210, 255, 0.8) 0 0.7px,
            transparent 1px
        );
    background-size: 73px 73px;
    animation-direction: reverse;
    animation-duration: 240s;
}

.space-haze {
    position: absolute;
    inset: 0;
    opacity: 0.5;
    background:
        radial-gradient(
            ellipse at 50% 46%,
            rgba(120, 170, 210, 0.075),
            transparent 50%
        );
}

@keyframes starDrift {
    to {
        transform: translate3d(
            8%,
            5%,
            0
        );
    }
}

.os-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 30;
    display: flex;
    height: 76px;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    border-bottom: 1px solid rgba(255,255,255,0.035);
    background:
        linear-gradient(
            180deg,
            rgba(2, 7, 12, 0.86),
            rgba(2, 7, 12, 0.3)
        );
    backdrop-filter: blur(14px);
}

.brand {
    display: flex;
    cursor: pointer;
    align-items: center;
    gap: 14px;
    padding: 0;
    border: 0;
    background: transparent;
}

.brand-core {
    position: relative;
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid rgba(255,255,255,0.55);
    border-radius: 50%;
    box-shadow:
        0 0 18px rgba(255,255,255,0.18),
        inset 0 0 14px rgba(255,255,255,0.12);
}

.brand-core::before,
.brand-core::after {
    position: absolute;
    content: "";
    border-radius: 50%;
}

.brand-core::before {
    inset: 7px;
    border: 1px dotted rgba(255,255,255,0.45);
    animation: rotate 16s linear infinite;
}

.brand-core::after {
    width: 9px;
    height: 9px;
    background: white;
    box-shadow:
        0 0 14px white;
}

.brand-core span {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: white;
    transform: translate(13px, -8px);
}

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

.brand strong {
    display: block;
    font-size: 20px;
    font-weight: 550;
    letter-spacing: 0.29em;
}

.brand small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 9px;
    letter-spacing: 0.19em;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 19px;
}

.online-state {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #c9d8df;
    font-size: 11px;
    letter-spacing: 0.1em;
}

.online-state span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 12px var(--green);
}

.clock {
    display: grid;
    gap: 1px;
    text-align: right;
}

.clock strong {
    font-size: 15px;
    font-weight: 450;
}

.clock small {
    color: var(--muted);
    font-size: 9px;
}

.header-icon {
    display: grid;
    width: 37px;
    height: 37px;
    cursor: pointer;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface-light);
}

.sam-os {
    min-height: 100vh;
}

.home-space {
    display: none;
    min-height: 100vh;
    padding: 76px 22px 34px;
}

.home-space.active {
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
}

.core-stage {
    position: relative;
    width: min(78vw, 930px);
    height: min(64vh, 690px);
    min-height: 470px;
}

.core-title {
    position: absolute;
    top: 8px;
    right: 0;
    left: 0;
    z-index: 4;
    text-align: center;
    pointer-events: none;
}

.core-title p {
    margin: 0;
    font-size: clamp(33px, 4vw, 58px);
    font-weight: 360;
    letter-spacing: 0.25em;
}

.core-title span {
    display: block;
    margin-top: 7px;
    color: rgba(244, 249, 252, 0.72);
    font-size: 11px;
    letter-spacing: 0.31em;
}

#sam-core {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    filter:
        drop-shadow(
            0 0 35px rgba(255, 248, 230, 0.28)
        );
}

.core-aura {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: -1;
    width: 45%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: rgba(255, 248, 225, 0.12);
    filter: blur(70px);
    transform: translate(-50%, -50%);
    animation: auraBreathe 4.8s ease-in-out infinite;
}

@keyframes auraBreathe {
    50% {
        opacity: 0.65;
        transform:
            translate(-50%, -50%)
            scale(1.15);
    }
}

.core-status {
    position: absolute;
    right: 0;
    bottom: 14px;
    left: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: rgba(240, 248, 250, 0.84);
    font-size: 10px;
    letter-spacing: 0.13em;
}

.core-status span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 10px var(--green);
}

.welcome-area {
    width: min(760px, 100%);
    margin-top: -8px;
    text-align: center;
}

.welcome-area h1 {
    margin: 0;
    font-size: clamp(24px, 3vw, 36px);
    font-weight: 370;
    letter-spacing: -0.025em;
}

.welcome-area > p {
    margin: 9px 0 24px;
    color: var(--muted);
    font-size: 14px;
}

.command-box {
    display: grid;
    grid-template-columns: 54px 1fr 54px;
    min-height: 60px;
    align-items: center;
    border: 1px solid var(--border-strong);
    border-radius: 31px;
    background:
        linear-gradient(
            180deg,
            rgba(15, 29, 41, 0.77),
            rgba(7, 16, 24, 0.84)
        );
    box-shadow:
        0 18px 55px rgba(0,0,0,0.3),
        inset 0 0 20px rgba(255,255,255,0.018);
    backdrop-filter: blur(17px);
}

.command-box:focus-within {
    border-color: rgba(185, 221, 245, 0.5);
    box-shadow:
        0 0 0 4px rgba(120, 185, 230, 0.055),
        0 20px 65px rgba(0,0,0,0.35);
}

.command-box input {
    width: 100%;
    border: 0;
    outline: 0;
    color: var(--text);
    background: transparent;
    font-size: 14px;
}

.command-box input::placeholder {
    color: #657683;
}

.voice-button,
.send-button {
    display: grid;
    width: 42px;
    height: 42px;
    cursor: pointer;
    place-items: center;
    justify-self: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: rgba(255,255,255,0.025);
}

.send-button {
    border-color: rgba(185, 220, 255, 0.55);
    color: white;
    box-shadow:
        0 0 18px rgba(130, 190, 255, 0.12);
    font-size: 22px;
}

.voice-bars {
    display: flex;
    height: 20px;
    align-items: center;
    gap: 2px;
}

.voice-bars i {
    display: block;
    width: 2px;
    height: 8px;
    border-radius: 3px;
    background: #dceef7;
}

.voice-bars i:nth-child(2),
.voice-bars i:nth-child(4) {
    height: 15px;
}

.voice-bars i:nth-child(3) {
    height: 20px;
}

.voice-button.listening i {
    animation: voiceWave 0.8s ease-in-out infinite alternate;
}

.voice-button.listening i:nth-child(2) {
    animation-delay: -0.2s;
}

.voice-button.listening i:nth-child(3) {
    animation-delay: -0.4s;
}

.voice-button.listening i:nth-child(4) {
    animation-delay: -0.1s;
}

@keyframes voiceWave {
    to {
        height: 4px;
        opacity: 0.45;
    }
}

.quick-commands {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 9px;
    margin-top: 16px;
}

.quick-commands button {
    display: flex;
    min-height: 38px;
    cursor: pointer;
    align-items: center;
    gap: 8px;
    padding: 0 15px;
    border: 1px solid var(--border);
    border-radius: 20px;
    color: #a8b7c1;
    background: rgba(255,255,255,0.018);
    font-size: 11px;
}

.quick-commands button:hover {
    border-color: var(--border-strong);
    color: white;
    background: rgba(255,255,255,0.045);
}

.quick-commands span {
    color: white;
}

.workspace {
    display: none;
    min-height: 100vh;
    padding-top: 76px;
}

.workspace.active {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
}

.workspace-sidebar {
    position: fixed;
    top: 76px;
    bottom: 0;
    left: 0;
    z-index: 15;
    display: flex;
    width: 220px;
    flex-direction: column;
    padding: 20px 14px;
    border-right: 1px solid var(--border);
    background:
        linear-gradient(
            180deg,
            rgba(6, 15, 23, 0.94),
            rgba(3, 9, 14, 0.96)
        );
    backdrop-filter: blur(18px);
}

.mini-core-button {
    display: flex;
    cursor: pointer;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: 1px solid transparent;
    border-radius: 13px;
    background: transparent;
    text-align: left;
}

.mini-core-button:hover {
    border-color: var(--border);
    background: var(--surface-light);
}

#mini-core {
    width: 48px;
    height: 48px;
}

.mini-core-button strong {
    display: block;
    font-size: 12px;
}

.mini-core-button small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 9px;
}

.workspace-nav {
    display: grid;
    gap: 6px;
    margin-top: 25px;
}

.workspace-nav-item {
    display: flex;
    width: 100%;
    cursor: pointer;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: #8fa1ad;
    background: transparent;
    text-align: left;
    font-size: 12px;
}

.workspace-nav-item:hover {
    color: white;
    background: var(--surface-light);
}

.workspace-nav-item.active {
    border-color: rgba(150, 205, 245, 0.18);
    color: white;
    background:
        linear-gradient(
            90deg,
            rgba(65, 125, 180, 0.25),
            rgba(65, 125, 180, 0.06)
        );
}

.workspace-nav-item span {
    width: 20px;
    text-align: center;
}

.back-home-button {
    margin-top: auto;
    cursor: pointer;
    padding: 11px;
    border: 1px solid var(--border);
    border-radius: 11px;
    color: var(--muted);
    background: transparent;
}

.workspace-content {
    grid-column: 2;
    min-width: 0;
    padding: 33px;
}

.workspace-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 25px;
}

.workspace-eyebrow {
    margin: 0;
    color: #7991a0;
    font-size: 9px;
    letter-spacing: 0.22em;
}

.workspace-header h2 {
    margin: 5px 0 5px;
    font-size: 31px;
    font-weight: 420;
}

.workspace-header > div > p:last-child {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.workspace-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 18px;
    color: #a7b6bf;
    font-size: 9px;
    letter-spacing: 0.1em;
}

.workspace-status span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
}

.workspace-panel {
    display: none;
    animation: panelIn 0.42s ease;
}

.workspace-panel.active {
    display: block;
}

@keyframes panelIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 19px;
}

.section-heading h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 460;
}

.section-heading p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.glass-button {
    cursor: pointer;
    padding: 9px 13px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    color: #dbe8ee;
    background: rgba(255,255,255,0.025);
    font-size: 11px;
}

.glass-button:hover {
    background: rgba(255,255,255,0.055);
}

.portfolio-overview {
    display: grid;
    grid-template-columns:
        minmax(0, 1.65fr)
        minmax(280px, 0.75fr);
    gap: 16px;
}

.hero-card,
.glass-card,
.report-reader {
    border: 1px solid var(--border);
    border-radius: 16px;
    background:
        linear-gradient(
            150deg,
            rgba(14, 29, 41, 0.82),
            rgba(6, 16, 24, 0.8)
        );
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.hero-card {
    position: relative;
    overflow: hidden;
    min-height: 290px;
    padding: 23px;
}

.hero-card > span,
.glass-card > span {
    color: #8ca0ad;
    font-size: 9px;
    letter-spacing: 0.16em;
}

.hero-card strong {
    display: block;
    max-width: 550px;
    margin-top: 30px;
    font-size: clamp(26px, 4vw, 47px);
    font-weight: 370;
}

.hero-card p {
    max-width: 520px;
    margin: 13px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.portfolio-wave {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 130px;
    opacity: 0.65;
}

.portfolio-wave svg {
    width: 100%;
    height: 100%;
}

.portfolio-wave path {
    fill: none;
    stroke: #66b6ff;
    stroke-width: 2;
    filter:
        drop-shadow(
            0 0 8px rgba(80, 170, 255, 0.55)
        );
}

.glass-card {
    padding: 20px;
}

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

.stock-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
}

.stock-list li:last-child {
    border-bottom: 0;
}

.stock-list strong {
    font-size: 11px;
    font-weight: 500;
}

.stock-list small {
    color: var(--muted);
    font-size: 9px;
}

.data-grid,
.placeholder-grid,
.system-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 15px;
    margin-top: 16px;
}

.backtest-card {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}

.backtest-card h4 {
    overflow: hidden;
    margin: 10px 0 4px;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.backtest-card > span {
    color: var(--blue);
    font-size: 9px;
    letter-spacing: 0.12em;
}

.backtest-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 15px;
}

.backtest-metrics div {
    padding: 9px;
    border-radius: 9px;
    background: rgba(255,255,255,0.025);
}

.backtest-metrics small {
    display: block;
    color: var(--muted);
    font-size: 8px;
}

.backtest-metrics strong {
    display: block;
    margin-top: 4px;
    font-size: 12px;
}

.agent-card {
    display: grid;
    grid-template-columns: 45px 1fr auto;
    align-items: center;
    gap: 12px;
}

.agent-symbol {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    color: white;
    background: rgba(255,255,255,0.025);
}

.agent-card strong {
    display: block;
    font-size: 12px;
}

.agent-card div > span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 9px;
}

.state-ready {
    color: var(--green);
    font-size: 8px;
}

.project-card span {
    color: #647b89;
    font-size: 9px;
}

.project-card h4 {
    margin: 19px 0 8px;
    font-size: 16px;
    font-weight: 470;
}

.project-card p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.55;
}

.report-layout {
    display: grid;
    grid-template-columns:
        minmax(280px, 0.75fr)
        minmax(420px, 1.45fr);
    gap: 16px;
}

.report-list {
    display: grid;
    align-content: start;
    gap: 8px;
}

.report-item {
    cursor: pointer;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 11px;
    color: inherit;
    background: var(--surface);
    text-align: left;
}

.report-item:hover,
.report-item.active {
    border-color: var(--border-strong);
    background: rgba(255,255,255,0.045);
}

.report-item strong {
    display: block;
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-item small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 8px;
}

.report-reader {
    min-width: 0;
    padding: 18px;
}

.report-reader h4 {
    margin: 0 0 14px;
    font-size: 14px;
}

.report-reader pre {
    overflow: auto;
    max-height: calc(100vh - 235px);
    margin: 0;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: #bed0da;
    background: rgba(1, 6, 10, 0.6);
    font-family:
        "SFMono-Regular",
        Consolas,
        monospace;
    font-size: 10px;
    line-height: 1.55;
    white-space: pre-wrap;
}

.empty-section {
    display: grid;
    min-height: 430px;
    place-items: center;
    align-content: center;
    padding: 45px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    text-align: center;
}

.empty-symbol {
    display: grid;
    width: 75px;
    height: 75px;
    place-items: center;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    color: white;
    box-shadow:
        0 0 25px rgba(255,255,255,0.08);
    font-size: 27px;
}

.empty-section h3 {
    margin: 23px 0 8px;
    font-size: 22px;
    font-weight: 430;
}

.empty-section p {
    max-width: 440px;
    margin: 0 0 20px;
    color: var(--muted);
    line-height: 1.65;
}

.system-card {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}

.system-card span {
    color: var(--muted);
    font-size: 9px;
}

.system-card strong {
    display: block;
    margin-top: 10px;
    font-size: 18px;
    font-weight: 430;
}

.sam-companion {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 50;
    display: none;
    width: min(390px, calc(100vw - 40px));
    overflow: hidden;
    border: 1px solid var(--border-strong);
    border-radius: 17px;
    background: rgba(7, 17, 25, 0.97);
    box-shadow:
        0 28px 90px rgba(0,0,0,0.55);
    backdrop-filter: blur(24px);
}

.sam-companion.active {
    display: block;
    animation: companionIn 0.25s ease;
}

@keyframes companionIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
}

.sam-companion header {
    display: grid;
    grid-template-columns: 36px 1fr 30px;
    align-items: center;
    gap: 10px;
    padding: 13px;
    border-bottom: 1px solid var(--border);
}

.companion-core {
    position: relative;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid rgba(255,255,255,0.45);
    border-radius: 50%;
    box-shadow:
        0 0 14px rgba(255,255,255,0.12);
}

.companion-core::after {
    width: 8px;
    height: 8px;
    content: "";
    border-radius: 50%;
    background: white;
    box-shadow: 0 0 12px white;
}

.sam-companion header strong {
    display: block;
    font-size: 11px;
}

.sam-companion header small {
    color: var(--green);
    font-size: 8px;
}

.sam-companion header button {
    cursor: pointer;
    border: 0;
    color: var(--muted);
    background: transparent;
    font-size: 20px;
}

.companion-messages {
    display: grid;
    max-height: 310px;
    gap: 9px;
    overflow-y: auto;
    padding: 14px;
}

.sam-message,
.user-message {
    max-width: 86%;
    padding: 11px 12px;
    border-radius: 12px;
    font-size: 10px;
    line-height: 1.5;
}

.sam-message {
    justify-self: start;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.035);
}

.user-message {
    justify-self: end;
    background: rgba(65, 125, 190, 0.25);
}

.companion-input {
    display: grid;
    grid-template-columns: 1fr 38px;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--border);
}

.companion-input input {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: 0;
    color: white;
    background: rgba(255,255,255,0.025);
    font-size: 10px;
}

.companion-input button {
    cursor: pointer;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
}

.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 100;
    pointer-events: none;
    padding: 12px 15px;
    border: 1px solid var(--border-strong);
    border-radius: 11px;
    opacity: 0;
    background: var(--surface-strong);
    box-shadow: var(--shadow);
    font-size: 11px;
    transform: translateY(12px);
    transition: 180ms ease;
}

.toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.webgl-fallback {
    border-radius: 50%;
    background:
        radial-gradient(
            circle,
            white 0 9%,
            rgba(255,250,235,0.95) 12%,
            rgba(255,255,255,0.45) 34%,
            rgba(255,255,255,0.08) 51%,
            transparent 66%
        );
}

.login-body {
    display: grid;
    min-height: 100vh;
    place-items: center;
}

.login-shell {
    width: min(430px, calc(100% - 32px));
}

.login-panel {
    padding: 31px;
    border: 1px solid var(--border-strong);
    border-radius: 23px;
    background: rgba(7,17,25,0.94);
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.login-brand h1 {
    margin: 0;
    font-weight: 420;
    letter-spacing: 0.17em;
}

.login-copy {
    margin: 30px 0 23px;
}

.login-copy h2 {
    margin: 0 0 7px;
    font-weight: 430;
}

.login-copy p,
.login-security p {
    color: var(--muted);
}

#login-form {
    display: grid;
    gap: 15px;
}

#login-form label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 10px;
}

#login-form input {
    min-height: 47px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: 0;
    color: white;
    background: rgba(255,255,255,0.025);
}

.login-button {
    min-height: 47px;
    cursor: pointer;
    border: 1px solid rgba(220,235,245,0.45);
    border-radius: 10px;
    color: #061019;
    background: #edf8fc;
    font-weight: 700;
}

.login-error {
    min-height: 18px;
    color: var(--red);
    font-size: 10px;
}

.login-security {
    display: flex;
    gap: 10px;
    margin-top: 21px;
    padding-top: 17px;
    border-top: 1px solid var(--border);
    font-size: 9px;
}

.login-security p {
    margin: 3px 0 0;
}

@media (max-width: 1050px) {
    .workspace.active {
        grid-template-columns: 180px minmax(0,1fr);
    }

    .workspace-sidebar {
        width: 180px;
    }

    .workspace-content {
        grid-column: 2;
        padding: 25px;
    }

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

    .data-grid,
    .placeholder-grid,
    .system-grid {
        grid-template-columns:
            repeat(2, minmax(0,1fr));
    }
}

@media (max-width: 760px) {
    .os-header {
        height: 64px;
        padding: 0 15px;
    }

    .brand strong {
        font-size: 15px;
    }

    .brand small,
    .clock {
        display: none;
    }

    .home-space {
        padding-top: 64px;
    }

    .core-stage {
        width: 100%;
        height: 53vh;
        min-height: 390px;
    }

    .core-title {
        top: 24px;
    }

    .welcome-area {
        margin-top: -13px;
    }

    .welcome-area > p {
        padding: 0 16px;
    }

    .quick-commands {
        display: grid;
        grid-template-columns:
            repeat(2, minmax(0,1fr));
        padding: 0 10px;
    }

    .quick-commands button {
        justify-content: center;
    }

    .workspace {
        padding-top: 64px;
    }

    .workspace.active {
        display: block;
    }

    .workspace-sidebar {
        position: sticky;
        top: 64px;
        display: block;
        width: 100%;
        height: auto;
        overflow-x: auto;
        padding: 8px 12px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .mini-core-button,
    .back-home-button {
        display: none;
    }

    .workspace-nav {
        display: flex;
        min-width: max-content;
        margin: 0;
    }

    .workspace-nav-item {
        width: auto;
        padding: 9px 11px;
    }

    .workspace-content {
        padding: 21px 15px;
    }

    .workspace-header {
        display: block;
    }

    .workspace-status {
        width: fit-content;
        margin-top: 14px;
    }

    .data-grid,
    .placeholder-grid,
    .system-grid {
        grid-template-columns: 1fr;
    }

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

    .report-reader pre {
        max-height: 450px;
    }
}

/* ==========================================================
   UI.3.1.1 – SAM Living Core v2
   ========================================================== */

.core-stage {
    isolation: isolate;
}

#sam-core {
    z-index: 2;
    transform: translateZ(0);
    filter:
        drop-shadow(
            0 0 22px rgba(255, 248, 230, 0.18)
        )
        drop-shadow(
            0 0 58px rgba(210, 230, 255, 0.08)
        );
    transition:
        filter 700ms ease,
        transform 900ms cubic-bezier(
            0.2,
            0.8,
            0.2,
            1
        );
}

body[data-sam-state="listening"] #sam-core {
    filter:
        drop-shadow(
            0 0 30px rgba(255, 250, 238, 0.25)
        )
        drop-shadow(
            0 0 70px rgba(180, 220, 255, 0.12)
        );
}

body[data-sam-state="thinking"] #sam-core,
body[data-sam-state="working"] #sam-core {
    filter:
        drop-shadow(
            0 0 42px rgba(255, 248, 225, 0.32)
        )
        drop-shadow(
            0 0 96px rgba(170, 215, 255, 0.18)
        );
}

body[data-sam-state="speaking"] #sam-core {
    filter:
        drop-shadow(
            0 0 55px rgba(255, 252, 242, 0.52)
        )
        drop-shadow(
            0 0 135px rgba(195, 225, 255, 0.29)
        );
    transform: scale(1.025);
}

body[data-sam-state="alert"] #sam-core {
    filter:
        drop-shadow(
            0 0 42px rgba(255, 221, 158, 0.40)
        )
        drop-shadow(
            0 0 105px rgba(255, 185, 92, 0.18)
        );
}

.core-aura {
    z-index: 1;
    width: 53%;
    opacity: 0.38;
    background:
        radial-gradient(
            circle,
            rgba(255, 248, 224, 0.22),
            rgba(185, 220, 255, 0.07) 42%,
            transparent 72%
        );
    filter: blur(62px);
    animation:
        samIdleAura 5.6s ease-in-out infinite;
}

@keyframes samIdleAura {
    0%,
    100% {
        opacity: 0.30;
        transform:
            translate(-50%, -50%)
            scale(0.94);
    }

    50% {
        opacity: 0.46;
        transform:
            translate(-50%, -50%)
            scale(1.05);
    }
}

body[data-sam-state="thinking"] .core-aura,
body[data-sam-state="working"] .core-aura {
    opacity: 0.58;
    filter: blur(72px);
}

body[data-sam-state="speaking"] .core-aura {
    opacity: 0.85;
    width: 66%;
    filter: blur(80px);
    animation:
        samSpeakingAura 1.05s ease-out infinite;
}

@keyframes samSpeakingAura {
    0% {
        opacity: 0.84;
        transform:
            translate(-50%, -50%)
            scale(0.92);
    }

    100% {
        opacity: 0.18;
        transform:
            translate(-50%, -50%)
            scale(1.28);
    }
}

.core-wave-layer {
    position: absolute;
    inset: 0;
    z-index: 3;
    overflow: visible;
    pointer-events: none;
}

.core-wave {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 38%;
    aspect-ratio: 1;
    border: 1px solid rgba(235, 247, 255, 0);
    border-radius: 50%;
    opacity: 0;
    box-shadow:
        0 0 15px rgba(215, 238, 255, 0),
        inset 0 0 16px rgba(255, 250, 235, 0);
    transform:
        translate(-50%, -50%)
        scale(0.84);
}

body[data-sam-state="speaking"] .core-wave {
    animation:
        samScreenWave 1.65s
        cubic-bezier(0.15, 0.65, 0.2, 1)
        infinite;
}

body[data-sam-state="speaking"] .wave-two {
    animation-delay: 0.42s;
}

body[data-sam-state="speaking"] .wave-three {
    animation-delay: 0.84s;
}

@keyframes samScreenWave {
    0% {
        opacity: 0;
        border-color:
            rgba(255, 250, 238, 0.62);
        box-shadow:
            0 0 18px rgba(220, 240, 255, 0.32),
            inset 0 0 20px rgba(255, 250, 235, 0.22);
        transform:
            translate(-50%, -50%)
            scale(0.78);
    }

    18% {
        opacity: 0.78;
    }

    100% {
        opacity: 0;
        border-color:
            rgba(210, 235, 255, 0);
        box-shadow:
            0 0 80px rgba(210, 235, 255, 0),
            inset 0 0 30px rgba(255, 250, 235, 0);
        transform:
            translate(-50%, -50%)
            scale(2.65);
    }
}

body::after {
    position: fixed;
    inset: 0;
    z-index: 25;
    content: "";
    pointer-events: none;
    opacity: 0;
    background:
        radial-gradient(
            circle at 50% 43%,
            rgba(255, 255, 250, 0.24),
            rgba(186, 220, 255, 0.075) 28%,
            transparent 62%
        );
    mix-blend-mode: screen;
    transition: opacity 650ms ease;
}

body[data-sam-state="speaking"]::after {
    opacity: 0.44;
    animation:
        samRoomLight 1.65s ease-out infinite;
}

@keyframes samRoomLight {
    0% {
        opacity: 0.50;
    }

    45% {
        opacity: 0.18;
    }

    100% {
        opacity: 0;
    }
}

body[data-sam-state="listening"] .voice-bars i {
    animation:
        samListeningBars
        0.75s ease-in-out infinite alternate;
}

body[data-sam-state="listening"]
.voice-bars i:nth-child(2) {
    animation-delay: -0.18s;
}

body[data-sam-state="listening"]
.voice-bars i:nth-child(3) {
    animation-delay: -0.36s;
}

body[data-sam-state="listening"]
.voice-bars i:nth-child(4) {
    animation-delay: -0.12s;
}

body[data-sam-state="listening"]
.voice-bars i:nth-child(5) {
    animation-delay: -0.27s;
}

@keyframes samListeningBars {
    from {
        height: 5px;
        opacity: 0.48;
    }

    to {
        height: 21px;
        opacity: 1;
    }
}

@media (max-width: 760px) {
    .home-space {
        min-height: 100svh;
        justify-content: flex-start;
        padding:
            64px
            12px
            calc(25px + env(safe-area-inset-bottom));
    }

    .core-stage {
        width: min(142vw, 690px);
        height: clamp(
            490px,
            68svh,
            720px
        );
        min-height: 490px;
        margin-top: 4px;
        margin-right: -21vw;
        margin-left: -21vw;
    }

    .core-title {
        top: 27px;
    }

    .core-title p {
        font-size: clamp(
            38px,
            12vw,
            57px
        );
        letter-spacing: 0.21em;
        transform: translateX(0.105em);
    }

    .core-title span {
        font-size: 9px;
        letter-spacing: 0.25em;
    }

    #sam-core {
        filter:
            drop-shadow(
                0 0 30px rgba(255, 248, 230, 0.25)
            )
            drop-shadow(
                0 0 82px rgba(192, 224, 255, 0.13)
            );
    }

    body[data-sam-state="speaking"] #sam-core {
        filter:
            drop-shadow(
                0 0 52px rgba(255, 252, 242, 0.60)
            )
            drop-shadow(
                0 0 150px rgba(190, 225, 255, 0.34)
            );
        transform: scale(1.035);
    }

    .core-aura {
        width: 60%;
        filter: blur(53px);
    }

    body[data-sam-state="speaking"] .core-aura {
        width: 76%;
        filter: blur(66px);
    }

    .core-status {
        bottom: 26px;
        font-size: 9px;
    }

    .welcome-area {
        position: relative;
        z-index: 8;
        margin-top: -18px;
    }

    .welcome-area h1 {
        font-size: clamp(
            23px,
            7.5vw,
            32px
        );
        letter-spacing: 0.05em;
    }

    .welcome-area > p {
        margin-bottom: 18px;
        font-size: 12px;
    }

    .command-box {
        grid-template-columns:
            51px 1fr 51px;
        min-height: 59px;
    }

    .quick-commands {
        gap: 8px;
        padding: 0;
    }

    .quick-commands button {
        min-height: 44px;
        padding: 0 11px;
        font-size: 10px;
    }

    .core-wave {
        width: 42%;
    }

    body[data-sam-state="speaking"]::after {
        opacity: 0.52;
    }
}

@media (
    max-width: 760px
)
and (
    max-height: 740px
) {
    .core-stage {
        height: 505px;
        min-height: 505px;
    }

    .welcome-area {
        margin-top: -32px;
    }

    .quick-commands {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

    .quick-commands button:last-child {
        grid-column: auto;
    }
}

@media (
    prefers-reduced-motion: reduce
) {
    .core-aura,
    .core-wave,
    body::after {
        animation-duration: 8s !important;
    }
}

/* ==========================================================
   UI.3.1.2 – Räumliche Partikel und Parallax
   ========================================================== */

#spatial-particles {
    position: fixed;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.92;
    mix-blend-mode: screen;
}

.core-stage {
    --sam-parallax-x: 0px;
    --sam-parallax-y: 0px;
    --sam-rotate-x: 0deg;
    --sam-rotate-y: 0deg;

    perspective: 1100px;
    transform-style: preserve-3d;
    transition:
        transform 700ms
        cubic-bezier(
            0.16,
            0.75,
            0.2,
            1
        );
}

#sam-core,
.core-aura,
.core-wave-layer,
.core-title,
.core-status {
    will-change: transform;
}

#sam-core {
    transform:
        translate3d(
            var(--sam-parallax-x),
            var(--sam-parallax-y),
            18px
        )
        rotateX(
            var(--sam-rotate-x)
        )
        rotateY(
            var(--sam-rotate-y)
        );
}

.core-aura {
    transform:
        translate(
            calc(
                -50%
                + var(--sam-parallax-x)
                * 0.45
            ),
            calc(
                -50%
                + var(--sam-parallax-y)
                * 0.45
            )
        )
        translateZ(-10px);
}

.core-wave-layer {
    transform:
        translate3d(
            calc(
                var(--sam-parallax-x)
                * 0.7
            ),
            calc(
                var(--sam-parallax-y)
                * 0.7
            ),
            10px
        );
}

.core-title {
    transform:
        translate3d(
            calc(
                var(--sam-parallax-x)
                * 0.18
            ),
            calc(
                var(--sam-parallax-y)
                * 0.18
            ),
            30px
        );
}

.core-status {
    transform:
        translate3d(
            calc(
                var(--sam-parallax-x)
                * 0.24
            ),
            calc(
                var(--sam-parallax-y)
                * 0.24
            ),
            30px
        );
}

body[data-sam-state="thinking"]
#spatial-particles,
body[data-sam-state="working"]
#spatial-particles {
    opacity: 1;
}

body[data-sam-state="speaking"]
#spatial-particles {
    opacity: 1;
    filter:
        brightness(1.38)
        drop-shadow(
            0 0 7px rgba(220, 242, 255, 0.52)
        );
}

.space-haze {
    transform:
        translate3d(
            calc(
                var(--global-parallax-x, 0px)
                * -0.18
            ),
            calc(
                var(--global-parallax-y, 0px)
                * -0.18
            ),
            0
        );
    transition: transform 120ms linear;
}

.stars-near {
    transform:
        translate3d(
            calc(
                var(--global-parallax-x, 0px)
                * -0.38
            ),
            calc(
                var(--global-parallax-y, 0px)
                * -0.38
            ),
            0
        );
}

.stars-far {
    transform:
        translate3d(
            calc(
                var(--global-parallax-x, 0px)
                * -0.14
            ),
            calc(
                var(--global-parallax-y, 0px)
                * -0.14
            ),
            0
        );
}

@media (max-width: 760px) {
    #spatial-particles {
        opacity: 0.86;
    }

    .core-stage {
        perspective: 850px;
    }

    #sam-core {
        transform:
            translate3d(
                var(--sam-parallax-x),
                var(--sam-parallax-y),
                12px
            )
            rotateX(
                var(--sam-rotate-x)
            )
            rotateY(
                var(--sam-rotate-y)
            );
    }
}

@media (
    prefers-reduced-motion: reduce
) {
    #sam-core,
    .core-aura,
    .core-wave-layer,
    .core-title,
    .core-status,
    .space-haze,
    .stars {
        transform: none !important;
    }

    #spatial-particles {
        opacity: 0.54;
    }
}

/* ==========================================================
   UI.3.1.2.1 – Mobile Core Visual Repair
   ========================================================== */

#sam-core {
    opacity: 1;
    mix-blend-mode: screen;
}

body[data-sam-state="idle"] #sam-core {
    filter:
        brightness(1.08)
        contrast(1.22)
        saturate(0.92)
        drop-shadow(
            0 0 28px rgba(255, 248, 230, 0.25)
        )
        drop-shadow(
            0 0 74px rgba(190, 222, 255, 0.14)
        );
}

body[data-sam-state="listening"] #sam-core {
    filter:
        brightness(1.16)
        contrast(1.25)
        drop-shadow(
            0 0 38px rgba(255, 248, 230, 0.35)
        )
        drop-shadow(
            0 0 96px rgba(185, 222, 255, 0.20)
        );
}

body[data-sam-state="thinking"] #sam-core,
body[data-sam-state="working"] #sam-core {
    filter:
        brightness(1.25)
        contrast(1.28)
        drop-shadow(
            0 0 46px rgba(255, 248, 230, 0.42)
        )
        drop-shadow(
            0 0 118px rgba(180, 220, 255, 0.26)
        );
}

body[data-sam-state="speaking"] #sam-core {
    filter:
        brightness(1.44)
        contrast(1.30)
        drop-shadow(
            0 0 62px rgba(255, 252, 242, 0.65)
        )
        drop-shadow(
            0 0 165px rgba(190, 225, 255, 0.38)
        );
}

.core-aura {
    background:
        radial-gradient(
            circle,
            rgba(255, 250, 235, 0.30) 0%,
            rgba(245, 250, 255, 0.14) 24%,
            rgba(180, 218, 255, 0.075) 47%,
            transparent 73%
        );
}

body[data-sam-state="idle"] .core-aura {
    opacity: 0.42;
}

body[data-sam-state="thinking"] .core-aura,
body[data-sam-state="working"] .core-aura {
    opacity: 0.68;
}

body[data-sam-state="speaking"] .core-aura {
    opacity: 0.94;
}

@media (max-width: 760px) {
    html {
        min-height: 100%;
        background: #02070c;
    }

    body {
        min-height: 100%;
        overflow-x: hidden;
        overscroll-behavior-y: none;
    }

    .home-space {
        display: none;
        min-height: 100svh;
        padding:
            64px
            12px
            calc(
                145px
                + env(safe-area-inset-bottom)
            );
    }

    .home-space.active {
        display: flex;
        justify-content: flex-start;
    }

    .core-stage {
        width: min(118vw, 610px);
        height: clamp(
            445px,
            57svh,
            575px
        );
        min-height: 445px;
        margin:
            8px
            -9vw
            0;
    }

    .core-title {
        top: 24px;
    }

    .core-title p {
        font-size: clamp(
            42px,
            13vw,
            59px
        );
        font-weight: 330;
        letter-spacing: 0.20em;
    }

    .core-title span {
        margin-top: 8px;
        font-size: 9px;
        letter-spacing: 0.23em;
    }

    #sam-core {
        transform:
            translate3d(
                var(--sam-parallax-x),
                calc(
                    var(--sam-parallax-y)
                    - 7px
                ),
                12px
            )
            rotateX(
                var(--sam-rotate-x)
            )
            rotateY(
                var(--sam-rotate-y)
            );
    }

    body[data-sam-state="idle"] #sam-core {
        filter:
            brightness(1.12)
            contrast(1.30)
            drop-shadow(
                0 0 35px rgba(255, 248, 230, 0.34)
            )
            drop-shadow(
                0 0 92px rgba(190, 224, 255, 0.18)
            );
    }

    body[data-sam-state="thinking"] #sam-core,
    body[data-sam-state="working"] #sam-core {
        filter:
            brightness(1.32)
            contrast(1.32)
            drop-shadow(
                0 0 50px rgba(255, 248, 230, 0.50)
            )
            drop-shadow(
                0 0 128px rgba(185, 222, 255, 0.28)
            );
    }

    body[data-sam-state="speaking"] #sam-core {
        filter:
            brightness(1.52)
            contrast(1.34)
            drop-shadow(
                0 0 68px rgba(255, 252, 242, 0.72)
            )
            drop-shadow(
                0 0 180px rgba(190, 225, 255, 0.42)
            );
    }

    .core-aura {
        width: 66%;
        filter: blur(58px);
    }

    .core-status {
        right: auto;
        bottom: 5px;
        left: 50%;
        width: max-content;
        max-width: calc(100vw - 42px);
        padding: 8px 14px;
        border: 1px solid rgba(180, 215, 235, 0.18);
        border-radius: 22px;
        background:
            rgba(5, 14, 21, 0.68);
        backdrop-filter: blur(12px);
        font-size: 8px;
        letter-spacing: 0.12em;
        transform:
            translate3d(
                -50%,
                0,
                30px
            );
        white-space: nowrap;
    }

    .core-status strong {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .welcome-area {
        z-index: 10;
        width: 100%;
        margin-top: 20px;
        padding: 0 8px;
    }

    .welcome-area h1 {
        margin: 0;
        font-size: clamp(
            28px,
            8.7vw,
            38px
        );
        font-weight: 340;
        line-height: 1.12;
        letter-spacing: 0.005em;
    }

    .welcome-area > p {
        margin:
            13px
            auto
            22px;
        padding: 0 8px;
        font-size: 12px;
        line-height: 1.5;
    }

    .command-box {
        width: 100%;
        min-height: 62px;
        grid-template-columns:
            54px
            minmax(0, 1fr)
            54px;
        border-radius: 32px;
    }

    .command-box input {
        min-width: 0;
        font-size: 13px;
        text-overflow: ellipsis;
    }

    .voice-button,
    .send-button {
        width: 43px;
        height: 43px;
    }

    .quick-commands {
        display: grid;
        width: 100%;
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
        gap: 8px;
        margin-top: 17px;
        padding:
            0
            0
            env(safe-area-inset-bottom);
    }

    .quick-commands button {
        display: grid;
        min-width: 0;
        min-height: 58px;
        place-items: center;
        align-content: center;
        gap: 4px;
        padding: 7px 5px;
        border-radius: 17px;
        font-size: 9px;
        line-height: 1.15;
        text-align: center;
    }

    .quick-commands button span {
        display: block;
        font-size: 16px;
    }

    #spatial-particles {
        opacity: 0.70;
    }

    body[data-sam-state="speaking"]
    #spatial-particles {
        opacity: 1;
    }
}

@media (
    max-width: 390px
)
and (
    max-height: 760px
) {
    .core-stage {
        height: 430px;
        min-height: 430px;
    }

    .core-title {
        top: 18px;
    }

    .core-status {
        bottom: 1px;
    }

    .welcome-area {
        margin-top: 14px;
    }

    .welcome-area h1 {
        font-size: 27px;
    }

    .quick-commands button {
        min-height: 54px;
    }
}

@media (
    min-width: 761px
) {
    .core-status {
        padding: 8px 14px;
        border: 1px solid rgba(180, 215, 235, 0.14);
        border-radius: 20px;
        background: rgba(5, 14, 21, 0.42);
        backdrop-filter: blur(10px);
    }
}

/* ==========================================================
   UI.3.1.3 – SAM Reactor v3
   ========================================================== */

.core-stage {
    transform-style: preserve-3d;
}

#sam-core {
    mix-blend-mode: screen;
    image-rendering: auto;
}

.reactor-shells {
    position: absolute;
    inset: 0;
    z-index: 3;
    overflow: visible;
    pointer-events: none;
    transform-style: preserve-3d;
    transform:
        translate3d(
            calc(
                var(--sam-parallax-x)
                * 0.76
            ),
            calc(
                var(--sam-parallax-y)
                * 0.76
            ),
            22px
        );
}

.reactor-shell {
    position: absolute;
    top: 50%;
    left: 50%;
    aspect-ratio: 1;
    border-radius: 50%;
    opacity: 0.54;
    mix-blend-mode: screen;
    transform-style: preserve-3d;
}

.shell-one {
    width: 38%;
    border:
        1px solid
        rgba(245, 250, 255, 0.42);
    box-shadow:
        0 0 14px rgba(225, 242, 255, 0.21),
        inset 0 0 18px rgba(255, 248, 225, 0.12);
    animation:
        reactorShellOne
        13s linear infinite;
}

.shell-two {
    width: 47%;
    border:
        1px solid
        rgba(196, 226, 255, 0.25);
    box-shadow:
        0 0 21px rgba(190, 225, 255, 0.15);
    animation:
        reactorShellTwo
        19s linear infinite reverse;
}

.shell-three {
    width: 58%;
    border:
        1px dashed
        rgba(255, 245, 220, 0.18);
    box-shadow:
        0 0 25px rgba(255, 240, 210, 0.08);
    animation:
        reactorShellThree
        26s linear infinite;
}

@keyframes reactorShellOne {
    from {
        transform:
            translate(-50%, -50%)
            rotateX(67deg)
            rotateZ(0deg)
            scaleX(1.10);
    }

    to {
        transform:
            translate(-50%, -50%)
            rotateX(67deg)
            rotateZ(360deg)
            scaleX(1.10);
    }
}

@keyframes reactorShellTwo {
    from {
        transform:
            translate(-50%, -50%)
            rotateY(68deg)
            rotateZ(20deg)
            scaleY(1.08);
    }

    to {
        transform:
            translate(-50%, -50%)
            rotateY(68deg)
            rotateZ(380deg)
            scaleY(1.08);
    }
}

@keyframes reactorShellThree {
    from {
        transform:
            translate(-50%, -50%)
            rotateX(74deg)
            rotateY(26deg)
            rotateZ(0deg);
    }

    to {
        transform:
            translate(-50%, -50%)
            rotateX(74deg)
            rotateY(26deg)
            rotateZ(360deg);
    }
}

.reactor-flare {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 22%;
    opacity: 0.22;
    border-radius: 50%;
    background:
        linear-gradient(
            180deg,
            transparent,
            rgba(255, 250, 235, 0.78),
            transparent
        );
    filter: blur(1px);
    mix-blend-mode: screen;
    transform-origin: center bottom;
}

.flare-one {
    animation:
        reactorFlareOne
        8.5s ease-in-out infinite;
}

.flare-two {
    animation:
        reactorFlareTwo
        11s ease-in-out infinite;
    animation-delay: -4.1s;
}

@keyframes reactorFlareOne {
    0%,
    69%,
    100% {
        opacity: 0;
        transform:
            translate(-50%, -100%)
            rotate(42deg)
            scaleY(0.25);
    }

    78% {
        opacity: 0.48;
        transform:
            translate(-50%, -100%)
            rotate(47deg)
            scaleY(1.15);
    }

    90% {
        opacity: 0.08;
        transform:
            translate(-50%, -100%)
            rotate(52deg)
            scaleY(1.58);
    }
}

@keyframes reactorFlareTwo {
    0%,
    73%,
    100% {
        opacity: 0;
        transform:
            translate(-50%, -100%)
            rotate(-118deg)
            scaleY(0.2);
    }

    82% {
        opacity: 0.40;
        transform:
            translate(-50%, -100%)
            rotate(-113deg)
            scaleY(1.08);
    }

    92% {
        opacity: 0.05;
        transform:
            translate(-50%, -100%)
            rotate(-108deg)
            scaleY(1.45);
    }
}

body[data-sam-state="idle"] .reactor-shells {
    opacity: 0.72;
}

body[data-sam-state="thinking"] .reactor-shells,
body[data-sam-state="working"] .reactor-shells {
    opacity: 0.94;
    filter:
        brightness(1.24)
        drop-shadow(
            0 0 9px rgba(215, 238, 255, 0.26)
        );
}

body[data-sam-state="speaking"] .reactor-shells {
    opacity: 1;
    filter:
        brightness(1.62)
        drop-shadow(
            0 0 17px rgba(235, 248, 255, 0.48)
        );
}

body[data-sam-state="speaking"] .shell-one {
    animation-duration: 4.2s;
}

body[data-sam-state="speaking"] .shell-two {
    animation-duration: 5.4s;
}

body[data-sam-state="speaking"] .shell-three {
    animation-duration: 7.2s;
}

body[data-sam-state="alert"] .reactor-shell {
    border-color:
        rgba(255, 208, 138, 0.42);
}

.command-box,
.quick-commands button,
.os-header,
.core-status {
    transition:
        border-color 500ms ease,
        box-shadow 500ms ease,
        background 500ms ease;
}

body[data-sam-state="thinking"] .command-box,
body[data-sam-state="working"] .command-box {
    border-color:
        rgba(190, 225, 250, 0.36);
    box-shadow:
        0 0 35px rgba(145, 205, 245, 0.09),
        inset 0 0 23px rgba(220, 242, 255, 0.025);
}

body[data-sam-state="speaking"] .command-box {
    border-color:
        rgba(225, 244, 255, 0.58);
    box-shadow:
        0 0 52px rgba(180, 225, 255, 0.18),
        inset 0 0 28px rgba(255, 250, 235, 0.06);
}

body[data-sam-state="speaking"]
.quick-commands button {
    border-color:
        rgba(205, 232, 248, 0.25);
    box-shadow:
        0 0 18px rgba(180, 220, 255, 0.055);
}

@media (max-width: 760px) {
    .reactor-shells {
        transform:
            translate3d(
                calc(
                    var(--sam-parallax-x)
                    * 0.55
                ),
                calc(
                    var(--sam-parallax-y)
                    * 0.55
                    - 7px
                ),
                16px
            );
    }

    .shell-one {
        width: 42%;
    }

    .shell-two {
        width: 52%;
    }

    .shell-three {
        width: 64%;
        opacity: 0.34;
    }

    .reactor-flare {
        height: 19%;
    }

    body[data-sam-state="idle"] #sam-core {
        filter:
            brightness(1.07)
            contrast(1.38)
            drop-shadow(
                0 0 36px rgba(255, 248, 230, 0.34)
            )
            drop-shadow(
                0 0 102px rgba(190, 224, 255, 0.20)
            );
    }

    body[data-sam-state="thinking"] #sam-core,
    body[data-sam-state="working"] #sam-core {
        filter:
            brightness(1.24)
            contrast(1.42)
            drop-shadow(
                0 0 52px rgba(255, 248, 230, 0.48)
            )
            drop-shadow(
                0 0 138px rgba(185, 222, 255, 0.29)
            );
    }

    body[data-sam-state="speaking"] #sam-core {
        filter:
            brightness(1.43)
            contrast(1.45)
            drop-shadow(
                0 0 72px rgba(255, 252, 242, 0.68)
            )
            drop-shadow(
                0 0 190px rgba(190, 225, 255, 0.43)
            );
    }
}

@media (
    prefers-reduced-motion: reduce
) {
    .reactor-shell,
    .reactor-flare {
        animation-duration: 40s !important;
    }
}

/* ==========================================================
   UI.3.1.4.4 – Reactor X Visual Repair
   Neutralisiert alte Filter des weißen Renderers.
   ========================================================== */

#sam-core,
body[data-sam-state="idle"] #sam-core,
body[data-sam-state="listening"] #sam-core,
body[data-sam-state="thinking"] #sam-core,
body[data-sam-state="working"] #sam-core,
body[data-sam-state="speaking"] #sam-core,
body[data-sam-state="alert"] #sam-core {
    opacity: 1;
    mix-blend-mode: normal;
    filter:
        drop-shadow(
            0 0 20px rgba(35, 125, 255, 0.22)
        )
        drop-shadow(
            0 0 27px rgba(255, 105, 20, 0.20)
        ) !important;
}

body[data-sam-state="idle"] #sam-core {
    filter:
        drop-shadow(
            0 0 18px rgba(30, 118, 255, 0.19)
        )
        drop-shadow(
            0 0 24px rgba(255, 92, 18, 0.17)
        ) !important;
}

body[data-sam-state="listening"] #sam-core {
    filter:
        drop-shadow(
            0 0 28px rgba(25, 135, 255, 0.34)
        )
        drop-shadow(
            0 0 18px rgba(255, 105, 25, 0.13)
        ) !important;
}

body[data-sam-state="thinking"] #sam-core,
body[data-sam-state="working"] #sam-core {
    filter:
        drop-shadow(
            0 0 30px rgba(25, 130, 255, 0.30)
        )
        drop-shadow(
            0 0 32px rgba(255, 100, 18, 0.28)
        ) !important;
}

body[data-sam-state="speaking"] #sam-core {
    filter:
        drop-shadow(
            0 0 38px rgba(60, 155, 255, 0.40)
        )
        drop-shadow(
            0 0 42px rgba(255, 120, 30, 0.38)
        ) !important;
}

.core-aura,
body[data-sam-state="idle"] .core-aura,
body[data-sam-state="thinking"] .core-aura,
body[data-sam-state="working"] .core-aura,
body[data-sam-state="speaking"] .core-aura {
    opacity: 0.42;
    background:
        radial-gradient(
            circle,
            rgba(255, 116, 28, 0.13) 0%,
            rgba(32, 128, 255, 0.11) 29%,
            rgba(8, 28, 54, 0.07) 50%,
            transparent 72%
        );
    filter: blur(52px);
}

body[data-sam-state="thinking"] .core-aura,
body[data-sam-state="working"] .core-aura {
    opacity: 0.54;
}

body[data-sam-state="speaking"] .core-aura {
    opacity: 0.68;
}

.reactor-shells {
    opacity: 0.52 !important;
    filter: none !important;
}

.shell-one {
    border-color:
        rgba(255, 125, 35, 0.42) !important;
    box-shadow:
        0 0 13px rgba(255, 100, 20, 0.18),
        inset 0 0 14px rgba(255, 160, 75, 0.08) !important;
}

.shell-two {
    border-color:
        rgba(60, 145, 255, 0.38) !important;
    box-shadow:
        0 0 17px rgba(35, 125, 255, 0.18) !important;
}

.shell-three {
    border-color:
        rgba(110, 170, 255, 0.20) !important;
    box-shadow:
        0 0 19px rgba(255, 112, 30, 0.08) !important;
}

.reactor-flare {
    background:
        linear-gradient(
            180deg,
            transparent,
            rgba(65, 150, 255, 0.68),
            rgba(255, 125, 35, 0.72),
            transparent
        ) !important;
}

#spatial-particles {
    opacity: 0.56;
}

body[data-sam-state="speaking"] #spatial-particles {
    opacity: 0.76;
    filter: none;
}

@media (max-width: 760px) {
    #sam-core,
    body[data-sam-state="idle"] #sam-core,
    body[data-sam-state="listening"] #sam-core,
    body[data-sam-state="thinking"] #sam-core,
    body[data-sam-state="working"] #sam-core,
    body[data-sam-state="speaking"] #sam-core,
    body[data-sam-state="alert"] #sam-core {
        mix-blend-mode: normal;
        filter:
            drop-shadow(
                0 0 19px rgba(35, 130, 255, 0.23)
            )
            drop-shadow(
                0 0 24px rgba(255, 105, 22, 0.22)
            ) !important;
    }

    body[data-sam-state="speaking"] #sam-core {
        filter:
            drop-shadow(
                0 0 31px rgba(50, 145, 255, 0.38)
            )
            drop-shadow(
                0 0 36px rgba(255, 115, 25, 0.36)
            ) !important;
    }

    .reactor-shells {
        opacity: 0.46 !important;
    }

    .core-aura {
        opacity: 0.38;
        filter: blur(45px);
    }
}

/* ==========================================================
   UI.3.1.6 – SAM Dark Matter Core
   Finale visuelle Priorität für den Kern.
   ========================================================== */

#sam-core,
body[data-sam-state="idle"] #sam-core,
body[data-sam-state="listening"] #sam-core,
body[data-sam-state="thinking"] #sam-core,
body[data-sam-state="working"] #sam-core,
body[data-sam-state="speaking"] #sam-core,
body[data-sam-state="alert"] #sam-core {
    opacity: 1 !important;
    mix-blend-mode: normal !important;
    filter:
        drop-shadow(
            0 0 9px rgba(30, 106, 255, 0.20)
        )
        drop-shadow(
            0 0 11px rgba(255, 78, 10, 0.18)
        ) !important;
}

body[data-sam-state="listening"] #sam-core {
    filter:
        drop-shadow(
            0 0 13px rgba(25, 118, 255, 0.27)
        )
        drop-shadow(
            0 0 8px rgba(255, 72, 8, 0.12)
        ) !important;
}

body[data-sam-state="thinking"] #sam-core,
body[data-sam-state="working"] #sam-core {
    filter:
        drop-shadow(
            0 0 14px rgba(28, 118, 255, 0.25)
        )
        drop-shadow(
            0 0 15px rgba(255, 76, 8, 0.23)
        ) !important;
}

body[data-sam-state="speaking"] #sam-core {
    filter:
        drop-shadow(
            0 0 19px rgba(45, 135, 255, 0.32)
        )
        drop-shadow(
            0 0 21px rgba(255, 91, 12, 0.30)
        ) !important;
}

/*
 * Die alten großen Aura-Flächen waren für den
 * Taschenlampen-Eindruck verantwortlich.
 */
.core-aura,
body[data-sam-state="idle"] .core-aura,
body[data-sam-state="listening"] .core-aura,
body[data-sam-state="thinking"] .core-aura,
body[data-sam-state="working"] .core-aura,
body[data-sam-state="speaking"] .core-aura,
body[data-sam-state="alert"] .core-aura {
    opacity: 0.07 !important;
    background:
        radial-gradient(
            circle,
            rgba(255, 74, 9, 0.06) 0%,
            rgba(23, 98, 255, 0.045) 27%,
            transparent 58%
        ) !important;
    filter: blur(20px) !important;
}

.reactor-shells,
body[data-sam-state="idle"] .reactor-shells,
body[data-sam-state="listening"] .reactor-shells,
body[data-sam-state="thinking"] .reactor-shells,
body[data-sam-state="working"] .reactor-shells,
body[data-sam-state="speaking"] .reactor-shells,
body[data-sam-state="alert"] .reactor-shells {
    opacity: 0.24 !important;
    filter: none !important;
}

.reactor-flare {
    opacity: 0.10 !important;
}

.core-wave-layer {
    opacity: 0.38;
}

body[data-sam-state="speaking"]
.core-wave-layer {
    opacity: 0.72;
}

@media (max-width: 760px) {
    #sam-core,
    body[data-sam-state="idle"] #sam-core,
    body[data-sam-state="listening"] #sam-core,
    body[data-sam-state="thinking"] #sam-core,
    body[data-sam-state="working"] #sam-core,
    body[data-sam-state="speaking"] #sam-core,
    body[data-sam-state="alert"] #sam-core {
        filter:
            drop-shadow(
                0 0 8px rgba(28, 110, 255, 0.20)
            )
            drop-shadow(
                0 0 10px rgba(255, 79, 10, 0.18)
            ) !important;
    }

    body[data-sam-state="speaking"] #sam-core {
        filter:
            drop-shadow(
                0 0 15px rgba(38, 126, 255, 0.29)
            )
            drop-shadow(
                0 0 17px rgba(255, 87, 12, 0.27)
            ) !important;
    }

    .core-aura {
        opacity: 0.045 !important;
        filter: blur(16px) !important;
    }

    .reactor-shells {
        opacity: 0.18 !important;
    }
}

/* ==========================================================
   UI.3.2.0 – SAM Core 2
   Priorität: Kontrast, dunkle Kugel, kein Taschenlampen-Glow.
   ========================================================== */

#sam-core[data-sam-renderer="core-2"],
body[data-sam-state="idle"]
#sam-core[data-sam-renderer="core-2"],
body[data-sam-state="listening"]
#sam-core[data-sam-renderer="core-2"],
body[data-sam-state="thinking"]
#sam-core[data-sam-renderer="core-2"],
body[data-sam-state="working"]
#sam-core[data-sam-renderer="core-2"],
body[data-sam-state="speaking"]
#sam-core[data-sam-renderer="core-2"],
body[data-sam-state="alert"]
#sam-core[data-sam-renderer="core-2"] {
    opacity: 1 !important;
    mix-blend-mode: normal !important;
    filter:
        drop-shadow(
            0 0 6px rgba(25, 98, 255, 0.13)
        )
        drop-shadow(
            0 0 7px rgba(255, 68, 8, 0.12)
        ) !important;
}

body[data-sam-state="thinking"]
#sam-core[data-sam-renderer="core-2"],
body[data-sam-state="working"]
#sam-core[data-sam-renderer="core-2"] {
    filter:
        drop-shadow(
            0 0 8px rgba(26, 106, 255, 0.17)
        )
        drop-shadow(
            0 0 9px rgba(255, 70, 8, 0.16)
        ) !important;
}

body[data-sam-state="speaking"]
#sam-core[data-sam-renderer="core-2"] {
    filter:
        drop-shadow(
            0 0 12px rgba(36, 122, 255, 0.23)
        )
        drop-shadow(
            0 0 13px rgba(255, 78, 10, 0.21)
        ) !important;
}

/*
 * Externe Aura nahezu vollständig abschalten.
 * Der Shader selbst erzeugt die sichtbare Kugel.
 */
body:has(#sam-core[data-sam-renderer="core-2"])
.core-aura {
    opacity: 0.018 !important;
    filter: blur(10px) !important;
    background:
        radial-gradient(
            circle,
            rgba(255, 72, 8, 0.025) 0%,
            rgba(22, 91, 255, 0.018) 25%,
            transparent 48%
        ) !important;
}

body:has(#sam-core[data-sam-renderer="core-2"])
.reactor-shells {
    opacity: 0.10 !important;
    filter: none !important;
}

body:has(#sam-core[data-sam-renderer="core-2"])
.reactor-flare {
    opacity: 0.035 !important;
}

body:has(#sam-core[data-sam-renderer="core-2"])
.core-wave-layer {
    opacity: 0.24;
}

body[data-sam-state="speaking"]:has(
    #sam-core[data-sam-renderer="core-2"]
)
.core-wave-layer {
    opacity: 0.55;
}

@media (max-width: 760px) {
    #sam-core[data-sam-renderer="core-2"],
    body[data-sam-state]
    #sam-core[data-sam-renderer="core-2"] {
        filter:
            drop-shadow(
                0 0 5px rgba(25, 103, 255, 0.13)
            )
            drop-shadow(
                0 0 6px rgba(255, 70, 8, 0.12)
            ) !important;
    }

    body[data-sam-state="speaking"]
    #sam-core[data-sam-renderer="core-2"] {
        filter:
            drop-shadow(
                0 0 10px rgba(34, 119, 255, 0.21)
            )
            drop-shadow(
                0 0 11px rgba(255, 78, 9, 0.19)
            ) !important;
    }

    body:has(#sam-core[data-sam-renderer="core-2"])
    .core-aura {
        opacity: 0.012 !important;
        filter: blur(8px) !important;
    }

    body:has(#sam-core[data-sam-renderer="core-2"])
    .reactor-shells {
        opacity: 0.075 !important;
    }
}

/* ==========================================================
   UI.3.4.0 – SAM Core 4
   Raymarched Fusion Core ohne externe Lichtwolke.
   ========================================================== */

#sam-core[data-sam-renderer="core-4"],
body[data-sam-state]
#sam-core[data-sam-renderer="core-4"] {
    opacity: 1 !important;
    mix-blend-mode: normal !important;
    filter: none !important;
}

body:has(#sam-core[data-sam-renderer="core-4"])
.core-aura,
body:has(#sam-core[data-sam-renderer="core-4"])
.reactor-shells,
body:has(#sam-core[data-sam-renderer="core-4"])
.reactor-flare {
    display: none !important;
}

body:has(#sam-core[data-sam-renderer="core-4"])
.core-wave-layer {
    opacity: 0.10;
}

body[data-sam-state="speaking"]:has(
    #sam-core[data-sam-renderer="core-4"]
)
.core-wave-layer {
    opacity: 0.34;
}

/* ==========================================================
   UI.3.5.0 – SAM Core 5
   Letzter kontrollierter Reactor-Renderer.
   ========================================================== */

#sam-core[data-sam-renderer="core-5"],
body[data-sam-state]
#sam-core[data-sam-renderer="core-5"] {
    opacity: 1 !important;
    mix-blend-mode: normal !important;
    filter: none !important;
}

body:has(#sam-core[data-sam-renderer="core-5"])
.core-aura,
body:has(#sam-core[data-sam-renderer="core-5"])
.reactor-shells,
body:has(#sam-core[data-sam-renderer="core-5"])
.reactor-flare {
    display: none !important;
}

body:has(#sam-core[data-sam-renderer="core-5"])
.core-wave-layer {
    opacity: 0.06 !important;
}

body[data-sam-state="speaking"]:has(
    #sam-core[data-sam-renderer="core-5"]
)
.core-wave-layer {
    opacity: 0.24 !important;
}

body:has(#sam-core[data-sam-renderer="core-5"])
#spatial-particles {
    opacity: 0.22;
}

body[data-sam-state="speaking"]:has(
    #sam-core[data-sam-renderer="core-5"]
)
#spatial-particles {
    opacity: 0.38;
}

.live-stream-state { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 8px; margin-top: 12px; color: var(--text-secondary); }
.live-stream-state i { width: 8px; height: 8px; border-radius: 50%; background: var(--warning); }
.live-stream-state strong { font-size: .72rem; letter-spacing: .14em; }
.live-stream-state small { grid-column: 2; font-size: .68rem; }
.live-stream-state[data-state="LIVE"] i { background: var(--success); box-shadow: 0 0 10px rgba(87, 215, 165, .45); }
.live-stream-state[data-state="OFFLINE"] i,
.live-stream-state[data-state="RECONNECTING"] i { background: var(--danger); }
