/* Explore (/explore): gallery, answer view, filter rail. Ported from the prototype's explore.css. Foundation components live in bf.css, shared page parts in pages.css.
   The block at the end is new in the real build: the loading and error states, the charts for the five questions the prototype only sketched, and group comparisons. */
.ex-hero { --art-pos: center 22%; }
.ex-body { padding-top: 0; }
.ex-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; background: var(--cyan); color: var(--on-cyan); font: 700 12px/1 var(--mono); letter-spacing: 0; }
.ex-count[hidden] { display: none; }

/* ---- toolbar: scope and position lens */
.ex-body > .ex-toolbar { margin-top: var(--s-6); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); }
.ex-scopebar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px 16px; background: var(--panel); border: 1px solid var(--line-2); }
.ex-scopebar__k { font: 600 12px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.ex-toolbar__lens { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.ex-toolbar__lens > p { flex: none; }
.ex-lens { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.ex-lens::-webkit-scrollbar { display: none; }
.ex-lens__b { --cut: 6px; --edge: var(--line-3); flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line-3); background-color: var(--panel-2); color: var(--text-2); font: 600 14px/1 var(--body); clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); transition: border-color .15s, background-color .15s, color .15s; }
.ex-lens__b:hover { border-color: var(--pc, var(--cyan)); color: #fff; }
.ex-lens__b[aria-pressed="true"] { border-color: var(--pc, var(--cyan)); background-color: color-mix(in srgb, var(--pc, var(--cyan)) 16%, var(--panel-2)); color: #fff; box-shadow: inset 0 -3px 0 var(--pc, var(--cyan)); }
.ex-lens__b .bf-dot { --pc: inherit; background: var(--pc); box-shadow: 0 0 8px var(--pc); }
.ex-lens__b:focus-visible { clip-path: none; }

/* ---- groups and cards */
.ex-group .bf-sh { margin-bottom: var(--s-4); }
.ex-eb--openings { color: var(--cyan); } .ex-eb--economy { color: var(--amber); } .ex-eb--team { color: var(--red-hi); }
.ex-cards { display: grid; gap: var(--s-4); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ex-cards[data-n="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ex-card { --tc: var(--cyan); display: flex; flex-direction: column; gap: 10px; padding: 18px 18px 16px; }
.ex-card[data-topic="economy"] { --tc: var(--amber); } .ex-card[data-topic="team"] { --tc: var(--red); }
.ex-card:hover { border-color: var(--tc); }
.ex-card__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ex-card__ico { display: grid; place-items: center; flex: none; width: 40px; height: 40px; background: color-mix(in srgb, var(--tc, var(--cyan)) 18%, var(--panel-2)); border: 1px solid color-mix(in srgb, var(--tc, var(--cyan)) 50%, #000); color: var(--tc, var(--cyan)); clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.ex-card__ico svg { width: 22px; height: 22px; }
.ex-card__tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.ex-live { display: inline-block; width: 7px; height: 7px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); animation: bf-pulse 2.4s ease-in-out infinite; }
.ex-card__t { margin-top: 4px; font: 700 21px/1.2 var(--display); letter-spacing: .005em; text-wrap: balance; }
@media (min-width: 1101px) { .ex-cards[data-n="3"] .ex-card__t { min-height: 2.4em; } .ex-cards[data-n="4"] .ex-card__t { min-height: 2.4em; } }
.ex-card__d { font-size: 14px; line-height: 1.45; color: var(--muted); }
.ex-pv { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); min-height: 148px; }
.ex-pv__head { display: flex; align-items: center; gap: 12px; }
.ex-pv__img { width: 52px; height: 52px; object-fit: contain; background: var(--bg); border: 1px solid var(--line-2); padding: 3px; flex: none; }
.ex-pv__name { min-width: 0; font: 700 19px/1.2 var(--display); overflow: hidden; text-overflow: ellipsis; }
.ex-pv__big { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.ex-pv__head > .ex-pv__big:first-child { margin-left: 0; align-items: flex-start; text-align: left; }
.ex-pv__big b { font: 700 34px/1 var(--display); color: var(--cyan-hi); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.ex-card[data-topic="economy"] .ex-pv__big b { color: var(--amber-hi); } .ex-card[data-topic="team"] .ex-pv__big b { color: var(--red-hi); }
.ex-pv__big small { margin-top: 3px; font-size: 12px; line-height: 1.25; color: var(--muted); max-width: 22ch; }
.ex-pv__seq { display: flex; align-items: center; gap: 2px; }
.ex-pv__seq img { width: 40px; height: 40px; object-fit: contain; background: var(--bg); border: 1px solid var(--line-2); padding: 2px; }
.ex-pv__arr { width: 8px; height: 8px; border-right: 2px solid var(--line-3); border-top: 2px solid var(--line-3); transform: rotate(45deg); margin: 0 3px; flex: none; }
.ex-pv__line { font-size: 14px; color: var(--text-2); }
.ex-pv__what { font-size: 13px; line-height: 1.5; color: var(--muted); }
.ex-pv__rows { display: grid; gap: 6px; }
.ex-pv__rows li { display: grid; grid-template-columns: 24px minmax(0, 1fr) 64px 42px; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.ex-pv__rows li:not(:has(img)) { grid-template-columns: minmax(0, 1fr) 64px 42px; }
.ex-pv__rows img { width: 24px; height: 24px; object-fit: contain; background: var(--bg); border: 1px solid var(--line); }
.ex-pv__n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-pv__rows b { font: 600 13px/1 var(--mono); color: var(--text); text-align: right; }
.ex-pv .bf-bar { height: 6px; }
.ex-pv__foot { font-size: 12px; line-height: 1.4; color: var(--faint); }
.ex-card__go { display: inline-flex; align-items: center; gap: 6px; margin-top: 2px; font: 600 13px/1 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--tc); }
.ex-card__go::after { content: "\2192"; transition: transform .2s var(--ease); }
.ex-card:hover .ex-card__go::after { transform: translateX(4px); }
.ex-card--live { background: linear-gradient(180deg, rgba(253,192,76,.04), var(--panel) 44%); }

/* ghost shapes (sample only, no numbers) */
.ex-ghost { color: var(--line-3); }
.ex-ghost--bars { display: flex; flex-direction: column; gap: 8px; }
.ex-ghost--bars i { display: block; height: 12px; width: calc(var(--v) * 100%); background: repeating-linear-gradient(135deg, rgba(147,169,186,.32) 0 6px, rgba(147,169,186,.16) 6px 12px); }
.ex-ghost--hist { display: flex; align-items: flex-end; gap: 3px; height: 70px; border-bottom: 1px solid var(--line-3); }
.ex-ghost--hist i { flex: 1; height: calc(var(--v) * 100%); background: repeating-linear-gradient(135deg, rgba(147,169,186,.32) 0 6px, rgba(147,169,186,.16) 6px 12px); }
.ex-ghost--mix { display: block; width: 100%; height: 70px; fill: none; stroke: rgba(147,169,186,.5); stroke-width: 2; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.ex-ghost--mix path { vector-effect: non-scaling-stroke; }
.ex-ghost--pairs { display: flex; align-items: flex-end; gap: 14px; height: 70px; border-bottom: 1px solid var(--line-3); }
.ex-ghost--pairs span { flex: 1; display: flex; align-items: flex-end; gap: 3px; height: 100%; }
.ex-ghost--pairs i { flex: 1; height: calc(var(--v) * 100%); background: repeating-linear-gradient(135deg, rgba(147,169,186,.32) 0 6px, rgba(147,169,186,.16) 6px 12px); }
.ex-ghost--big.ex-ghost--bars { max-width: 520px; margin-top: var(--s-4); } .ex-ghost--big.ex-ghost--bars i { height: 20px; }
.ex-ghost--big.ex-ghost--hist, .ex-ghost--big.ex-ghost--pairs { height: 150px; margin-top: var(--s-4); max-width: 560px; }
.ex-ghost--big.ex-ghost--mix { height: 150px; max-width: 560px; margin-top: var(--s-4); }
.ex-ghost--card.ex-ghost--bars i { height: 10px; }

/* ---- build your own */
.ex-builders { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); }
.ex-build { display: flex; flex-direction: column; gap: var(--s-4); }
.ex-build__top { display: flex; align-items: flex-start; gap: 14px; }
.ex-build__ico { display: grid; place-items: center; flex: none; width: 48px; height: 48px; background: var(--cyan); color: var(--on-cyan); clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px); }
.ex-build__ico svg { width: 26px; height: 26px; }
.ex-build__ico--amber { background: var(--amber); color: var(--on-amber); } .ex-build__ico--red { background: var(--red); color: #1a0705; }
.ex-sentence { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 14px; background: var(--bg-2); border: 1px solid var(--line-2); font-size: 14px; color: var(--muted); }
.ex-sentence b { padding: 4px 10px; background: var(--cyan-tint); border: 1px solid var(--cyan-lo); color: var(--cyan-hi); font-weight: 600; }
.ex-shelves { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 12px; background: var(--bg-2); border: 1px solid var(--line-2); }
.ex-shelves > div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 52px; padding: 8px; border: 1px dashed var(--line-3); }
.ex-shelves > div:first-child { grid-row: span 3; align-content: flex-start; border-style: solid; border-color: var(--line-2); background: var(--panel); }
.ex-shelves small { flex-basis: 100%; font: 600 12px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.ex-shelves span { padding: 4px 9px; background: var(--panel-3); border: 1px solid var(--line-3); font-size: 13px; color: var(--text-2); }
.ex-shelves span.on { background: var(--amber-tint); border-color: #8a6a2a; color: var(--amber-hi); }
.ex-presets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.ex-presets .bf-tag { white-space: normal; height: auto; min-height: 36px; line-height: 1.25; font-size: 12px; }
.ex-build__list { margin-top: -4px; }
.ex-build__note { margin-top: -8px; }
.ex-build__act { margin-top: auto; }
.ex-saved { display: grid; gap: 6px; margin-top: 8px; }
.ex-saved li { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: center; gap: 8px; }
.ex-saved a { display: flex; flex-direction: column; gap: 2px; min-height: 44px; justify-content: center; padding: 6px 12px; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--text); text-decoration: none; min-width: 0; }
.ex-saved a:hover { border-color: var(--cyan); background: var(--cyan-tint); }
.ex-saved b { font: 600 14px/1.3 var(--body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-saved span { font: 500 12px/1.2 var(--mono); color: var(--muted); }

/* ---- answer view */
.ex-answer { padding-top: var(--s-5); }
.ex-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: var(--s-4); font-size: 13px; color: var(--muted); }
.ex-crumb a { display: inline-flex; align-items: center; min-height: 32px; color: var(--cyan); text-decoration: none; }
.ex-crumb a:hover { color: var(--cyan-hi); text-decoration: underline; text-underline-offset: 4px; }
.ex-crumb i { width: 6px; height: 6px; border-right: 2px solid var(--line-3); border-top: 2px solid var(--line-3); transform: rotate(45deg); }
.ex-crumb span { color: var(--text-2); }
.ex-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-5); margin-bottom: var(--s-5); }
.ex-head h1 { max-width: 20ch; }
.ex-head__lead { margin-top: var(--s-4); font-size: 1.0625rem; }
.ex-actions { display: flex; flex-wrap: wrap; gap: 8px; flex: none; }
.ex-filterbar { display: none; }
.ex-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s-6); align-items: start; }
.ex-main { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
.ex-scope { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.ex-scope__k { font: 600 12px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.ex-scope__p { display: inline-flex; align-items: center; gap: 7px; min-height: 28px; padding: 3px 11px; background: var(--panel-2); border: 1px solid var(--line-2); font-size: 13px; color: var(--text-2); }
.ex-scope__p.is-pos { border-color: color-mix(in srgb, var(--pc) 60%, #000); color: #fff; }
.ex-verdict { display: flex; flex-direction: column; gap: 12px; }
.ex-verdict__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.ex-chart__head { margin-bottom: var(--s-4); }
.ex-chart__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: var(--s-4); font-size: 13px; color: var(--muted); }
.ex-chart__foot b { color: var(--text-2); font-weight: 600; }
.ex-disc .bf-table-wrap { max-height: 420px; overflow: auto; }

/* rows (bars) */
.ex-rows { display: grid; gap: 0; }
.ex-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 14px; min-height: 64px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ex-row:last-child { border-bottom: 0; }
.ex-row__img { display: grid; place-items: center; width: 44px; height: 44px; background: var(--bg); border: 1px solid var(--line-2); }
.ex-row__img img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }
.ex-row__img i { font: 700 18px/1 var(--display); color: var(--muted); font-style: normal; }
.ex-row__main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ex-row__t { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font: 600 16px/1.3 var(--body); color: var(--text); }
.ex-row__t small { font: 500 13px/1.3 var(--body); color: var(--muted); }
.ex-row__bar { display: block; height: 8px; background: var(--bg-2); border: 1px solid var(--line-2); }
.ex-row__bar i { display: block; height: 100%; width: var(--w); background: linear-gradient(90deg, var(--cyan-lo), var(--cyan)); }
.ex-row.is-top .ex-row__bar i { background: linear-gradient(90deg, var(--cyan), var(--cyan-hi)); box-shadow: 0 0 14px rgba(60,198,244,.45); }
.ex-row__v { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; min-width: 76px; }
.ex-row__v b { font: 700 20px/1 var(--display); color: var(--cyan-hi); font-variant-numeric: tabular-nums; }
.ex-row.is-top .ex-row__v b { color: #fff; }
.ex-row__v small { font: 500 12px/1.2 var(--mono); color: var(--muted); white-space: nowrap; }
.ex-row--other .ex-row__img { border-style: dashed; }
.ex-row--other .ex-row__v b { color: var(--text-2); }
.ex-rows--seq .ex-row, .ex-rows--ms .ex-row { grid-template-columns: minmax(0, 1fr) auto; }
.ex-rows--seq .ex-row--seq { grid-template-columns: 34px minmax(0, 1fr) auto; }
.ex-rows--seq .ex-row--other { grid-template-columns: 44px minmax(0, 1fr) auto; }
.ex-row__rank { width: 30px; height: 30px; font-size: 14px; }
.ex-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 2px; }
.ex-step { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; background: var(--panel-2); border: 1px solid var(--line-2); font-size: 14px; font-weight: 600; }
.ex-step img { width: 32px; height: 32px; object-fit: contain; background: var(--bg); border: 1px solid var(--line); }
.ex-step small { font: 600 14px/1 var(--body); color: var(--text); }
.ex-then { display: inline-block; width: 8px; height: 8px; margin: 0 6px; border-right: 2px solid var(--line-3); border-top: 2px solid var(--line-3); transform: rotate(45deg); flex: none; }
.ex-row__t--chips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 2px; }
.ex-ms { --edge: var(--line-3); --cut: 5px; display: inline-flex; align-items: center; min-height: 30px; padding: 3px 12px; border: 1px solid var(--line-3); font: 600 13px/1.2 var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--text); background-color: var(--panel-2); clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); }
.ex-ms--a { border-color: #8a6a2a; background-color: var(--amber-tint); color: var(--amber-hi); }
.ex-ms--b { border-color: var(--cyan-lo); background-color: var(--cyan-tint); color: var(--cyan-hi); }
.ex-ms--c { border-color: #6a58a8; background-color: #1a1530; color: #cdbbff; }
.ex-ms--none { color: var(--muted); }
.ex-miss { font-size: 13px; color: var(--muted); }

/* timing chart */
.ex-timing__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-bottom: var(--s-4); }
.ex-readout { flex: 1; min-width: 220px; font-size: 14px; color: var(--muted); min-height: 22px; }
.ex-readout b { color: var(--cyan-hi); font-family: var(--mono); font-weight: 600; }
.ex-plot { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; }
.ex-plot__y { display: flex; flex-direction: column; justify-content: space-between; height: 240px; margin-top: 32px; text-align: right; font: 500 12px/1 var(--mono); color: var(--muted); }
.ex-plot__y i { font-style: normal; transform: translateY(-4px); } .ex-plot__y i:last-child { transform: translateY(2px); }
.ex-plot__c { position: relative; padding-top: 32px; min-width: 0; }
.ex-hist, .ex-cum { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 240px; border-bottom: 1px solid var(--line-3); border-left: 1px solid var(--line-2); background: repeating-linear-gradient(180deg, transparent 0 59px, rgba(120,190,230,.1) 59px 60px); }
.ex-hist i { position: relative; z-index: 1; flex: 1; min-width: 2px; height: calc(var(--v) * 100%); min-height: 2px; background: linear-gradient(180deg, var(--cyan), var(--cyan-lo)); opacity: .85; transition: opacity .15s; }
.ex-hist i:hover, .ex-hist i.on { opacity: 1; background: linear-gradient(180deg, var(--amber-hi), var(--amber)); }
.ex-hist__band { position: absolute; top: 0; bottom: 0; z-index: 0; background: rgba(60,198,244,.1); border-inline: 1px dashed rgba(60,198,244,.5); pointer-events: none; }
.ex-hist__med { position: absolute; z-index: 3; top: -4px; bottom: 0; width: 3px; margin-left: -1px; background: #fff; box-shadow: 0 0 12px rgba(255,255,255,.7); pointer-events: none; }
.ex-hist__med b { position: absolute; top: -28px; left: 50%; transform: translateX(-50%); padding: 3px 8px; background: var(--panel-3); border: 1px solid var(--line-3); font: 700 13px/1 var(--mono); color: #fff; white-space: nowrap; }
.ex-cum svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ex-cum__line { fill: none; stroke: var(--cyan); stroke-width: 2.5; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 6px rgba(60,198,244,.6)); }
.ex-cum__area { fill: rgba(60,198,244,.13); stroke: none; }
.ex-plot__x { position: relative; height: 22px; margin-top: 8px; }
.ex-plot__x i { position: absolute; top: 0; transform: translateX(-50%); font: 500 12px/1 var(--mono); font-style: normal; color: var(--muted); white-space: nowrap; }
.ex-plot__x i:first-child { transform: none; }
.ex-pos-timing { display: grid; gap: 0; max-width: 720px; }
.ex-bar-lg { height: 10px; margin-top: 8px; }
.ex-needs-in { padding: 34px 20px 18px; }
.ex-pos-timing .bf-needs { margin-top: var(--s-5); }

/* needs-new-data state */
.ex-needs { padding: 0; }
.ex-needs__in { padding: 44px var(--s-5) var(--s-5); }
.ex-needs__in .pg-list { margin-top: var(--s-3); max-width: 70ch; }
.ex-needs__in .bf-cap { margin-top: var(--s-4); }

/* more questions */
.ex-more-q { margin-top: var(--s-4); }
.ex-more-q h2 { margin-bottom: var(--s-3); }
.ex-poslinks { display: flex; flex-wrap: wrap; gap: 8px; }
.ex-poslink { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--text-2); text-decoration: none; font: 600 14px/1 var(--body); }
.ex-poslink:hover { border-color: var(--pc); color: #fff; background: color-mix(in srgb, var(--pc) 12%, var(--panel-2)); }
.ex-poslink.is-on { border-color: var(--pc); color: #fff; box-shadow: inset 0 -3px 0 var(--pc); }
.ex-rel { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); }
a.ex-rel__c { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.ex-rel__c b { display: block; font: 600 15px/1.3 var(--body); }
.ex-rel__c small { font-size: 12px; color: var(--muted); }
.ex-full { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); margin-top: var(--s-4); }
.ex-full .bf-h3 { margin-bottom: 4px; }

/* the rail */
.ex-rail { position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100vh - var(--header-h) - 32px); display: flex; flex-direction: column; padding: 0; }
.ex-rail__head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 10px 18px; border-bottom: 1px solid var(--line); }
.ex-rail__body { overflow-y: auto; padding: 14px 18px 20px; overscroll-behavior: contain; scrollbar-width: thin; }
.ex-fs { margin: 0 0 18px; padding: 0; border: 0; min-width: 0; }
.ex-fs legend { padding: 0; margin-bottom: 10px; font: 700 12px/1.3 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); }
.ex-field { margin-top: 12px; }
.ex-field:first-of-type { margin-top: 0; }
.ex-field__h { margin-bottom: 6px; font: 600 12px/1.4 var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.ex-field .bf-cap { margin-top: 6px; }
.ex-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; overflow: visible; }
.ex-seg button { min-height: 44px; padding: 6px 6px; white-space: normal; line-height: 1.2; text-align: center; font-size: 12px; letter-spacing: .05em; }
.ex-pos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.ex-pos button { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--text-2); font: 600 14px/1.1 var(--body); text-align: left; }
.ex-pos button:first-child { grid-column: 1 / -1; }
.ex-pos button:hover { border-color: var(--pc, var(--cyan)); color: #fff; }
.ex-pos button[aria-pressed="true"] { border-color: var(--pc, var(--cyan)); background: color-mix(in srgb, var(--pc, var(--cyan)) 16%, var(--panel-2)); color: #fff; box-shadow: inset 0 -3px 0 var(--pc, var(--cyan)); }
.ex-rate { display: grid; gap: 8px; }
.ex-num { display: flex; align-items: center; gap: 10px; }
.ex-num span { flex: none; font-size: 13px; color: var(--muted); }
.ex-more { border-top: 1px solid var(--line); }
.ex-more > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; list-style: none; min-height: 48px; cursor: pointer; font: 700 12px/1.3 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); }
.ex-more > summary::-webkit-details-marker { display: none; }
.ex-more > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--cyan); border-bottom: 2px solid var(--cyan); transform: translateY(-2px) rotate(45deg); transition: transform .2s; }
.ex-more[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.ex-more[open] { padding-bottom: 12px; }
.ex-badge { margin-left: auto; margin-right: 10px; padding: 2px 8px; background: var(--amber-tint); border: 1px solid #8a6a2a; color: var(--amber-hi); font: 600 12px/1.3 var(--display); letter-spacing: .08em; }
.ex-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.ex-dates label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.ex-radios { display: grid; }
.ex-radios label { display: flex; align-items: center; gap: 12px; min-height: 44px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 14px; color: var(--text-2); }
.ex-radios input { width: 20px; height: 20px; accent-color: var(--cyan); flex: none; }
.ex-ranges { margin-top: 10px; }
.ex-ranges .ex-field__h { margin-top: 8px; }
.ex-active { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.ex-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.ex-chip { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 3px 8px 3px 10px; background: var(--cyan-tint); border: 1px solid var(--cyan-lo); color: var(--cyan-hi); font: 600 13px/1.2 var(--body); }
.ex-chip::after { content: ""; position: absolute; inset: -6px 0; }
.ex-chip i { font-style: normal; font-size: 18px; line-height: 1; color: var(--muted); }
.ex-chip:hover i { color: #fff; }

/* sheet and drawer contents */
.ex-sheetbody { padding-bottom: 8px; }
.ex-dl { display: grid; gap: 0; }
.ex-dl > div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.ex-dl dt { font: 600 12px/1.4 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.ex-dl dd { margin: 3px 0 0; font-size: 15px; line-height: 1.55; color: var(--text-2); }
.ex-explain section + section { margin-top: var(--s-4); }
.ex-explain h3 { margin-bottom: 6px; font: 700 12px/1.3 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); }
.ex-explain p { font-size: 15px; line-height: 1.6; color: var(--text-2); }
.ex-explain p + p { margin-top: 8px; }
.ex-explain__w a { display: inline-block; margin: 0 6px 6px 0; padding: 4px 10px; border: 1px solid var(--line-3); background: var(--panel-2); color: var(--cyan-hi); text-decoration: none; font-size: 13px; }
.ex-explain__w a:hover { border-color: var(--cyan); background: var(--cyan-tint); }

/* ---- breakpoints */
@media (max-width: 1100px) {
  .ex-presets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ex-cards, .ex-cards[data-n="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ex-builders { grid-template-columns: minmax(0, 1fr); }
  .ex-grid { grid-template-columns: minmax(0, 1fr); }
  .ex-rail { display: none; }
  .ex-filterbar { display: block; position: sticky; top: var(--header-h); z-index: 30; margin: 0 calc(var(--gutter) * -1) var(--s-4); padding: 10px var(--gutter); background: rgba(6,10,16,.94); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line-2); }
  .ex-summary { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 6px 14px; background: var(--panel-2); border: 1px solid var(--line-3); color: var(--text); font: 500 14px/1.3 var(--body); text-align: left; }
  .ex-summary::after { content: ""; flex: none; width: 8px; height: 8px; margin-left: auto; border-right: 2px solid var(--cyan); border-bottom: 2px solid var(--cyan); transform: rotate(45deg) translateY(-2px); }
  .ex-summary__k { flex: none; display: inline-flex; align-items: center; gap: 6px; font: 700 12px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); }
  .ex-summary__k svg { width: 18px; height: 18px; }
  .ex-summary__v { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
  .ex-summary__n { flex: none; min-width: 22px; padding: 2px 7px; background: var(--cyan); color: var(--on-cyan); font: 700 12px/1.3 var(--mono); text-align: center; }
  .ex-summary__n[hidden] { display: none; }
  .ex-head { align-items: flex-start; flex-direction: column; gap: var(--s-4); }
}
@media (max-width: 760px) {
  .ex-answer { padding-top: var(--s-4); }
  .ex-crumb { margin-bottom: var(--s-2); }
  .ex-head { margin-bottom: var(--s-4); gap: var(--s-3); }
  .ex-head__lead { margin-top: var(--s-3); font-size: 15px; }
  .ex-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr 0.8fr; gap: 8px; }
  .ex-actions .bf-btn { padding-inline: 8px; gap: 6px; }
  .ex-actions .bf-btn svg { width: 16px; height: 16px; }
  .ex-scope { display: none; }
  .ex-main .bf-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ex-main .bf-tile { padding: 12px 10px 12px 16px; }
  .ex-main .bf-tile__value { font-size: 1.65rem; }
  .ex-main .bf-tile__label { letter-spacing: .08em; }
  .ex-toolbar { margin-top: var(--s-5); }
  .ex-cards, .ex-cards[data-n="4"] { grid-template-columns: minmax(0, 1fr); }
  .ex-scopebar { padding: 12px; }
  .ex-toolbar__lens { align-items: stretch; flex-direction: column; flex-wrap: nowrap; gap: 6px; }
  .ex-lens { width: calc(100% + var(--gutter) * 2); min-width: 0; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); }
  .ex-rel { grid-template-columns: minmax(0, 1fr); }
  .ex-full { flex-direction: column; align-items: flex-start; }
  .ex-row { grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; }
  .ex-row__img { width: 38px; height: 38px; }
  .ex-row__v { min-width: 60px; } .ex-row__v b { font-size: 18px; }
  .ex-rows--seq .ex-row--seq { grid-template-columns: 28px minmax(0, 1fr) auto; }
  .ex-step { font-size: 13px; padding-right: 8px; } .ex-step img { width: 28px; height: 28px; }
  .ex-plot { grid-template-columns: 38px minmax(0, 1fr); gap: 4px; }
  .ex-plot__y, .ex-hist, .ex-cum { height: 200px; }
  .ex-needs__in { padding: 44px var(--s-4) var(--s-4); }
  .ex-sentence { padding: 12px; }
}
.ex-sketch { padding: 12px 14px 14px; border: 1px dashed var(--line-3); background: var(--bg-2); }
.ex-sketch small { display: block; margin-bottom: 10px; font: 600 12px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.ex-sketch .ex-ghost--bars { gap: 6px; } .ex-sketch .ex-ghost--bars i { height: 10px; }
.ex-toolbar [data-mapnote] { margin-bottom: 0; }

/* ---- real build additions (no style="" attributes: dynamic values go through --custom properties set by bf.js) */
.ex-boot { padding-top: 48px; }
.ex-boot .bf-skel--card { margin-top: 24px; }
.ex-pv__wait .bf-skel--line { margin: 6px 0; }
.ex-saved__tool { grid-template-columns: minmax(0, 1fr); }
.ex-loading { display: block; }
.ex-loading .bf-skel--tile { margin-top: var(--s-4); }
.ex-loading .bf-skel--card { margin-top: var(--s-4); }
.ex-loading .bf-caption { margin-top: var(--s-3); }
.ex-error .bf-empty { padding-block: var(--s-4); }
.ex-ms-plus { margin: 0 4px; font: 700 14px/1 var(--display); color: var(--muted); }

/* build outcomes and sharing reuse the bar rows; threat changes pairs a before and an after bar */
.ex-rows--pair .ex-row--pair { grid-template-columns: minmax(0, 1fr) auto; align-items: start; padding: 12px 0; }
.ex-row--pair .ex-row__main { gap: 8px; }
.ex-pair { display: grid; grid-template-columns: 52px minmax(0, 1fr) 62px; align-items: center; gap: 8px; }
.ex-pair small { font: 600 12px/1 var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ex-pair b { font: 600 13px/1 var(--mono); color: var(--text-2); text-align: right; font-variant-numeric: tabular-nums; }
.ex-pair--after .ex-row__bar i { background: linear-gradient(90deg, #a87a1b, var(--amber)); }
.ex-row--pair .ex-row__v { padding-top: 2px; }

/* production mix: six lines over game time */
.ex-mix { display: block; }
.ex-mix svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ex-mix__l { fill: none; stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.ex-mix__l[data-s="combat"] { stroke: var(--cyan); } .ex-mix__l[data-s="static_defence"] { stroke: var(--red); } .ex-mix__l[data-s="economy"] { stroke: var(--amber); }
.ex-mix__l[data-s="factory"] { stroke: var(--pos-geo-sea); } .ex-mix__l[data-s="constructor"] { stroke: var(--pos-air); } .ex-mix__l[data-s="other"] { stroke: var(--muted); stroke-dasharray: 5 4; }
.ex-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px 20px; margin-top: var(--s-4); }
.ex-legend li { display: flex; align-items: center; gap: 10px; min-height: 28px; font-size: 14px; color: var(--text-2); }
.ex-legend i { flex: none; width: 18px; height: 4px; background: var(--muted); }
.ex-legend li[data-s="combat"] i { background: var(--cyan); } .ex-legend li[data-s="static_defence"] i { background: var(--red); } .ex-legend li[data-s="economy"] i { background: var(--amber); }
.ex-legend li[data-s="factory"] i { background: var(--pos-geo-sea); } .ex-legend li[data-s="constructor"] i { background: var(--pos-air); }
.ex-legend b { margin-left: auto; font: 600 13px/1 var(--mono); color: var(--text); }

/* two groups side by side in the group comparison: stacked, so each chart keeps its full width */
.ex-compare { display: grid; gap: var(--s-3); }
.ex-groups { display: grid; gap: var(--s-4); }
.ex-group-card .ex-chart__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); }
@media (max-width: 760px) { .ex-pair { grid-template-columns: 46px minmax(0, 1fr) 54px; } .ex-legend { grid-template-columns: minmax(0, 1fr); } }

/* the note for readers without scripts (inside <noscript>, so it never shows with scripts on) */
.ex-nojs { padding-top: 20px; padding-bottom: 4px; }
