:root {
    --dynamic-bg: #020611;
    --dynamic-panel: #08111f;
    --dynamic-panel-raised: #0b1628;
    --dynamic-border: rgba(125, 211, 252, 0.16);
    --dynamic-border-strong: rgba(96, 165, 250, 0.38);
    --dynamic-text: #e5edf8;
    --dynamic-muted: #8798ad;
    --dynamic-blue: #60a5fa;
    --dynamic-cyan: #67e8f9;
    --dynamic-green: #4ade80;
    --dynamic-amber: #fbbf24;
    --dynamic-red: #fb7185;
    --dynamic-mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

body.dynamic-lab-page,
body.dynamic-session-page,
body.dynamic-lab-page main,
body.dynamic-session-page main {
    background: var(--dynamic-bg);
}

body.dynamic-lab-page > footer,
body.dynamic-session-page > footer {
    border-color: rgba(96, 165, 250, 0.12) !important;
    background: #030914;
    color: #64748b !important;
}

body.dynamic-modal-open,
body.dynamic-generation-open {
    overflow: hidden;
}

.dynamic-lab [hidden],
.dynamic-session [hidden] {
    display: none !important;
}

.dynamic-lab,
.dynamic-session {
    position: relative;
    min-height: calc(100dvh - 56px);
    overflow: hidden;
    color: var(--dynamic-text);
    isolation: isolate;
}

.dynamic-lab {
    overflow: clip;
    background:
        radial-gradient(circle at 14% 12%, rgba(37, 99, 235, 0.14), transparent 31%),
        radial-gradient(circle at 84% 26%, rgba(14, 116, 144, 0.12), transparent 28%),
        linear-gradient(180deg, #030815 0%, var(--dynamic-bg) 48%, #030713 100%),
        var(--dynamic-bg);
}

.dynamic-lab::before,
.dynamic-session::before {
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(96, 165, 250, 0.028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(96, 165, 250, 0.028) 1px, transparent 1px);
    background-size: 56px 56px;
    content: "";
    mask-image: linear-gradient(to bottom, #000 8%, transparent 92%);
}

.dynamic-lab-atmosphere {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.dynamic-light-source {
    position: absolute;
    top: -210px;
    left: 50%;
    width: min(78vw, 1080px);
    height: 480px;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(59, 130, 246, 0.11), transparent 67%);
    filter: blur(6px);
    transform: translateX(-50%);
    animation: dynamic-light-drift 12s ease-in-out infinite alternate;
}

.dynamic-orbit {
    position: absolute;
    border: 1px solid rgba(96, 165, 250, 0.07);
    border-radius: 50%;
}

.dynamic-orbit::after {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(103, 232, 249, 0.52);
    box-shadow: 0 0 18px rgba(103, 232, 249, 0.42);
    content: "";
}

.dynamic-orbit-one {
    top: 128px;
    right: -190px;
    width: 520px;
    height: 520px;
}

.dynamic-orbit-one::after {
    top: 92px;
    left: 69px;
}

.dynamic-orbit-two {
    top: 420px;
    left: -260px;
    width: 620px;
    height: 620px;
}

.dynamic-orbit-two::after {
    top: 116px;
    right: 70px;
}

.dynamic-lab-shell {
    width: min(100% - 48px, 1320px);
    margin: 0 auto;
    padding: 22px 0 84px;
}

.dynamic-lab-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    animation: dynamic-fade-down 0.55s ease-out backwards;
}

.dynamic-back-link {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    color: #9fb0c5;
    font-size: 0.82rem;
    font-weight: 650;
    text-decoration: none;
    transition: color 0.18s ease, transform 0.18s ease;
}

.dynamic-back-link:hover {
    color: #fff;
    transform: translateX(-2px);
}

.dynamic-back-link:focus-visible,
.difficulty-card button:focus-visible,
.dynamic-start-error button:focus-visible {
    outline: 3px solid rgba(125, 211, 252, 0.72);
    outline-offset: 4px;
}

.dynamic-back-icon {
    display: grid;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.46);
    place-items: center;
}

.dynamic-system-state,
.generation-live {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    color: #86efac;
    font-family: var(--dynamic-mono);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.dynamic-status-dot,
.generation-live span {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--dynamic-green);
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.68);
}

.dynamic-lab .dynamic-status-dot {
    animation: dynamic-status-pulse 2.4s ease-in-out infinite;
}

.dynamic-hero {
    display: grid;
    padding: clamp(62px, 7vw, 94px) 0 48px;
    grid-template-columns: minmax(0, 1.22fr) minmax(330px, 0.78fr);
    gap: clamp(54px, 8vw, 116px);
    align-items: center;
}

.dynamic-eyebrow {
    display: block;
    color: var(--dynamic-blue);
    font-family: var(--dynamic-mono);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.dynamic-hero-copy {
    min-width: 0;
    animation: dynamic-fade-up 0.7s 0.08s ease-out backwards;
}

.dynamic-hero h1 {
    max-width: 780px;
    margin: 15px 0 22px;
    color: #f8fbff;
    font-size: clamp(3rem, 5.4vw, 5rem);
    font-weight: 770;
    letter-spacing: -0.06em;
    line-height: 0.96;
    text-wrap: balance;
}

.dynamic-hero-copy > p {
    max-width: 680px;
    margin: 0;
    color: #a9b8ca;
    font-size: clamp(1rem, 1.6vw, 1.16rem);
    line-height: 1.72;
}

.dynamic-hero-tags {
    display: flex;
    margin-top: 28px;
    flex-wrap: wrap;
    gap: 9px;
}

.dynamic-hero-tags span {
    padding: 7px 10px;
    border: 1px solid rgba(125, 211, 252, 0.13);
    border-radius: 999px;
    background: rgba(8, 24, 43, 0.56);
    color: #92a9bd;
    font-family: var(--dynamic-mono);
    font-size: 0.64rem;
    letter-spacing: 0.035em;
}

.dynamic-ops-preview {
    position: relative;
    min-width: 0;
    padding: 22px;
    overflow: hidden;
    border: 1px solid rgba(125, 211, 252, 0.19);
    border-radius: 18px;
    background:
        linear-gradient(145deg, rgba(11, 28, 49, 0.88), rgba(5, 14, 27, 0.93));
    box-shadow:
        0 26px 72px rgba(0, 0, 0, 0.3),
        inset 0 1px rgba(255, 255, 255, 0.025);
    animation: dynamic-fade-up 0.75s 0.18s ease-out backwards;
}

.dynamic-ops-preview::before {
    position: absolute;
    top: -80px;
    right: -70px;
    width: 210px;
    height: 210px;
    border-radius: 50%;
    background: rgba(14, 165, 233, 0.1);
    filter: blur(38px);
    content: "";
}

.dynamic-ops-heading,
.dynamic-ops-metrics {
    position: relative;
    z-index: 1;
}

.dynamic-ops-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: start;
}

.dynamic-ops-heading > div {
    display: grid;
    gap: 5px;
}

.dynamic-ops-kicker,
.dynamic-ops-state,
.dynamic-ops-metrics dt {
    font-family: var(--dynamic-mono);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.dynamic-ops-kicker,
.dynamic-ops-metrics dt {
    color: #668098;
}

.dynamic-ops-heading strong {
    color: #dcecff;
    font-size: 0.95rem;
}

.dynamic-ops-state {
    padding: 5px 7px;
    border: 1px solid rgba(74, 222, 128, 0.2);
    border-radius: 5px;
    background: rgba(22, 101, 52, 0.12);
    color: #86efac;
}

.dynamic-ops-visual {
    position: relative;
    height: 106px;
    margin: 21px 0 17px;
    border-top: 1px solid rgba(125, 211, 252, 0.1);
    border-bottom: 1px solid rgba(125, 211, 252, 0.1);
    background:
        linear-gradient(90deg, rgba(96, 165, 250, 0.025) 1px, transparent 1px),
        linear-gradient(rgba(96, 165, 250, 0.025) 1px, transparent 1px);
    background-size: 24px 24px;
}

.dynamic-ops-line {
    position: absolute;
    top: 52px;
    right: 12%;
    left: 12%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.44), transparent);
}

