:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --bg: #eef1f6;
  --canvas: #ffffff;
  --fg: #1d1d1f;
  --fg-2: #4a4f5c;
  --fg-3: #6b7180;
  --accent: #0a6cff;
  --accent-hover: #005ae0;
  --accent-soft: rgba(10, 108, 255, 0.12);
  --on-accent: #ffffff;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-solid: rgba(251, 252, 254, 0.97);
  --glass-border: rgba(255, 255, 255, 0.7);
  --line: rgba(60, 70, 95, 0.14);
  --ctl: rgba(255, 255, 255, 0.9);
  --ctl-hover: #ffffff;
  --ctl-press: #e9edf5;
  --track: rgba(60, 70, 95, 0.16);
  --danger: #c62828;
  --danger-soft: rgba(198, 40, 40, 0.1);
  --warn: #9a5b00;
  --ok: #1d7a46;
  --surface-2: rgba(60, 70, 95, 0.045);
  --row-hover: rgba(60, 70, 95, 0.05);
  --shadow-1: 0 1px 2px rgba(20, 30, 60, 0.06), 0 4px 14px rgba(20, 30, 60, 0.07);
  --shadow-2: 0 2px 6px rgba(20, 30, 60, 0.08), 0 14px 36px rgba(20, 30, 60, 0.12);
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-pill: 999px;
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  /* Type scale: page > module > layer > parameter group > label > help. Weight and colour carry most of the hierarchy. */
  --fs-page: 15px;
  --fs-module: 13px;
  --fs-layer: 12.5px;
  --fs-group: 12.5px;
  --fs-label: 12.5px;
  --fs-help: 11.5px;
  --fw-page: 650;
  --fw-module: 600;
  --fw-layer: 600;
  --fw-group: 550;
  --fw-label: 450;
  /* Controls and rows */
  --ctl-h: 30px;
  --ctl-col: 56%;
  --row-gap: var(--s-2);
  --head-h: 36px;
  --sub-h: 30px;
  --blur: saturate(160%) blur(18px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur: 160ms;
  --top-h: 56px;
  --status-h: 34px;
  --panel-w: 288px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font: 13px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body { position: relative; display: flex; flex-direction: column; overflow: hidden; }

.ic { width: 18px; height: 18px; flex: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.spacer { flex: 1 1 auto; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-1);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
}
@media (prefers-reduced-transparency: reduce) {
  .glass { background: var(--glass-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

#topbar {
  position: relative;
  z-index: 6;
  height: var(--top-h);
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 0 var(--s-4);
  border-width: 0 0 1px 0;
  border-bottom-color: var(--line);
  border-radius: 0;
}
.brand { display: flex; align-items: center; gap: var(--s-2); min-width: 0; margin-right: var(--s-2); white-space: nowrap; }
.brand-ic { width: 26px; height: 26px; flex: none; }
.brand-name { font-weight: 650; font-size: 15px; letter-spacing: 0.01em; }
.actions { display: flex; align-items: center; gap: var(--s-2); }

.search { position: relative; display: flex; align-items: center; gap: 2px; width: 280px; flex: 0 1 280px; min-width: 150px; min-height: 32px; padding: 0 var(--s-1) 0 var(--s-3); border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--ctl); }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-ic { flex: none; color: var(--fg-3); margin-right: 4px; }
.search input { flex: 1 1 auto; min-width: 0; height: 30px; padding: 0; border: 0; background: transparent; color: var(--fg); font: inherit; }
.search input:focus-visible { outline: none; }
.search-count { flex: none; color: var(--fg-3); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.search .icon-btn.small .ic { width: 16px; height: 16px; }
.search .icon-btn.up .ic { transform: rotate(180deg); }
.search-list.glass { background: var(--glass-solid); }
.search-list { left: 0; right: 0; min-width: 0; max-height: min(360px, 60vh); overflow-y: auto; }
.search-list [role="option"] { appearance: none; display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); width: 100%; padding: var(--s-1) var(--s-3); border: 0; border-radius: var(--r-sm); background: transparent; color: var(--fg); font: inherit; text-align: left; cursor: pointer; }
.search-list [role="option"] span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-list [role="option"]:hover, .search-list [role="option"].active { background: var(--accent-soft); }
.search-list .search-note { padding: var(--s-1) var(--s-3); color: var(--fg-3); font-size: 12px; }
.search-list mark { background: transparent; color: var(--accent-hover); font-weight: 650; }

.btn, .icon-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 var(--s-3);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--ctl);
  color: var(--fg);
  font: inherit;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 1px 1px rgba(20, 30, 60, 0.04);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.icon-btn { width: 32px; padding: 0; }
.icon-btn.small { width: 26px; min-height: 26px; border-color: transparent; background: transparent; box-shadow: none; }
.btn:hover, .icon-btn:hover { background: var(--ctl-hover); border-color: var(--fg-3); box-shadow: var(--shadow-1); }
.btn:active, .icon-btn:active { background: var(--ctl-press); transform: scale(0.97); box-shadow: none; }
.btn[aria-pressed="true"], .icon-btn[aria-expanded="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-hover); }
.btn:disabled, .icon-btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.btn.wide { width: 100%; }
.btn:focus-visible, .icon-btn:focus-visible, .segmented button:focus-visible, .switch:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* File inputs sit inside their button label; sibling combinators here would make inserting many elements quadratic. */
label.btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

.menu-wrap { position: relative; }
#appearanceMenu { left: auto; right: 0; }
#exportList { max-height: calc(100vh - 64px); overflow-y: auto; }
.btn .chev { width: 14px; height: 14px; margin-right: -4px; color: var(--fg-3); transition: transform var(--dur) var(--ease); }
.btn[aria-expanded="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-hover); }
.btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.menu { position: absolute; z-index: 8; top: calc(100% + 6px); left: 0; min-width: 236px; padding: var(--s-1); display: flex; flex-direction: column; gap: 2px; border-radius: var(--r-md); background: var(--glass-solid); box-shadow: var(--shadow-2); }
.menu button { appearance: none; display: flex; align-items: center; gap: var(--s-3); width: 100%; padding: var(--s-2) var(--s-3); border: 0; border-radius: var(--r-sm); background: transparent; color: var(--fg); font: inherit; text-align: left; cursor: pointer; }
.menu button:hover, .menu button:focus-visible { background: var(--accent-soft); outline: none; }
.menu button .ic { color: var(--fg-2); }
.menu-text { display: flex; flex-direction: column; min-width: 0; font-weight: 500; }
.menu-text small { color: var(--fg-3); font-size: 11.5px; font-weight: 400; white-space: normal; }
.menu-field { padding: var(--s-1) var(--s-3) var(--s-2) calc(var(--s-3) * 2 + 16px); color: var(--fg-2); font-size: 12px; }
.menu .menu-field select { flex-basis: 120px; width: 120px; }
.menu button[aria-expanded="true"] { background: var(--accent-soft); }
.menu .sub-chev { flex: 0 0 auto; width: 14px; height: 14px; margin-left: auto; margin-right: -4px; color: var(--fg-3); transform: rotate(-90deg); }
.submenu { top: 0; min-width: 264px; padding: var(--s-3); gap: var(--s-2); animation: submenu-in var(--dur) var(--ease); }
.submenu[data-side="left"] { --submenu-from: 6px; }
.submenu[data-side="below"], .submenu[data-side="above"] { --submenu-from: 0; animation-name: submenu-fade; }
@keyframes submenu-fade { from { opacity: 0; } to { opacity: 1; } }
.submenu-title { color: var(--fg-3); font-size: var(--fs-help); font-weight: var(--fw-group); letter-spacing: 0.02em; }
.submenu-note { margin: 0; color: var(--fg-3); font-size: var(--fs-help); line-height: 1.4; }
.menu button.submenu-run { justify-content: center; margin-top: var(--s-1); background: var(--accent); color: var(--on-accent); font-weight: 600; }
.menu button.submenu-run:hover, .menu button.submenu-run:focus-visible { background: var(--accent-hover); }
@keyframes submenu-in { from { opacity: 0; transform: translateX(var(--submenu-from, -6px)); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .submenu { animation: none; } }

.segmented {
  display: inline-flex;
  padding: 2px;
  gap: 2px;
  border-radius: var(--r-pill);
  background: var(--track);
}
.segmented button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--fg-2);
  font: inherit;
  font-weight: 500;
  min-height: 26px;
  padding: 0 var(--s-3);
  border-radius: var(--r-pill);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.segmented button:hover { color: var(--fg); }
.segmented button.on { background: var(--ctl-hover); color: var(--fg); box-shadow: 0 1px 3px rgba(20, 30, 60, 0.18); }
.segmented.lang button { min-width: 64px; }
#wedgeMode { display: flex; width: 100%; }
.segmented.grid2 { display: grid; grid-template-columns: 1fr 1fr; width: 100%; border-radius: var(--r-md); }
.segmented.grid2 button { border-radius: var(--r-sm); padding: 0 var(--s-2); }
#wedgeMode button { flex: 1 1 0; padding: 0 var(--s-2); }

#workspace { position: relative; flex: 1 1 auto; min-height: 0; display: flex; }

.panel {
  position: relative;
  z-index: 4;
  flex: none;
  width: var(--panel-w);
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: var(--s-3) 0 var(--s-3) var(--s-3);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  overflow: hidden;
  transition: margin var(--dur) var(--ease), width var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.panel-resize { position: absolute; top: 0; right: 0; bottom: 0; width: 6px; cursor: ew-resize; z-index: 5; touch-action: none; }
.panel-resize:hover, .panel-resize:focus-visible, .panel-resizing .panel-resize { background: var(--accent-soft); outline: none; }
.panel-resizing .panel { transition: none; }
.panel-resizing { cursor: ew-resize; user-select: none; }
body.panel-closed .panel { width: 0; margin-left: 0; margin-right: 0; opacity: 0; border-width: 0; pointer-events: none; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); padding: var(--s-3) var(--s-4) var(--s-2); }
.panel-head h2 { margin: 0; font-size: var(--fs-page); font-weight: var(--fw-page); color: var(--fg); }
.panel-body, .props-body { container-type: inline-size; }
.panel-body { flex: 1 1 auto; overflow-y: auto; padding: 0 var(--s-4) var(--s-4); }
.group { border-top: 1px solid var(--line); }
.group:first-child { border-top: 0; }
.group h3 { margin: 0; font-size: var(--fs-module); font-weight: var(--fw-module); }
.props-sec h3 { margin: 0; font-size: var(--fs-group); font-weight: var(--fw-module); color: var(--fg-2); }
.group-head, .sec-head {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  min-height: var(--head-h);
  padding: 0 var(--s-1);
  margin: 0 calc(-1 * var(--s-1));
  width: calc(100% + 2 * var(--s-1));
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--fg-2);
  font: inherit;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.group-head:hover, .sec-head:hover { background: var(--row-hover); color: var(--fg); }
.group-head[aria-expanded="true"], .sec-head[aria-expanded="true"] { color: var(--fg); }
.chev { width: 14px; height: 14px; flex: none; color: var(--fg-3); transition: transform var(--dur) var(--ease); }
.group-head[aria-expanded="false"] .chev, .sec-head[aria-expanded="false"] .chev, .param-group:not([open]) > summary .chev { transform: rotate(-90deg); }
.group-head:focus-visible, .sec-head:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.group-body { display: flex; flex-direction: column; gap: var(--row-gap); padding: 0 0 var(--s-3); }

/* Current layer: a tinted card under the layer list, so its parameters read as belonging to that layer. */
.group.layer-sec { margin: 0 calc(-1 * var(--s-2)) var(--s-2); padding: 0 var(--s-2); border: 0; border-radius: var(--r-md); background: var(--surface-2); }
.layer-sec h3 { font-size: var(--fs-layer); font-weight: var(--fw-layer); }
.layer-sec .group-head { min-height: var(--sub-h); }
.layer-sec .group-head > span::before { content: ""; display: inline-block; width: 3px; height: 0.95em; margin-right: var(--s-2); border-radius: 2px; background: var(--accent); vertical-align: -0.12em; }
.layer-sec + .group { border-top: 0; }

/* Parameter groups inside a layer: one accordion style for every layer; a collapsed group keeps only its header. */
.param-group { border-top: 1px solid var(--line); }
.param-group > summary { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); min-height: var(--sub-h); padding: 0 var(--s-1); margin: 0 calc(-1 * var(--s-1)); border-radius: var(--r-sm); color: var(--fg-2); font-size: var(--fs-group); font-weight: var(--fw-group); list-style: none; cursor: pointer; user-select: none; }
.param-group > summary::-webkit-details-marker { display: none; }
.param-group > summary:hover { background: var(--row-hover); color: var(--fg); }
.param-group[open] > summary { color: var(--fg); }
.param-group > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.param-group-body { display: flex; flex-direction: column; gap: var(--row-gap); padding: var(--s-1) 0 var(--s-3); }
.group-body div:not([class]), .param-group-body div:not([class]) { display: flex; flex-direction: column; gap: var(--row-gap); }
.param-group-body > div:not([class]):empty, .group-body > div:not([class]):empty { display: none; }

input[type="number"] {
  width: 100%;
  min-height: var(--ctl-h);
  padding: 0 var(--s-3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--ctl);
  color: var(--fg);
  font: inherit;
  font-variant-numeric: tabular-nums;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
/* Every parameter row: label column and control column on one grid, so controls line up across layers and modules.
   In a narrow panel the control moves under its label. */
.field-row, .switch-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, var(--ctl-col)); align-items: center; gap: var(--s-1) var(--s-3); min-height: var(--ctl-h); color: var(--fg-2); font-size: var(--fs-label); font-weight: var(--fw-label); line-height: 1.35; }
.field-row > :first-child, .switch-row > :first-child { min-width: 0; overflow-wrap: anywhere; }
.field-row > :nth-child(2) { width: 100%; min-width: 0; }
.field-row > input[type="color"], .switch-row > .switch { justify-self: end; }
.switch-row, .field-row:has(> input[type="color"]:last-child) { grid-template-columns: minmax(0, 1fr) auto; }
.switch-row { cursor: pointer; }
.field-block { display: flex; flex-direction: column; gap: var(--s-1); color: var(--fg-2); font-size: var(--fs-label); font-weight: var(--fw-label); }
@container (max-width: 230px) {
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .field-row > input[type="color"] { justify-self: start; }
}
.field-row input[type="color"], .field-row .anno-pair input[type="color"] { width: 40px; height: var(--ctl-h); padding: 2px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--ctl); cursor: pointer; }
.field-row select, .menu-field select, .field-row input[type="text"], .field-row input[type="search"] { min-width: 0; height: var(--ctl-h); padding: 0 var(--s-2); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--ctl); color: var(--fg); font: inherit; font-size: var(--fs-label); }
.field-row select, .menu-field select, .dv-pagesize select { appearance: none; -webkit-appearance: none; padding-right: 26px; overflow: hidden; white-space: nowrap; background: linear-gradient(45deg, transparent 50%, var(--fg-3) 50%) calc(100% - 14px) 52% / 5px 5px no-repeat, linear-gradient(135deg, var(--fg-3) 50%, transparent 50%) calc(100% - 9px) 52% / 5px 5px no-repeat, var(--ctl); transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); cursor: pointer; }
/* Palette selects show the chosen palette as a strip along the bottom of the closed control. */
.field-row select.palette-select { padding-bottom: 5px; background: linear-gradient(45deg, transparent 50%, var(--fg-3) 50%) calc(100% - 14px) 45% / 5px 5px no-repeat, linear-gradient(135deg, var(--fg-3) 50%, transparent 50%) calc(100% - 9px) 45% / 5px 5px no-repeat, var(--swatch, transparent) 8px calc(100% - 4px) / calc(100% - 36px) 4px no-repeat, var(--ctl); }
.field-row select:hover, .field-row input:hover, .multi-select:hover { border-color: var(--fg-3); }
.field-row select:focus, .field-row input[type="text"]:focus, .field-row input[type="search"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field-row select[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field-row:has(> :disabled), .switch-row:has(> :disabled) { color: var(--fg-3); }
.field-row > :disabled, .field-row .pair > :disabled, .switch-row > :disabled { opacity: 0.45; cursor: not-allowed; }
input[type="number"]:hover { border-color: var(--fg-3); }
input[type="number"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
/* Invalid values: a red border plus the browser's validation message, never colour alone. */
.field-row input:invalid, .field-row input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }

.switch {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: none;
  width: 38px;
  height: 22px;
  margin: 0;
  border-radius: var(--r-pill);
  background: var(--track);
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ctl-hover);
  box-shadow: 0 1px 3px rgba(20, 30, 60, 0.3);
  transition: transform var(--dur) var(--ease);
}
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(16px); }
.switch:disabled { opacity: 0.45; cursor: not-allowed; }

