/* ===================== Scene-first layout: the Coast planner =====================
   Loaded straight after world.css. Everything is scoped to the scene-first stage (.w-stage.sf), so the classic layout,
   its full-screen view and the reading version are unchanged. planner.js adds two pieces of chrome in this layout only:
   - #pl-sfbar: the time controls (play, year, slider with storm ticks and year jumps, sea level, storms) in the
     dock's place at the bottom of the scene. It takes the dock's height (--sf-dockh), so the caption, map, toasts and
     the phone sheet all keep above it.
   - .pl-chips: the headline outcomes for the year on the slider, as glass chips at the top of the scene (in the HUD
     stack, above the map key). Each opens the matching Outcomes tab in the guide.
   The plan itself (presets, units, outcomes, compare, challenges) stays in the guide, split by the section tabs.
   Ids in the selectors keep these rules ahead of the later scene-first sheets' "no dock" rules. */

/* ---------- the time bar takes the dock's place ---------- */
.pl-sfbar{display:none}
#world .w-stage.sf:has(> #pl-sfbar){--sf-dockh:66px}
#world .w-stage.sf #pl-sfbar{display:block;position:absolute;left:14px;right:14px;bottom:14px;z-index:30;min-height:var(--sf-dockh);padding:8px 14px 8px 8px;border:1px solid var(--sf-line);border-radius:16px;background:var(--sf-glass);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);color:var(--sf-ink);container-type:inline-size;container-name:plbar}
#world .w-stage.sf.sf-dock #pl-sfbar{right:calc(var(--sf-colw,min(440px,40%)) + 14px)}
.w-stage.sf .pl-sft{display:flex;align-items:center;gap:14px;margin:0;padding:0;border:0;background:none;min-height:48px}
.w-stage.sf .pl-sfplay{flex:none;width:48px;height:48px;border-radius:50%;border:0;padding:0;display:grid;place-items:center;background:var(--sf-amber);color:#1d1407;cursor:pointer}
.w-stage.sf .pl-sfplay:hover{background:var(--sf-amber2)}
.w-stage.sf .pl-sfplay .pa,.w-stage.sf .pl-sfplay[data-on=true] .pl{display:none}.w-stage.sf .pl-sfplay[data-on=true] .pa{display:block}
.w-stage.sf .pl-sfyear{flex:none;display:grid;line-height:1.1;min-width:84px}
.w-stage.sf .pl-sfyear b{font-family:Georgia,serif;font-weight:400;font-size:27px;color:var(--sf-ink);font-variant-numeric:tabular-nums}
.w-stage.sf .pl-sfyear span{font-size:11.5px;color:var(--sf-muted);white-space:nowrap}
/* the slider, storm ticks above it, year jumps below it at their place on the track */
.w-stage.sf .pl-sftrack{position:relative;flex:1;min-width:120px;padding:4px 0 20px}
.w-stage.sf .pl-sftrack input{display:block;width:100%;margin:0;accent-color:var(--sf-amber);height:22px}
.w-stage.sf .pl-ticks{position:absolute;left:8px;right:8px;top:-3px;height:8px;pointer-events:none}
.w-stage.sf .pl-ticks i{position:absolute;top:0;width:0;height:0;margin-left:-5px;border:5px solid transparent;border-top:7px solid #ff9a7a}
.w-stage.sf .pl-sfjumps{position:absolute;left:8px;right:8px;bottom:0;height:18px}
.w-stage.sf .pl-sfjumps .pl-jump{position:absolute;bottom:0;transform:translateX(-50%);min-height:0;height:18px;padding:0 6px;border:0;border-radius:6px;background:none;color:var(--sf-muted);font-size:11px;font-weight:650;font-variant-numeric:tabular-nums}
.w-stage.sf .pl-sfjumps .pl-jump:last-child{transform:translateX(-85%)}
.w-stage.sf .pl-sfjumps .pl-jump:hover{background:rgba(255,255,255,.1);color:var(--sf-ink)}
/* sea level and storms */
.w-stage.sf .pl-sft .pl-cond{flex:none;flex-wrap:nowrap;gap:4px}
.w-stage.sf .pl-sft .pl-cond>span{min-width:0;font-size:11px;color:var(--sf-muted);margin-right:2px;white-space:nowrap}
.w-stage.sf .pl-sft .pl-cond button{min-height:34px;padding:5px 11px;border:1px solid var(--sf-line);border-radius:999px;background:rgba(255,255,255,.06);color:var(--sf-ink);font-size:12px;font-weight:650;white-space:nowrap}
.w-stage.sf .pl-sft .pl-cond button:hover{background:rgba(255,255,255,.13)}
.w-stage.sf .pl-sft .pl-cond button[aria-pressed=true]{background:var(--sf-ink);border-color:var(--sf-ink);color:#13202a}
.w-stage.sf .pl-sft #pl-storm{border-color:rgba(255,154,122,.55);color:#ffd2c4}
.w-stage.sf .pl-sft #pl-storm small{display:inline-grid;place-items:center;min-width:18px;height:18px;margin-left:3px;border-radius:9px;background:rgba(255,154,122,.3);font-size:11px}
/* narrower bars: the labels go, then the year jumps */
@container plbar (max-width:760px){
 .w-stage.sf .pl-sft{gap:10px}
 .w-stage.sf .pl-sft .pl-cond>span{display:none}
 .w-stage.sf .pl-sfyear{min-width:64px}.w-stage.sf .pl-sfyear b{font-size:23px}
}
@container plbar (max-width:600px){
 .w-stage.sf .pl-sfyear span{display:none}
 .w-stage.sf .pl-sfjumps{display:none}.w-stage.sf .pl-sftrack{padding-bottom:4px}
}
/* the storms in the plan are listed (and removed) in the guide; the bar shows them as ticks on the track */
.w-stage.sf .pl-stormlist:empty{display:none}
.w-stage.sf .pl-stormlist{margin:10px 0 2px}
.w-stage.sf .pl-stormlist .pl-cond>span{font-size:11px;color:var(--muted);min-width:0;margin-right:4px}

/* ---------- headline outcomes over the scene, the map key under them ---------- */
.pl-chips{display:none}
.w-stage.sf .pl-chips{display:block}
#world .w-stage.sf .w-stack:has(.pl-chips){width:min(600px,calc(100% - var(--sf-cardw,36%) - var(--sf-railw,92px) - 62px));max-width:none}
#world .w-stage.sf.sf-dock .w-stack:has(.pl-chips),#world .w-stage.sf:not(.w-guide-open) .w-stack:has(.pl-chips){width:min(600px,calc(100% - var(--sf-railw,92px) - 52px))}
.w-stage.sf .pl-chipk{display:inline-block;margin:0 0 6px;padding:4px 10px;border-radius:999px;background:var(--sf-glass);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);border:1px solid var(--sf-line);font-size:11px;font-weight:750;letter-spacing:.1em;text-transform:uppercase;color:var(--sf-amber2)}
.w-stage.sf .pl-chipk small{font-weight:600;letter-spacing:0;text-transform:none;color:var(--sf-ink);opacity:.85}
.w-stage.sf .pl-chips ul{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.w-stage.sf .pl-c{width:100%;height:100%;display:grid;align-content:start;gap:2px;min-width:0;padding:9px 12px 10px;border:1px solid var(--sf-line);border-radius:14px;background:var(--sf-glass);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);color:var(--sf-ink);text-align:left;cursor:pointer;font:inherit}
.w-stage.sf .pl-c:hover{border-color:rgba(255,255,255,.35)}
.w-stage.sf .pl-c b{font-size:21px;line-height:1.15;font-weight:750;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.w-stage.sf .pl-c span{font-size:11.5px;line-height:1.3;color:var(--sf-muted);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.w-stage.sf .pl-c.good{box-shadow:inset 0 3px 0 var(--sf-good)}.w-stage.sf .pl-c.good b{color:var(--sf-good)}
.w-stage.sf .pl-c.mid{box-shadow:inset 0 3px 0 var(--sf-amber)}.w-stage.sf .pl-c.mid b{color:var(--sf-amber2)}
.w-stage.sf .pl-c.bad{box-shadow:inset 0 3px 0 #f2785c}.w-stage.sf .pl-c.bad b{color:#ffb4a1}
.w-stage.sf .pl-crange b{font-size:17px;white-space:normal;overflow-wrap:anywhere}
.w-stage.sf .pl-cpeople b{font-size:16px;padding-top:3px;display:flex;gap:3px;align-items:center}
.w-stage.sf .pl-cpeople i{font-style:normal;font-size:14px;margin-left:4px}.w-stage.sf .pl-cpeople i:first-child{margin-left:0}
/* the key: one compact strip, the year is on the time bar */
.w-stage.sf .w-hud:has(.pl-hud){padding:7px 12px;align-self:stretch}
.w-stage.sf .pl-hud>b,.w-stage.sf .pl-hud>span{display:none}
.w-stage.sf .pl-hud ul{margin:0;display:flex;flex-wrap:wrap;gap:4px 14px}
.w-stage.sf .pl-hud li{color:var(--sf-ink)}

/* laptops and classroom displays with short screens: one line per chip, the year label goes (the bar shows it) */
@media (min-width:721px) and (max-height:820px){
 .w-stage.sf .pl-chipk{display:none}
 .w-stage.sf .pl-chips ul{gap:6px}
 .w-stage.sf .pl-c{padding:6px 10px 7px;border-radius:12px}
 .w-stage.sf .pl-c b{font-size:17px}.w-stage.sf .pl-crange b{font-size:14px}.w-stage.sf .pl-cpeople b{font-size:14px;padding-top:1px}
 .w-stage.sf .pl-c span{-webkit-line-clamp:1;font-size:11px}
 .w-stage.sf .w-hud:has(.pl-hud){padding:5px 10px}
 .w-stage.sf .pl-hud li{font-size:10.5px}
}

/* ---------- the plan in the guide: section tabs, like the classic full-screen view ---------- */
.w-stage.sf .pl-secnav{display:flex;gap:4px;position:sticky;top:-16px;z-index:2;margin:-16px -20px 2px;padding:10px 20px;background:var(--sf-paper);border-bottom:1px solid #e2dccd}
.w-stage.sf:not(.sf-dock) .pl-secnav{background:rgba(16,25,32,.97);border-bottom-color:var(--sf-line)}
.w-stage.sf .pl-secnav button{min-height:34px;font-size:12px}
.w-stage.sf .pl-sec:not(.on){display:none}
.w-stage.sf .pl-hlong{display:none}
.w-stage.sf #w-body:has(.pl-secnav):not([data-sec-now=plan]) > .w-body{display:none}
.w-stage.sf .pl-unit{scroll-margin-top:60px}
.w-stage.sf .pl-out h4{margin-top:12px}
.w-stage.sf:not(.sf-dock) .pl-secnav button{background:rgba(255,255,255,.06);border-color:var(--sf-line);color:var(--sf-ink)}
.w-stage.sf:not(.sf-dock) .pl-secnav button[aria-current=true]{background:var(--sf-ink);border-color:var(--sf-ink);color:#13202a}
/* floated over the scene on dark glass (the column is the default; the dock button floats it) */
.w-stage.sf:not(.sf-dock) .pl-honest{background:rgba(242,178,62,.1);border-color:rgba(242,178,62,.3);color:var(--sf-ink)}
.w-stage.sf:not(.sf-dock) .pl-about{color:var(--sf-ink)}
.w-stage.sf:not(.sf-dock) .pl-presets button{background:rgba(255,255,255,.06);border-color:var(--sf-line);color:var(--sf-ink)}
.w-stage.sf:not(.sf-dock) .pl-presets button[aria-pressed=true]{background:var(--sf-ink);border-color:var(--sf-ink);color:#13202a}
.w-stage.sf:not(.sf-dock) .pl-ledger th,.w-stage.sf:not(.sf-dock) .pl-ledger td{border-color:var(--sf-line);color:var(--sf-ink)}
.w-stage.sf:not(.sf-dock) .pl-ledger thead th{background:rgba(255,255,255,.07)}
.w-stage.sf:not(.sf-dock) .pl-ledger td.ok{color:var(--sf-good)}.w-stage.sf:not(.sf-dock) .pl-ledger td.mid{color:var(--sf-amber2)}.w-stage.sf:not(.sf-dock) .pl-ledger td.bad{color:#ffb4a1}
.w-stage.sf:not(.sf-dock) .pl-unit{background:rgba(255,255,255,.05);border-color:var(--sf-line)}
.w-stage.sf:not(.sf-dock) .pl-uhead,.w-stage.sf:not(.sf-dock) .pl-un b{color:var(--sf-ink)}
.w-stage.sf:not(.sf-dock) .pl-un small{color:var(--sf-muted)}
.w-stage.sf:not(.sf-dock) .pl-n{background:var(--sf-ink);color:#13202a}
.w-stage.sf:not(.sf-dock) .pl-pill{background:rgba(255,255,255,.1);color:var(--sf-ink)}
.w-stage.sf:not(.sf-dock) .pl-ures{background:rgba(255,255,255,.07);color:var(--sf-ink)}
.w-stage.sf:not(.sf-dock) .pl-pol button,.w-stage.sf:not(.sf-dock) .pl-tabs button,.w-stage.sf:not(.sf-dock) .pl-stormlist button{background:rgba(255,255,255,.06);border-color:var(--sf-line);color:var(--sf-ink)}
.w-stage.sf:not(.sf-dock) .pl-pol button[aria-checked=true],.w-stage.sf:not(.sf-dock) .pl-tabs button[aria-selected=true]{background:var(--sf-ink);border-color:var(--sf-ink);color:#13202a}
.w-stage.sf:not(.sf-dock) .pl-meth select{background:#1b2830;color:var(--sf-ink);border-color:var(--sf-line)}
.w-stage.sf:not(.sf-dock) .pl-stats li,.w-stage.sf:not(.sf-dock) .pl-people li,.w-stage.sf:not(.sf-dock) .pl-ch{border-color:var(--sf-line);background:rgba(255,255,255,.04)}
.w-stage.sf:not(.sf-dock) .pl-stats b{color:var(--sf-ink)}.w-stage.sf:not(.sf-dock) .pl-stats span,.w-stage.sf:not(.sf-dock) .pl-people small{color:var(--sf-muted)}
.w-stage.sf:not(.sf-dock) .pl-events li{border-bottom-color:var(--sf-line)}.w-stage.sf:not(.sf-dock) .pl-events span{color:var(--sf-amber2)}
.w-stage.sf:not(.sf-dock) .pl-chart .g{stroke:rgba(255,255,255,.15)}.w-stage.sf:not(.sf-dock) .pl-chart .t,.w-stage.sf:not(.sf-dock) .pl-chart .u.s{fill:var(--sf-muted)}.w-stage.sf:not(.sf-dock) .pl-chart .u{fill:var(--sf-ink)}
.w-stage.sf:not(.sf-dock) .pl-checks .ok{color:var(--sf-good)}.w-stage.sf:not(.sf-dock) .pl-checks .no{color:#ffb4a1}

/* ---------- portrait tablets: the reading column is a sheet along the bottom; the bar sits above it ---------- */
@media (min-width:721px) and (max-width:900px){
 #world .w-stage.sf.sf-dock #pl-sfbar{right:14px;bottom:calc(var(--sf-psheet,44%) + 14px)}
}

/* ---------- phones: the bar is the bottom strip; the sheet rides on it; two-by-two chips, no key ---------- */
@media (max-width:720px){
 #world .w-stage.sf:has(> #pl-sfbar){--sf-dockh:58px}
 #world .w-stage.sf #pl-sfbar,#world .w-stage.sf.sf-dock #pl-sfbar{left:0;right:0;bottom:0;padding:5px 10px 5px 8px;border-radius:0;border-width:1px 0 0}
 .w-stage.sf .pl-sft{gap:8px;min-height:46px}
 .w-stage.sf .pl-sfplay{width:42px;height:42px}
 .w-stage.sf .pl-sfyear{min-width:0}.w-stage.sf .pl-sfyear b{font-size:20px}
 .w-stage.sf .pl-sftrack{min-width:80px}
 .w-stage.sf .pl-sft .pl-cond button{min-height:36px;padding:4px 9px;font-size:11.5px}
 .w-stage.sf .pl-sft #pl-storm{font-size:0;min-width:38px;padding:0 8px}.w-stage.sf .pl-sft #pl-storm::before{content:'⚡';font-size:16px}.w-stage.sf .pl-sft #pl-storm small{font-size:10.5px}
 #world .w-stage.sf .w-stack:has(.pl-chips),#world .w-stage.sf.sf-dock .w-stack:has(.pl-chips){left:8px;right:auto;width:calc(100% - var(--sf-railw) - 28px);max-width:none}
 #world .w-stage.sf.w-guide-open .w-stack:has(.pl-chips)>:not(.pl-chips){display:none}
 .w-stage.sf .pl-chipk{display:none}
 .w-stage.sf .pl-chips ul{grid-template-columns:1fr 1fr;gap:5px}
 .w-stage.sf .pl-c{padding:6px 9px 7px;border-radius:11px}
 .w-stage.sf .pl-c b{font-size:15px}.w-stage.sf .pl-crange b{font-size:13px}.w-stage.sf .pl-cpeople b{font-size:13px;padding-top:1px}.w-stage.sf .pl-cpeople i{font-size:12px}
 .w-stage.sf .pl-c span{font-size:10.5px;-webkit-line-clamp:1}
 .w-stage.sf .pl-secnav{top:-12px;margin:-12px -16px 2px;padding:8px 16px}
 .w-stage.sf .pl-secnav button{padding:4px 4px;font-size:11.5px}
}