.dynamic-ops-node {
    position: absolute;
    top: 46px;
    width: 13px;
    height: 13px;
    border: 3px solid #0a1729;
    border-radius: 50%;
    background: var(--dynamic-cyan);
    box-shadow: 0 0 0 1px rgba(103, 232, 249, 0.28), 0 0 20px rgba(34, 211, 238, 0.36);
}

.dynamic-ops-node-one { left: 13%; }
.dynamic-ops-node-two { left: calc(50% - 6px); }
.dynamic-ops-node-three { right: 13%; }

.dynamic-ops-metrics {
    display: grid;
    margin: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dynamic-ops-metrics div {
    display: grid;
    min-width: 0;
    padding-inline: 12px;
    gap: 4px;
}

.dynamic-ops-metrics div:first-child { padding-left: 0; }
.dynamic-ops-metrics div:last-child { padding-right: 0; }

.dynamic-ops-metrics div + div {
    border-left: 1px solid rgba(125, 211, 252, 0.1);
}

.dynamic-ops-metrics dd {
    margin: 0;
    overflow: hidden;
    color: #b9c9d9;
    font-size: 0.7rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dynamic-feature-strip {
    display: grid;
    overflow: hidden;
    border: 1px solid rgba(125, 211, 252, 0.13);
    border-radius: 14px;
    background: rgba(5, 14, 27, 0.66);
    grid-template-columns: repeat(4, minmax(0, 1fr));
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.18);
}

.dynamic-feature {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 104px;
    padding: 20px;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    animation: dynamic-fade-up 0.55s ease-out backwards;
    transition: background-color 0.22s ease;
}

.dynamic-feature:nth-child(1) { animation-delay: 0.24s; }
.dynamic-feature:nth-child(2) { animation-delay: 0.31s; }
.dynamic-feature:nth-child(3) { animation-delay: 0.38s; }
.dynamic-feature:nth-child(4) { animation-delay: 0.45s; }

.dynamic-feature + .dynamic-feature {
    border-left: 1px solid rgba(125, 211, 252, 0.11);
}

.dynamic-feature:hover {
    background: rgba(15, 36, 61, 0.55);
}

.dynamic-feature-number {
    display: grid;
    width: 27px;
    height: 27px;
    border: 1px solid rgba(103, 232, 249, 0.19);
    border-radius: 7px;
    background: rgba(8, 47, 73, 0.25);
    color: #67e8f9;
    font-family: var(--dynamic-mono);
    font-size: 0.58rem;
    font-weight: 700;
    place-items: center;
}

.dynamic-feature > div {
    min-width: 0;
}

.dynamic-feature strong {
    display: block;
    color: #cedbea;
    font-size: 0.79rem;
    line-height: 1.35;
}

.dynamic-feature p {
    margin: 6px 0 0;
    color: #6f8297;
    font-size: 0.68rem;
    line-height: 1.5;
}

.difficulty-section {
    padding-top: clamp(64px, 7vw, 92px);
}

.difficulty-heading {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    align-items: end;
    margin-bottom: 32px;
}

.difficulty-heading h2 {
    margin: 7px 0 0;
    color: #f1f5f9;
    font-size: clamp(1.7rem, 3vw, 2.45rem);
    letter-spacing: -0.035em;
}

.difficulty-heading > p {
    max-width: 530px;
    margin: 0;
    color: var(--dynamic-muted);
    line-height: 1.65;
}

.difficulty-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.difficulty-card {
    --difficulty-accent: 96, 165, 250;
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 474px;
    padding: 27px;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(var(--difficulty-accent), 0.2);
    border-radius: 18px;
    background:
        linear-gradient(155deg, rgba(var(--difficulty-accent), 0.075), transparent 38%),
        rgba(7, 17, 31, 0.92);
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.24);
    animation: dynamic-card-enter 0.65s ease-out backwards;
    transition:
        border-color 0.24s ease,
        box-shadow 0.24s ease,
        transform 0.24s ease;
}

.difficulty-card:nth-child(1) { animation-delay: 0.08s; }
.difficulty-card:nth-child(2) { animation-delay: 0.16s; }
.difficulty-card:nth-child(3) { animation-delay: 0.24s; }

.difficulty-card::before {
    position: absolute;
    top: 0;
    right: 22px;
    left: 22px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(var(--difficulty-accent), 0.86), transparent);
    content: "";
}

.difficulty-card::after {
    position: absolute;
    top: -130px;
    right: -120px;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: rgba(var(--difficulty-accent), 0.1);
    filter: blur(46px);
    content: "";
    opacity: 0.65;
    transition: opacity 0.24s ease, transform 0.35s ease;
}

.difficulty-card > * {
    position: relative;
    z-index: 1;
}

.difficulty-card-easy { --difficulty-accent: 34, 211, 238; }
.difficulty-card-medium { --difficulty-accent: 129, 140, 248; }

.difficulty-card-active {
    border-color: rgba(var(--difficulty-accent), 0.3);
}

.difficulty-card-active:hover {
    border-color: rgba(var(--difficulty-accent), 0.55);
    box-shadow:
        0 30px 75px rgba(0, 0, 0, 0.34),
        0 0 30px rgba(var(--difficulty-accent), 0.075);
    transform: translateY(-6px);
}

.difficulty-card-active:hover::after {
    opacity: 1;
    transform: translate(-8px, 8px);
}

.difficulty-card-top {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
}

.difficulty-identity {
    display: flex;
    gap: 10px;
    align-items: center;
}

.difficulty-sequence {
    display: grid;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(var(--difficulty-accent), 0.24);
    border-radius: 8px;
    background: rgba(var(--difficulty-accent), 0.08);
    color: rgba(var(--difficulty-accent), 0.9);
    font-family: var(--dynamic-mono);
    font-size: 0.62rem;
    font-weight: 700;
    place-items: center;
}

.difficulty-code {
    color: rgb(var(--difficulty-accent));
    font-family: var(--dynamic-mono);
    font-size: 0.76rem;
    font-weight: 750;
    letter-spacing: 0.12em;
}

