.page-collective-synchronization-transition-field {
    --dim: #6b8b85;
}

.page-collective-synchronization-transition-field .lab-hero {
    margin-bottom: clamp(1rem, 2vw, 1.6rem);
}

.page-collective-synchronization-transition-field .site-header {
    background: rgba(5, 7, 8, 0.96);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.34);
}

.page-collective-synchronization-transition-field .lab-hero h1 {
    max-width: 24ch;
    font-size: clamp(2.1rem, 4.2vw, 3.55rem);
    line-height: 1;
}

.page-collective-synchronization-transition-field .lab-status-panel span {
    max-width: 22ch;
    overflow-wrap: anywhere;
}

.collective-app,
.collective-app * {
    box-sizing: border-box;
}

.collective-app {
    display: grid;
    gap: clamp(1rem, 2vw, 1.6rem);
    width: min(var(--max), calc(100% - 32px));
    max-width: 1180px;
    min-width: 0;
    margin-inline: auto;
    overflow-x: clip;
}

.collective-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.85fr);
    gap: clamp(1rem, 2vw, 1.5rem);
    align-items: start;
    min-width: 0;
}

.collective-stage,
.collective-controls {
    min-width: 0;
    padding: clamp(0.85rem, 2vw, 1.25rem);
}

.collective-stage {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 18%, rgba(120, 246, 231, 0.08), transparent 32%),
        radial-gradient(circle at 84% 76%, rgba(255, 217, 138, 0.07), transparent 34%);
}

.collective-stage__head,
.collective-controls .control-heading,
.collective-control-group .section-heading,
.collective-transition-log .section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.collective-stage__head h2,
.collective-controls .control-heading h2,
.collective-notes h2 {
    margin: 0.2rem 0 0;
    color: var(--text);
    line-height: 1.18;
}

.collective-stage__head h2 {
    font-size: clamp(1.25rem, 2.4vw, 1.8rem);
}

.collective-stage__head p:not(.eyebrow) {
    max-width: 68ch;
    margin: 0.55rem 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.collective-state {
    flex: 0 0 auto;
    min-width: 10rem;
    padding: 0.52rem 0.68rem;
    border: 1px solid var(--line-strong);
    color: var(--cyan);
    background: rgba(120, 246, 231, 0.055);
    font-size: 0.74rem;
    letter-spacing: 0.1em;
    text-align: center;
    overflow-wrap: anywhere;
}

.collective-state[data-state="synchronized"],
.collective-state[data-state="clustered"] {
    border-color: rgba(168, 255, 191, 0.62);
    color: var(--green);
    box-shadow: 0 0 24px rgba(168, 255, 191, 0.14);
}

.collective-state[data-state="partial-synchrony"] {
    border-color: rgba(255, 217, 138, 0.62);
    color: var(--amber);
}

.collective-state[data-state="async"] {
    border-color: rgba(255, 141, 154, 0.54);
    color: var(--dangerless-red);
}

.collective-state[data-state="model-error"] {
    border-color: rgba(255, 141, 154, 0.72);
    color: var(--dangerless-red);
    background: rgba(255, 141, 154, 0.08);
}

.collective-canvas-frame {
    width: 100%;
    height: clamp(360px, 42vw, 520px);
    margin-top: 1rem;
    overflow: hidden;
    border: 1px solid rgba(120, 246, 231, 0.24);
    background: #030708;
}

#collectiveCanvas {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    outline: none;
    background: #030708;
    touch-action: manipulation;
}

#collectiveCanvas:focus-visible {
    box-shadow: inset 0 0 0 2px var(--cyan), 0 0 0 2px rgba(120, 246, 231, 0.26);
}

.collective-canvas-help,
.collective-control-help {
    color: var(--dim);
    line-height: 1.5;
}

.collective-canvas-help {
    margin: 0.62rem 0 0;
    font-size: 0.76rem;
}

