/* ── Fuel Cell Butler-Volmer model (fuel-cell-butler-volmer.html) ── */

.fcbv-controls {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin: 15px 0;
    align-items: start;
}

.fcbv-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 15px;
    margin: 20px 0;
    align-items: start;
}

.fcbv-main {
    min-width: 0;
}

.fcbv-side {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ── View toggle row (sits above the graph, ~40px tall) ── */
.fcbv-view-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.fcbv-view-toggle {
    display: flex;
    gap: 6px;
}

.fcbv-view-btn {
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 700;
    border: 2px solid currentColor;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.fcbv-view-btn[aria-pressed="true"] {
    outline: 3px solid currentColor;
    outline-offset: 2px;
}

.fcbv-view-btn[aria-pressed="true"]::before {
    content: "\2713\00a0";
}

.fcbv-axis-note {
    font-size: 12px;
    opacity: 0.85;
}

.fcbv-axis-note[hidden] {
    display: none;
}

/* ── Simple view: voltage waterfall ── */
.fcbv-simple {
    display: block;
    width: 100%;
    min-height: 514px;
}

.fcbv-simple[hidden] {
    display: none;
}

.fcbv-simple-caption {
    margin: 0 0 14px 0;
    font-size: 15px;
    line-height: 1.5;
}

.fcbv-waterfall {
    display: flex;
    align-items: stretch;
    gap: 14px;
    height: 430px;
}

.fcbv-wf-scale {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 12px;
    text-align: right;
    flex: 0 0 auto;
}

.fcbv-wf-bar {
    display: flex;
    flex-direction: column;
    width: 90px;
    flex: 0 0 90px;
    border: 2px solid currentColor;
    border-radius: 8px;
    overflow: hidden;
}

.fcbv-wf-seg {
    width: 100%;
    transition: height 0.3s ease;
}

.fcbv-wf-key {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
}

.fcbv-wf-keyrow {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.fcbv-wf-swatch {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border: 2px solid currentColor;
    border-radius: 4px;
}

.fcbv-wf-keytext {
    font-size: 14px;
    line-height: 1.4;
}

.fcbv-wf-keytext strong {
    font-size: 17px;
}

/* ── Kinetics view: Plotly graph ── */
.fcbv-plot {
    display: block;
    width: 100%;
    min-height: 514px;
}

.fcbv-plot[hidden] {
    display: none;
}

/* ── Catalyst selector buttons: colours come from .model-reset-btn, the
   chosen one is marked by a tick and an outline so it stays obvious in
   high contrast ── */
.fcbv-mat-row {
    display: flex;
    gap: 6px;
}

.fcbv-mat-btn {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    line-height: 1.3;
}

.fcbv-mat-btn[aria-pressed="true"] {
    outline: 3px solid currentColor;
    outline-offset: 2px;
    font-weight: 800;
}

.fcbv-mat-btn[aria-pressed="true"]::before {
    content: "\2713\00a0";
}

.fcbv-mat-i0 {
    display: block;
    font-size: 10px;
    font-weight: 400;
    margin-top: 2px;
}

.fcbv-mat-tag {
    display: block;
    font-size: 11px;
    font-weight: 700;
    margin-top: 3px;
}

.fcbv-slider-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.fcbv-slider-row input[type="range"] {
    flex: 1 1 auto;
    min-width: 0;
}

.fcbv-slider-row span {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 12px;
}

.fcbv-state {
    margin: 0 0 10px 0;
    font-weight: 700;
}

/* ── Glossary pop-ups (native details/summary, no JavaScript) ── */
.fcbv-info {
    display: inline-block;
    position: relative;
    margin-left: 5px;
    vertical-align: middle;
}

.fcbv-info-btn {
    display: inline-block;
    width: 18px;
    height: 18px;
    line-height: 16px;
    text-align: center;
    font-size: 12px;
    font-style: italic;
    font-weight: 700;
    border: 2px solid currentColor;
    border-radius: 50%;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.fcbv-info-btn::-webkit-details-marker {
    display: none;
}

.fcbv-info-body {
    display: block;
    position: absolute;
    z-index: 30;
    top: 24px;
    left: 0;
    width: 260px;
    max-width: 78vw;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.45;
    text-align: left;
    border: 2px solid currentColor;
    border-radius: 8px;
    background: var(--model-bg, #fff);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.fcbv-info[open] .fcbv-info-btn {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Visually hidden, still read aloud */
.fcbv-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

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

@media (max-width: 760px) {
    .fcbv-plot,
    .fcbv-simple { min-height: 300px; }
    .fcbv-waterfall { height: 290px; gap: 10px; }
    .fcbv-wf-bar { width: 62px; flex: 0 0 62px; }
    .fcbv-wf-keytext { font-size: 13px; }
    .fcbv-wf-keytext strong { font-size: 15px; }
    .fcbv-simple-caption { font-size: 14px; }
    .fcbv-info-body { width: 240px; }
}

@media (prefers-reduced-motion: reduce) {
    .fcbv-wf-seg { transition: none; }
}