.difficulty-availability,
.difficulty-coming-soon {
    padding: 5px 8px;
    border-radius: 5px;
    font-family: var(--dynamic-mono);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.difficulty-availability {
    border: 1px solid rgba(74, 222, 128, 0.24);
    background: rgba(22, 101, 52, 0.16);
    color: #86efac;
}

.difficulty-coming-soon {
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(51, 65, 85, 0.28);
    color: #8291a5;
}

.difficulty-card-title {
    margin-top: 30px;
}

.difficulty-card-title > span {
    color: #6f8399;
    font-family: var(--dynamic-mono);
    font-size: 0.61rem;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.difficulty-card h3 {
    margin: 5px 0 0;
    color: #eef4fb;
    font-size: 1.65rem;
    letter-spacing: -0.025em;
}

.difficulty-card p {
    margin: 14px 0 0;
    color: var(--dynamic-muted);
    font-size: 0.88rem;
    line-height: 1.68;
}

.difficulty-complexity {
    display: flex;
    margin-top: 19px;
    padding: 11px 0;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.difficulty-complexity > span {
    color: #71849a;
    font-family: var(--dynamic-mono);
    font-size: 0.61rem;
    font-weight: 650;
    letter-spacing: 0.075em;
    text-transform: uppercase;
}

.difficulty-complexity > div {
    display: flex;
    gap: 5px;
}

.difficulty-complexity i {
    width: 22px;
    height: 3px;
    border-radius: 999px;
    background: rgba(100, 116, 139, 0.25);
}

.difficulty-complexity i.is-active {
    background: rgb(var(--difficulty-accent));
    box-shadow: 0 0 10px rgba(var(--difficulty-accent), 0.34);
}

.difficulty-card ul {
    display: grid;
    margin: 17px 0 26px;
    padding: 0;
    gap: 10px;
    color: #aab9ca;
    font-size: 0.82rem;
    list-style: none;
}

.difficulty-card li {
    position: relative;
    padding-left: 17px;
}

.difficulty-card li::before {
    position: absolute;
    top: 0.55em;
    left: 0;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgb(var(--difficulty-accent));
    box-shadow: 0 0 8px rgba(var(--difficulty-accent), 0.34);
    content: "";
}

.difficulty-card button,
.dynamic-primary-button,
.dynamic-secondary-button,
.dynamic-start-error button,
.completion-banner button {
    display: inline-flex;
    min-height: 46px;
    padding: 10px 17px;
    border-radius: 7px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-weight: 700;
    text-decoration: none;
    transition:
        border-color 0.18s ease,
        background-color 0.18s ease,
        box-shadow 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease;
}

.difficulty-card button {
    width: 100%;
    margin-top: auto;
}

.dynamic-primary-button,
.difficulty-card-active button {
    border: 1px solid rgba(var(--difficulty-accent, 96, 165, 250), 0.74);
    background: linear-gradient(135deg, rgba(var(--difficulty-accent, 96, 165, 250), 0.92), rgba(37, 99, 235, 0.96));
    color: #fff;
    box-shadow: 0 12px 28px rgba(30, 64, 175, 0.22);
}

.dynamic-primary-button:hover:not(:disabled),
.difficulty-card-active button:hover:not(:disabled) {
    border-color: rgba(var(--difficulty-accent, 96, 165, 250), 0.94);
    background: linear-gradient(135deg, rgba(var(--difficulty-accent, 96, 165, 250), 1), #3b82f6);
    color: #fff;
    box-shadow: 0 15px 32px rgba(var(--difficulty-accent, 96, 165, 250), 0.2);
    transform: translateY(-2px) scale(1.005);
}

.dynamic-cta-arrow {
    font-size: 1.05rem;
    transition: transform 0.18s ease;
}

.difficulty-card-active button:hover .dynamic-cta-arrow {
    transform: translateX(4px);
}

.start-incident-button:disabled {
    cursor: wait;
    opacity: 0.72;
}

.dynamic-secondary-button {
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(15, 23, 42, 0.88);
    color: #cbd5e1;
}

.dynamic-secondary-button:hover:not(:disabled) {
    border-color: rgba(96, 165, 250, 0.48);
    color: #fff;
}

.difficulty-card-locked {
    --difficulty-accent: 100, 116, 139;
    border-color: rgba(100, 116, 139, 0.13);
    background:
        linear-gradient(155deg, rgba(71, 85, 105, 0.045), transparent 40%),
        rgba(6, 13, 24, 0.66);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.17);
}

.difficulty-card-locked h3,
.difficulty-card-locked p,
.difficulty-card-locked li {
    color: #66758a;
}

.difficulty-card-locked li::before {
    background: #475569;
}

.difficulty-card-locked button {
    cursor: not-allowed;
    border: 1px solid rgba(100, 116, 139, 0.15);
    background: rgba(30, 41, 59, 0.45);
    color: #5f7085;
    box-shadow: none;
}

.dynamic-start-error {
    display: flex;
    margin-top: 24px;
    padding: 18px 20px;
    border: 1px solid rgba(251, 113, 133, 0.3);
    border-radius: 10px;
    background: rgba(127, 29, 29, 0.12);
    justify-content: space-between;
    gap: 24px;
    align-items: center;
}

.dynamic-start-error p {
    margin: 7px 0 0;
    color: #fecdd3;
}

.dynamic-start-error button {
    flex: 0 0 auto;
    border: 1px solid rgba(251, 113, 133, 0.4);
    background: rgba(159, 18, 57, 0.3);
    color: #fff;
}

.generation-overlay,
.completion-overlay,
.exit-confirmation {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    padding: 20px;
    place-items: center;
    background: rgba(1, 5, 14, 0.9);
    backdrop-filter: blur(12px);
}

.generation-panel {
    width: min(100%, 680px);
    padding: clamp(28px, 5vw, 46px);
    border: 1px solid var(--dynamic-border-strong);
    border-radius: 16px;
    background: #07111f;
    box-shadow: 0 36px 100px rgba(0, 0, 0, 0.58);
}

.generation-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
}

.generation-panel h2 {
    margin: 28px 0 10px;
    color: #f8fafc;
    font-size: clamp(1.7rem, 4vw, 2.45rem);
}

.generation-panel > p {
    margin: 0;
    color: var(--dynamic-muted);
}

.generation-spinner {
    width: 36px;
    height: 36px;
    margin: 28px auto 0;
    border: 3px solid rgba(51, 65, 85, 0.6);
    border-top-color: var(--dynamic-blue);
    border-radius: 50%;
    animation: generation-wait 1s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
    .generation-spinner { animation: none; }
}

.dynamic-session {
    background: #020713;
}

.workspace-state-panel,
.end-summary {
    display: grid;
    min-height: calc(100dvh - 56px);
    padding: 30px;
    place-content: center;
    justify-items: center;
    text-align: center;
}

.end-summary {
    overflow-y: auto;
}

.workspace-state-panel h1,
.end-summary h1 {
    margin: 11px 0;
    color: #f8fafc;
    font-size: clamp(1.8rem, 4vw, 3rem);
}

.workspace-state-panel > p,
.end-summary-panel > p {
    max-width: 580px;
    color: var(--dynamic-muted);
    line-height: 1.7;
}

.workspace-loading-mark {
    display: flex;
    height: 38px;
    margin-bottom: 24px;
    gap: 7px;
    align-items: end;
}

.workspace-loading-mark span {
    width: 5px;
    height: 16px;
    border-radius: 2px;
    background: var(--dynamic-blue);
    animation: dynamic-loading-bars 0.9s ease-in-out infinite alternate;
}

.workspace-loading-mark span:nth-child(2) {
    height: 30px;
    animation-delay: 0.16s;
}

.workspace-loading-mark span:nth-child(3) {
    height: 22px;
    animation-delay: 0.32s;
}

.workspace-state-code,
.end-summary-code {
    color: var(--dynamic-red);
    font-family: var(--dynamic-mono);
    font-size: 0.7rem;
    font-weight: 750;
    letter-spacing: 0.13em;
}

.workspace-state-actions {
    display: flex;
    margin-top: 15px;
    gap: 10px;
}

.workspace-content {
    width: min(100% - 28px, 1500px);
    min-height: calc(100dvh - 56px);
    margin: 0 auto;
    padding: 18px 0 26px;
}

.workspace-topbar {
    display: flex;
    min-height: 68px;
    padding: 10px 16px;
    border: 1px solid var(--dynamic-border);
    border-radius: 10px;
    background: rgba(7, 15, 29, 0.94);
    justify-content: space-between;
    gap: 24px;
    align-items: center;
}

.workspace-brand {
    display: flex;
    gap: 12px;
    align-items: center;
}

.workspace-brand > a {
    display: grid;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(96, 165, 250, 0.42);
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.14);
    color: #bfdbfe;
    font-family: var(--dynamic-mono);
    font-size: 0.78rem;
    font-weight: 800;
    text-decoration: none;
    place-items: center;
}

.workspace-brand div {
    display: grid;
    gap: 2px;
}

.workspace-brand span,
.workspace-score span {
    color: #6f829a;
    font-family: var(--dynamic-mono);
    font-size: 0.61rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.workspace-brand strong {
    overflow: hidden;
    max-width: min(52vw, 560px);
    color: #e6eef8;
    font-size: 0.9rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-topbar-state {
    display: flex;
    gap: 18px;
    align-items: center;
}

.workspace-exit-button,
.danger-button {
    min-height: 40px;
    padding: 8px 13px;
    border: 1px solid rgba(251, 113, 133, 0.34);
    border-radius: 6px;
    background: rgba(159, 18, 57, 0.18);
    color: #fecdd3;
    font-size: 0.76rem;
    font-weight: 700;
}

.workspace-exit-button:hover,
.danger-button:hover {
    border-color: rgba(251, 113, 133, 0.62);
    background: rgba(159, 18, 57, 0.32);
}

.session-status-badge {
    padding: 6px 9px;
    border: 1px solid rgba(74, 222, 128, 0.24);
    border-radius: 5px;
    background: rgba(22, 101, 52, 0.13);
    color: #86efac;
    font-family: var(--dynamic-mono);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.session-status-badge[data-status="completed"] {
    border-color: rgba(96, 165, 250, 0.35);
    background: rgba(37, 99, 235, 0.13);
    color: #bfdbfe;
}

.session-status-badge[data-status="ended"] {
    border-color: rgba(148, 163, 184, 0.22);
    background: rgba(51, 65, 85, 0.25);
    color: #a6b3c3;
}

.workspace-score {
    display: grid;
    min-width: 62px;
    text-align: right;
}

.workspace-score strong {
    color: #fff;
    font-family: var(--dynamic-mono);
    font-size: 1.16rem;
}

.completion-banner {
    display: flex;
    margin-top: 12px;
    padding: 12px 15px;
    border: 1px solid rgba(74, 222, 128, 0.26);
    border-radius: 9px;
    background: rgba(20, 83, 45, 0.14);
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    color: #bbf7d0;
}

.completion-banner > div {
    display: flex;
    gap: 10px;
    align-items: center;
}

.completion-banner button {
    min-height: 36px;
    padding: 7px 12px;
    border: 1px solid rgba(74, 222, 128, 0.35);
    background: rgba(22, 101, 52, 0.25);
    color: #dcfce7;
    font-size: 0.8rem;
}

.workspace-grid {
    display: grid;
    min-height: calc(100dvh - 168px);
    margin-top: 12px;
    grid-template-columns: minmax(285px, 360px) minmax(0, 1fr);
    gap: 12px;
}

.incident-sidebar {
    display: grid;
    align-content: start;
    gap: 12px;
}

.incident-card,
.terminal-panel,
.infrastructure-panel {
    border: 1px solid var(--dynamic-border);
    border-radius: 10px;
    background: rgba(7, 15, 29, 0.95);
}

.workspace-main {
    display: grid;
    min-width: 0;
    align-content: start;
    gap: 12px;
}

.hint-intro {
    margin: 0 0 13px;
    color: #8194aa;
    font-size: 0.78rem;
    line-height: 1.55;
}

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

.revealed-hints li {
    padding: 10px;
    border-left: 2px solid rgba(103, 232, 249, 0.42);
    background: rgba(14, 116, 144, 0.08);
}

.revealed-hints p {
    margin: 0;
    color: #cbdbea;
    font-size: 0.8rem;
    line-height: 1.55;
}

.revealed-hints span {
    display: block;
    margin-top: 5px;
    color: #64748b;
    font-family: var(--dynamic-mono);
    font-size: 0.61rem;
}

.hint-button {
    width: 100%;
    min-height: 42px;
    margin-top: 12px;
    border: 1px solid rgba(103, 232, 249, 0.3);
    border-radius: 6px;
    background: rgba(14, 116, 144, 0.12);
    color: #cffafe;
    font-size: 0.78rem;
    font-weight: 700;
}

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

.hint-error {
    margin: 10px 0 0;
    color: #fda4af;
    font-size: 0.75rem;
}

.infrastructure-panel {
    min-width: 0;
    overflow: hidden;
}

.infrastructure-header {
    display: flex;
    min-height: 66px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--dynamic-border);
    justify-content: space-between;
    gap: 20px;
    align-items: center;
}

.infrastructure-header h2 {
    margin: 2px 0 0;
    color: #e6eef8;
    font-size: 1rem;
}

.infrastructure-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: #718399;
    font-family: var(--dynamic-mono);
    font-size: 0.58rem;
}

.infrastructure-legend span {
    display: flex;
    gap: 5px;
    align-items: center;
}

.infrastructure-legend i,
.infrastructure-node i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #94a3b8;
}

.infrastructure-legend .is-running,
.infrastructure-node.is-running i {
    background: #4ade80;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.4);
}

.infrastructure-legend .is-failed,
.infrastructure-node.is-failed i {
    background: #fb7185;
    box-shadow: 0 0 8px rgba(251, 113, 133, 0.42);
}

.infrastructure-legend .is-unknown,
.infrastructure-node.is-unknown i {
    background: #fbbf24;
}

.infrastructure-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    min-height: 280px;
}

