/* Shared editorial controls for the guided model. */
html:not([data-theme]) #step-card {
    --panel:#faf5e9; --ink:#353e39; --muted:#5d655b;
    --accent:#476b70; --line:#b9b9ab; --panel-2:#e8e8dc;
}
#step-card { background:var(--panel); color:var(--ink); border:0; border-radius:0; box-shadow:none; backdrop-filter:none; -webkit-backdrop-filter:none; }
#step-title { font:400 26px/1.15 Georgia,serif; }
#step-panel { max-width:calc(100vw - 32px); }
#hint { color:#c3cbc6; opacity:.75; width:max-content; max-width:calc(100% - 32px); text-align:center; font:11px/1.5 Georgia,serif; }
#hint a { color:inherit; text-underline-offset:3px; }
/* A compact field selector, a quiet disclosure, and directional navigation. */
#step-card { display:flex; flex-direction:column; padding:22px; }
#step-title { font-size:26px; letter-spacing:-.025em; margin-bottom:8px; }
#step-kid { font-size:12px; line-height:1.55; margin-bottom:12px; }
#step-card .field-buttons {
    order:2; gap:0 12px; border:0; padding:0; margin:8px 0 12px;
    grid-template-columns:repeat(2,minmax(0,1fr));
}
#step-card .field-buttons.visible { display:grid; }
#step-card .field-buttons button {
    position:relative; border:0; border-bottom:1px solid var(--line);
    border-radius:0; background:none; color:var(--muted); text-align:left;
    min-height:38px; padding:9px 8px; font:400 12px/1.35 system-ui,sans-serif;
}
#step-card .field-buttons button:hover { background:var(--panel-2); color:var(--ink); }
#step-card .field-buttons button.active {
    color:var(--ink); background:color-mix(in srgb,var(--accent) 11%,transparent);
    border-bottom:2px solid var(--accent); padding-bottom:8px; font-weight:600;
}
#step-card .field-buttons button.source-toggle-btn { margin-left:0; }
#step-card .field-buttons select {
    grid-column:1/-1; border-radius:0; background:var(--panel);
    min-height:40px; color:var(--ink); padding:8px; font-size:12px;
}
#step-card .field-buttons select option { color:var(--ink); background:var(--panel); }
#step-card .frames-controls.visible { display:flex; gap:10px; align-items:center; }
#step-card .frames-controls button { border:1px solid var(--line); text-align:center; padding:8px 12px; }
#step-card .frames-controls input { min-width:0; flex:1; }
#step-card #frames-day-label { color:var(--ink); }
#step-card > details { order:5; margin-top:4px; }
#step-card > details > summary {
    display:flex; justify-content:space-between; align-items:center; min-height:36px;
    font:400 12px/1.4 system-ui,sans-serif!important; color:var(--muted)!important;
    cursor:pointer;
}
#step-card > details > summary::after { content:"+"; color:var(--accent); font:400 20px/1 Georgia,serif; }
#step-card > details[open] > summary::after { content:"−"; }
#step-card > details > summary:hover { color:var(--ink)!important; }
#step-card #parts-legend { order:1; }
#step-card #river-detail, #step-card #argo-detail { order:3; }
#step-card #step-limitation { order:6; }
#step-card #step-nav {
    order:10; justify-content:space-between; align-items:center;
    border-top:1px solid var(--line); padding-top:10px; margin-top:12px;
}
#step-card #step-nav button {
    border:0; border-radius:0; padding:8px 0; min-height:36px;
    color:var(--ink); font:400 15px/1.3 Georgia,serif;
}
#step-card #step-nav button:hover { text-decoration:underline; text-underline-offset:5px; }
#step-card :is(button,select,summary):focus-visible {
    outline:2px solid var(--accent); outline-offset:3px;
}


@media(max-width:640px) {
    #step-panel #step-card { overflow-y:auto; max-height:48dvh; }
    #step-card .field-buttons button, #step-card #step-nav button { min-height:44px; }
}
#step-dots { gap:5px; margin-bottom:14px; }
#step-dots .step-dot {
    position:relative; width:14px; height:3px; border:0; border-radius:0;
    background:#718079; box-shadow:none; transform:none;
}
#step-dots .step-dot::before { content:""; position:absolute; inset:-8px -2px; }
#step-dots .step-dot.active { background:#f8f3e8; width:22px; }
#step-dots .step-dot.done { background:#a5bab5; }

