/* GBS-18: only the mounted, non-embedded Explorer. Chart colours and marks are unchanged. */
html.explorer-mounted:not(.embed) .explorer-shell {
  width: min(100% - 48px, 1540px);
  margin: 0 auto;
  padding: 16px 0 48px;
  overflow-wrap: anywhere;
}
html.explorer-mounted:not(.embed) .explorer-heading { margin-bottom: 12px; }
html.explorer-mounted:not(.embed) .explorer-heading h1 { font-family: var(--font-sans); font-size: 1.3rem; line-height: 1.3; margin: 0; }
html.explorer-mounted:not(.embed) .explorer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-block: 1px solid var(--ink-2); padding: 10px 0; margin-bottom: 20px; }
html.explorer-mounted:not(.embed) .explorer-views { display: flex; flex-wrap: wrap; gap: 4px; }
html.explorer-mounted:not(.embed) .explorer-views a { display: flex; align-items: center; min-height: 44px; padding: 8px 14px; color: var(--ink); border: 1px solid transparent; border-radius: 4px; font-weight: 650; text-decoration: none; }
html.explorer-mounted:not(.embed) .explorer-views a:hover { background: var(--surface-2); border-color: var(--ink-2); }
html.explorer-mounted:not(.embed) .explorer-views a[aria-current] { color: var(--surface); background: var(--ink); }
html.explorer-mounted:not(.embed) .explorer-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
html.explorer-mounted:not(.embed) .explorer-export-status { flex-basis: 100%; max-width: 45ch; font-size: .9rem; }
html.explorer-mounted:not(.embed) .explorer-export-status:empty { display: none; }
html.explorer-mounted:not(.embed) .explorer-workspace { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
html.explorer-mounted:not(.embed) :is(.explorer-figures, .explorer-view, .explorer-settings, .explorer-advanced) { min-width: 0; }
html.explorer-mounted:not(.embed) .explorer-view > .figure { margin: 0; }
html.explorer-mounted:not(.embed) .explorer-view[hidden="until-found"] { border: 0; margin: 0; padding: 0; }
html.explorer-mounted:not(.embed) .explorer-view .figure-title { font-size: 1.6rem; }
html.explorer-mounted:not(.embed) .explorer-view .figure-subtitle { font-size: .95rem; }
html.explorer-mounted:not(.embed) .explorer-measure-note { margin: 4px 0 0; border: 0; padding: 0; }
html.explorer-mounted:not(.embed) .explorer-measure-note > summary { font-size: .9rem; color: var(--ink-2); }
/* Log-range bands retain their original group hues, endpoints and open/filled markers. */
html.explorer-mounted:not(.embed) .explorer-shell #rank-chart .row-hit > line[stroke-width="4"] { opacity: .7; }
html.explorer-mounted:not(.embed) .explorer-view .tabs { flex-wrap: wrap; overflow: visible; padding-block: 2px; }
html.explorer-mounted:not(.embed) .explorer-view .tab { white-space: normal; }
html.explorer-mounted:not(.embed) .explorer-settings { margin: 0; border: 1px solid var(--ink-2); border-radius: 8px; background: var(--surface-2); }
html.explorer-mounted:not(.embed) .explorer-settings > summary { padding: 12px 16px; font-weight: 700; }
html.explorer-mounted:not(.embed) .explorer-settings > .more-body { padding: 0; margin: 0; }
html.explorer-mounted:not(.embed) #assumptions-card { margin: 0; border: 0; border-radius: 8px; background: transparent; }
html.explorer-mounted:not(.embed) #assumptions-card .figure-body { padding: 16px; }
html.explorer-mounted:not(.embed) #explorer-settings-title { font-family: var(--font-sans); font-size: 1.1rem; margin: 0 0 12px; }
html.explorer-mounted:not(.embed) #assumptions-card .controls { display: block; padding: 0; margin-bottom: 20px; }
html.explorer-mounted:not(.embed) #assumptions-card .control { margin-bottom: 14px; }
html.explorer-mounted:not(.embed) #assumptions-card .control-label { font-size: .8rem; color: var(--ink-2); font-weight: 650; }
html.explorer-mounted:not(.embed) #ctl-metric { display: grid; width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); border-color: var(--ink-2); }
html.explorer-mounted:not(.embed) #ctl-metric button { border-bottom: 1px solid var(--ink-2); padding: 8px; text-align: start; overflow-wrap: anywhere; }
html.explorer-mounted:not(.embed) #ctl-metric button:nth-child(2n) { border-right: 0; }
html.explorer-mounted:not(.embed) #ctl-metric button:nth-last-child(-n + 2) { border-bottom: 0; }
html.explorer-mounted:not(.embed) #ctl-scope { display: grid; gap: 6px; }
html.explorer-mounted:not(.embed) #ctl-scope .chip { width: 100%; border-radius: 4px; text-align: left; font-size: .9rem; padding: 8px 10px; color: var(--ink); background: var(--surface); }
html.explorer-mounted:not(.embed) #ctl-scope .chip::after { content: ''; width: 18px; height: 18px; border: 1.5px solid var(--ink-2); border-radius: 2px; margin-left: auto; flex: none; line-height: 15px; text-align: center; font-size: 14px; }
html.explorer-mounted:not(.embed) #ctl-scope .chip[aria-pressed="true"]::after { content: '✓'; color: var(--surface); background: var(--ink); border-color: var(--ink); }
html.explorer-mounted:not(.embed) #ctl-scope .swatch { width: 12px; height: 12px; }
html.explorer-mounted:not(.embed) #ctl-scale { display: flex; border-color: var(--ink-2); }
html.explorer-mounted:not(.embed) #ctl-scale button { flex: 1; }
html.explorer-mounted:not(.embed) .explorer-shell :is(.btn, .btn-link, .tab, .chip, .seg button, select, summary, .check) { min-height: 44px; }
html.explorer-mounted:not(.embed) .explorer-shell :is(.btn, select, input[type="number"], .seg) { border-color: var(--ink-2); }
html.explorer-mounted:not(.embed) .explorer-shell :is(button, select, a, summary):focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
html.explorer-mounted:not(.embed) .explorer-shell .seg button:focus-visible { outline-offset: -3px; }
html.explorer-mounted:not(.embed) .explorer-shell :is(.btn, .btn-link) { white-space: normal; }
html.explorer-mounted:not(.embed) .explorer-settings-done { display: flex; margin-top: 14px; }
#custom-pain-form { max-width: 28rem; margin-block-start: .25rem; }
#custom-pain-form .chart-note { margin: .45rem 0; }
.custom-pain-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 7rem), 1fr)); gap: .45rem .75rem; }
.custom-pain-fields label { display: grid; gap: .2rem; font-size: .9rem; }
.custom-pain-fields input[type="number"] { width: 100%; min-width: 0; min-height: 44px; }
#custom-pain-status:empty { margin: 0; }
html.explorer-mounted:not(.embed) .explorer-advanced { margin-top: 24px; padding: 16px 20px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 8px; }
html.explorer-mounted:not(.embed) .explorer-advanced #assumptions-panel { border: 0; background: transparent; padding: 0; margin: 0; }
html.explorer-mounted:not(.embed) .explorer-context { margin-top: 24px; }
html.explorer-mounted:not(.embed) .explorer-context .wrap { width: 100%; padding-inline: 0; }
html.explorer-mounted:not(.embed) .explorer-context :is(.section, .hero) { padding-block: 20px; }
html.explorer-mounted:not(.embed) .explorer-context #explore .section-head { display: none; }
html.explorer-mounted:not(.embed) .explorer-context #attention { display: none; }
html.explorer-mounted:not(.embed) .explorer-notices > p:not([hidden]):not(.visually-hidden) { margin: 0 0 16px; }
html.explorer-mounted:not(.embed) .explorer-funding-note { margin: 0 0 12px; }