.infrastructure-map {
    position: relative;
    min-width: 0;
    min-height: 280px;
    overflow: hidden;
    background:
        linear-gradient(rgba(96, 165, 250, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(96, 165, 250, 0.035) 1px, transparent 1px),
        #030914;
    background-size: 24px 24px;
}

#infrastructure-links {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#infrastructure-links line {
    stroke: rgba(103, 232, 249, 0.34);
    stroke-width: 2;
    stroke-dasharray: 5 5;
}

.infrastructure-nodes {
    position: relative;
    z-index: 1;
    display: grid;
    min-height: 280px;
    padding: 34px clamp(18px, 4vw, 44px);
    grid-template-columns: repeat(var(--infrastructure-columns), minmax(110px, 1fr));
    grid-template-rows: repeat(2, minmax(72px, auto));
    gap: 58px clamp(16px, 5vw, 54px);
    align-items: center;
}

.infrastructure-node {
    display: grid;
    min-width: 0;
    min-height: 72px;
    padding: 10px 12px;
    border: 1px solid rgba(96, 165, 250, 0.24);
    border-radius: 7px;
    background: rgba(7, 19, 35, 0.95);
    color: #dbeafe;
    text-align: left;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.26);
}

.infrastructure-node:hover,
.infrastructure-node.is-selected {
    border-color: rgba(103, 232, 249, 0.65);
    transform: translateY(-1px);
}