#stage { position: relative; flex: 1 1 auto; min-width: 0; margin: var(--s-3); border-radius: var(--r-lg); overflow: hidden; overflow: clip; background: var(--canvas); box-shadow: var(--shadow-1); border: 1px solid var(--line); }
#stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
#labels { pointer-events: none; }

.diag {
  position: absolute;
  z-index: 3;
  width: 260px;
  max-width: calc(100% - 24px);
  padding-bottom: var(--s-3);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
}
.props { position: absolute; z-index: 4; top: var(--s-2); left: var(--s-2); width: 240px; max-width: calc(100% - 2 * var(--s-2)); max-height: calc(100% - 2 * var(--s-2)); display: flex; flex-direction: column; border-radius: var(--r-lg); box-shadow: var(--shadow-2); }
.props .panel-head { flex: none; cursor: grab; touch-action: none; user-select: none; padding: var(--s-2) var(--s-3) var(--s-1); }
.props.dragging .panel-head { cursor: grabbing; }
.pdf-dlg { position: absolute; z-index: 7; top: 0; left: 0; width: 320px; max-width: calc(100% - 2 * var(--s-2)); max-height: calc(100% - 2 * var(--s-2)); display: flex; flex-direction: column; border-radius: var(--r-lg); box-shadow: var(--shadow-2); }
.pdf-dlg .panel-head { flex: none; cursor: grab; touch-action: none; user-select: none; }
.pdf-dlg.dragging .panel-head { cursor: grabbing; }
.pdf-dlg .btn.wide { width: calc(100% - 2 * var(--s-4)); margin: 0 var(--s-4); }
.pdf-dlg .segmented.pdf-mode { margin: 0 var(--s-4); width: auto; }
.pdf-row { margin: 0 var(--s-4); }
.pdf-note { margin: 0 var(--s-4); overflow-wrap: anywhere; color: var(--fg-2); font-size: 12px; line-height: 1.5; }
.props-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: var(--s-2); }
.props-sec { display: flex; flex-direction: column; padding: var(--s-1) 0; border-top: 1px solid var(--line); }
.props-sec:first-child { border-top: 0; padding-top: 0; }
.props-sec h3 { margin: 0 var(--s-3); }
.props-sec .sec-head { min-height: 26px; margin: 0; width: 100%; padding: 0 var(--s-1); }
.sec-body { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-1) 0 var(--s-2); }
.props .btn.wide { width: calc(100% - 2 * var(--s-3)); margin: 0 var(--s-3); }
.props .btn { min-height: 28px; padding: 0 var(--s-2); gap: 4px; font-size: 12px; }
.props .btn .ic { width: 14px; height: 14px; flex: none; }
.props .anno-row { gap: var(--s-1) var(--s-2); }
.props .sec-body { gap: var(--s-1); }
.props .kv { padding: 0 var(--s-3); gap: 3px var(--s-2); font-size: 12px; }
.props .field-row { grid-template-columns: minmax(0, 1fr) minmax(0, 132px); gap: var(--s-1) var(--s-2); margin: 0 var(--s-3); min-height: 28px; }
.props .field-row:has(> input[type="color"]) { grid-template-columns: minmax(0, 1fr) auto auto; }
.props .field-row select, .props .field-row input[type="color"] { height: 28px; }
#propsWedgeMapOpts { display: flex; flex-direction: column; gap: var(--s-2); }
.props .dv-hint { margin: 0 var(--s-3); }
.anno-row { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: 0 var(--s-3); }
.anno-row .btn { flex: 1 1 auto; min-width: 0; }
.panel .btn, .props .btn, .pdf-dlg .btn, .modal .btn { white-space: normal; overflow-wrap: break-word; text-align: center; }
.anno-row input[type="color"] { flex: 0 0 36px; height: 32px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--ctl); cursor: pointer; }
.anno-row input[type="text"] { flex: 1 1 6em; min-width: 0; min-height: var(--ctl-h); padding: 0 var(--s-3); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--ctl); color: var(--fg); font: inherit; }
.anno-row input[type="text"]:hover { border-color: var(--fg-3); }
.anno-row input[type="text"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.anno-group { display: flex; flex-direction: column; gap: var(--s-2); margin: 0 var(--s-4) var(--s-2); padding: var(--s-2) var(--s-3); border: 1px solid var(--line); border-radius: var(--r-md); }
.anno-group h4, .anno-sub { margin: 0; color: var(--fg-3); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; }
.anno-sub { margin: var(--s-1) var(--s-4) 0; }
.anno-line { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); min-height: 28px; color: var(--fg-2); font-size: 12px; font-weight: 500; }
.anno-line input[type="number"] { width: 84px; min-height: 28px; padding: 0 var(--s-2); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--ctl); color: var(--fg); font: inherit; text-align: right; }
.anno-line input[type="color"] { flex: 0 0 36px; height: 28px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--ctl); cursor: pointer; }
.anno-line :disabled, .anno-line:has(:disabled) { opacity: 0.45; cursor: not-allowed; }
.anno-group .btn { }
.anno-params { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); margin: 0 var(--s-4); }
.anno-params[hidden] { display: none; }
.anno-params label, .anno-param { display: flex; flex-direction: column; gap: 4px; min-width: 0; color: var(--fg-2); font-size: 12px; font-weight: 500; }
.anno-pair { display: flex; align-items: center; gap: var(--s-2); min-height: 32px; min-width: 0; max-width: 100%; }
.anno-pair .btn { min-width: 0; padding: 0 var(--s-2); overflow: hidden; text-overflow: ellipsis; }
.anno-params input[type="color"] { flex: 0 0 36px; height: 32px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--ctl); cursor: pointer; }
.anno-params :disabled { opacity: 0.45; cursor: not-allowed; }
.diag { right: var(--s-3); bottom: var(--s-3); }
.diag .panel-head { padding-top: var(--s-2); }