@media (min-width: 70em) {
  html.explorer-mounted:not(.embed) .explorer-workspace { grid-template-columns: 21rem minmax(0, 1fr); gap: 24px; }
  html.explorer-mounted:not(.embed) .explorer-figures { grid-column: 2; grid-row: 1; }
  html.explorer-mounted:not(.embed) .explorer-settings { grid-column: 1; grid-row: 1; position: sticky; top: calc(var(--header-h, 64px) + 16px); max-height: calc(100dvh - var(--header-h, 64px) - 32px); overflow-y: auto; scrollbar-gutter: stable; }
  html.explorer-mounted:not(.embed) .explorer-settings > summary,
  html.explorer-mounted:not(.embed) .explorer-settings-done { display: none; }
}
@media (max-width: 699px) {
  html.explorer-mounted:not(.embed) .explorer-shell { width: calc(100% - 24px); padding-top: 16px; }
  html.explorer-mounted:not(.embed) .explorer-toolbar { gap: 10px; }
  html.explorer-mounted:not(.embed) .explorer-views { width: 100%; }
  html.explorer-mounted:not(.embed) .explorer-views a { padding-inline: 10px; }
  html.explorer-mounted:not(.embed) .explorer-view :is(.figure-head, .figure-body, .figure-foot) { padding-inline: 12px; }
  html.explorer-mounted:not(.embed) .explorer-advanced { padding: 12px; }
}
@media (max-width: 24em) {
  html.explorer-mounted:not(.embed) #ctl-metric { grid-template-columns: minmax(0, 1fr); }
  html.explorer-mounted:not(.embed) #ctl-metric button { border-right: 0; border-bottom: 1px solid var(--ink-2); }
  html.explorer-mounted:not(.embed) #ctl-metric button:nth-last-child(2) { border-bottom: 1px solid var(--ink-2); }
  html.explorer-mounted:not(.embed) #ctl-metric button:last-child { border-bottom: 0; }
}
@media print {
  html.explorer-mounted:not(.embed) .explorer-shell { width: 100%; }
  html.explorer-mounted:not(.embed) .explorer-workspace { display: block; }
  html.explorer-mounted:not(.embed) :is(.explorer-toolbar, .explorer-settings) { display: none; }
}

.explorer-comparison h3 { margin: 0 0 .5rem; color: var(--ink); }
.explorer-comparison > label { display: block; margin-bottom: .35rem; }
.explorer-comparison select { max-width: 100%; }
.explorer-comparison .group-share-result { margin-top: 1.25rem; }
.explorer-comparison .explorer-group-total { margin: .5rem 0 1.25rem; }
.explorer-group-total strong { font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.15; font-variant-numeric: tabular-nums; }
.explorer-comparison .log-rows { gap: 12px; margin-block: 1rem; }
.explorer-comparison .lr-band { background: var(--row-colour); opacity: .7; }
.explorer-comparison .lr-dot { background: var(--row-colour); }
.explorer-comparison .table-wrap { margin-block: 1rem; }
.explorer-comparison table.data :is(th, td.num) { white-space: normal; }
.explorer-comparison tbody th { position: static; }
#fig-rank:has(.tab[data-tab="groups"][aria-selected="true"]) #rank-foot .figure-note { display: none; }
#fig-share:has(.tab[data-tab="compare"][aria-selected="true"]) > :is(.figure-head, .figure-foot) { display: none; }