.infrastructure-node > span {
    color: #60758d;
    font-family: var(--dynamic-mono);
    font-size: 0.56rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.infrastructure-node strong {
    overflow: hidden;
    margin: 3px 0 5px;
    font-family: var(--dynamic-mono);
    font-size: 0.76rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.infrastructure-node small {
    display: flex;
    gap: 6px;
    align-items: center;
    color: #8295aa;
    font-family: var(--dynamic-mono);
    font-size: 0.59rem;
}

.node-details {
    padding: 16px;
    border-left: 1px solid var(--dynamic-border);
    background: #07111f;
}

.node-details-heading {
    display: flex;
    margin-bottom: 18px;
    justify-content: space-between;
    align-items: center;
    color: #70849c;
    font-family: var(--dynamic-mono);
    font-size: 0.58rem;
}

.node-details-heading button {
    border: 0;
    background: transparent;
    color: #94a3b8;
    font-size: 1.25rem;
}

.node-details > strong {
    color: #e0f2fe;
    font-family: var(--dynamic-mono);
    font-size: 0.84rem;
}

.node-details dl {
    display: grid;
    margin: 16px 0 0;
    gap: 10px;
}

.node-details dl div {
    display: grid;
    gap: 2px;
}

.node-details dt {
    color: #64748b;
    font-size: 0.65rem;
    font-weight: 500;
}

.node-details dd {
    margin: 0;
    color: #b9c8d8;
    font-family: var(--dynamic-mono);
    font-size: 0.72rem;
}

.incident-card {
    padding: 18px;
}

.incident-card-heading {
    display: flex;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(125, 211, 252, 0.1);
    justify-content: space-between;
    gap: 12px;
    color: #7890aa;
    font-family: var(--dynamic-mono);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.incident-briefing-card h1 {
    margin: 0 0 18px;
    color: #edf5ff;
    font-size: 1.22rem;
    line-height: 1.35;
}

.incident-facts {
    display: grid;
    margin: 0;
    gap: 10px;
}

.incident-facts div {
    display: grid;
    gap: 3px;
}

.incident-facts dt,
.incident-objective-summary > span,
.incident-tools > span {
    color: #64768d;
    font-family: var(--dynamic-mono);
    font-size: 0.61rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.incident-facts dd {
    margin: 0;
    color: #becbda;
    font-size: 0.83rem;
}

.incident-objective-summary,
.incident-tools {
    margin-top: 17px;
    padding-top: 15px;
    border-top: 1px solid rgba(125, 211, 252, 0.09);
}

.incident-objective-summary p {
    margin: 7px 0 0;
    color: #dce7f3;
    font-size: 0.88rem;
    line-height: 1.55;
}

.incident-tool-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 9px;
}

.incident-tool-list span {
    padding: 5px 7px;
    border: 1px solid rgba(96, 165, 250, 0.17);
    border-radius: 5px;
    background: rgba(37, 99, 235, 0.08);
    color: #a8c8ef;
    font-size: 0.7rem;
}

.objectives-list {
    display: grid;
    gap: 8px;
}

.objective-item {
    display: grid;
    padding: 10px;
    grid-template-columns: auto 1fr;
    gap: 10px;
    border: 1px solid rgba(100, 116, 139, 0.13);
    border-radius: 7px;
    background: rgba(15, 23, 42, 0.45);
}

.objective-marker {
    color: #64748b;
    font-family: var(--dynamic-mono);
}

.objective-item > div {
    display: grid;
    gap: 3px;
}

.objective-item strong {
    color: #b7c4d4;
    font-size: 0.78rem;
    line-height: 1.4;
}

.objective-item > div span {
    color: #64748b;
    font-family: var(--dynamic-mono);
    font-size: 0.61rem;
    text-transform: uppercase;
}

.objective-item.is-complete {
    border-color: rgba(74, 222, 128, 0.2);
    background: rgba(20, 83, 45, 0.09);
}

.objective-item.is-complete .objective-marker,
.objective-item.is-complete > div span {
    color: #4ade80;
}

.objective-item.is-complete strong {
    color: #d1fae5;
}

.progress-metrics,
.completion-stats,
.end-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.progress-metrics div,
.completion-stats div,
.end-summary-grid div {
    display: grid;
    min-height: 60px;
    padding: 9px;
    border: 1px solid rgba(100, 116, 139, 0.12);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.42);
    align-content: center;
}

.progress-metrics span,
.completion-stats span,
.end-summary-grid span {
    color: #64748b;
    font-family: var(--dynamic-mono);
    font-size: 0.59rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.progress-metrics strong,
.completion-stats strong,
.end-summary-grid strong {
    margin-top: 2px;
    color: #e2e8f0;
    font-family: var(--dynamic-mono);
    font-size: 0.9rem;
}

.terminal-panel {
    display: grid;
    min-width: 0;
    min-height: max(500px, calc(100dvh - 168px));
    overflow: hidden;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    background: #030914;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.terminal-toolbar {
    display: grid;
    min-height: 52px;
    padding: 9px 14px;
    grid-template-columns: 1fr auto 1fr;
    gap: 14px;
    align-items: center;
    border-bottom: 1px solid var(--dynamic-border);
    background: #091321;
}

.terminal-window-controls {
    display: flex;
    gap: 6px;
}

.terminal-window-controls span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #334155;
}

.terminal-window-controls span:first-child {
    background: #fb7185;
}

.terminal-window-controls span:nth-child(2) {
    background: #fbbf24;
}

.terminal-window-controls span:nth-child(3) {
    background: #4ade80;
}

.terminal-toolbar-title {
    display: grid;
    justify-items: center;
}

.terminal-toolbar-title span {
    color: #617389;
    font-family: var(--dynamic-mono);
    font-size: 0.57rem;
    letter-spacing: 0.1em;
}

.terminal-toolbar-title strong {
    color: #b8c7d8;
    font-family: var(--dynamic-mono);
    font-size: 0.68rem;
    font-weight: 600;
}

.terminal-connection {
    justify-self: end;
    color: #4ade80;
    font-family: var(--dynamic-mono);
    font-size: 0.59rem;
    letter-spacing: 0.07em;
}

.terminal-connection.is-locked {
    color: #fbbf24;
}

.terminal-output {
    min-height: 300px;
    max-height: calc(100dvh - 300px);
    overflow: auto;
    padding: clamp(18px, 3vw, 28px);
    scrollbar-color: #334155 transparent;
}

.terminal-entry {
    margin-bottom: 16px;
}

.terminal-entry pre {
    max-width: 100%;
    margin: 0;
    color: #c8d4e3;
    font-family: var(--dynamic-mono);
    font-size: clamp(0.77rem, 1.4vw, 0.9rem);
    line-height: 1.62;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.terminal-entry-command pre {
    color: #dbeafe;
}

.terminal-entry-output pre {
    color: #b8c9dc;
}

.terminal-entry-system pre {
    color: #6685a7;
}

.terminal-entry-error pre {
    color: #fda4af;
}

.terminal-form {
    display: grid;
    min-width: 0;
    padding: 12px 14px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 9px;
    align-items: center;
    border-top: 1px solid rgba(96, 165, 250, 0.14);
    background: #06101d;
}

.terminal-form:focus-within {
    box-shadow: inset 0 1px rgba(96, 165, 250, 0.32);
}

.terminal-prompt {
    color: #4ade80;
    font-family: var(--dynamic-mono);
    font-size: 0.79rem;
    white-space: nowrap;
}

.terminal-form input {
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #e5edf8;
    font-family: var(--dynamic-mono);
    font-size: 0.84rem;
}

.terminal-form input::placeholder {
    color: #42536a;
}

.terminal-form button {
    min-height: 36px;
    padding: 7px 12px;
    border: 1px solid rgba(96, 165, 250, 0.3);
    border-radius: 5px;
    background: rgba(37, 99, 235, 0.16);
    color: #bfdbfe;
    font-size: 0.74rem;
    font-weight: 700;
}

.terminal-form.is-disabled {
    opacity: 0.6;
}

.terminal-form button:disabled {
    cursor: not-allowed;
}

.terminal-footer {
    display: flex;
    min-height: 34px;
    padding: 7px 14px;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    border-top: 1px solid rgba(96, 165, 250, 0.08);
    background: #050c17;
    color: #52647a;
    font-family: var(--dynamic-mono);
    font-size: 0.6rem;
}

.terminal-footer kbd {
    border: 1px solid #334155;
    background: #0f172a;
    color: #94a3b8;
    box-shadow: none;
}

.completion-panel {
    width: min(100%, 590px);
    max-height: calc(100dvh - 40px);
    overflow: auto;
    padding: clamp(28px, 5vw, 46px);
    border: 1px solid rgba(74, 222, 128, 0.34);
    border-radius: 16px;
    background: #07131f;
    text-align: center;
    box-shadow: 0 38px 110px rgba(0, 0, 0, 0.62);
}

.exit-confirmation-panel {
    width: min(100%, 520px);
    padding: clamp(25px, 5vw, 40px);
    border: 1px solid rgba(251, 113, 133, 0.3);
    border-radius: 14px;
    background: #07111f;
    box-shadow: 0 34px 100px rgba(0, 0, 0, 0.58);
}

.exit-confirmation-panel h2 {
    margin: 12px 0;
    color: #f8fafc;
    font-size: clamp(1.45rem, 4vw, 2rem);
}

.exit-confirmation-panel > p {
    color: #9aabba;
    line-height: 1.65;
}

.exit-confirmation-actions {
    display: grid;
    margin-top: 24px;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
}

.completion-mark {
    display: grid;
    width: 62px;
    height: 62px;
    margin: 0 auto 22px;
    border: 1px solid rgba(74, 222, 128, 0.42);
    border-radius: 50%;
    background: rgba(22, 101, 52, 0.18);
    color: #86efac;
    font-size: 1.7rem;
    place-items: center;
    box-shadow: 0 0 30px rgba(74, 222, 128, 0.12);
}

.completion-panel h2 {
    margin: 10px 0 12px;
    color: #f0fdf4;
    font-size: clamp(1.8rem, 5vw, 2.65rem);
    letter-spacing: -0.035em;
}

.completion-panel > p {
    color: #9eb1c4;
    line-height: 1.7;
}

.completion-stats {
    margin: 26px 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.completion-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
}

.completion-error {
    margin: 14px 0 0 !important;
    color: #fda4af !important;
    font-size: 0.84rem;
}

.end-summary-panel {
    width: min(100%, 660px);
    padding: clamp(28px, 5vw, 48px);
    border: 1px solid var(--dynamic-border-strong);
    border-radius: 16px;
    background: #07111f;
    box-shadow: 0 32px 90px rgba(0, 0, 0, 0.45);
}

.end-summary-grid {
    margin: 28px 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.end-summary-panel .dynamic-primary-button {
    width: min(100%, 260px);
    margin: 0 auto;
}

.post-incident-report {
    margin: 0 0 24px;
    padding: 18px;
    border: 1px solid var(--dynamic-border);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.55);
    text-align: left;
}

.post-incident-report h2,
.post-incident-report h3 {
    color: #e2e8f0;
}

.post-incident-report h2 {
    margin: 0 0 14px;
    font-size: 1rem;
}

.post-incident-report h3 {
    margin: 16px 0 8px;
    font-size: 0.8rem;
}

.post-incident-report dl,
.post-incident-report ul {
    margin: 0;
}

.post-incident-report dl div {
    margin-top: 9px;
}

.post-incident-report dt {
    color: #64748b;
    font-family: var(--dynamic-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
}

.post-incident-report dd,
.post-incident-report li {
    color: #cbd5e1;
    font-size: 0.8rem;
    line-height: 1.5;
}

@keyframes dynamic-loading-bars {
    from { opacity: 0.35; transform: scaleY(0.7); }
    to { opacity: 1; transform: scaleY(1); }
}

@keyframes dynamic-fade-up {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes dynamic-fade-down {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes dynamic-card-enter {
    from { opacity: 0; transform: translateY(22px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes dynamic-status-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.28), 0 0 12px rgba(74, 222, 128, 0.58); }
    50% { opacity: 0.78; box-shadow: 0 0 0 5px rgba(74, 222, 128, 0), 0 0 18px rgba(74, 222, 128, 0.72); }
}

@keyframes dynamic-light-drift {
    from { opacity: 0.72; transform: translateX(-52%) scale(0.96); }
    to { opacity: 1; transform: translateX(-48%) scale(1.04); }
}

@media (max-width: 1050px) {
    .dynamic-hero {
        grid-template-columns: minmax(0, 1.08fr) minmax(315px, 0.92fr);
        gap: 38px;
    }

    .dynamic-feature-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dynamic-feature:nth-child(3) {
        border-left: 0;
        border-top: 1px solid var(--dynamic-border);
    }

    .dynamic-feature:nth-child(4) {
        border-top: 1px solid var(--dynamic-border);
    }

    .workspace-grid {
        grid-template-columns: minmax(250px, 310px) minmax(0, 1fr);
    }

    .incident-card {
        padding: 15px;
    }
}

@media (max-width: 900px) {
    .dynamic-hero {
        grid-template-columns: 1fr;
    }

    .dynamic-ops-preview {
        width: min(100%, 600px);
    }

    .difficulty-grid {
        grid-template-columns: 1fr;
    }

    .difficulty-card {
        min-height: auto;
    }

    .difficulty-card ul {
        margin-bottom: 24px;
    }

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

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

    .incident-briefing-card {
        grid-row: span 2;
    }

    .terminal-panel {
        min-height: 640px;
    }

    .infrastructure-body {
        grid-template-columns: minmax(0, 1fr) 200px;
    }

    .terminal-output {
        max-height: 520px;
    }
}

@media (max-width: 680px) {
    .dynamic-lab-shell,
    .workspace-content {
        width: min(100% - 20px, 100%);
    }

    .dynamic-lab-shell {
        padding-top: 14px;
    }

    .dynamic-hero {
        padding: 54px 0 44px;
        text-align: left;
    }

    .dynamic-hero h1 {
        font-size: clamp(2.5rem, 15vw, 4rem);
    }

    .dynamic-feature-strip {
        grid-template-columns: 1fr;
    }

    .dynamic-feature + .dynamic-feature,
    .dynamic-feature:nth-child(3),
    .dynamic-feature:nth-child(4) {
        border-top: 1px solid var(--dynamic-border);
        border-left: 0;
    }

    .dynamic-feature {
        min-height: 88px;
    }

    .dynamic-ops-metrics {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .dynamic-ops-metrics div,
    .dynamic-ops-metrics div:first-child,
    .dynamic-ops-metrics div:last-child {
        padding: 0;
    }

    .dynamic-ops-metrics div + div {
        padding-top: 9px;
        border-top: 1px solid rgba(125, 211, 252, 0.1);
        border-left: 0;
    }

    .difficulty-heading {
        display: grid;
        gap: 12px;
    }

    .difficulty-card {
        padding: 21px;
    }

    .dynamic-start-error,
    .generation-header,
    .completion-banner {
        align-items: stretch;
        flex-direction: column;
    }

    .generation-overlay,
    .completion-overlay,
    .exit-confirmation {
        padding: 10px;
    }

    .generation-panel,
    .completion-panel {
        padding: 24px 20px;
        border-radius: 12px;
    }

    .workspace-content {
        padding-top: 10px;
    }

    .workspace-topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }

    .workspace-brand strong {
        max-width: 48vw;
    }

    .workspace-topbar-state {
        display: grid;
        grid-template-columns: auto auto;
        gap: 7px;
        justify-items: end;
    }

    .workspace-exit-button {
        min-height: 44px;
        grid-column: 1 / -1;
    }

    .workspace-score {
        min-width: 48px;
    }

    .infrastructure-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .infrastructure-body {
        grid-template-columns: 1fr;
    }

    .node-details {
        border-top: 1px solid var(--dynamic-border);
        border-left: 0;
    }

    .infrastructure-nodes {
        padding-inline: 14px;
        gap: 48px 12px;
    }

    .incident-sidebar {
        grid-template-columns: 1fr;
    }

    .incident-briefing-card {
        grid-row: auto;
    }

    .terminal-panel {
        min-height: 560px;
    }

    .terminal-toolbar {
        grid-template-columns: auto 1fr auto;
    }

    .terminal-toolbar-title {
        justify-items: start;
    }

    .terminal-form {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .terminal-prompt {
        grid-column: 1 / -1;
        font-size: 0.7rem;
    }

    .terminal-form button {
        min-width: 78px;
    }

    .terminal-footer {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .completion-stats div:first-child {
        grid-column: 1 / -1;
    }

    .completion-actions {
        grid-template-columns: 1fr;
    }

    .exit-confirmation-actions {
        grid-template-columns: 1fr;
    }

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

    .workspace-state-actions {
        width: min(100%, 360px);
        flex-direction: column;
    }
}

@media (max-height: 780px) and (min-width: 1024px) {
    .dynamic-hero {
        padding-top: 46px;
        padding-bottom: 38px;
    }

    .difficulty-section {
        padding-top: 58px;
    }
}

@media (max-width: 480px) {
    .workspace-topbar {
        grid-template-columns: 1fr;
    }

    .workspace-brand strong {
        max-width: calc(100vw - 100px);
    }

    .workspace-topbar-state {
        width: 100%;
        grid-template-columns: 1fr auto;
        justify-items: start;
    }

    .workspace-score {
        justify-self: end;
    }

    .workspace-exit-button {
        width: 100%;
    }
}

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

.dynamic-gameplay [hidden] {
    display: none !important;
}

.dynamic-gameplay {
    position: relative;
    min-height: calc(100dvh - 56px);
    overflow: hidden;
    background:
        radial-gradient(circle at 50% -20%, rgba(14, 116, 144, 0.18), transparent 42%),
        #01050d;
    color: var(--dynamic-text);
}

.gameplay-workspace {
    width: min(100% - 24px, 1780px);
    min-height: calc(100dvh - 56px);
    margin: 0 auto;
    padding: 12px 0 18px;
}

.gameplay-topbar {
    display: flex;
    min-height: 58px;
    padding: 8px 12px;
    border: 1px solid rgba(56, 189, 248, 0.19);
    border-radius: 9px 9px 3px 3px;
    background: rgba(4, 12, 23, 0.96);
    justify-content: space-between;
    gap: 22px;
    align-items: center;
    box-shadow: 0 12px 42px rgba(0, 0, 0, 0.3);
}

.gameplay-brand {
    display: flex;
    min-width: 0;
    gap: 11px;
    align-items: center;
}

.gameplay-brand > a {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border: 1px solid rgba(34, 211, 238, 0.45);
    border-radius: 7px;
    background: linear-gradient(145deg, rgba(14, 116, 144, 0.3), rgba(30, 64, 175, 0.2));
    color: #cffafe;
    font-family: var(--dynamic-mono);
    font-size: 0.72rem;
    font-weight: 800;
    text-decoration: none;
    place-items: center;
    box-shadow: inset 0 0 18px rgba(34, 211, 238, 0.08);
}

.gameplay-brand > div {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.gameplay-brand span,
.gameplay-map-name {
    color: #5c7891;
    font-family: var(--dynamic-mono);
    font-size: 0.57rem;
    letter-spacing: 0.12em;
}

.gameplay-brand strong {
    overflow: hidden;
    max-width: min(42vw, 590px);
    color: #e8f2fc;
    font-size: 0.86rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gameplay-statusline {
    display: flex;
    gap: 15px;
    align-items: center;
}

.gameplay-map-name {
    padding-right: 15px;
    border-right: 1px solid rgba(100, 116, 139, 0.2);
    color: #7892aa;
    letter-spacing: 0.05em;
}

.gameplay-stage {
    position: relative;
    min-height: calc(100dvh - 144px);
    margin-top: 10px;
    overflow: hidden;
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 3px 3px 11px 11px;
    background: #020713;
    box-shadow: 0 32px 100px rgba(0, 0, 0, 0.4);
}

.game-viewport-panel,
.game-canvas,
.game-canvas canvas {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
}

.game-canvas canvas {
    outline: 0;
}

.game-vignette {
    position: absolute;
    inset: 0;
    z-index: 2;
    background:
        linear-gradient(90deg, rgba(1, 5, 13, 0.38), transparent 18%, transparent 80%, rgba(1, 5, 13, 0.3)),
        radial-gradient(circle at center, transparent 52%, rgba(0, 0, 0, 0.32));
    pointer-events: none;
}

.game-map-label,
.game-controls,
.interaction-prompt,
.game-announcement {
    position: absolute;
    z-index: 4;
    border: 1px solid rgba(56, 189, 248, 0.18);
    background: rgba(3, 12, 23, 0.86);
    backdrop-filter: blur(10px);
    font-family: var(--dynamic-mono);
}

.game-map-label {
    top: 14px;
    left: 330px;
    display: grid;
    padding: 8px 11px;
    border-radius: 5px;
}

.game-map-label span {
    color: #4f718b;
    font-size: 0.51rem;
    letter-spacing: 0.13em;
}

.game-map-label strong {
    color: #a5d8ef;
    font-size: 0.62rem;
    font-weight: 600;
}

.game-controls {
    right: 14px;
    bottom: 14px;
    display: flex;
    padding: 8px 10px;
    gap: 13px;
    border-radius: 5px;
    color: #70879d;
    font-size: 0.57rem;
}

.game-controls kbd,
.interaction-prompt kbd {
    border: 1px solid rgba(125, 211, 252, 0.28);
    background: rgba(30, 64, 175, 0.16);
    color: #bae6fd;
    box-shadow: none;
}

.interaction-prompt {
    bottom: 52px;
    left: 50%;
    display: flex;
    min-width: 280px;
    padding: 10px 14px;
    border-color: rgba(34, 211, 238, 0.42);
    border-radius: 7px;
    gap: 11px;
    align-items: center;
    justify-content: center;
    color: #d7f7ff;
    font-size: 0.72rem;
    transform: translateX(-50%);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 25px rgba(34, 211, 238, 0.08);
}

.game-announcement {
    top: 16px;
    left: 50%;
    padding: 8px 12px;
    border: 0;
    background: rgba(2, 8, 18, 0.7);
    color: #7dd3fc;
    font-size: 0.62rem;
    transform: translateX(-50%);
}

.gameplay-left-panel {
    position: absolute;
    top: 14px;
    bottom: 14px;
    left: 14px;
    z-index: 5;
    width: 292px;
    overflow: auto;
    border: 1px solid rgba(56, 189, 248, 0.19);
    border-radius: 7px;
    background: rgba(4, 13, 25, 0.93);
    scrollbar-color: #24435c transparent;
    backdrop-filter: blur(13px);
    transition: width 0.2s ease;
    box-shadow: 0 18px 54px rgba(0, 0, 0, 0.34);
}

.panel-collapse-button {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    width: 100%;
    min-height: 36px;
    padding: 8px 11px;
    border: 0;
    border-bottom: 1px solid rgba(56, 189, 248, 0.15);
    background: rgba(7, 20, 36, 0.98);
    color: #7494aa;
    font-family: var(--dynamic-mono);
    font-size: 0.58rem;
    letter-spacing: 0.12em;
    justify-content: space-between;
}

.briefing-panel-content {
    padding: 14px;
}

.briefing-panel-content > h1 {
    margin: 0 0 10px;
    color: #eef8ff;
    font-size: 1rem;
    line-height: 1.34;
}

.briefing-panel-content .incident-briefing {
    margin: 0 0 13px;
    color: #93a7b9;
    font-size: 0.74rem;
    line-height: 1.55;
}

.gameplay-left-panel.is-collapsed {
    width: 42px;
    overflow: hidden;
}

.gameplay-left-panel.is-collapsed .briefing-panel-content {
    display: none;
}

.gameplay-left-panel.is-collapsed .panel-collapse-button {
    height: 130px;
    padding: 9px;
    writing-mode: vertical-rl;
}

.gameplay-objectives,
.gameplay-hints {
    margin-top: 17px;
    padding-top: 14px;
    border-top: 1px solid rgba(125, 211, 252, 0.1);
}

.gameplay-left-panel .incident-card-heading {
    margin-bottom: 11px;
}

.gameplay-left-panel .incident-facts {
    grid-template-columns: 1fr;
    gap: 7px;
}

.gameplay-left-panel .incident-facts dd,
.gameplay-left-panel .incident-objective-summary p {
    font-size: 0.72rem;
}

.gameplay-left-panel .objective-item {
    padding: 8px;
}

.gameplay-left-panel .objective-item strong {
    font-size: 0.7rem;
}

.gameplay-left-panel .revealed-hints p {
    font-size: 0.7rem;
}

.gameplay-hud {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 5;
    display: grid;
    width: 150px;
    border: 1px solid rgba(56, 189, 248, 0.18);
    border-radius: 7px;
    overflow: hidden;
    background: rgba(4, 13, 25, 0.9);
    backdrop-filter: blur(12px);
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.3);
}

.gameplay-hud > div {
    display: flex;
    min-height: 42px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(100, 116, 139, 0.13);
    justify-content: space-between;
    align-items: center;
}

.gameplay-hud > div:last-child {
    border-bottom: 0;
}

.gameplay-hud span {
    color: #527089;
    font-family: var(--dynamic-mono);
    font-size: 0.51rem;
    letter-spacing: 0.09em;
}

.gameplay-hud strong {
    color: #d6e4ef;
    font-family: var(--dynamic-mono);
    font-size: 0.63rem;
}

.gameplay-hud .hud-health strong {
    color: #4ade80;
}

.gameplay-hud .hud-health strong.is-alert {
    color: #fb7185;
}

.gameplay-completion-banner {
    position: absolute;
    top: 80px;
    left: 50%;
    z-index: 8;
    width: min(540px, calc(100% - 40px));
    transform: translateX(-50%);
}

.game-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: grid;
    padding: 24px;
    overflow: auto;
    background: rgba(0, 3, 10, 0.78);
    backdrop-filter: blur(8px);
    place-items: center;
}

.game-overlay-panel {
    width: min(100%, 760px);
    max-height: calc(100dvh - 48px);
    overflow: auto;
    border: 1px solid rgba(56, 189, 248, 0.28);
    border-radius: 10px;
    background: #06101d;
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.66), 0 0 60px rgba(14, 116, 144, 0.08);
}

.terminal-overlay-panel {
    display: grid;
    width: min(100%, 980px);
    min-height: min(680px, calc(100dvh - 48px));
    grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.terminal-overlay-panel .terminal-output {
    min-height: 360px;
    max-height: none;
}

.overlay-close {
    min-height: 30px;
    padding: 5px 9px;
    border: 1px solid rgba(125, 211, 252, 0.22);
    border-radius: 4px;
    background: rgba(15, 23, 42, 0.72);
    color: #9fb5c8;
    font-family: var(--dynamic-mono);
    font-size: 0.59rem;
}

.overlay-panel-header {
    display: flex;
    padding: 20px 22px;
    border-bottom: 1px solid rgba(125, 211, 252, 0.14);
    justify-content: space-between;
    gap: 20px;
    align-items: center;
}

.overlay-panel-header h2 {
    margin: 4px 0 0;
    color: #edf7ff;
    font-size: 1.25rem;
}

.monitoring-signals {
    display: grid;
    padding: 22px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.monitoring-signal {
    display: flex;
    min-height: 72px;
    padding: 13px;
    border: 1px solid rgba(100, 116, 139, 0.2);
    border-radius: 7px;
    background: rgba(15, 23, 42, 0.54);
    justify-content: space-between;
    gap: 15px;
    align-items: center;
}

.monitoring-signal > div {
    display: flex;
    min-width: 0;
    gap: 9px;
    align-items: center;
}

.monitoring-signal i {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #fbbf24;
}

.monitoring-signal.is-ok i { background: #4ade80; box-shadow: 0 0 12px rgba(74, 222, 128, 0.55); }
.monitoring-signal.is-critical i { background: #fb7185; box-shadow: 0 0 12px rgba(251, 113, 133, 0.55); }
.monitoring-signal strong { overflow: hidden; color: #dbeafe; font-size: 0.78rem; text-overflow: ellipsis; white-space: nowrap; }
.monitoring-signal > span { color: #7890a6; font-family: var(--dynamic-mono); font-size: 0.65rem; }

.overlay-help {
    margin: 0;
    padding: 15px 22px;
    border-top: 1px solid rgba(125, 211, 252, 0.1);
    color: #657d91;
    font-size: 0.7rem;
}

.rack-details {
    padding: 24px;
}

.rack-resource-heading {
    display: flex;
    padding: 16px;
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: 7px;
    background: rgba(14, 116, 144, 0.08);
    justify-content: space-between;
    align-items: center;
}

.rack-resource-heading strong { color: #dff8ff; font-family: var(--dynamic-mono); }
.rack-resource-heading span { color: #4ade80; font-family: var(--dynamic-mono); font-size: 0.7rem; text-transform: uppercase; }
.rack-details dl { display: grid; margin: 18px 0 0; gap: 1px; }
.rack-details dl div { display: grid; padding: 12px; grid-template-columns: 150px 1fr; gap: 20px; background: rgba(15, 23, 42, 0.4); }
.rack-details dt { color: #60788e; font-size: 0.72rem; }
.rack-details dd { margin: 0; color: #b8cad9; font-family: var(--dynamic-mono); font-size: 0.72rem; }

.desktop-gate {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: grid;
    padding: 20px;
    background:
        radial-gradient(circle at 50% 20%, rgba(14, 116, 144, 0.19), transparent 42%),
        #020611;
    place-items: center;
}

.desktop-gate-card {
    display: grid;
    width: min(100%, 560px);
    padding: 38px;
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 14px;
    background: rgba(5, 15, 29, 0.96);
    text-align: center;
    justify-items: center;
    box-shadow: 0 35px 100px rgba(0, 0, 0, 0.5);
}

.desktop-gate-icon {
    display: grid;
    width: 68px;
    height: 68px;
    margin: 20px 0;
    border: 1px solid rgba(34, 211, 238, 0.35);
    border-radius: 12px;
    background: rgba(14, 116, 144, 0.12);
    color: #67e8f9;
    font-size: 1.7rem;
    place-items: center;
}

.desktop-gate-card h1 { margin: 0; color: #f0f9ff; font-size: clamp(1.7rem, 6vw, 2.5rem); }
.desktop-gate-card p { margin: 16px 0 8px; color: #91a6ba; line-height: 1.7; }
.desktop-gate-card strong { color: #86efac; font-size: 0.8rem; }
.desktop-gate-card a { margin-top: 24px; }

@media (max-height: 780px) and (min-width: 1024px) {
    .gameplay-stage { min-height: 620px; }
    .gameplay-workspace { min-height: 720px; }
}

@media (max-width: 1180px) and (min-width: 1024px) {
    .gameplay-map-name { display: none; }
    .gameplay-left-panel { width: 270px; }
    .gameplay-hud { width: 132px; }
    .game-map-label { left: 308px; }
}