.kv { margin: 0; padding: 0 var(--s-4); display: grid; grid-template-columns: auto 1fr; gap: 6px var(--s-3); }
.kv dt { color: var(--fg-3); white-space: nowrap; }
.kv dd { margin: 0; text-align: right; min-width: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.empty { grid-column: 1 / -1; color: var(--fg-3); }

.toast {
  position: absolute;
  z-index: 6;
  top: var(--s-3);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--s-2);
  max-width: min(560px, calc(100% - 24px));
  padding: var(--s-2) var(--s-2) var(--s-2) var(--s-4);
  border-radius: var(--r-md);
  border-color: rgba(198, 40, 40, 0.35);
  color: var(--danger);
  font-weight: 500;
  box-shadow: var(--shadow-2);
}

.drop { position: absolute; inset: 0; z-index: 7; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); border: 2px dashed var(--accent); border-radius: inherit; color: var(--accent-hover); font-size: 16px; font-weight: 600; pointer-events: none; }

.code { position: relative; z-index: 5; flex: none; display: flex; flex-direction: column; height: var(--code-h, 180px); margin: 0 var(--s-3) var(--s-2); border-radius: var(--r-md); box-shadow: var(--shadow-1); overflow: hidden; }
.code[data-open="false"] { height: auto; }
.code[data-open="false"] .code-body, .code[data-open="false"] .code-resize { display: none; }
.code-resize { position: absolute; left: 0; right: 0; top: 0; height: 6px; cursor: ns-resize; z-index: 1; touch-action: none; }
.code-resize:hover { background: var(--accent-soft); }
.code-head { flex: none; display: flex; align-items: center; gap: var(--s-3); padding: var(--s-1) var(--s-3); }
.code-title { display: inline-flex; align-items: center; gap: var(--s-2); background: none; border: 0; padding: var(--s-1) 0; color: var(--fg); cursor: pointer; font: inherit; }
.code-title h2 { margin: 0; font-size: 13px; font-weight: 600; }
.code-title .chev { transition: transform var(--dur) var(--ease); }
.code[data-open="false"] .chev { transform: rotate(-90deg); }
.code-adv { flex: none; padding: 0 var(--s-3) var(--s-1); border-top: 1px solid var(--line); font-size: 12px; }
.code-adv[hidden] { display: none; }
.code-adv summary { cursor: pointer; padding: var(--s-1) 0; color: var(--fg-2); }
.code-paths { display: flex; flex-direction: column; gap: var(--s-1); max-height: 84px; overflow-y: auto; }
.code-paths .field-row input { min-width: 0; flex: 1 1 auto; }
.code[data-open="false"] .code-adv { display: none; }
.code-notes { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg-3); font-size: 12px; }
.code-body { flex: 1 1 auto; min-height: 0; margin: 0; padding: var(--s-2) var(--s-3); overflow: auto; font-size: 12px; line-height: 1.55; color: var(--fg); user-select: text; white-space: pre; border-top: 1px solid var(--line); }