.collective-live {
    min-height: 2.5rem;
    margin: 0.75rem 0 0;
    padding: 0.62rem 0.75rem;
    border-left: 2px solid var(--cyan);
    color: var(--muted);
    background: rgba(120, 246, 231, 0.045);
    font-size: 0.78rem;
    line-height: 1.45;
}

.collective-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.58rem;
    margin: 0.85rem 0 0;
}

.collective-metrics div {
    min-width: 0;
    padding: 0.7rem;
    border: 1px solid var(--line);
    background: rgba(3, 8, 9, 0.58);
}

.collective-metrics dt {
    color: var(--dim);
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    line-height: 1.35;
    text-transform: uppercase;
}

.collective-metrics dd {
    margin: 0.32rem 0 0;
    color: var(--text);
    font: 700 clamp(0.8rem, 1.65vw, 1rem)/1.25 ui-monospace, SFMono-Regular, Consolas, monospace;
    overflow-wrap: anywhere;
}

.collective-controls {
    position: sticky;
    top: 82px;
    display: grid;
    gap: 1rem;
    max-height: calc(100vh - 94px);
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
}

.collective-controls .control-heading h2 {
    font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.collective-controls h3 {
    margin: 0;
    color: var(--text);
    font-size: 0.78rem;
    letter-spacing: 0.09em;
}

.collective-control-group,
.collective-range-stack,
.collective-shortcut-note,
.collective-transition-log {
    min-width: 0;
    padding: 0.85rem;
    border: 1px solid var(--line);
    background: rgba(3, 8, 9, 0.45);
}

.collective-control-group {
    display: grid;
    gap: 0.65rem;
}

.collective-controls .section-heading span,
.collective-control-readout,
#collectiveRunReadout,
#collectiveTransportReadout,
#collectivePresetReadout,
#collectiveTransitionClock {
    color: var(--green);
    font: 700 0.72rem/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
    letter-spacing: 0.08em;
    text-align: right;
}

#collectiveRunReadout,
#collectiveTransportReadout,
#collectivePresetReadout,
#collectiveTransitionClock {
    min-width: 0;
    overflow-wrap: anywhere;
}

#collectiveRunReadout {
    min-width: 4.5rem;
    overflow-wrap: normal;
    white-space: nowrap;
}

.collective-preset-grid,
.collective-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.collective-app button {
    min-width: 0;
    min-height: 44px;
    padding: 0.58rem 0.7rem;
    border: 1px solid var(--line-strong);
    border-radius: 0;
    color: var(--text);
    background: rgba(120, 246, 231, 0.055);
    font: inherit;
    line-height: 1.25;
    cursor: pointer;
    overflow-wrap: anywhere;
    touch-action: manipulation;
}

.collective-app button:hover,
.collective-app button:focus-visible {
    border-color: var(--cyan);
    outline: none;
    box-shadow: 0 0 0 2px rgba(120, 246, 231, 0.18);
}

.collective-app button:disabled,
.collective-app input:disabled,
.collective-app select:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.collective-app button.is-active,
.collective-app button[aria-pressed="true"] {
    border-color: rgba(120, 246, 231, 0.72);
    color: var(--cyan);
    background: rgba(120, 246, 231, 0.12);
}

.collective-app .primary-control {
    border-color: rgba(120, 246, 231, 0.58);
    color: var(--cyan);
    background: rgba(120, 246, 231, 0.1);
}

.collective-range-stack {
    display: grid;
    gap: 0.78rem;
}

.collective-range-stack label {
    display: grid;
    gap: 0.42rem;
    color: var(--muted);
    font-size: 0.78rem;
}

.collective-range-stack label > span {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    overflow-wrap: anywhere;
}

.collective-range-stack output {
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    white-space: nowrap;
}

.collective-range-stack input[type="range"] {
    width: 100%;
    min-height: 44px;
    accent-color: var(--cyan);
}

.collective-range-stack input[type="range"]:focus-visible,
.collective-range-stack select:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
}

.collective-range-stack select {
    width: 100%;
    min-height: 44px;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--line-strong);
    border-radius: 0;
    color: var(--text);
    background: rgba(2, 6, 7, 0.9);
    font: inherit;
}

