/* Part 5d — walk, device, and the two charts on one screen. */

body.cl-page {
    height: 100dvh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.cl-page .ai-header,
body.cl-page .mt-series-mount,
body.cl-page .ai-site-footer { flex-shrink: 0; }

body.cl-page .ai-site-footer {
    margin-top: 0;
    padding: 4px 12px 6px;
}

body.cl-page .control-loops-series-nav--bottom { display: none; }

body.cl-page .cl-workspace {
    flex: 1 1 auto;
    min-height: 0;
    max-width: none;
    overflow: hidden;
    align-items: stretch;
}

body.cl-page .cl-walk { max-height: 100%; }

body.cl-page .cl-lab {
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: auto;
    display: flex;
    flex-direction: column;
}

.sw-panel {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sw-panel .im-panel-head {
    margin-bottom: 0;
    gap: 6px 10px;
    align-items: center;
    flex-shrink: 0;
}

.sw-panel .im-panel-head h2 { font-size: 0.98rem; margin: 0; }
.sw-panel .im-panel-sub { font-size: 0.74rem; }

.sw-head-tools .im-preset-btn {
    padding: 3px 8px;
    font-size: 0.72rem;
}

.sw-regime {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    width: 13rem;
    flex: 0 0 13rem;
}

.sw-regime-pill {
    display: block;
    box-sizing: border-box;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-align: center;
    padding: 5px 8px;
    border-radius: 999px;
    border: 1px solid transparent;
}

.sw-regime-pill.is-delay { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.sw-regime-pill.is-irise { background: #fff7ed; color: #c2410c; border-color: #fdba74; }
.sw-regime-pill.is-miller { background: #fef3c7; color: #b45309; border-color: #fcd34d; }
.sw-regime-pill.is-finish { background: #ecfdf5; color: #047857; border-color: #6ee7b7; }

.sw-regime-note {
    font-size: 0.72rem;
    color: var(--ai-gray-600);
    line-height: 1.3;
}

.sw-bias-bar {
    display: grid;
    grid-template-columns: 13rem minmax(0, 1fr);
    gap: 8px 12px;
    align-items: start;
    margin: 0;
    padding: 6px 8px;
    background: #fff;
    border: 1px solid var(--ai-gray-200);
    border-radius: 10px;
    flex-shrink: 0;
}

.sw-bias-bar .im-controls {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px 8px;
    margin: 0;
}

.sw-bias-bar .im-controls label { font-size: 0.72rem; gap: 1px; }
.sw-bias-bar .im-controls input[type="number"] { padding: 2px 4px; font-size: 0.76rem; }

.sw-scrub {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 4px 8px;
    background: #fff;
    border: 1px solid var(--ai-gray-200);
    border-radius: 8px;
    font-size: 0.75rem;
    color: var(--ai-gray-600);
    flex-shrink: 0;
}

.sw-scrub input[type="range"] { flex: 1; }
.sw-scrub strong { color: var(--ai-gray-800); }
.sw-scrub span { min-width: 4.5rem; text-align: right; font-variant-numeric: tabular-nums; }

.sw-views {
    flex: 1 1 auto;
    min-height: 300px;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(300px, 460px) minmax(0, 1fr);
    gap: 8px;
}

.sw-fig,
.sw-side > div {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.sw-side {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(188px, 1.4fr) minmax(124px, 0.72fr);
    gap: 6px;
}

.sw-views .im-chart-label {
    margin: 0 0 2px;
    font-size: 0.72rem;
    flex-shrink: 0;
}

.sw-views .im-canvas-wrap {
    flex: 1 1 auto;
    min-height: 0;
    max-width: none;
    margin: 0;
}

.sw-views .im-canvas-wrap canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.sw-sym-wrap { position: relative; }

.sw-rgate-field {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.68rem;
    font-weight: 700;
    color: #6d28d9;
    transform: translate(-50%, -100%);
    white-space: nowrap;
    z-index: 2;
}

.sw-rgate-field input {
    width: 2.8rem;
    padding: 1px 4px;
    font-size: 0.72rem;
    border: 1px solid #c4b5fd;
    border-radius: 4px;
    color: #4c1d95;
}

.sw-panel .im-readouts {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 6px;
    margin: 0;
    flex-shrink: 0;
}

.sw-panel .im-readout { padding: 4px 6px; }
.sw-panel .im-readout-label { font-size: 0.62rem; }
.sw-panel .im-readout-value { font-size: 0.78rem; }

.sw-eq {
    flex-shrink: 0;
    margin: 0;
    padding: 2px 8px;
}

.sw-eq .im-eq-row { margin: 0; }
.sw-eq .im-eq-math { font-size: 0.82rem; }
.sw-eq .im-eq-val { font-size: 0.82rem; }

@media (max-width: 1100px) {
    body.cl-page {
        height: auto;
        max-height: none;
        display: block;
        overflow: auto;
    }
    body.cl-page .cl-workspace { overflow: visible; height: auto; }
    .sw-bias-bar,
    .sw-views { grid-template-columns: 1fr; }
    .sw-bias-bar .im-controls { grid-template-columns: 1fr 1fr; }
    .sw-panel .im-readouts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .sw-sym-wrap { height: 280px; }
    .sw-side { grid-template-rows: 220px 200px; }
    .sw-views canvas { height: 100%; }
}