/* One block per line: updating a line re-lays out that line only. */
.code-body code > span { display: block; }
.tok-c { color: #6a737d; font-style: italic; }
.tok-s { color: #0a7a3d; }
.tok-k { color: #a626a4; }
.tok-n { color: #b45309; }
.tok-f { color: #0a6cff; }
.tok-o { color: #c2410c; }

#statusbar {
  position: relative;
  z-index: 5;
  flex: none;
  min-height: var(--status-h);
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: 0 var(--s-4);
  border-width: 1px 0 0 0;
  border-top-color: var(--line);
  border-radius: 0;
  color: var(--fg-2);
  white-space: nowrap;
  overflow: hidden;
}
.stat { display: inline-flex; align-items: baseline; gap: 6px; flex: none; }
.stat:has(#sRenderer) { flex: 0 1 auto; min-width: 0; overflow: hidden; }
#sRenderer { overflow: hidden; text-overflow: ellipsis; }
.stat-k { color: var(--fg-3); }
.stat b { color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; }
.busy { color: var(--accent-hover); font-weight: 600; }
.hint { color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; }
.meta-match { display: flex; flex-direction: column; gap: var(--s-2); }
.meta-report { margin: 0; padding: 0; list-style: none; color: var(--fg-2); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
/* Layer status: match rate and track in a quiet line; errors get an icon and a tinted box, not only a colour. */
.extra-status { margin: 0; padding: var(--s-1) var(--s-2); border-radius: var(--r-sm); background: var(--surface-2); color: var(--fg-2); font-size: var(--fs-help); line-height: 1.5; overflow-wrap: anywhere; }
.extra-status:empty { display: none; }
.extra-status.error { background: var(--danger-soft); color: var(--danger); }
.extra-status.error::before { content: "⚠ "; }
.pair { display: flex; gap: var(--s-1); min-width: 0; }
.field-row .pair input[type="number"] { flex: 1 1 0; width: auto; min-width: 0; }

@media (max-width: 1180px) {
  .search { width: 200px; flex-basis: 200px; }
  .actions .btn span { display: none; }
  .actions .btn { width: 32px; padding: 0; }
  .actions .btn .chev { display: none; }
}
@media (max-width: 960px) {
  .hint { display: none; }
  .diag { right: auto; left: var(--s-3); }
  .panel { position: absolute; top: 0; bottom: 0; left: 0; margin: var(--s-3); max-height: calc(100% - 2 * var(--s-3)); }
  body.panel-closed .panel { margin: var(--s-3) 0 var(--s-3) calc(-1 * var(--panel-w)); }
  #stage { margin: var(--s-3); }
}
@media (max-width: 520px) {
  #topbar { height: auto; min-height: var(--top-h); flex-wrap: wrap; row-gap: var(--s-2); padding-block: var(--s-2); }
  .search { order: 1; flex: 1 1 100%; }
  .view-tabs { order: 2; max-width: 100%; }
  #exportList { left: auto; right: 0; }
}
@media (max-width: 640px) {
  .search { width: auto; flex: 1 1 100px; min-width: 0; }
  :root { --panel-w: 260px; }
  #topbar { gap: var(--s-2); padding: 0 var(--s-3); }
  .brand-name { display: none; }
  .segmented.lang button { min-width: 0; padding: 0 var(--s-2); }
  .stat:nth-of-type(n+3) { display: none; }
  .props { width: 224px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
#metaInfo { white-space: normal; margin: 0 0 6px; }

.layer-list { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.layer-row { display: flex; align-items: center; gap: 2px; padding: 1px 2px; border-radius: 8px; border: 1px solid transparent; }
.layer-row[aria-current="true"] { background: var(--accent-soft); border-color: var(--accent); }
.layer-row.off .layer-name { opacity: 0.5; }
.layer-name { flex: 1; min-width: 0; text-align: left; background: transparent; border: 0; padding: 4px 6px; font: inherit; color: inherit; cursor: pointer; overflow-wrap: anywhere; }
.layer-row .icon-btn.small .ic { width: 15px; height: 15px; }
.layer-row .icon-btn.up .ic { transform: rotate(180deg); }
.layer-row .icon-btn.small[aria-pressed="true"] { background: transparent; border-color: transparent; color: inherit; }

select { min-width: 0; max-width: 100%; text-overflow: ellipsis; }
/* Option lists of selects and multi-selects: drawn in the GUI root, never clipped; full text wraps. */
.select-menu { position: fixed; z-index: 100; display: flex; flex-direction: column; gap: 1px; overflow-y: auto; overscroll-behavior: contain; padding: var(--s-1); border-radius: var(--r-md); background: var(--glass-solid); box-shadow: var(--shadow-2); font-size: var(--fs-label); }
.select-menu [role="option"] { display: flex; align-items: center; gap: var(--s-2); width: 100%; min-height: 30px; border: 0; border-radius: var(--r-sm); padding: 5px var(--s-2); background: transparent; color: var(--fg); text-align: left; font: inherit; white-space: normal; overflow-wrap: anywhere; cursor: pointer; }
.select-menu [role="option"][hidden] { display: none; }
.select-menu-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.select-menu small, .multi-list small { color: var(--fg-3); font-size: var(--fs-help); }
.select-menu [role="option"][aria-selected="true"] { background: var(--accent-soft); color: var(--accent-hover); font-weight: 550; }
.select-menu [role="option"]:hover { background: var(--row-hover); }
.select-menu [role="option"]:focus-visible { background: var(--accent-soft); outline: 2px solid var(--accent); outline-offset: -2px; }
.select-menu [role="option"]:disabled, .select-menu [role="option"][aria-disabled="true"] { color: var(--fg-3); cursor: not-allowed; }
.select-menu [role="option"]:disabled .swatch { opacity: 0.4; }
.select-menu-search { position: sticky; top: calc(-1 * var(--s-1)); z-index: 1; flex: none; height: 28px; margin-bottom: var(--s-1); padding: 0 var(--s-2); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--ctl); color: var(--fg); font: inherit; }
.select-menu-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.select-menu-empty { padding: var(--s-2); color: var(--fg-3); }
.select-tip { position: fixed; z-index: 101; max-width: min(420px, calc(100vw - 16px)); padding: 4px var(--s-2); border-radius: var(--r-sm); background: var(--glass-solid); border: 1px solid var(--line); box-shadow: var(--shadow-1); color: var(--fg); font-size: var(--fs-help); overflow-wrap: anywhere; pointer-events: none; }
/* Palette previews sit on a neutral frame so the colours read the same on light and dark backgrounds. */
.swatch { flex: none; width: 88px; height: 12px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.5); }

/* Multi-column picker: summary button, popup list with check boxes that keep the chosen order. */
.multi-select { display: flex; align-items: center; justify-content: space-between; gap: var(--s-1); width: 100%; min-width: 0; height: var(--ctl-h); padding: 0 var(--s-2); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--ctl); color: var(--fg); font: inherit; font-size: var(--fs-label); text-align: left; cursor: pointer; }
.multi-select[data-count="0"] { color: var(--fg-3); }
.multi-select-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.multi-select[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.multi-select[aria-expanded="true"] .chev { transform: rotate(180deg); }
.multi-actions { display: flex; gap: var(--s-1); margin-bottom: var(--s-1); }
.multi-actions .btn { min-height: 24px; padding: 0 var(--s-2); font-size: var(--fs-help); }
.multi-list { display: flex; flex-direction: column; gap: 1px; }
.multi-list [role="option"] { display: flex; align-items: center; gap: var(--s-2); min-height: 28px; padding: 4px var(--s-2); border-radius: var(--r-sm); color: var(--fg); cursor: pointer; outline: none; }
.multi-list [role="option"][hidden] { display: none; }
.multi-list [role="option"]:hover { background: var(--row-hover); }
.multi-list [role="option"]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.multi-list [role="option"][aria-selected="true"] { background: var(--accent-soft); }
.multi-list [role="option"][aria-disabled="true"] { color: var(--fg-3); cursor: not-allowed; }
.multi-label { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.multi-check { flex: none; width: 15px; height: 15px; border: 1.5px solid var(--fg-3); border-radius: 4px; background: var(--ctl); }
[aria-selected="true"] > .multi-check { position: relative; border-color: var(--accent); background: var(--accent); }
[aria-selected="true"] > .multi-check::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid var(--on-accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* Category colours: a compact two-column list of colour chips, scrolling when long. */
.color-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: var(--s-1); max-height: 176px; overflow-y: auto; }
.color-chip { display: flex; align-items: center; gap: var(--s-2); min-width: 0; height: 28px; padding: 0 var(--s-2) 0 3px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--ctl); color: var(--fg); font-size: var(--fs-help); cursor: pointer; }
.color-chip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.color-chip input[type="color"] { flex: none; width: 28px; height: 20px; padding: 0; border: 0; border-radius: 5px; background: none; cursor: pointer; }
.color-chip:hover { border-color: var(--fg-3); }

[data-appearance="dark"] {
  color-scheme: dark;
  --bg: #202227; --canvas: #24262b;
  --fg: #f2f3f5; --fg-2: #c5c9d2; --fg-3: #9ca3b2;
  --accent: #78a9f5; --accent-hover: #99bfff; --accent-soft: rgba(120,169,245,.17);
  --on-accent: #171d28;
  --glass: rgba(43,46,53,.85); --glass-solid: #2b2e35; --glass-border: rgba(225,230,245,.12);
  --line: rgba(215,223,242,.18); --ctl: #353942; --ctl-hover: #424753; --ctl-press: #292d35;
  --track: rgba(210,220,240,.24); --danger: #ff9898; --danger-soft: rgba(255,152,152,.14);
  --warn: #f0bd6a; --ok: #7fd3a1; --surface-2: rgba(225,232,250,.055); --row-hover: rgba(225,232,250,.07);
  --shadow-1: 0 1px 3px #0003, 0 4px 14px #0004;
  --shadow-2: 0 2px 8px #0005, 0 14px 36px #0006;
}
[data-appearance="light"] { color-scheme: light; }
[data-appearance="dark"] .tok-c { color: #a5acb8; }
[data-appearance="dark"] .tok-s { color: #8dd7ab; }
[data-appearance="dark"] .tok-k { color: #d8a2e7; }
[data-appearance="dark"] .tok-n { color: #efbc80; }
[data-appearance="dark"] .tok-f { color: var(--accent); }
[data-appearance="dark"] .tok-o { color: #edac88; }
.pdf-note.warn, .meta-report .warn { color: var(--danger); }
#appearanceMenu { right: 0; min-width: 160px; }
#appearanceMenu [aria-checked="true"] { background: var(--accent-soft); color: var(--accent); }
#appearanceMenu [aria-checked="true"]::after { content: "✓"; margin-left: auto; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
* { scrollbar-color: var(--track) transparent; }

.select-menu-group { padding: var(--s-2) var(--s-2) 2px; color: var(--fg-3); font-size: var(--fs-help); font-weight: 600; }
.select-menu-group[hidden] { display: none; }

/* Data viewer */
.dv { position: relative; z-index: 4; flex: none; width: var(--dv-w, 520px); max-width: calc(100% - 340px); height: var(--dv-h, auto); max-height: calc(100% - 2 * var(--s-3)); display: flex; flex-direction: column; min-height: 0; margin: var(--s-3) var(--s-3) var(--s-3) 0; border-radius: var(--r-lg); box-shadow: var(--shadow-2); overflow: hidden; transition: margin var(--dur) var(--ease), width var(--dur) var(--ease), opacity var(--dur) var(--ease), visibility 0s linear 0s; }
/* Closed: the panel slides away like the settings panel (width, margin and opacity), then leaves the layout and the tab order. */
.dv[data-open="false"] { width: 0; margin-left: 0; margin-right: 0; opacity: 0; border-width: 0; pointer-events: none; visibility: hidden; transition: margin var(--dur) var(--ease), width var(--dur) var(--ease), opacity var(--dur) var(--ease), visibility 0s linear var(--dur); }
.dv-resizing .dv { transition: none; }
.dv-resize { position: absolute; top: 0; bottom: 0; left: 0; width: 6px; cursor: ew-resize; z-index: 6; touch-action: none; }
.dv-resize:hover, .dv-resize:focus-visible, .dv-resizing .dv-resize { background: var(--accent-soft); outline: none; }
.dv-resizing { user-select: none; }
.dv-resize-b { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; cursor: ns-resize; z-index: 6; touch-action: none; }
.dv-resize-c { position: absolute; left: 0; bottom: 0; width: 14px; height: 14px; cursor: nesw-resize; z-index: 7; touch-action: none; }
.dv-resize-b:hover, .dv-resize-b:focus-visible { background: var(--accent-soft); outline: none; }
.dv[data-max="true"] .dv-resize, .dv[data-max="true"] .dv-resize-b, .dv[data-max="true"] .dv-resize-c { display: none; }
.dv[data-max="true"] { position: absolute; inset: var(--s-3); width: auto; height: auto; max-width: none; max-height: none; margin: 0; }
.dv-head-actions { display: inline-flex; align-items: center; gap: var(--s-1); }
.dv-main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: var(--s-2); padding: 0 var(--s-3) var(--s-3); }
.dv-main[hidden], .dv-empty[hidden] { display: none; }
.dv-empty { margin: var(--s-4); color: var(--fg-3); }
.dv-meta { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-2); flex: none; font-size: 12px; color: var(--fg-2); }
.dv-info { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-state { flex: none; color: var(--fg-3); }
.dv-state.dirty { color: var(--accent-hover); font-weight: 600; }
.dv-bar { display: flex; align-items: center; gap: var(--s-1); flex: none; flex-wrap: wrap; }
.dv-search { flex: 1 1 120px; min-width: 0; min-height: 28px; padding: 0 var(--s-3); border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--ctl); color: var(--fg); font: inherit; font-size: 12.5px; }
.dv .btn.small { min-height: 28px; padding: 0 var(--s-3); font-size: 12.5px; }
.dv .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.dv .btn.primary:hover { background: var(--accent-hover); }
.dv .btn.primary:disabled { background: var(--ctl); border-color: var(--line); color: var(--fg); }
.dv .icon-btn.small { border-color: var(--line); background: var(--ctl); }
.dv-scroll { position: relative; flex: 1 1 auto; min-height: 80px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--canvas); font-size: var(--fs-label); outline: none; }
.dv-scroll:focus-visible { border-color: var(--accent); }
.dv-head { position: sticky; top: 0; z-index: 3; display: flex; height: 58px; background: var(--glass-solid); border-bottom: 1px solid var(--line); }
.dv-hcell { position: relative; flex: none; box-sizing: border-box; display: flex; flex-direction: column; gap: 3px; padding: 5px 8px; min-width: 0; }
.dv-hcell + .dv-hcell::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; border-left: 1px solid var(--line); }
.dv-hcell.dv-num { align-items: center; justify-content: center; color: var(--fg-3); }
.dv-hname { appearance: none; display: flex; align-items: baseline; gap: 5px; min-width: 0; padding: 0; border: 0; background: none; color: var(--fg); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.dv-hcell:has(.dv-type-num) .dv-hname { flex-direction: row-reverse; text-align: right; }
.dv-hlabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-type { flex: none; color: var(--fg-3); font-size: 10.5px; font-weight: 400; }
.dv-arrow { flex: none; color: var(--accent); font-size: 10px; }
.dv-filter { box-sizing: border-box; width: 100%; min-height: 20px; padding: 0 5px; border: 1px solid var(--line); border-radius: 5px; background: var(--ctl); color: var(--fg); font: inherit; font-size: 11.5px; }
.dv-grip { position: absolute; top: 0; right: -3px; bottom: 0; width: 7px; cursor: col-resize; z-index: 2; touch-action: none; }
.dv-grip:hover { background: var(--accent-soft); }
.dv-body { position: relative; }
.dv-row { position: absolute; left: 0; right: 0; height: 28px; border-bottom: 1px solid var(--line); }
.dv-row:hover { background: var(--row-hover); }
.dv-cell { position: absolute; top: 0; box-sizing: border-box; height: 28px; line-height: 27px; padding: 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dv-cell.dv-num { left: 0; color: var(--fg-3); font-size: var(--fs-help); text-align: right; background: var(--glass-solid); border-right: 1px solid var(--line); }
.dv-norows { position: sticky; left: 0; margin: 0; padding: var(--s-4); color: var(--fg-3); text-align: center; }
.dv-cell.num { text-align: right; }
.dv-cell.na { color: var(--fg-3); font-style: italic; }
.dv-cell.edited { background: var(--accent-soft); }
.dv-cell.sel { outline: 2px solid var(--accent); outline-offset: -2px; }
.dv-edit { position: absolute; z-index: 2; box-sizing: border-box; padding: 0 6px; border: 2px solid var(--accent); border-radius: 0; background: var(--canvas); color: var(--fg); font: inherit; outline: none; }
.dv-edit[aria-invalid="true"] { border-color: var(--danger); }
.dv-report { flex: none; max-height: 30%; overflow-y: auto; margin: 0; padding: 0; list-style: none; font-size: 12px; display: flex; flex-direction: column; gap: 3px; }
.dv-report[hidden] { display: none; }
.dv-report li { padding: 4px 8px; border-radius: var(--r-sm); background: var(--ctl); border-left: 3px solid var(--fg-3); overflow-wrap: anywhere; }
.dv-report li.ok { border-left-color: var(--accent); }
.dv-report li.warn { border-left-color: var(--warn); }
.dv-report li.err { border-left-color: var(--danger); color: var(--danger); }
@media (max-width: 960px) {
  .dv { position: absolute; top: 0; bottom: 0; right: 0; margin: var(--s-3); max-width: calc(100% - 2 * var(--s-3)); max-height: calc(100% - 2 * var(--s-3)); }
}

.dv-hint { margin: 0; font-size: 11.5px; line-height: 1.4; color: var(--fg-3); }
.dv-hint.warn { color: var(--warn); }
.dv-viewer { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.dv-viewer[hidden] { display: none; }
.meta-match { display: flex; flex-direction: column; gap: var(--s-2); }
.legend-list { display: flex; flex-direction: column; gap: var(--s-2); }
.legend-row { display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--ctl); }
.legend-row.off { opacity: 0.6; }
.legend-row-top { display: flex; align-items: center; gap: 6px; }
.legend-row-top input[type="text"] { flex: 1 1 auto; min-width: 0; min-height: 26px; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--canvas); color: var(--fg); font: inherit; }
.legend-row .icon-btn.up .ic { transform: rotate(180deg); }
.legend-row .icon-btn.small { border-color: var(--line); background: var(--ctl); }
.legend-sub { margin: 0; font-size: 11px; color: var(--fg-3); overflow-wrap: anywhere; }
.dv-join { display: flex; flex-direction: column; gap: var(--s-2); }
.dv-join summary { cursor: pointer; font-size: 12px; color: var(--fg-2); padding: 2px 0; }
.dv-join[open] summary { margin-bottom: var(--s-2); }
.meta-report { margin: 0; }

.dv-tabs { display: flex; gap: 2px; margin: 0 var(--s-3) var(--s-2); padding: 2px; border-radius: var(--r-pill); background: var(--track); }
.dv-tab { flex: 1 1 0; appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 26px; padding: 0 var(--s-3); border: 0; border-radius: var(--r-pill); background: transparent; color: var(--fg-2); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.dv-tab:hover { color: var(--fg); }
.dv-tab[aria-selected="true"] { background: var(--ctl-hover); color: var(--fg); box-shadow: 0 1px 3px rgba(20, 30, 60, 0.18); }
.dv-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.dv-count { min-width: 16px; padding: 0 5px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-hover); font-size: 11px; line-height: 16px; text-align: center; }
.dv-count:empty { display: none; }
.dv-pane { flex: none; display: flex; flex-direction: column; gap: var(--s-2); }
.dv-pane[hidden] { display: none; }
#dvPaneExtra { max-height: 50%; overflow-y: auto; }
.dv-seg { width: 100%; }
.dv-sec-head { display: flex; align-items: center; gap: var(--s-2); }
.dv-sec-head > .btn { flex: none; }
.dv-picker { appearance: none; flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 var(--s-2) 0 var(--s-3); border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--ctl); color: var(--fg); font: inherit; font-size: 12.5px; font-weight: 600; text-align: left; cursor: pointer; }
.dv-picker:hover:not(:disabled) { background: var(--ctl-hover); }
.dv-picker:disabled { color: var(--fg-3); cursor: default; }
.dv-picker[aria-expanded="true"] { border-color: var(--accent); }
.dv-picker-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-picker .chev { flex: none; width: 14px; height: 14px; color: var(--fg-3); }
.dv-menu { padding: var(--s-1); }
.dv-chip { display: flex; align-items: center; border-radius: var(--r-sm); }
.dv-chip:hover { background: var(--row-hover); }
.dv-chip:has(.dv-pick[aria-pressed="true"]) { background: var(--accent-soft); color: var(--accent-hover); }
.dv-pick { appearance: none; flex: 1 1 auto; display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 30px; padding: 0 var(--s-2); border: 0; border-radius: var(--r-sm); background: none; color: inherit; font: inherit; font-size: 12.5px; font-weight: 550; text-align: left; cursor: pointer; }
.dv-pick:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.dv-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-dot { color: var(--accent); font-size: 9px; }
.dv-join-mark { color: var(--accent); font-weight: 700; }
.dv-del { flex: none; width: 22px; min-height: 22px; margin-right: 2px; }
.dv-del .ic { width: 12px; height: 12px; }
.dv-detail { display: flex; flex-direction: column; gap: var(--s-1); padding: 0 var(--s-1); }
.dv-detail[hidden] { display: none; }
.dv-empty { margin: 0; padding: var(--s-3); border: 1px dashed var(--line); border-radius: var(--r-md); color: var(--fg-3); font-size: 12.5px; }
.dv-empty[hidden] { display: none; }
.dv-empty p { margin: 0; }
.dv-seg { display: flex; }
.dv-seg button { flex: 1 1 0; }
.dv-seg button[aria-pressed="true"] { background: var(--ctl-hover); color: var(--fg); box-shadow: 0 1px 3px rgba(20, 30, 60, 0.18); }

.source-controls { display: flex; align-items: center; gap: var(--s-1); min-width: 0; }
.source-controls select { flex: 1 1 0; width: 0; }
.source-controls .icon-btn.small { flex: none; width: var(--ctl-h); min-height: var(--ctl-h); border-color: var(--line); background: var(--ctl); }
.extra-range { display: grid; gap: var(--s-1); min-width: 0; }

/* Second-level navigation of the tree data: an underlined tab row, lighter than the first-level segmented control. */
.dv-subtabs { display: flex; gap: var(--s-3); border-bottom: 1px solid var(--line); }
.dv-subtabs button { appearance: none; position: relative; padding: 4px 2px 7px; border: 0; background: none; color: var(--fg-2); font: inherit; font-size: var(--fs-label); font-weight: 550; cursor: pointer; }
.dv-subtabs button:hover { color: var(--fg); }
.dv-subtabs button[aria-pressed="true"] { color: var(--fg); }
.dv-subtabs button[aria-pressed="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.dv-subtabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 4px; }

/* Overview dashboard of the tree file */
.dv-dash { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: var(--s-3); padding-bottom: var(--s-2); }
.dv-summary { margin: 0; color: var(--fg); font-size: 13px; line-height: 1.55; }
.dv-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: var(--s-2); }
.dv-stat, .dv-panel { padding: var(--s-2) var(--s-3); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--ctl); }
.dv-stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dv-stat-k { color: var(--fg-2); font-size: var(--fs-help); font-weight: 550; }
.dv-stat-v { color: var(--fg); font-size: 22px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dv-stat-sub { color: var(--fg-3); font-size: var(--fs-help); }
.dv-panel { display: flex; flex-direction: column; gap: var(--s-2); }
.dv-panel h4 { margin: 0; color: var(--fg); font-size: var(--fs-module); font-weight: var(--fw-module); }
.dv-panel h5 { margin: var(--s-1) 0 0; color: var(--fg-2); font-size: var(--fs-help); font-weight: 550; }
.dv-kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px var(--s-3); margin: 0; font-size: var(--fs-label); }
.dv-kv dt { color: var(--fg-2); }
.dv-kv dd { margin: 0; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-minis { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: var(--s-1); }
.dv-mini { display: flex; flex-direction: column; gap: 1px; padding: 6px var(--s-2); border-radius: var(--r-sm); background: var(--surface-2); min-width: 0; }
.dv-mini span { color: var(--fg-2); font-size: var(--fs-help); }
.dv-mini strong { color: var(--fg); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dv-hist-fig { margin: 0; }
.dv-hist { display: block; width: 100%; height: 96px; }
.dv-hist-bar { fill: var(--accent); }
.dv-hist-hit { fill: transparent; }
.dv-hist g:hover .dv-hist-bar { fill: var(--accent-hover); }
.dv-hist g:hover .dv-hist-hit { fill: var(--row-hover); }
.dv-hist-base { stroke: var(--line); stroke-width: 1; }
.dv-hist-axis { display: flex; justify-content: space-between; color: var(--fg-3); font-size: var(--fs-help); font-variant-numeric: tabular-nums; }
.dv-note { margin: 0; color: var(--fg-3); font-size: var(--fs-help); line-height: 1.5; }
.dv-note.warn { color: var(--warn); }
.dv-note.warn::before { content: "⚠ "; }
.dv-emptystate { padding: var(--s-3); border: 1px dashed var(--line); border-radius: var(--r-sm); text-align: center; }

/* Pager under the table */
.dv-pager { flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-1) var(--s-3); color: var(--fg-2); font-size: var(--fs-help); }
.dv-range { font-variant-numeric: tabular-nums; }
.dv-pagesize { display: inline-flex; align-items: center; gap: var(--s-1); }
.dv-pagesize select, .dv-pagenav input { height: 26px; padding: 0 var(--s-2); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--ctl); color: var(--fg); font: inherit; }
.dv-pagenav { display: inline-flex; align-items: center; gap: var(--s-1); font-variant-numeric: tabular-nums; }
.dv-pagenav input { width: 56px; text-align: right; min-height: 0; }
.dv-pagenav .icon-btn.small { width: 26px; min-height: 26px; border-color: var(--line); background: var(--ctl); }
.dv-prev .ic { transform: rotate(90deg); }
.dv-next .ic { transform: rotate(-90deg); }
.dv-bar .btn.small[id="dvCsv"] { margin-left: auto; }

.modal { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: var(--s-4); background: rgba(10, 16, 28, 0.38); }
.modal[hidden] { display: none; }
.modal-box { width: min(420px, 100%); padding: var(--s-4); border-radius: var(--r-lg); box-shadow: var(--shadow-2); background: var(--glass-solid); }
.modal-box h2 { margin: 0 0 var(--s-2); font-size: 15px; }
.modal-box p { margin: 0 0 var(--s-4); color: var(--fg-2); line-height: 1.5; white-space: pre-line; }
.modal-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); justify-content: flex-end; }
.modal-actions .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.modal-actions .btn.primary:hover { background: var(--accent-hover); }

/* Tree views: the opened tree and the subtrees extracted from it */
.view-tabs { display: inline-flex; align-items: center; gap: 2px; padding: 2px; margin-left: var(--s-2); border-radius: var(--r-pill); background: var(--track); max-width: 40%; overflow: hidden; }
.view-tab { display: inline-flex; align-items: center; border-radius: var(--r-pill); min-width: 0; }
.view-tab > button:first-child { appearance: none; border: 0; background: transparent; color: var(--fg-2); font: inherit; font-weight: 500; min-height: 26px; padding: 0 var(--s-3); border-radius: var(--r-pill); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.view-tab.on { background: var(--ctl-hover); box-shadow: 0 1px 3px rgba(20, 30, 60, 0.18); }
.view-tab.on > button:first-child { color: var(--fg); }
.view-tab .icon-btn.small { width: 22px; height: 22px; margin-right: 2px; }
.view-tab .icon-btn.small .ic { width: 14px; height: 14px; }
.orient-block { gap: var(--s-2); }
.orient-group { display: flex; flex-direction: column; gap: var(--s-1); padding: var(--s-2); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.orient-label { color: var(--fg-3); font-size: var(--fs-help); font-weight: var(--fw-group); letter-spacing: 0.02em; }
.orient-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-1); }
.orient-actions .btn { min-height: var(--ctl-h); padding: 3px var(--s-2); border-radius: var(--r-sm); }
.segmented.orient-mirror { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); width: 100%; border-radius: var(--r-sm); }
.segmented.orient-mirror button { min-height: 26px; padding: 3px var(--s-1); border-radius: 6px; white-space: normal; line-height: 1.25; }
.segmented.orient-mirror button.on { color: var(--accent-hover); }
.slider-row { display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-1); padding: var(--s-2) var(--s-3); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); color: var(--fg-2); font-size: var(--fs-label); font-weight: var(--fw-label); }
.slider-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.slider-row output { min-width: 3.4em; padding: 1px var(--s-2); border-radius: var(--r-sm); background: var(--ctl); border: 1px solid var(--line); color: var(--fg); font-variant-numeric: tabular-nums; font-size: var(--fs-help); text-align: center; }
.slider-row input[type="range"] { appearance: none; -webkit-appearance: none; width: 100%; min-width: 0; height: 16px; margin: 0; background: transparent; cursor: pointer; }
.slider-row input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: var(--r-pill); background: var(--track); }
.slider-row input[type="range"]::-moz-range-track { height: 4px; border-radius: var(--r-pill); background: var(--track); }
.slider-row input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; border: 2px solid var(--accent); background: var(--ctl-hover); box-shadow: var(--shadow-1); transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.slider-row input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--accent); background: var(--ctl-hover); box-shadow: var(--shadow-1); transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.slider-row input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.12); }
.slider-row input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.2); background: var(--accent); }
.slider-row input[type="range"]:focus-visible { outline: none; }
.slider-row input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--accent-soft); }
.slider-row input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--accent-soft); }
.slider-row input[type="range"]:disabled { cursor: not-allowed; opacity: 0.45; }
.props .field-row > input[type="color"] { justify-self: end; }
.anno-row input[type="number"] { flex: 0 0 72px; min-width: 0; min-height: var(--ctl-h); padding: 0 var(--s-2); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--ctl); color: var(--fg); font: inherit; }
.anno-row input[type="number"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.remove-ids { margin: 0 var(--s-4); min-height: 72px; padding: var(--s-2) var(--s-3); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--ctl); color: var(--fg); font: 12px/1.4 ui-monospace, monospace; resize: vertical; }
.remove-ids:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#removePreview { margin: 0 var(--s-4); }
#removeConfirm { margin: 0 var(--s-4); width: auto; }

