/* Part 11 — walk, dropper-versus-switcher figure, and the power chart 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;
}

.ws-panel {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #fff;
    border: 1px solid var(--ai-gray-200);
    border-radius: var(--ai-radius-lg);
    box-shadow: var(--ai-shadow-sm);
    padding: 8px 10px 8px;
}

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

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

.ws-panel .im-preset-btn {
    padding: 3px 8px;
    font-size: 0.72rem;
}

.ws-bias {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px 10px;
    align-items: center;
    margin: 0;
    padding: 6px 8px;
    background: #f8fafc;
    border: 1px solid var(--ai-gray-200);
    border-radius: 10px;
    flex-shrink: 0;
}

.ws-bias label {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 3.4rem;
    grid-template-rows: auto auto;
    column-gap: 6px;
    row-gap: 1px;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--ai-gray-600);
    min-width: 0;
}

.ws-knob-name { grid-column: 1 / -1; }
.ws-bias input[type="range"] { grid-column: 1; grid-row: 2; width: 100%; min-width: 0; }
.ws-bias input[type="number"] {
    grid-column: 2;
    grid-row: 2;
    width: 3.4rem;
    box-sizing: border-box;
    padding: 2px 4px;
    font-size: 0.76rem;
    font-family: var(--ai-font-mono, ui-monospace, monospace);
    border: 1px solid var(--ai-gray-200);
    border-radius: var(--ai-radius-sm);
}

.ws-bias label.accent-blue input[type="range"] { accent-color: #2563eb; }
.ws-bias label.accent-emerald input[type="range"] { accent-color: #059669; }
.ws-bias label.accent-violet input[type="range"] { accent-color: #7c3aed; }
.ws-bias label.accent-amber input[type="range"] { accent-color: #d97706; }

.ws-status-row {
    display: flex;
    align-items: center;
    margin: 0;
    min-height: 1.15em;
    flex-shrink: 0;
}

.ws-status-note {
    font-size: 0.75rem;
    color: var(--ai-gray-600);
    line-height: 1.3;
}

.ws-views {
    flex: 1 1 auto;
    min-height: 180px;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(420px, 1.35fr) minmax(280px, 1fr);
    gap: 8px;
}

.ws-fig,
.ws-side,
.ws-chart {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.ws-chart { flex: 1 1 auto; }

.ws-views .im-chart-label {
    margin: 0 0 2px;
    font-size: 0.68rem;
    line-height: 1.25;
    flex-shrink: 0;
}

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

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

.ws-map {
    width: 100%;
    border-collapse: collapse;
    margin-top: 4px;
    flex-shrink: 0;
    font-size: 0.68rem;
    line-height: 1.25;
}

.ws-map th,
.ws-map td {
    text-align: left;
    padding: 1px 6px 1px 0;
    border-bottom: 1px solid var(--ai-gray-200);
    white-space: nowrap;
}

.ws-map th {
    color: var(--ai-gray-600);
    font-weight: 700;
    font-size: 0.62rem;
    letter-spacing: 0.02em;
}

.ws-map a { color: var(--ai-blue-800); }

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

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

.ws-eq {
    flex-shrink: 0;
    margin: 0;
    padding: 2px 8px;
    display: grid;
    grid-template-columns: 1.1fr 1.3fr 1.1fr;
    gap: 0 12px;
    overflow: hidden;
}

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

@media (max-height: 820px) and (min-width: 1101px) {
    body.cl-page .ai-header { padding: 4px 14px; }
    body.cl-page .control-loops-series-nav--top { padding: 0 12px; }
    body.cl-page .control-loops-series-nav--top .series-nav-inner { padding: 2px 8px; }
    body.cl-page .control-loops-series-nav--top .series-nav-btn {
        min-height: 0;
        padding: 2px 8px;
    }
    body.cl-page .cl-workspace { padding: 4px 10px 4px; gap: 8px 12px; }
    body.cl-page .ai-site-footer { padding: 1px 10px 2px; }
    .ws-panel { gap: 3px; padding: 4px 8px; }
    .ws-panel .im-panel-sub { display: none; }
    .ws-bias { padding: 3px 6px; }
    .ws-panel .im-readout { padding: 2px 4px; }
    .ws-eq { padding: 0 6px; }
    .ws-map th, .ws-map td { padding-top: 0; padding-bottom: 0; }
}

@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; }
    .ws-bias,
    .ws-eq { grid-template-columns: 1fr; }
    .ws-views {
        display: flex;
        flex-direction: column;
        flex: none;
        height: auto;
        min-height: 0;
    }
    .ws-fig,
    .ws-side,
    .ws-chart {
        flex: none;
        height: auto;
        min-height: 0;
    }
    .ws-panel .im-readouts { grid-template-columns: 1fr 1fr; }
    .ws-fig .im-canvas-wrap,
    .ws-chart .im-canvas-wrap {
        flex: none;
        height: 240px;
    }
    .ws-fig .im-canvas-wrap {
        height: 280px;
        overflow-x: auto;
    }
    .ws-fig .im-canvas-wrap canvas {
        min-width: 760px;
        width: 760px;
        height: 280px;
    }
}
