/* Joiner — palette and type, shared with burritojustice/block-party */
:root {
  --ink: #1E2340;
  --ink-soft: #545B7F;
  --paper: #F4F7FF;
  --card: #FFFFFF;
  --line: #D6DCF0;
  --pink: #FF3D7F;
  --sun: #FFC53D;
  --grape: #6D4AF5;
  --grape-wash: #EEE9FF;
  --pick: #00A862;          /* selected area, matches CONFIG.highlight */
  --pick-wash: #E2F5EA;
  --nodata: #F0EFEC;
  --radius: 14px;
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Figtree", "Avenir Next", "Segoe UI", system-ui, sans-serif;
}
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--body); font-size: 15px; line-height: 1.45; color: var(--ink); background: var(--paper); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--grape); outline-offset: 2px; }

.app {
  display: grid; height: 100vh; height: 100dvh;
  grid-template-columns: 360px 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas: "bar bar" "panel map";
}

/* ── top bar ─────────────────────────────────────────── */
.bar {
  grid-area: bar; display: flex; align-items: center; gap: 18px;
  padding: 8px 16px; background: var(--card); border-bottom: 2px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); flex: none; }
.brand span { font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -0.01em; }
.brand img { border-radius: 50%; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.tab {
  display: inline-flex; align-items: center; gap: 6px;
  border: 2px solid transparent; background: none; border-radius: 999px;
  padding: 5px 14px; font-weight: 600; cursor: pointer; color: var(--ink-soft);
}
.tab:hover { color: var(--ink); background: var(--paper); }
.tab[aria-selected="true"] { color: #fff; background: var(--ink); }
.tab select {
  border: 0; background: transparent; font-weight: 600; color: inherit; cursor: pointer;
  padding: 0 2px; max-width: 220px;
}
/* A tab with several sets: the set's name and a triangle, with the native select laid over it. */
.tab.menu { position: relative; }
.tab.menu .tri { font-size: 11px; margin-left: -1px; opacity: .8; }
.tab.menu select { position: absolute; inset: 0; width: 100%; max-width: none; opacity: 0; cursor: pointer; }
.tab[aria-selected="true"] select option { color: var(--ink); }
.bar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.version { font-size: 12px; color: var(--ink-soft); text-decoration: none; font-variant-numeric: tabular-nums; }
.version:hover { color: var(--grape); text-decoration: underline; }
.source-chip {
  font-size: 13px; color: var(--ink-soft); background: var(--paper);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px;
  max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.btn {
  border: 2px solid var(--ink); background: var(--sun); border-radius: 999px;
  padding: 5px 14px; font-weight: 700; cursor: pointer; box-shadow: 0 2px 0 var(--ink);
}
.btn:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--ink); }
.btn.ghost { background: var(--card); }
.btn:disabled { opacity: .45; cursor: default; box-shadow: none; }

/* ── side panel ──────────────────────────────────────── */
.panel {
  grid-area: panel; overflow-y: auto; display: flex; flex-direction: column;
  border-right: 2px solid var(--line); background: var(--paper);
}
.card {
  margin: 12px 12px 0; padding: 12px 14px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.card.empty h2 { font-family: var(--display); font-weight: 800; font-size: 22px; margin: 0 0 6px; }
.card.empty p { margin: 0 0 8px; }
.card.empty ul { margin: 0 0 8px; padding-left: 18px; }
.card.empty code { font-size: 13px; background: var(--paper); padding: 0 4px; border-radius: 4px; }
.linkish { border: 0; background: none; padding: 0; color: var(--grape); font-weight: 600; text-decoration: underline; cursor: pointer; }
.hint { font-size: 13px; color: var(--ink-soft); margin: 4px 0 0; }
.field { margin-bottom: 10px; }
.field label { display: block; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 3px; }
.field select { width: 100%; padding: 6px 8px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); }
.match { font-size: 14px; }
.match b { font-variant-numeric: tabular-nums; }
.match .bar-track { height: 6px; border-radius: 3px; background: var(--nodata); margin: 4px 0 2px; overflow: hidden; }
.match .bar-fill { height: 100%; background: var(--ink); border-radius: 3px; }
.unmatched { margin-top: 8px; font-size: 13px; }
.unmatched summary { cursor: pointer; color: var(--ink-soft); font-weight: 600; }
.unmatched ul { list-style: none; margin: 6px 0 0; padding: 0; max-height: 160px; overflow: auto; }
.unmatched li { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; border-bottom: 1px solid var(--paper); }
.unmatched li span:last-child { color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.list-card { flex: 1 0 280px; min-height: 280px; display: flex; flex-direction: column; margin: 12px 12px 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.list-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 10px 14px 6px; }
.list-head h3 { margin: 0; min-width: 0; font-family: var(--display); font-weight: 800; font-size: 17px; line-height: 1.25; overflow-wrap: anywhere; }
.list-head .seg { margin-top: 1px; }
.seg { display: inline-flex; flex: none; align-self: flex-start; border: 1.5px solid var(--ink); border-radius: 999px; overflow: hidden; }   /* never squished or stretched by a wrapping neighbor */
.seg button { border: 0; background: none; font-size: 12.5px; font-weight: 600; padding: 3px 10px; cursor: pointer; white-space: nowrap; }
.seg button + button { border-left: 1.5px solid var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.area-list { list-style: none; margin: 0; padding: 0 6px 8px; overflow: auto; flex: 1; }
.area-list li {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center;
  padding: 5px 8px; border-radius: 8px; cursor: pointer;
}
.area-list li:hover, .area-list li.hover { background: var(--paper); }
.area-list li.selected { background: var(--pick-wash); box-shadow: inset 4px 0 0 var(--pick); }
.area-list .caret { display: inline-block; width: 1em; color: var(--ink-soft); font-size: 11px; }
.area-list li.open { background: var(--pick-wash); }
.area-list .items { grid-column: 1 / -1; list-style: none; margin: 4px 0 2px; padding: 4px 0 2px 14px; border-left: 2px solid var(--line); max-height: 320px; overflow: auto; }
.area-list .items li { display: flex; justify-content: space-between; gap: 10px; padding: 2px 6px; border-radius: 6px; font-size: 13px; cursor: default; }
.area-list .items li.has-loc { cursor: pointer; }
.area-list .items li.has-loc:hover { background: var(--card); }
.area-list .items li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.area-list .items .iv { font-variant-numeric: tabular-nums; font-weight: 600; flex: none; }
.area-list .items li.none { color: var(--ink-soft); font-style: italic; }
.area-list .nm small { font-weight: 500; color: var(--ink-soft); }
.area-list .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.area-list .v { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; }
.area-list .sw { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--nodata); overflow: hidden; }
.area-list .sw i { display: block; height: 100%; border-radius: 2px; }
.area-list li.zero .nm, .area-list li.zero .v { color: var(--ink-soft); font-weight: 500; }

/* ── labels card ─────────────────────────────────────── */
.labels-card, .fmt-card { padding: 8px 14px 10px; flex: none; }
.labels-card:last-child { margin-bottom: 12px; }
.fmt-card summary { cursor: pointer; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); }
.fmt-card[open] summary { margin-bottom: 6px; }
.fmt-card .field { margin: 8px 0 0; }
.fmt-card .row-key { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--ink-soft); margin-top: 4px; }
.basemap-opts.tight { border-top: 0; padding-top: 0; }
.labels-card summary { cursor: pointer; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); }
.labels-card[open] summary { margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; border: 1.5px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 2px 10px; font-size: 13px; cursor: pointer; color: var(--ink-soft);
}
.chip { max-width: 100%; min-width: 0; }
.chip > :not(b) { overflow: hidden; text-overflow: ellipsis; }
.chip { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chip[aria-pressed="true"] { border-color: var(--grape); background: var(--grape-wash); color: var(--ink); }
.chip.more { border-style: dashed; color: var(--grape); font-weight: 600; }
.chip b { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: var(--grape); color: #fff; font-size: 11px; }
.check { display: flex; align-items: center; gap: 6px; font-size: 13.5px; margin-top: 6px; flex-wrap: wrap; }
.check input[type=range] { flex: 1; min-width: 90px; accent-color: var(--grape); }
.basemap-opts { display: flex; align-items: center; gap: 4px 14px; flex-wrap: wrap; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); font-size: 13.5px; }
.basemap-opts > span { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); }
.basemap-opts .check { margin-top: 0; }
.seg.pal button { display: inline-flex; align-items: center; gap: 5px; }
.seg.pal i { width: 22px; height: 8px; border-radius: 2px; }
.row-key { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink-soft); }
.row-key i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.row-key i.in { background: var(--rows); border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(30,35,64,.2); }
.row-key i.out { background: #fff; border: 2px solid var(--rows); margin-left: 6px; }

/* ── map ─────────────────────────────────────────────── */
.map-wrap { grid-area: map; position: relative; min-height: 0; }
#map { position: absolute; inset: 0; }
.legend {
  position: absolute; left: 12px; top: 12px; z-index: 2;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 8px 10px; font-size: 12.5px; box-shadow: 0 2px 8px rgba(30,35,64,.12); min-width: 150px;
}
.legend h4 { margin: 0 0 4px; font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.legend .row { display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.legend .row i { width: 18px; height: 12px; border-radius: 3px; border: 1px solid rgba(30,35,64,.25); flex: none; }
.legend .row .n { margin-left: auto; padding-left: 10px; color: var(--ink-soft); }
.legend h4.rows-h { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line); }
.legend .row i.dot { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(30,35,64,.3); margin: 0 4px 0 3px; }
.legend .foot { margin-top: 4px; font-size: 11px; color: var(--ink-soft); }
.tip {
  position: absolute; z-index: 3; pointer-events: none; transform: translate(12px, 12px);
  background: var(--ink); color: #fff; border-radius: 10px; padding: 6px 10px; font-size: 13px;
  box-shadow: 0 4px 12px rgba(30,35,64,.25); max-width: 260px;
}
.tip b { display: block; font-size: 14px; }
.tip div { opacity: .9; }
.drop {
  position: fixed; inset: 0; z-index: 50; background: rgba(109,74,245,.18);
  display: grid; place-items: center; pointer-events: none;
}
.drop div {
  font-family: var(--display); font-weight: 800; font-size: 28px; color: var(--ink);
  background: var(--card); border: 3px dashed var(--grape); border-radius: 22px; padding: 28px 48px;
}
.maplibregl-popup-content { font-family: var(--body); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; box-shadow: 0 4px 0 rgba(30,35,64,.25); max-width: 300px; }
.pop h4 { margin: 0 0 4px; font-family: var(--display); font-size: 17px; }
.pop .big { font-size: 15px; margin-bottom: 4px; }
.pop .sub { color: var(--ink-soft); margin-bottom: 2px; }
.pop dl.fields { margin: 6px 0 0; max-height: 260px; overflow: auto; display: grid; gap: 5px; }
.pop dl.fields div { min-width: 0; }
.pop dl.fields dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.pop dl.fields dt { font-size: 11.5px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pop table { border-collapse: collapse; margin-top: 4px; font-size: 12.5px; display: block; max-height: 220px; overflow: auto; }
.pop th { text-align: left; font-weight: 600; color: var(--ink-soft); padding: 1px 8px 1px 0; vertical-align: top; white-space: nowrap; }
.pop td { padding: 1px 0; }
.pop ul { margin: 4px 0 0; padding-left: 16px; max-height: 160px; overflow: auto; }
.pop .more { color: var(--ink-soft); }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 55vh 1fr; grid-template-areas: "bar" "map" "panel"; }
  .bar { flex-wrap: wrap; gap: 8px; }
  .bar-actions { margin-left: 0; }
  .panel { border-right: 0; border-top: 2px solid var(--line); }
}

/* v9 */
.chip-x { border: 0; background: none; color: var(--ink-soft); font-size: 14px; line-height: 1; padding: 4px 6px; margin-left: -6px; border-radius: 999px; cursor: pointer; }
.chip-x:hover { background: var(--paper); color: var(--ink); }
.field .check.loc { margin: 2px 0 6px; font-weight: 600; text-transform: none; letter-spacing: 0; font-size: 13.5px; color: var(--ink); }
.check.loc .n { font-weight: 400; color: var(--ink-soft); font-size: 12.5px; }
#key-row.off select { opacity: .45; }
#hex-seg button { padding: 3px 8px; }
.hex-card .hint { margin-top: 6px; }
.area-list li.note { font-size: 12.5px; color: var(--ink-soft); cursor: default; display: block; }
.area-list li.note:hover { background: none; }
#order-seg button { padding: 3px 8px; }

/* v11 */
.bar-toggles { display: flex; gap: 4px; margin-left: 4px; }
.tog { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 4px 10px; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-soft); cursor: pointer; white-space: nowrap; }
.tog i { width: 10px; height: 10px; border-radius: 3px; border: 1.5px solid currentColor; }
.tog[aria-pressed="true"] { color: #fff; background: var(--ink); border-color: var(--ink); }
.tog[aria-pressed="true"] i { background: #fff; border-color: #fff; }
.tog:hover { border-color: var(--ink); }
details.sub { margin-top: 2px; }
details.sub > summary { cursor: pointer; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft);
  list-style: none; display: flex; gap: 6px; align-items: baseline; padding: 4px 0; }
details.sub > summary::-webkit-details-marker { display: none; }
details.sub > summary::before { content: '▸'; font-size: 11px; }
details.sub[open] > summary::before { content: '▾'; }
details.sub > summary .n { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
details.sub[open] > summary .n { display: none; }
.legend i.clear { background: transparent; border: 1.5px solid var(--line); box-sizing: border-box; }
.btn { white-space: nowrap; }
.source-chip { max-width: 190px; }
.bar-actions { gap: 6px; }
.tabs { flex-wrap: nowrap; }
.tab { white-space: nowrap; }
@media (max-width: 1280px) { .version { display: none; } }
.tabs { flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.bar-toggles, .bar-actions { flex-shrink: 0; }
.source-chip { max-width: 170px; }
.lcolors { display: flex; flex-wrap: wrap; gap: 4px; }
.lcolors .chip { display: inline-flex; align-items: center; gap: 5px; }
.lcolors .chip i { font-style: normal; font-weight: 700; font-size: 13px; padding: 0 3px; background: linear-gradient(90deg, #5598e7 33%, #feb24c 33% 66%, #d7191c 66%); border-radius: 3px; }
.lcolors .chip .swap { font-size: 12px; color: var(--grape); margin-left: 1px; }

/* v13: Airtable */
.at-card input[type=text], .at-card input[type=password] { width: 100%; box-sizing: border-box; font: inherit; font-size: 13.5px; padding: 6px 8px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--card); }
.at-card input:focus { outline: 2px solid var(--grape); outline-offset: 0; border-color: transparent; }
.at-card .btn { margin-top: 4px; }
.at-status { font-size: 13px; margin: 6px 0 0; min-height: 0; }
.at-status:empty { display: none; }
.at-status.err { color: #b3261e; }
.at-skipped { list-style: none; margin: 4px 0; padding: 0; max-height: 220px; overflow: auto; }
.at-skipped .check { margin-top: 2px; font-size: 13px; }
.at-skipped .why { color: var(--ink-soft); font-size: 12px; }
#at-info { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; }

/* v14: row card beside the list */
.rowcard { position: absolute; left: 8px; width: 300px; max-height: 60vh; overflow: auto; z-index: 5; pointer-events: none;
  box-shadow: 0 6px 24px rgba(30,35,64,.22); border-radius: 12px; padding: 12px 14px; }
.rowcard[hidden] { display: none; }

/* v15: table drawer */
.map-wrap { --drawer: 0px; }
#map { bottom: var(--drawer); }
.legend, .tip { }
.table-drawer { position: absolute; left: 0; right: 0; bottom: 0; height: var(--drawer); background: var(--card); border-top: 1.5px solid var(--line);
  display: flex; flex-direction: column; z-index: 4; box-shadow: 0 -4px 16px rgba(30,35,64,.08); }
.table-drawer[hidden] { display: none; }
.table-grip { height: 7px; cursor: ns-resize; flex-shrink: 0; margin-top: -4px; }
.table-grip:hover { background: var(--grape-wash); }
.table-head { display: flex; align-items: center; gap: 10px; padding: 2px 12px 6px; font-size: 13.5px; flex-shrink: 0; }
.table-head .hint { margin: 0; flex: 1; }
.table-head .seg button { padding: 3px 9px; }
.table-scroll { overflow: auto; flex: 1; min-height: 0; }
table.grid { border-collapse: separate; border-spacing: 0; font-size: 12.5px; font-variant-numeric: tabular-nums; }
table.grid th { position: sticky; top: 0; background: var(--paper); text-align: left; font-weight: 700; padding: 5px 10px; white-space: nowrap;
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; cursor: pointer; border-bottom: 1px solid var(--line); z-index: 1; }
table.grid th.asc::after { content: ' ▲'; font-size: 9px; } table.grid th.desc::after { content: ' ▼'; font-size: 9px; }
table.grid td { padding: 4px 10px; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; border-bottom: 1px solid var(--line); }
table.grid tbody tr { cursor: pointer; }
table.grid tbody tr:hover td, table.grid tbody tr.hl td { background: #FFF4D1; }

/* v16: token help */
.at-steps { margin: 4px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--ink-soft); }
.at-steps li { margin: 2px 0; }
.at-make { display: inline-block; margin: 6px 0 2px; font-size: 13px; font-weight: 700; color: var(--grape); }
.at-safe { margin: 6px 0 0; padding: 6px 9px; border-radius: 8px; background: #FFF6DB; font-size: 12.5px; line-height: 1.4; }

/* v17: toast */
.toast { position: absolute; left: 50%; bottom: calc(var(--drawer, 0px) + 18px); transform: translateX(-50%); z-index: 6; display: flex; align-items: flex-start; gap: 10px;
  max-width: min(460px, calc(100% - 32px)); padding: 10px 12px 10px 14px; border-radius: 12px; background: var(--ink); color: #fff; box-shadow: 0 8px 28px rgba(30,35,64,.28); font-size: 13.5px; }
.toast[hidden] { display: none; }
.toast-msg { font-weight: 700; line-height: 1.3; }
.toast-sub { margin-top: 2px; font-size: 12.5px; opacity: .82; line-height: 1.35; }
.toast-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.toast-actions .btn { padding: 4px 11px; font-size: 12.5px; }
.toast-actions .btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.toast-x { border: 0; background: none; color: #fff; opacity: .6; cursor: pointer; font-size: 13px; padding: 0 0 0 4px; }
.toast-x:hover { opacity: 1; }
.toast .spin { display: none; width: 15px; height: 15px; margin-top: 1px; flex: none; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.3); border-top-color: var(--sun); animation: spin .8s linear infinite; }
.toast.busy .spin { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.side-dock .toast { bottom: 18px; left: calc((100% - var(--drawer-w, 0px)) / 2); }

/* v17: other Airtable tables */
.at-browse { margin: 6px 0 4px; max-height: 260px; overflow: auto; border: 1.5px solid var(--line); border-radius: 8px; padding: 4px 8px; font-size: 13px; }
.at-base summary { cursor: pointer; font-weight: 700; padding: 3px 0; }
.at-tables { list-style: none; margin: 0 0 4px; padding: 0 0 0 14px; }
.at-tables li { padding: 1px 0; }
.at-tables button[aria-current] { color: var(--ink); text-decoration: none; }
.at-tables button[aria-current]::after { content: ' (loaded)'; font-weight: 400; color: var(--ink-soft); }
.at-browse .err { color: #b3261e; }
.why { color: var(--ink-soft); font-size: 12px; }

/* v17: table below or beside the map; area and name columns pinned */
.map-wrap { --drawer-w: 0px; }
#map { right: var(--drawer-w); }
.table-head { flex-wrap: wrap; row-gap: 6px; }
.side-dock .table-drawer { left: auto; top: 0; width: var(--drawer-w); height: auto; border-top: 0; border-left: 1.5px solid var(--line); box-shadow: -4px 0 16px rgba(30,35,64,.08); }
.side-dock .table-grip { position: absolute; left: -4px; top: 0; bottom: 0; width: 8px; height: auto; margin: 0; cursor: ew-resize; z-index: 5; }
.side-dock .table-head { padding-top: 8px; }

/* v17: three palettes fit the card; the side table's count gets its own line */
.seg.pal { max-width: 100%; }
.seg.pal button { padding: 3px 7px; font-size: 12px; gap: 4px; }
.seg.pal i { width: 15px; }
.side-dock .table-head .hint { order: 9; flex-basis: 100%; }

/* v18: Airtable buttons on one row; animated "Loading…" */
.at-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.at-card .at-buttons .btn { margin-top: 0; }
.btn.small { padding: 4px 10px; font-size: 12.5px; }
.loading::after { content: '…'; display: inline-block; width: 1.2em; text-align: left; overflow: hidden; vertical-align: bottom; animation: dots 1.2s steps(4, end) infinite; }
@keyframes dots { 0% { width: 0; } 100% { width: 1.2em; } }

/* v18: one pinned column, chosen with the pin in its header */
table.grid td.area { font-weight: 600; }
table.grid th.pinned, table.grid td.pinned { position: sticky; left: 0; background: var(--card); z-index: 2; box-shadow: 1px 0 0 var(--line); }
table.grid th.pinned { background: var(--paper); z-index: 3; }
table.grid tbody tr:hover td.pinned, table.grid tbody tr.hl td.pinned { background: #FFF4D1; }
table.grid th .th-t { overflow: hidden; text-overflow: ellipsis; }
table.grid th { max-width: 240px; }
table.grid th .pin { border: 0; background: none; padding: 0 0 0 4px; margin: 0; cursor: pointer; vertical-align: -2px; opacity: 0; }
table.grid th .pin svg { width: 12px; height: 12px; fill: var(--ink-soft); }
table.grid th:hover .pin, table.grid th .pin:focus-visible { opacity: .55; }
table.grid th .pin[aria-pressed="true"] { opacity: 1; }
table.grid th .pin[aria-pressed="true"] svg { fill: var(--grape); }

/* v18: color chips keep their size (fixed names, swap mark always there) */
.lcolors { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 4px; width: 100%; }
.lcolors .chip { font-size: 12px; padding: 2px 7px; gap: 4px; justify-content: flex-start; min-width: 0; }
.lcolors .chip .nm { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lcolors .chip i { font-size: 12px; }
.lcolors .chip .swap { opacity: 0; color: var(--grape); font-size: 12px; }
.lcolors .chip[aria-pressed="true"] .swap { opacity: 1; }

/* v18: the loaded source's name heads the match card, which collapses */
.join-card > summary.src-head { cursor: pointer; list-style: none; display: block; margin: -2px 0 8px; }
.join-card > summary.src-head::-webkit-details-marker { display: none; }
.src-title { display: block; font-family: var(--display); font-weight: 800; font-size: 18px; line-height: 1.2; overflow-wrap: anywhere; padding-left: 16px; position: relative; }
.src-title::before { content: '▾'; position: absolute; left: 0; top: 1px; font-size: 13px; color: var(--ink-soft); }
.join-card:not([open]) .src-title::before { content: '▸'; }
.src-meta { display: block; padding-left: 16px; margin-top: 2px; font-size: 12.5px; color: var(--ink-soft); }
.join-card[open] .src-meta { display: none; }
.join-card:not([open]) > summary.src-head { margin-bottom: 0; }

/* v19: Airtable heading like the other cards; area colors and labels under Color by */
.at-card > summary { cursor: pointer; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); }
.at-card[open] > summary { margin-bottom: 6px; }
.top-opts { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.top-opts .lab + .lab, .top-opts .seg + .lab { margin-top: 6px; }
.top-opts .lab { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); }
.top-opts .labels-jump { justify-self: start; text-align: left; font-size: 13px; }
.labels-card.flash { box-shadow: 0 0 0 3px var(--sun); transition: box-shadow .3s; }

/* v20: a pinned row card stays, scrolls and can be closed; the row it shows is marked in the list */
.rowcard.pinned { pointer-events: auto; box-shadow: 0 0 0 2px var(--pick), 0 6px 24px rgba(30,35,64,.22); }
.rowcard .card-x { position: sticky; top: 0; float: right; margin: -4px -6px 0 6px; border: 0; background: var(--card); border-radius: 50%; width: 24px; height: 24px; cursor: pointer; color: var(--ink-soft); font-size: 13px; z-index: 1; }
.rowcard .card-x:hover { color: var(--ink); background: var(--paper); }
.area-list .items li.cur { background: var(--pick-wash); box-shadow: inset 3px 0 0 var(--pick); font-weight: 700; }

/* v21: cards and popups slightly see-through */
.rowcard, .maplibregl-popup-content { background: rgba(255,255,255,.9); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: rgba(255,255,255,.9); }
.maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: rgba(255,255,255,.9); }
.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: rgba(255,255,255,.9); }
.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: rgba(255,255,255,.9); }
.rowcard .card-x { background: transparent; }

/* v22: the table list's freshness line */
.at-fresh { margin: 6px 0 2px; font-size: 12px; }

/* v23: hexagon resolution on its own row, with − / + */
.hex-card .lab, .fmt-card .look .lab { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 5px; }
.fmt-card .look .lab b { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--ink); margin-left: 4px; }
.hex-row { display: flex; gap: 8px; flex-wrap: nowrap; align-items: center; }
#hex-seg button.cur { box-shadow: inset 0 0 0 2px var(--ink); }
.hex-row .seg button:disabled { opacity: .35; cursor: default; }
#hex-hint { min-height: 2.6em; }
/* Size and style as pictures; the name of the choice is next to the heading */
.seg.dots button { width: 34px; height: 26px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.seg.dots i { display: inline-block; border-radius: 50%; background: var(--rows); }
#psize-seg button[aria-pressed="true"] i { background: #fff; }
#pstyle-seg i { width: 12px; height: 12px; }
#pstyle-seg .ps-fill { border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(30,35,64,.25); }
#pstyle-seg .ps-ring { background: none; border: 2px solid var(--rows); }
#pstyle-seg .ps-ghost { background: color-mix(in srgb, var(--rows) 22%, transparent); border: 1px solid color-mix(in srgb, var(--rows) 60%, transparent); }
#pstyle-seg .ps-black { border: 2px solid #1e1e1e; }
#pstyle-seg .ps-white { border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(30,35,64,.2); }
#pstyle-seg .ps-bw { background: #fff; border: 2px solid #1e1e1e; }
#pstyle-seg button[aria-pressed="true"] { background: #e9e9f1; }
#pstyle-seg button[aria-pressed="true"] i { outline: none; }
.fmt-card .look { margin-top: 10px; }
/* Checkboxes inside a field read as options, not headings */
.field label.check { display: flex; font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink); margin-bottom: 0; }
.fmt-card .look .lab { font-size: 12px; letter-spacing: .04em; }
/* v24: white ring / ghost show on a dark chip */
#pstyle-seg button.w { background: #4a5170; }
#pstyle-seg button.w .ps-ring { border-color: #fff; }
#pstyle-seg button.w .ps-ghost { background: rgba(255,255,255,.3); border-color: rgba(255,255,255,.8); }
/* v24: the H3 card: mode, a small aligned table of levels, names */
.hex-top, .hex-names { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hex-top .lab, .hex-names .lab { margin: 0; flex: 1; }
.hex-names { margin-top: 10px; }
.hex-names select { flex-basis: 100%; width: 100%; max-width: 100%; min-width: 0; }
.seg.mini button { padding: 2px 8px; font-size: 12px; }
.seg.mini button:disabled { opacity: .35; cursor: default; }
.hex-tab { width: 100%; table-layout: fixed; border-collapse: collapse; margin-top: 8px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.hex-tab col.c-z { width: 36%; } .hex-tab col.c-r { width: 12%; } .hex-tab col.c-s { width: 22%; } .hex-tab col.c-a { width: 30%; }
.hex-tab th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); padding: 0 4px 3px; }
.hex-tab td { padding: 3px 4px; white-space: nowrap; color: var(--ink-soft); }
.hex-tab tbody tr.cur td { background: var(--ink); color: #fff; font-weight: 600; }
.hex-tab tbody tr.cur td:first-child { border-radius: 6px 0 0 6px; } .hex-tab tbody tr.cur td:last-child { border-radius: 0 6px 6px 0; }
.hex-tab tfoot td { padding-top: 6px; }
#hex-hint { min-height: 2.6em; font-variant-numeric: tabular-nums; }

/* v25: the H3 card folds like the others; Auto / Fixed sit in its heading */
.hex-card { padding: 8px 14px 10px; }
.hex-card > summary { cursor: pointer; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft);
  display: flex; align-items: center; gap: 6px; }
.hex-card > summary .n { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 12.5px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hex-card[open] > summary .n { visibility: hidden; }
.hex-card > summary .seg { margin-left: auto; text-transform: none; letter-spacing: 0; }
.hex-card[open] > summary { margin-bottom: 2px; }
/* An area hovered in the list tints its rows in the table */
table.grid tbody tr.hl-area td { background: #FFF9E6; }
/* v25: a tighter top bar, with room for another tab */
.bar { gap: 10px; padding: 8px 12px; }
.brand img { width: 32px; height: 32px; }
.brand span { font-size: 20px; }
.tabs { gap: 2px; }
.tab { padding: 4px 10px; font-size: 14px; }
.tab.menu > span:first-child { display: inline-block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.bar-toggles { gap: 3px; margin-left: 0; }
.tog { padding: 3px 8px; font-size: 12.5px; gap: 5px; }
.source-chip { max-width: 150px; }
.hex-card > summary { list-style: none; }
.hex-card > summary::-webkit-details-marker { display: none; }
.hex-card > summary::before { content: '▸'; font-size: 11px; }
.hex-card[open] > summary::before { content: '▾'; }
.tab { padding: 4px 8px; }
.tab.menu > span:first-child { max-width: 130px; }
.source-chip { max-width: 120px; }
.bar { gap: 8px; }
@media (max-width: 1440px) { .version { display: none; } }
/* v26: the legend folds to one bar per layer */
.legend .lg-fold { all: unset; cursor: pointer; display: block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 4px; }
.legend .lg-fold:hover { color: var(--ink); }
.legend.compact { width: 250px; }
.legend .lg-row + .lg-row { margin-top: 8px; }
.legend .lg-name { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 600; color: var(--ink); }
.legend .lg-name span { font-weight: 400; color: var(--ink-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
.legend .lg-bar { position: relative; display: flex; height: 10px; margin-top: 4px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(30,35,64,.18); }
.legend .lg-bar b { flex: 1; }
.legend .lg-bar b:first-child { border-radius: 3px 0 0 3px; } .legend .lg-bar b:last-child { border-radius: 0 3px 3px 0; }
.legend .lg-bar .mk { position: absolute; transform: translateX(-50%); }
.legend .lg-bar .mk.med { top: -3px; bottom: -3px; width: 2px; background: var(--ink); border-radius: 1px; box-shadow: 0 0 0 1px rgba(255,255,255,.8); }
.legend .lg-bar .mk.mean { top: 50%; width: 7px; height: 7px; background: #fff; border: 1.5px solid var(--ink); transform: translate(-50%, -50%) rotate(45deg); }
.legend .lg-ticks { position: relative; height: 15px; margin-top: 3px; font-size: 11px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.legend .lg-ticks span { position: absolute; white-space: nowrap; }
.legend .lg-ticks .l { left: 0; } .legend .lg-ticks .r { right: 0; }
.legend .lg-ticks .m { transform: translateX(-50%); font-weight: 600; color: var(--ink); }
.legend .lg-cats { display: flex; flex-wrap: wrap; gap: 3px 10px; margin-top: 3px; font-size: 11.5px; }
.legend .lg-cats i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.legend .lg-key { display: flex; gap: 12px; margin-top: 6px; font-size: 10.5px; color: var(--ink-soft); }
.legend .lg-key i { display: inline-block; vertical-align: middle; margin-right: 4px; }
.legend .lg-key i.med { width: 2px; height: 11px; background: var(--ink); }
.legend .lg-key i.mean { width: 6px; height: 6px; border: 1.5px solid var(--ink); transform: rotate(45deg); margin-right: 6px; }
.legend.compact { width: 270px; }
.legend .lg-name { align-items: baseline; }
.legend .lg-name span { font-size: 11px; }
/* v27: one triangle for every folding heading (cards, sub-sections, the file title, the legend) */
details.card > summary, details.sub > summary { list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before, details.sub > summary::before, .src-title::before, .legend .lg-fold::before {
  content: '▸'; display: inline-block; width: 12px; font-size: 11px; line-height: 1; color: var(--ink-soft); font-weight: 400; letter-spacing: 0; }
details.card[open] > summary::before, details.sub[open] > summary::before, .legend .lg-fold[aria-expanded="true"]::before { content: '▾'; }
.join-card > summary.src-head::before { content: none; }
.src-title::before { content: '▾'; position: absolute; left: 0; top: 5px; }
.join-card:not([open]) .src-title::before { content: '▸'; }
.src-title { padding-left: 13px; }
.hex-card > summary::before { content: '▸'; font-size: 11px; }
.hex-card[open] > summary::before { content: '▾'; }
details.join-card > summary.src-head::before, details.join-card[open] > summary.src-head::before { content: none; display: none; }
/* v28: a progress bar in the toast */
.toast-bar { height: 4px; border-radius: 2px; background: rgba(30,35,64,.12); margin-top: 6px; overflow: hidden; min-width: 200px; }
.toast-bar i { display: block; height: 100%; width: 0; background: var(--grape); transition: width .15s; }
/* v28: classes control in the top section */
.class-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.class-row .check { margin-top: 0; font-size: 12.5px; }
/* bigger fold triangles */
details.card > summary::before, details.sub > summary::before, .src-title::before, .legend .lg-fold::before, .hex-card > summary::before { font-size: 15px; width: 15px; }
.src-title::before { top: 1px; font-size: 16px; }
.src-title { padding-left: 17px; }
/* v29: area outline swatches: a square of area color with the outline */
.outline-field { margin-top: 10px; }
.outline-field .lab { display: block; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 5px; }
.outline-field .lab b { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--ink); margin-left: 4px; }
#outline-seg i { width: 14px; height: 12px; border-radius: 2px; background: #5598e7; box-sizing: border-box; }
#outline-seg .ol-auto { border: 1.5px solid rgba(30,35,64,.55); }
#outline-seg .ol-palette { border: 2px solid #1c5cab; }
#outline-seg .ol-ghost { border: 2px solid rgba(28,92,171,.35); }
#outline-seg .ol-grey { border: 1.5px solid #8a8f9c; }
#outline-seg .ol-white { border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(30,35,64,.2); }
#outline-seg .ol-black { border: 1.5px solid #1e1e1e; }
#outline-seg .ol-none { border: 0; }
#outline-seg button[aria-pressed="true"] { background: #e9e9f1; }
#outline-w { margin-top: 6px; }
/* v34: full set names on menu tabs */
.tab.menu > span:first-child { max-width: none; }
/* Load data dialog */
.load-dialog { border: 0; border-radius: 14px; padding: 18px 20px 16px; width: min(460px, calc(100vw - 32px)); box-shadow: 0 10px 40px rgba(30,35,64,.25); color: var(--ink); background: var(--card); }
.load-dialog::backdrop { background: rgba(30,35,64,.35); }
.load-dialog h3 { margin: 0 0 12px; font-family: var(--display); font-size: 20px; }
.load-dialog .ld-close { position: absolute; top: 10px; right: 10px; margin: 0; }
.load-dialog .lab { display: block; margin-top: 16px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); }
.load-dialog .ld-row { display: flex; gap: 8px; margin-top: 6px; }
.load-dialog input { flex: 1; min-width: 0; font: inherit; font-size: 13.5px; padding: 6px 8px; border: 1.5px solid var(--line); border-radius: 8px; }
.load-dialog input:focus { outline: 2px solid var(--grape); outline-offset: 0; border-color: transparent; }
.at-card > summary .n { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 12.5px; margin-left: 4px; }
.at-card[open] > summary .n { display: none; }
/* v35: table search and filters */
.table-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 0 12px 6px; font-size: 13px; flex-shrink: 0; }
.table-tools input[type=search] { font: inherit; font-size: 13px; padding: 4px 8px; border: 1.5px solid var(--line); border-radius: 999px; width: 180px; }
.table-tools input[type=search]:focus, .tf-pop input:focus, .tf-pop select:focus { outline: 2px solid var(--grape); outline-offset: 0; border-color: transparent; }
.tf-chips { display: contents; }
.tf-chip { display: inline-flex; align-items: center; border: 1.5px solid var(--ink); border-radius: 999px; background: #eef0fb; }
.tf-chip button { all: unset; cursor: pointer; font-size: 12.5px; padding: 2px 4px 2px 10px; }
.tf-chip .tf-edit { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-chip .tf-x { padding: 2px 9px 2px 4px; color: var(--ink-soft); }
.tf-chip .tf-x:hover { color: var(--ink); }
.tf-pop { position: relative; margin: 0 12px 6px; padding: 10px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); box-shadow: 0 4px 14px rgba(30,35,64,.12); max-width: 420px; flex-shrink: 0; }
.tf-pop .tf-row { display: flex; gap: 8px; align-items: center; }
.tf-pop select { flex: 1; font: inherit; font-size: 13px; padding: 4px 6px; border: 1.5px solid var(--line); border-radius: 8px; }
.tf-pop .btn { padding: 4px 12px; font-size: 13px; }
.tf-pop .tf-ops { margin-top: 8px; }
.tf-pop .tf-nums { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.tf-pop .tf-nums input { width: 110px; font: inherit; font-size: 13px; padding: 4px 6px; border: 1.5px solid var(--line); border-radius: 8px; }
.tf-pop .tf-find { margin-top: 8px; width: 100%; box-sizing: border-box; font: inherit; font-size: 13px; padding: 4px 8px; border: 1.5px solid var(--line); border-radius: 8px; }
.tf-pop .tf-vals { max-height: 180px; overflow: auto; margin-top: 6px; }
.tf-pop .tf-vals .check { margin-top: 2px; font-size: 13px; flex-wrap: nowrap; }
.tf-pop .tf-vals .check span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-pop .tf-vals .n { color: var(--ink-soft); font-size: 12px; font-variant-numeric: tabular-nums; }
.tf-pop .tf-vals label[hidden] { display: none; }
/* v36: the filter editor floats over the map */
.tf-pop { position: fixed; margin: 0; z-index: 30; width: min(420px, calc(100vw - 32px)); max-width: none; box-sizing: border-box; }
.tf-pop .tf-vals { max-height: min(260px, 40vh); }
#tf-map { margin-left: auto; }
.mask-note { display: block; margin-bottom: 4px; color: var(--grape); font-weight: 600; }
/* v37: search and filters share the header row (bottom dock); their own row beside the map */
.table-head .hint { flex: 0 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.table-head .table-tools { flex: 1 1 320px; min-width: 0; padding: 0; }
.table-tools input[type=search] { width: 150px; padding: 3px 8px; }
.side-dock .table-head .table-tools { order: 10; flex-basis: 100%; }
.side-dock .table-head .hint { white-space: normal; }
#dock-seg button { padding: 3px 7px; display: inline-flex; align-items: center; }
#dock-seg svg { width: 16px; height: 16px; display: block; }
.table-head .table-tools { flex-wrap: nowrap; }
.table-head .tf-chips { display: flex; gap: 6px; flex: 0 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.table-head .tf-chips::-webkit-scrollbar { display: none; }
.table-head .tf-chip { flex: none; }
.table-head .tf-chip .tf-edit { max-width: 200px; }
.table-head .table-tools > * { flex-shrink: 0; }
.table-head .table-tools > .tf-chips { flex-shrink: 1; }
#tf-map { margin-left: 0; white-space: nowrap; }
.side-dock .table-head .table-tools { flex-wrap: wrap; }
/* the header row: count, then search and filters (as much room as they need), then the right-hand group,
   which moves to a second line only when the drawer is too narrow */
.table-head .table-tools { flex: 0 1 auto; }
.table-head .tf-chips { min-width: 90px; }
.table-head .th-right { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-shrink: 0; }
.side-dock .table-head .th-right { margin-left: 0; }
.table-head .tf-chip .tf-edit { max-width: 160px; }
.table-head { gap: 8px; }
.table-head .table-tools { gap: 6px; }
.table-head .table-tools input[type=search] { width: 130px; }
/* v38: chips show the value first; the column name is faded and cut first */
.tf-chip .tf-edit { display: inline-flex; min-width: 0; max-width: 220px; overflow: hidden; }
.table-head .tf-chip .tf-edit { max-width: 200px; }
.tf-chip .tf-v { font-weight: 600; white-space: nowrap; flex: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.tf-chip .tf-k { color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
/* the column menu stays inside the editor, however long the names */
.tf-pop .tf-row { min-width: 0; }
.tf-pop .tf-row select { flex: 1 1 0; min-width: 0; width: 0; max-width: 100%; text-overflow: ellipsis; }
.tf-pop .tf-row .btn { flex: none; }
.tf-chip .tf-k { max-width: 110px; }

/* v50: one rule for buttons (black when on or open, white when off; yellow is for what you picked);
   the density palette menu and Flip under its legend */
.dens-ctl { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.pal-pick { position: relative; }
.pal-pick summary { list-style: none; display: flex; align-items: center; gap: 6px; cursor: pointer; border: 1.5px solid var(--line); border-radius: 999px; padding: 2px 9px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pal-pick summary:hover { border-color: var(--ink); }
.pal-pick summary::-webkit-details-marker { display: none; }
.pal-pick[open] summary { background: var(--ink); border-color: var(--ink); color: #fff; }
.pal-sw { display: inline-block; width: 34px; height: 10px; border-radius: 2px; }
.pal-list { position: absolute; z-index: 5; left: 0; top: calc(100% + 4px); background: var(--card); border: 1.5px solid var(--ink); border-radius: 10px; padding: 4px; display: grid; gap: 2px; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.pal-list button { display: flex; align-items: center; gap: 8px; border: 0; background: none; font: inherit; font-size: 13px; padding: 4px 8px; border-radius: 6px; cursor: pointer; color: var(--ink); white-space: nowrap; }
.pal-list button:hover { background: var(--paper); }
.pal-list button[aria-pressed="true"] { background: var(--ink); color: #fff; }
