/* ECMWF ensemble explorer: the MOGREPS-UK explorer's look, with a relief basemap, fronts and cyclones. */
:root {
  --bg: #f6f5f1; --surface: #ffffff; --ink: #1d1d1b; --ink2: #4a4945; --muted: #7a7873; --line: #dddbd4;
  --accent: #2a62c9; --sea: #dfe8ee; --coast: #3f3d38; --iso: #1d1d1b; --halo: #ffffff; --pick: #e8820c;
  --map-border: #6b6962; --map-state: #9a978f; --map-water: #5b7a90; --map-grid: rgba(0, 0, 0, .14);
  --nodata: rgba(120, 118, 112, .35); --fine: #2a62c9; --below: rgba(60, 50, 40, .55);
  --cold: #2a62c9; --warm: #d62f2f; --qs: #7a4fb8; --occl: #8a3fb8; --track: #1d1d1b;
  --stage0: #9a978f; --stage1: #1f9d55; --stage2: #e8a20c; --stage3: #d62f2f; --stage4: #7a4fb8;
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161615; --surface: #20201e; --ink: #ecebe6; --ink2: #c4c2bb; --muted: #8f8d87; --line: #3a3936;
    --accent: #6c9bf0; --sea: #1c2630; --coast: #d4d1c7; --iso: #f4f3ee; --halo: #161615; --pick: #ffa23a;
    --map-border: #aeaba2; --map-state: #7d7a73; --map-water: #6f93ad; --map-grid: rgba(255, 255, 255, .13);
    --nodata: rgba(10, 10, 10, .45); --fine: #6c9bf0; --below: rgba(235, 225, 210, .55);
    --cold: #5a9cf0; --warm: #ff6b5e; --qs: #b08be8; --occl: #c18ef0; --track: #f4f3ee;
    --stage0: #8f8d87; --stage1: #49c97c; --stage2: #ffc23a; --stage3: #ff6b5e; --stage4: #b08be8;
  }
}
:root[data-theme="dark"] {
  --bg: #161615; --surface: #20201e; --ink: #ecebe6; --ink2: #c4c2bb; --muted: #8f8d87; --line: #3a3936;
  --accent: #6c9bf0; --sea: #1c2630; --coast: #d4d1c7; --iso: #f4f3ee; --halo: #161615; --pick: #ffa23a;
  --map-border: #aeaba2; --map-state: #7d7a73; --map-water: #6f93ad; --map-grid: rgba(255, 255, 255, .13);
  --nodata: rgba(10, 10, 10, .45); --fine: #6c9bf0; --below: rgba(235, 225, 210, .55);
  --cold: #5a9cf0; --warm: #ff6b5e; --qs: #b08be8; --occl: #c18ef0; --track: #f4f3ee;
  --stage0: #8f8d87; --stage1: #49c97c; --stage2: #ffc23a; --stage3: #ff6b5e; --stage4: #b08be8;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
body { display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; padding: 8px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.top h1 { font-size: 1.05rem; margin: 0; white-space: nowrap; }
.grow { flex: 1; }
.theme { white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .8rem; margin: 6px 0 0; }
kbd { font: .75rem ui-monospace, Menlo, monospace; border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 4px; padding: 0 4px; background: var(--bg); color: var(--ink2); }

/* the explorer's sections */
.apptabs { display: flex; gap: 2px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.apptabs a { padding: 3px 11px; border-radius: 6px; font-size: .86rem; color: var(--ink2); text-decoration: none; white-space: nowrap; }
.apptabs a[href]:hover { background: var(--surface); color: var(--ink); }
.apptabs a.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
.apptabs a.soon { color: var(--muted); opacity: .6; cursor: default; }
a.button { font-size: .88rem; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
  padding: 4px 9px; text-decoration: none; }
a.button:hover { border-color: var(--muted); }

.app { flex: 1; min-height: 0; display: grid; grid-template-columns: 300px minmax(0, 1fr); }
.side { overflow-y: auto; padding: 12px; border-right: 1px solid var(--line); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.panel h2 { font-size: .9rem; margin: 0 0 8px; }
.panel label { display: flex; flex-direction: column; gap: 3px; font-size: .8rem; color: var(--ink2); margin-bottom: 8px; }
.panel label.check { flex-direction: row; align-items: center; gap: 6px; margin-bottom: 4px; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
.check input { accent-color: var(--accent); margin: 0; }
select, input[type=number], button {
  font: inherit; font-size: .88rem; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; padding: 4px 7px; min-height: 30px; }
input[type=range] { accent-color: var(--accent); }
button { cursor: pointer; }
button:hover, select:hover { border-color: var(--muted); }
.h2row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.h2row h2 { margin: 0; }
button.link { font-size: .78rem; min-height: 26px; padding: 2px 8px; border-radius: 13px; }
button.link[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.modes { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 8px; }
.modes button { text-align: left; }
.modes button[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); font-weight: 600; }
.row { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.row input { width: 90px; }

.legend { display: flex; flex-direction: column; gap: 2px; }
.legend .sw { display: flex; height: 14px; border-radius: 3px; overflow: hidden; }
.legend .sw span { flex: 1; }
.legend .lab { position: relative; height: 16px; font-size: .72rem; color: var(--ink2); font-variant-numeric: tabular-nums; }
.legend .lab span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
i.hatch { display: inline-block; width: 18px; height: 11px; vertical-align: middle; border: 1px solid var(--line);
  background: repeating-linear-gradient(-45deg, var(--below) 0 1.5px, transparent 1.5px 5px); }
i.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: middle; margin-right: 4px; }

.mapcol { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.map { position: relative; flex: 1; min-height: 0; overflow: hidden; background: var(--sea); }
.map canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.map canvas.dragging { cursor: grabbing; }
.zoom { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 4px; }
.zoom button { width: 32px; height: 32px; padding: 0; background: var(--surface); }
/* the compact legend in the map's lower right corner */
.maplegend { position: absolute; right: 10px; bottom: 22px; z-index: 3; width: 230px; max-height: calc(100% - 300px);
  overflow: auto; background: color-mix(in srgb, var(--surface) 90%, transparent); border: 1px solid var(--line);
  border-radius: 6px; padding: 4px 9px 2px; font-size: .74rem; box-shadow: 0 1px 6px rgba(0, 0, 0, .12); }
.maplegend.folded { width: auto; padding: 0; }
.ml-fold { display: flex; align-items: center; gap: 5px; width: 100%; background: none; border: 0; padding: 2px 0 4px;
  font: 600 .74rem system-ui, sans-serif; color: var(--ink2); }
.ml-fold::after { content: "▾"; margin-left: auto; }
.maplegend.folded .ml-fold { padding: 5px 9px; }
.maplegend.folded .ml-fold::after { content: "▸"; }
.maplegend.folded .ml-body { display: none; }
.ml-block { margin-bottom: 5px; }
.ml-block h4 { margin: 0 0 2px; font-size: .72rem; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml-block h4 span { color: var(--muted); }
.ml-block .legend .sw { height: 9px; }
.ml-block .legend .lab { height: 13px; font-size: .66rem; }
.ml-body .key, .ml-body p { margin: 2px 0 5px; font-size: .7rem; }
.status { position: absolute; left: 10px; bottom: 22px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 6px; padding: 4px 8px; font: .75rem ui-monospace, Menlo, monospace; color: var(--ink2); max-width: calc(100% - 270px); }
.status:empty { display: none; }
.tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--line);
  border-radius: 6px; padding: 5px 8px; font-size: .8rem; line-height: 1.35; white-space: nowrap; z-index: 4;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .15); font-variant-numeric: tabular-nums; }
.empty { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; color: var(--ink2); pointer-events: none; }

.timebar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line); }
.timebar input[type=range] { flex: 1; min-width: 80px; }
.timebar button { min-width: 34px; }
.when { display: flex; flex-direction: column; min-width: 14em; font-variant-numeric: tabular-nums; }
.when span { font-size: .78rem; }
.badge { font-size: .74rem; padding: 2px 8px; border-radius: 10px; border: 1px solid var(--line); white-space: nowrap; cursor: help; }
.badge.fine { border-color: var(--fine); color: var(--fine); }
.badge.coarse { color: var(--muted); }

/* layers */
.setup-row select { flex: 1; min-width: 0; }
.setup-row button, #setup-form button { white-space: nowrap; }
#setup-form input[type=text] { flex: 1; min-width: 0; width: auto; font: inherit; font-size: .88rem; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 6px; padding: 4px 7px; min-height: 30px; }
#setup-form label.check:has(input:disabled) { opacity: .55; }
.cond2 { border-left: 3px solid var(--accent); padding: 6px 0 2px 8px; margin: 0 0 8px; }
.cond2 .row { margin-bottom: 6px; }
.cond2 select[data-k="and-join"] { flex: 0 0 auto; width: auto; }
.cond2 select[data-k="and-f"] { flex: 1 1 auto; min-width: 0; width: 0; }
.cond2-add { margin: 0 0 8px; }
/* "?" explanations (helptips.js) */
.help-q { min-height: 0; width: 17px; height: 17px; padding: 0; margin: 0 6px; border-radius: 50%; font-size: .68rem; font-weight: 700;
  line-height: 1; color: var(--muted); background: transparent; border: 1px solid var(--line); vertical-align: 2px; }
.help-q:hover, .help-q[aria-expanded="true"] { color: #fff; background: var(--accent); border-color: var(--accent); }
.help-pop { position: fixed; z-index: 50; background: var(--surface); color: var(--ink2); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 11px; font-size: .8rem; line-height: 1.45; box-shadow: 0 6px 20px rgba(0, 0, 0, .22); }
.help-pop a { color: var(--accent); white-space: nowrap; }
.setup-tools { flex-wrap: wrap; gap: 6px; margin: 8px 0 0; align-items: center; }
.setup-tools input[type=checkbox] { width: auto; }
#setup-imp-btns { margin: 0; }
.setup-tools button { font-size: .8rem; min-height: 26px; padding: 2px 8px; white-space: nowrap; }
.setup-tools label.check { margin: 0; flex: 1; min-width: 12em; font-size: .78rem; }
.setup-tools label.check:has(input:disabled) { opacity: .55; }
.setup-pop { margin-top: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg);
  display: flex; flex-wrap: wrap; gap: 6px; }
.setup-pop[hidden] { display: none; }
.setup-pop button { font-size: .8rem; min-height: 26px; padding: 2px 8px; }
.setup-pop p { margin: 0 0 2px; font-size: .78rem; color: var(--ink2); line-height: 1.4; overflow-wrap: anywhere; }
button.add { font-size: .8rem; min-height: 26px; padding: 2px 9px; border-radius: 13px; border-color: var(--accent); color: var(--accent); }
.layers { display: flex; flex-direction: column; gap: 6px; }
.layers:empty::before { content: "No layers yet: add one, or pick a saved setup."; color: var(--muted); font-size: .8rem; }
.layer { border: 1px solid var(--line); border-radius: 7px; background: var(--bg); }
.layer.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.layer.drag-over { border-top: 3px solid var(--accent); }
.layer.off .lname { opacity: .5; }
.layer.na .lname { opacity: .45; font-style: italic; }
.dev { display: inline-block; margin-left: 4px; padding: 0 4px; border-radius: 3px; font-size: .62rem; font-weight: 700;
       letter-spacing: .04em; text-transform: uppercase; vertical-align: 1px; background: #e8820c; color: #fff; font-style: normal; }
.lhead { display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 2px; cursor: pointer; }
.lhead .grip { cursor: grab; color: var(--muted); padding: 0 3px; user-select: none; font-size: .85rem; }
.lhead input[type=checkbox] { margin: 0 2px; accent-color: var(--accent); }
.lname { flex: 1; min-width: 0; font-size: .8rem; line-height: 1.25; }
.lname b { font-weight: 600; }
.lname .ltype { color: var(--muted); }
.lhead button { min-height: 24px; min-width: 24px; padding: 0 4px; font-size: .78rem; background: transparent; border-color: transparent; color: var(--ink2); }
.lhead button:hover { border-color: var(--line); }
.lhead button.chain[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.lbody { padding: 4px 8px 8px; border-top: 1px solid var(--line); }
.lbody label { display: flex; flex-direction: column; gap: 3px; font-size: .78rem; color: var(--ink2); margin-bottom: 7px; }
.lbody .two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 6px; }
.lbody select, .lbody input[type=text] { min-width: 0; width: 100%; }
.lbody input[type=text] { font: inherit; font-size: .85rem; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; padding: 4px 7px; min-height: 30px; }
.lbody .row { margin-bottom: 7px; }
.lbody .row input[type=number] { width: 80px; }
.lbody .modes { flex-direction: row; flex-wrap: wrap; }
.lbody .modes button { flex: 1 1 45%; font-size: .78rem; padding: 3px 5px; }
.lbody .linked-hint { font-size: .74rem; color: var(--accent); margin: 0 0 6px; }
.lbody details { font-size: .78rem; margin-top: 2px; }
.lbody summary { cursor: pointer; color: var(--ink2); margin-bottom: 6px; }
.legend-block { margin-bottom: 10px; }
.legend-block h3 { font-size: .78rem; margin: 0 0 4px; font-weight: 600; color: var(--ink2); }

.lbody .hint, .hint { font-size: .74rem; color: var(--muted); margin: -2px 0 7px; }
.row-tight { display: flex; gap: 6px; }

/* member viewer */
.stamps { position: absolute; inset: 0; z-index: 3; overflow: auto; background: var(--bg); padding: 10px;
  display: grid; gap: 6px; justify-content: center; align-content: start; }
.stamp { margin: 0; cursor: pointer; border-radius: 4px; }
.stamps .stamp canvas { position: static; display: block; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; }
.stamps .stamp:hover canvas { border-color: var(--accent); }
.stamp figcaption { font-size: .72rem; color: var(--ink2); text-align: center; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; font-variant-numeric: tabular-nums; height: 16px; }

/* side panel: point, box, cyclone */
:root { --t-lower: #2a78d6; --t-middle: #8a8882; --t-upper: #eb6834; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --t-lower: #5a9cf0; --t-middle: #b3b1aa; --t-upper: #ff8a52; }
}
:root[data-theme="dark"] { --t-lower: #5a9cf0; --t-middle: #b3b1aa; --t-upper: #ff8a52; }
:root {
  --sk-grid: #e4e2db; --member: rgba(70, 70, 70, .38); --band: rgba(42, 98, 201, .16); --median: #1d1d1b; --mean: #2a62c9;
  --now: #e8820c; --other: rgba(120, 118, 112, .16); --other-line: #8a8882; --coarse-band: rgba(120, 118, 112, .08);
  --below-band: rgba(120, 90, 50, .12);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sk-grid: #34332f; --member: rgba(220, 218, 210, .32); --band: rgba(108, 155, 240, .22); --median: #f4f3ee; --mean: #6c9bf0;
    --now: #ffa23a; --other: rgba(200, 198, 190, .14); --other-line: #a3a19a; --coarse-band: rgba(255, 255, 255, .05);
    --below-band: rgba(230, 200, 150, .12);
  }
}
:root[data-theme="dark"] {
  --sk-grid: #34332f; --member: rgba(220, 218, 210, .32); --band: rgba(108, 155, 240, .22); --median: #f4f3ee; --mean: #6c9bf0;
  --now: #ffa23a; --other: rgba(200, 198, 190, .14); --other-line: #a3a19a; --coarse-band: rgba(255, 255, 255, .05);
  --below-band: rgba(230, 200, 150, .12);
}
/* with the side panel open, the map and the panel share the width; dragging the panel's left edge sets --side-w */
.app.with-side { grid-template-columns: 300px minmax(0, 1.25fr) var(--side-w, minmax(440px, 1fr)); }
.sidepanel { position: relative; overflow-y: auto; padding: 10px 12px; border-left: 1px solid var(--line); }
.sidepanel.edge { cursor: col-resize; box-shadow: inset 3px 0 0 var(--accent); }
body.resizing { cursor: col-resize; user-select: none; }
body.resizing canvas { pointer-events: none; }
.ph { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 8px; }
.ph span { font-size: .82rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; }
.card h3 { font-size: .88rem; margin: 0 0 6px; }
.small-inline { font-weight: 400; font-size: .76rem; }
.ch { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ch h3 { margin: 0; }
canvas.plume { width: 100%; height: clamp(170px, 11vw, 260px); display: block; cursor: pointer; }
.key { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .74rem; color: var(--ink2); margin: 4px 0 6px; }
.key i { display: inline-block; width: 14px; height: 3px; vertical-align: middle; margin-right: 4px; border-radius: 2px; }
.key i.dot { width: 9px; height: 9px; border-radius: 50%; }
.key i.qs { background: repeating-linear-gradient(90deg, var(--warm) 0 4px, var(--cold) 4px 8px); }
.key i.dashed { background: repeating-linear-gradient(90deg, var(--ink) 0 5px, transparent 5px 8px); }
table.nums { width: 100%; border-collapse: collapse; font-size: .76rem; font-variant-numeric: tabular-nums; margin-top: 6px; }
table.nums th, table.nums td { text-align: right; padding: 2px 4px; border-bottom: 1px solid var(--line); }
table.nums th:first-child, table.nums td:first-child { text-align: left; }
table.nums th { color: var(--muted); font-weight: 500; }
.stagebar { display: flex; height: 18px; border-radius: 4px; overflow: hidden; margin: 6px 0 2px; font-size: .72rem; }
.stagebar span { display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; min-width: 14px; }
#cy-summary p { margin: 4px 0; font-size: .82rem; }
@media (max-width: 1300px) {
  .app.with-side { grid-template-columns: 260px minmax(0, 1fr) var(--side-w, 420px); }
}
/* narrower: the side panel slides over the map instead of squeezing it */
@media (max-width: 1100px) {
  .app { position: relative; }
  .app.with-side { grid-template-columns: 260px minmax(0, 1fr); }
  .sidepanel { position: absolute; right: 0; top: 0; bottom: 0; width: min(var(--side-w, 460px), 100%); z-index: 5;
    background: var(--bg); box-shadow: -6px 0 20px rgba(0, 0, 0, .25); }
  .keys { display: none; }
}
@media (max-width: 760px) {
  .app, .app.with-side { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .side { max-height: 40vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .when { min-width: 0; }
  .top { padding: 8px 12px; }
  #store { display: none; }
}

/* box tool and the side panel's tabs */
.zoom button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.map canvas.boxing { cursor: crosshair; }
.ph .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs { display: flex; gap: 2px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 2px; flex: none; }
.tabs button { border: 0; background: transparent; min-height: 26px; padding: 2px 12px; border-radius: 6px; color: var(--ink2); }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
.pane-hint { margin: 16px 4px; font-size: .85rem; }
.spec { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 2px 8px; margin: 6px 0 4px; }
.spec label { display: flex; flex-direction: column; gap: 2px; font-size: .76rem; color: var(--ink2); margin-bottom: 4px; min-width: 0; }
.spec .wide { grid-column: 1 / -1; }
.spec select, .spec button { width: 100%; min-width: 0; font-size: .82rem; }
.spec .row-tight select { width: auto; min-width: 54px; flex: none; }
.spec .row-tight input { width: 100%; min-width: 0; font: inherit; font-size: .82rem; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; min-height: 30px; }
.spec button[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); font-weight: 600; }
.axes2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.axes2 h4 { margin: 4px 0 0; font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.axes2 .spec { grid-template-columns: 1fr; }
.seg { display: flex; gap: 0; }
.seg button { border-radius: 0; font-size: .78rem; min-height: 26px; padding: 2px 9px; }
.seg button:first-child { border-radius: 6px 0 0 6px; }
.seg button:last-child { border-radius: 0 6px 6px 0; border-left: 0; }
.seg button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
canvas.strip { width: 100%; height: 110px; display: block; margin: 4px 0 6px; }
canvas.scatter { width: 100%; height: clamp(300px, 24vw, 520px); display: block; margin-top: 6px; }
.scatter-text { font-size: .8rem; font-variant-numeric: tabular-nums; }
.scatter-text p { margin: 4px 0; }
.scatter-text .yes { color: var(--stage1); }
.scatter-text .no { color: var(--muted); }
#box-table td:nth-child(5) { color: var(--ink2); }
button:disabled { opacity: .45; cursor: default; }

/* the thirds map in the Box tab */
.thirds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0; }
.thirds button { display: block; text-align: left; padding: 6px 8px; border-radius: 6px; font-size: .82rem; line-height: 1.3; }
.thirds button span { display: block; color: var(--muted); font-size: .74rem; font-variant-numeric: tabular-nums; }
.thirds button i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.thirds button[aria-selected="true"] { border-color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.minimap { position: relative; }
.minimap canvas { width: 100%; aspect-ratio: 1 / .95; display: block; border-radius: 6px; border: 1px solid var(--line); cursor: crosshair; }
.mini-zoom { position: absolute; top: 8px; right: 8px; display: flex; flex-direction: column; gap: 4px; }
.mini-zoom button { width: 28px; height: 28px; padding: 0; font-size: 1rem; }
.minimap .tip { position: absolute; pointer-events: none; }
#tm-legend { margin-top: 8px; }
#open-compare { margin-top: 2px; }

/* projection */
.proj { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; font-size: .85rem; }
.lon0in { display: flex; align-items: center; gap: 4px; color: var(--ink2); }
#lon0 { width: 5.5em; }
.lon0s { margin-top: 6px; flex-wrap: wrap; }
.lon0s button { font-size: .75rem; padding: 2px 6px; }

/* export */
.export { position: absolute; right: 50px; top: 10px; z-index: 4; width: 260px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; box-shadow: 0 4px 16px rgba(0,0,0,.18);
  display: flex; flex-direction: column; gap: 6px; font-size: .85rem; }
.export[hidden] { display: none; }
.export h3 { font-size: .9rem; margin: 0; }
.export h4 { margin: 6px 0 0; font-size: .8rem; color: var(--ink2); }
.export label { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.export select { max-width: 170px; }
.export .two { display: flex; gap: 8px; }
.export .row { display: flex; align-items: center; gap: 8px; }
.chart-png { position: absolute; z-index: 3; font-size: .72rem; padding: 2px 6px; transform: translateX(-30px);
  background: var(--surface); opacity: .9; }
.chart-png[hidden] { display: none; }