.collective-control-help {
    margin: 0;
    font-size: 0.74rem;
}

.collective-shortcut-note p {
    margin: 0.62rem 0 0;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.6;
}

.collective-shortcut-note kbd {
    display: inline-block;
    padding: 0.08rem 0.32rem;
    border: 1px solid var(--line-strong);
    color: var(--cyan);
    background: rgba(120, 246, 231, 0.06);
    font: inherit;
}

.collective-transition-log ol {
    display: grid;
    gap: 0.45rem;
    max-height: 10rem;
    margin: 0.7rem 0 0;
    padding: 0;
    overflow: auto;
    list-style: none;
}

.collective-transition-log li {
    padding-left: 0.65rem;
    border-left: 2px solid rgba(120, 246, 231, 0.28);
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.collective-transition-log li:first-child {
    border-left-color: var(--cyan);
    color: var(--text);
}

.collective-notes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(0.8rem, 1.8vw, 1.2rem);
}

.collective-notes article,
.collective-lower-grid > * {
    min-width: 0;
    padding: clamp(0.9rem, 2vw, 1.2rem);
}

.collective-notes h2 {
    font-size: clamp(1rem, 1.8vw, 1.24rem);
}

.collective-notes p,
.collective-notes li {
    color: var(--muted);
    line-height: 1.62;
}

.collective-notes ul {
    margin: 0.65rem 0 0;
    padding-left: 1.15rem;
}

.collective-notes strong {
    color: var(--text);
}

.collective-notes code {
    color: var(--green);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    overflow-wrap: anywhere;
}

.collective-lower-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
    gap: clamp(0.8rem, 1.8vw, 1.2rem);
    width: min(var(--max), calc(100% - 32px));
    max-width: 1180px;
    min-width: 0;
    margin: clamp(1rem, 2vw, 1.6rem) auto 0;
}

.page-collective-synchronization-transition-field .related-lab-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

    .collective-controls {
        position: static;
        max-height: none;
        overflow-y: visible;
        overscroll-behavior-y: auto;
        scrollbar-gutter: auto;
    }

    .collective-notes {
        grid-template-columns: 1fr 1fr;
    }

    .collective-notes .formula-card {
        grid-column: 1 / -1;
    }
}

@media (max-width: 620px) {
    .collective-app {
        width: min(100% - 22px, 1180px);
    }

    .collective-lower-grid {
        width: min(100% - 22px, 1180px);
    }

    .page-collective-synchronization-transition-field .lab-hero {
        gap: 0.7rem;
        padding: 0.85rem 0 0.7rem;
    }

    .page-collective-synchronization-transition-field .lab-hero h1 {
        font-size: clamp(1.6rem, 8.8vw, 2.3rem);
        overflow-wrap: anywhere;
    }

    .collective-stage,
    .collective-controls {
        padding: 0.78rem;
    }

    .collective-stage__head,
    .collective-controls .control-heading {
        display: grid;
    }

    .collective-state {
        width: 100%;
        min-width: 0;
        text-align: left;
    }

    .collective-canvas-frame {
        height: clamp(390px, 70vw, 460px);
        margin-top: 0.75rem;
    }

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

    .collective-notes,
    .collective-lower-grid {
        grid-template-columns: 1fr;
    }

    .collective-notes .formula-card {
        grid-column: auto;
    }

    .page-collective-synchronization-transition-field .related-lab-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 420px) {
    .collective-canvas-frame {
        height: 390px;
    }

    .collective-preset-grid,
    .collective-action-grid {
        grid-template-columns: 1fr;
    }

    .collective-metrics {
        gap: 0.45rem;
    }

    .collective-metrics div {
        padding: 0.58rem;
    }

    .collective-range-stack label > span {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.2rem;
    }

    .collective-range-stack output {
        white-space: normal;
    }
}

@media (prefers-reduced-motion: reduce) {
    .collective-app,
    .collective-app * {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
    }
}