#step-card #step-nav button:disabled { visibility:hidden; }
#viewport[data-step="parts"] #step-panel { top:28px; bottom:auto; width:246px; }
#viewport[data-step="parts"] #step-dots,
#viewport[data-step="parts"] #step-card > details { display:none; }
#viewport[data-step="parts"] #step-card { background:none; --ink:#f2ede2; --muted:#bac4be; --line:#738179; padding:0; }
#viewport[data-step="parts"] #step-card::before { display:none; }
#viewport[data-step="parts"] #step-title { font-size:27px; }
#viewport[data-step="parts"] #parts-legend { display:flex; flex-direction:column; gap:22px; margin:16px 0 0; }
.component-links { display:flex; flex-direction:column; width:100%; }
.component-links a { padding:12px 0; border-bottom:1px solid #738179; text-decoration:none; color:#f2ede2; font:400 19px/1.25 Georgia,serif; }
.component-links a:hover { padding-left:6px; background:none; }
.component-links a:focus-visible { outline:1px solid currentColor; outline-offset:4px; }
@media(max-width:640px) {
    #step-panel { left:16px; bottom:30px; }
    #viewport[data-step="parts"] #step-panel { top:auto; bottom:30px; width:calc(100% - 32px); }
    #viewport[data-step="parts"] #step-title { font-size:24px; }
    #viewport[data-step="parts"] .component-links { display:grid; grid-template-columns:1fr 1fr; gap:0 12px; }
    #viewport[data-step="parts"] .component-links a { font-size:16px; min-height:44px; }
}
#viewport ~ .language-switch { background:none; color:#f2ede2; }

.gesture-touch { display:none; }
@media(pointer:coarse) {
    .gesture-mouse { display:none; }
    .gesture-touch { display:inline; }
}
#viewport[data-step="empty"] #step-card > details { display:none; }


#argo-evaluation { order:1; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 16px; margin:8px 0 16px; padding:4px 0 14px; border-bottom:1px solid var(--line); }
#argo-evaluation[hidden] { display:none; }
#argo-evaluation p { margin:0; }
#argo-evaluation .evaluation-value { font:400 38px/1.05 Georgia,serif; letter-spacing:-.04em; color:var(--ink); }
.evaluation-value span { font-size:.65em; margin-left:2px; }
#argo-evaluation .evaluation-label { font:400 14px/1.4 Georgia,serif; margin:4px 0 8px; min-height:40px; }
#argo-evaluation .evaluation-comparison { font:400 12px/1.5 system-ui,sans-serif; font-variant-numeric:tabular-nums; }
.evaluation-comparison span { display:block; color:var(--muted); }
#argo-evaluation .evaluation-context { grid-column:1/-1; font:400 10px/1.5 system-ui,sans-serif; color:var(--muted); margin-top:5px; }
#argo-evaluation .evaluation-source { font:400 10px/1.5 system-ui,sans-serif; color:var(--muted); margin-top:5px; }

#step-card #frames-controls-wrap.visible {
    display:grid; grid-template-columns:48px minmax(60px,1fr) 88px;
    gap:12px; align-items:center; margin:10px 0 12px;
}
#step-card #frames-play-btn {
    display:inline-flex; align-items:center; justify-content:center; gap:7px;
    min-height:38px; padding:0; border:0; color:var(--ink);
    font:400 13px/1.2 Georgia,serif; background:none;
}
#frames-play-btn::before {
    content:""; display:block; width:8px; height:10px; background:currentColor;
    clip-path:polygon(0 0,100% 50%,0 100%);
}
#frames-play-btn[data-playing="true"]::before {
    clip-path:none; background:none; border-left:2px solid currentColor; border-right:2px solid currentColor;
}
#step-card :is(#frames-day-slider, #argo-time) {
    appearance:none; -webkit-appearance:none; width:100%; min-width:0;
    height:32px; padding:0; margin:0; border:0; background:transparent; cursor:grab;
}
:is(#frames-day-slider, #argo-time):active { cursor:grabbing; }
:is(#frames-day-slider, #argo-time)::-webkit-slider-runnable-track {
    height:2px; border:0; border-radius:0;
    background:linear-gradient(to right,var(--accent) 0 var(--frame-progress,0%),var(--line) var(--frame-progress,0%) 100%);
}
:is(#frames-day-slider, #argo-time)::-webkit-slider-thumb {
    appearance:none; -webkit-appearance:none; width:12px; height:12px;
    margin-top:-5px; border:1.5px solid var(--accent); border-radius:50%;
    background:var(--panel); box-shadow:0 0 0 3px var(--panel);
}
:is(#frames-day-slider, #argo-time)::-moz-range-track { height:2px; background:var(--line); border:0; border-radius:0; }
:is(#frames-day-slider, #argo-time)::-moz-range-progress { height:2px; background:var(--accent); }
:is(#frames-day-slider, #argo-time)::-moz-range-thumb {
    width:10px; height:10px; border:1.5px solid var(--accent); border-radius:50%;
    background:var(--panel); box-shadow:0 0 0 3px var(--panel);
}
:is(#frames-day-slider, #argo-time):focus-visible { outline:1px solid var(--accent); outline-offset:2px; }
#step-card #frames-day-label {
    min-width:0; color:var(--muted); font:400 11px/1.2 Georgia,serif;
    text-align:right; font-variant-numeric:tabular-nums;
}
@media(pointer:coarse) {
    #step-card :is(#frames-day-slider, #argo-time), #step-card #frames-play-btn { min-height:44px; }
}

html[lang="mi"] #step-card #frames-controls-wrap.visible { grid-template-columns:80px minmax(50px,1fr) 110px; }
#step-card #frames-play-btn { justify-content:flex-start; }

.model-home {
    position:fixed; z-index:6; top:22px; left:24px; display:inline-flex;
    align-items:center; gap:8px; color:#f2ede2; text-decoration:none; font:400 13px/1.4 Georgia,serif;
}
.model-home:hover { text-decoration:underline; text-underline-offset:4px; }
.model-home:focus-visible { outline:1px solid currentColor; outline-offset:5px; }
#entrance ~ .model-home { visibility:hidden; }
@media(min-width:641px) { #viewport[data-step="parts"] #step-panel { top:68px; } }
@media(max-width:640px) { .model-home { top:16px; left:16px; } }

/* The column-integrated stratification field gets its own final row. */
#frames-field-buttons > button:last-child:nth-child(odd) { grid-column:1 / -1; }
#budget-link { order:4; display:block; margin:4px 0 8px; color:var(--ink); font:15px/1.4 Georgia,serif; text-underline-offset:4px; }
#budget-link[hidden] { display:none; }
#budget-stage { display:flex; flex-direction:column; padding-top:52px; box-sizing:border-box; position:fixed; inset:0; z-index:10001; background:#f7f4e9; color:#293b3a; }
#budget-stage[hidden] { display:none; }
.budget-flow { order:2; flex-shrink:0; height:52px; display:flex; align-items:center; justify-content:space-between; padding:0 22px; border-top:1px solid #cbd0c4; }
.budget-flow button { display:flex; align-items:center; gap:8px; border:0; padding:8px 0; background:none; color:inherit; font:15px Georgia,serif; cursor:pointer; }
.budget-flow button:hover span { text-decoration:underline; text-underline-offset:4px; }
.budget-flow svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.2; }
#budget-frame { display:block; flex:1; min-height:0; width:100%; height:calc(100% - 104px); border:0; background:#f7f4e9; }
.budget-active #viewport { visibility:hidden; }
.budget-active .model-home { z-index:10002; color:#293b3a; }
.budget-active #viewport ~ .language-switch { z-index:10002; top:8px; color:#293b3a; }
@media(max-width:500px) { .budget-flow { padding-inline:12px; } .budget-flow button { font-size:12px; gap:4px; } .budget-active > .language-switch { gap:7px; font-size:12px; } }
#argo-drift-controls { order:2; display:grid; grid-template-columns:55px minmax(60px,1fr) 100px; align-items:center; gap:10px; margin:6px 0 14px; }
#argo-drift-controls[hidden] { display:none; }
#argo-play { border:0; padding:8px 0; background:none; color:var(--ink); font:14px Georgia,serif; cursor:pointer; }
#argo-time { width:100%; min-width:0; accent-color:var(--accent); }
#argo-date { text-align:right; white-space:nowrap; font:11px Georgia,serif; font-variant-numeric:tabular-nums; }
#step-card #tide-constituent-select {
 appearance:none; border:0; border-bottom:1px solid var(--line); border-radius:0;
 background:transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='10' viewBox='0 0 14 10'%3E%3Cpath d='m2 2 5 5 5-5' fill='none' stroke='%235d655b' stroke-width='1.1'/%3E%3C/svg%3E") right 8px center/14px 10px no-repeat;
 padding:10px 30px 10px 0; color:var(--ink); font:18px/1.4 Georgia,serif;
}