/* Colour picker popover shared by all colour inputs */
.color-pop { position: fixed; z-index: 1000; width: 208px; padding: var(--s-3); display: flex; flex-direction: column; gap: var(--s-3); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--glass-solid); box-shadow: var(--shadow-2); }
.color-pop[hidden] { display: none; }
.cp-sv { position: relative; height: 128px; border-radius: var(--r-sm); background: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, var(--cp-hue, #f00)); cursor: crosshair; touch-action: none; }
.cp-hue { position: relative; height: 12px; border-radius: 6px; background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); cursor: pointer; touch-action: none; }
.cp-handle { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45); pointer-events: none; }
.cp-hue .cp-handle { top: 50%; }
.cp-row { display: flex; align-items: center; gap: var(--s-2); }
.cp-preview { flex: none; width: 28px; height: 28px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.cp-hex { flex: 1 1 auto; min-width: 0; height: 28px; padding: 0 var(--s-2); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--ctl); color: var(--fg); font: inherit; font-family: var(--mono); font-size: var(--fs-label); text-transform: uppercase; }
.cp-hex.invalid { border-color: #d03b3b; }

/* Colour editor: per-category colours (virtual list) or gradient control points, opened from the palette select. */
.pal-edit { position: fixed; z-index: 900; box-sizing: border-box; padding: var(--s-3); display: flex; flex-direction: column; gap: var(--s-2); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-2); font-size: var(--fs-label); color: var(--fg); }
.pal-edit[hidden] { display: none; }
.pe-head { display: flex; align-items: center; gap: var(--s-2); }
.pe-head strong { flex: 1 1 auto; font-weight: var(--fw-label); }
.pe-count { color: var(--fg-3); }
.pe-close, .pe-undo, .pe-add, .pe-del, .pe-restore-all { height: 24px; min-width: 24px; padding: 0 var(--s-2); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--ctl); color: var(--fg-2); font: inherit; cursor: pointer; }
.pe-close { border-color: transparent; background: none; font-size: 16px; line-height: 1; }
.pe-close:hover, .pe-undo:hover, .pe-add:hover, .pe-del:hover:not(:disabled), .pe-restore-all:hover { border-color: var(--fg-3); }
.pe-del:disabled { opacity: 0.4; cursor: not-allowed; }
.pe-search, .pe-hex { box-sizing: border-box; height: 26px; padding: 0 var(--s-2); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--ctl); color: var(--fg); font: inherit; }
.pe-hex { width: 76px; flex: none; font-family: var(--mono); text-transform: uppercase; }
.pe-hex.invalid { border-color: #d03b3b; }
.pe-list { position: relative; overflow-y: auto; overscroll-behavior: contain; }
.pe-list[data-empty] { overflow: hidden; }
.pe-spacer { width: 1px; }
.pe-list > .pe-row { position: absolute; left: 0; right: 0; height: 30px; }
.pe-row { display: flex; align-items: center; gap: var(--s-2); min-height: 30px; box-sizing: border-box; }
.pe-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pe-sw { flex: none; width: 32px; height: 22px; padding: 1px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--ctl); cursor: pointer; }
.pe-undo[hidden] { display: none; }
.pe-undo { visibility: visible; }
.pe-foot { display: flex; gap: var(--s-2); align-items: center; }
.pe-bar { height: 14px; border: 1px solid var(--line); border-radius: 7px; }
.pe-stops { display: flex; flex-direction: column; max-height: 260px; overflow-y: auto; }
.pe-empty { margin: 0; color: var(--fg-3); }

#icp { flex: none; padding: 2px var(--s-3); text-align: center; font-size: 12px; line-height: 18px; }
#icp a { color: var(--fg-3); text-decoration: none; }
#icp a:hover { color: var(--fg-2); text-decoration: underline; }
