:root {
  --bg: #f6f7f9;
  --surface: #fff;
  --border: #d9dde3;
  --text: #1d2330;
  --muted: #6b7382;
  --accent: #2f6fde;
  --accent-soft: #e3ecfc;
  --danger: #c93b3b;
  --node: #fff;
  --node-border: #8b93a3;
  --arc: #6e7685;
  --grid: #e7e9ee;
  --observed: #d9480f;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16191f;
    --surface: #1e222a;
    --border: #353b47;
    --text: #e3e6ec;
    --muted: #949cab;
    --accent: #6d9bf1;
    --accent-soft: #233350;
    --danger: #f07171;
    --node: #262b35;
    --node-border: #6c7484;
    --arc: #9aa2b1;
    --grid: #20242c;
    --observed: #ff8a4c;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  display: flex;
  flex-direction: column;
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}
button, input, select, textarea { font: inherit; color: inherit; }
button, .file-button {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  white-space: nowrap;
}
button:hover, .file-button:hover { border-color: var(--accent); }
button:disabled { opacity: 0.45; cursor: default; border-color: var(--border); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { color: var(--danger); }
button.small { padding: 1px 7px; font-size: 12px; }
button.icon { border: none; background: none; padding: 0 4px; color: var(--muted); }
button.icon:hover { color: var(--danger); }
input[type=text], input[type=number], select, textarea {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 5px;
  padding: 3px 6px;
  min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

.toolbar {
  display: flex;
  flex-wrap: wrap; /* below about 980px the buttons go onto a second row rather than squeezing */
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.brand { margin-right: 8px; position: relative; cursor: default; white-space: nowrap; }
/* A hover bubble spelling out "BN", styled like .drag-tip */
.brand::after, .brand::before {
  position: absolute;
  left: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 0.12s, transform 0.12s;
}
.brand::after {
  content: attr(data-tip);
  top: calc(100% + 10px);
  padding: 5px 9px;
  border-radius: 7px;
  background: var(--text);
  color: var(--surface);
  font-size: 12px;
  font-weight: normal;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgb(0 0 0 / 0.25);
}
.brand::before {
  content: "";
  top: calc(100% + 4px);
  left: 14px;
  border: 6px solid transparent;
  border-top: 0;
  border-bottom-color: var(--text);
}
.brand:hover::after, .brand:hover::before { opacity: 1; transform: none; transition-delay: 0.25s; }
.sep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }
.grow { flex: 1; }
.hint, .muted { color: var(--muted); font-size: 12px; }
.toolbar .hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
/* The shortcuts are also in the side panel's help; drop them once they no longer fit on one line. */
@media (max-width: 1400px) { .toolbar .hint { display: none; } }
/* Tighter toolbar so it stays on one row down to about 860px. */
@media (max-width: 1040px) {
  .toolbar { gap: 3px; }
  .toolbar button { padding: 4px 5px; }
  .toolbar .sep { margin: 0 2px; }
}

main { flex: 1; display: flex; min-height: 0; }
#work { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#canvas-wrap { position: relative; flex: 1; min-height: 0; }
#canvas-wrap.dropping { outline: 3px dashed var(--accent); outline-offset: -6px; }
#canvas {
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
  user-select: none;
  touch-action: none;
  background-color: var(--bg);
}
#grid { pointer-events: none; }
.grid-dot { fill: var(--grid); }
#canvas.panning { cursor: grabbing; }

.node rect.body { fill: var(--node); stroke: var(--node-border); stroke-width: 1.5; }
.node { cursor: grab; }
.node.selected rect.body { stroke: var(--accent); stroke-width: 2.5; }
.node.target rect.body { stroke: var(--accent); stroke-dasharray: 4 3; stroke-width: 2.5; }
.node text { fill: var(--text); pointer-events: none; }
.node .name { font-weight: 600; font-size: 14px; }
.node .states { font-size: 11px; fill: var(--muted); }
.node .bad { fill: var(--danger); }
.node .port {
  fill: var(--accent);
  stroke: var(--node);
  stroke-width: 2;
  opacity: 0;
  cursor: crosshair;
  transition: opacity 0.1s;
}
.node:hover .port, .node.selected .port { opacity: 1; }
.arc path.line { stroke: var(--arc); stroke-width: 1.6; fill: none; }
.arc path.hit { stroke: transparent; stroke-width: 12; fill: none; cursor: pointer; }
.arc:hover path.line { stroke: var(--accent); }
.arc.selected path.line { stroke: var(--accent); stroke-width: 2.5; }
.arrowhead { fill: var(--arc); }
.arrowhead.sel { fill: var(--accent); }
.ghost { stroke: var(--accent); stroke-width: 1.6; stroke-dasharray: 5 4; fill: none; }
.rubber { fill: var(--accent-soft); fill-opacity: 0.5; stroke: var(--accent); stroke-dasharray: 3 3; }

#inline-edit {
  position: absolute;
  text-align: center;
  font-weight: 600;
  z-index: 5;
}

#side { position: relative; flex: none; display: flex; border-left: 1px solid var(--border); background: var(--surface); }
#panel {
  width: clamp(300px, 30vw, 400px);
  overflow: auto;
  padding: 12px 14px 40px;
}
#panel-toggle { position: absolute; top: 9px; right: 8px; z-index: 2; font-size: 18px; line-height: 1; padding: 2px 6px; }
#panel-toggle:hover, #panel-strip:hover { color: var(--accent); }
#panel-strip { display: none; }
/* Collapsed, the side panel is a strip naming what it would show; clicking it opens the panel again. */
#side.collapsed #panel, #side.collapsed #panel-toggle { display: none; }
#side.collapsed #panel-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 34px;
  padding: 12px 0;
  border: none;
  border-radius: 0;
  background: none;
  color: var(--muted);
  font-size: 12px;
  writing-mode: vertical-rl;
  white-space: nowrap;
  overflow: hidden;
}
#panel-strip::before { content: "‹"; writing-mode: horizontal-tb; font-size: 18px; }
#panel h2 { font-size: 15px; margin: 0 0 10px; }
#panel h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 18px 0 6px; display: flex; align-items: center; gap: 6px; }
#panel h3 .grow { flex: 1; }
.field { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 6px; margin-bottom: 6px; }
.field label { color: var(--muted); font-size: 13px; }
.states-list { display: flex; flex-direction: column; gap: 3px; }
.state-row { display: flex; align-items: center; gap: 4px; }
.state-row input { flex: 1; }
.state-row .idx { width: 18px; color: var(--muted); font-size: 11px; text-align: right; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { display: inline-flex; align-items: center; gap: 2px; background: var(--accent-soft); border-radius: 10px; padding: 1px 4px 1px 9px; font-size: 13px; cursor: pointer; }
.chip button.icon { font-size: 13px; }
.warn { color: var(--danger); font-size: 13px; }
ul.warn { padding-left: 18px; margin: 6px 0; max-height: 140px; overflow: auto; }
.import-networks { display: flex; align-items: center; gap: 8px; margin: 8px 0 2px; font-size: 13px; }
.import-networks[hidden] { display: none; }
.import-result { margin: 8px 0 0; padding: 8px 12px; border-radius: 8px; font-size: 13px; border: 1px solid; }
.import-result[hidden] { display: none; }
.import-result p { margin: 0; }
.import-result ul { padding-left: 18px; margin: 6px 0 0; max-height: 140px; overflow: auto; }
.import-result.ok { --tone: #1f8a4c; border-color: color-mix(in srgb, var(--tone) 45%, transparent); background: color-mix(in srgb, var(--tone) 9%, transparent); }
.import-result.ok b { color: var(--tone); }
/* nonfatal notes about a network that was imported: amber, not the red of a failure */
.import-result.ok ul { color: color-mix(in srgb, #b86e00 80%, var(--text)); }
.import-result.failed { border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: color-mix(in srgb, var(--danger) 8%, transparent); color: var(--danger); }
.import-networks select { font: inherit; padding: 3px 6px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg); color: var(--text); }
.link { color: var(--accent); cursor: pointer; text-decoration: underline; }
.help dt { font-weight: 600; margin-top: 6px; }
.help dd { margin: 0 0 0 0; color: var(--muted); }
.panel-foot { margin-top: 18px; font-size: 12px; }
.panel-foot a { color: inherit; }
.panel-foot a:hover { color: var(--accent); }
kbd { font: 11px ui-monospace, monospace; border: 1px solid var(--border); border-radius: 3px; padding: 0 4px; background: var(--bg); }

dialog {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  width: min(900px, 92vw);
  padding: 16px 18px;
}
dialog::backdrop { background: rgb(0 0 0 / 0.35); }
dialog h2 { margin: 0 0 8px; font-size: 16px; }
dialog textarea {
  width: 100%;
  height: 60vh;
  font: 12.5px/1.45 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  resize: vertical;
  white-space: pre;
}
.dialog-actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; }

#toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--surface);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
#toast.show { opacity: 1; }
.ghost, .rubber { pointer-events: none; }

/* ---------------------------------------------------------------- CPT dock */
#cpt-dock {
  position: relative;
  flex: none;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
#cpt-dock.collapsed .cpt-scroll { display: none; }
.dock-resize { position: absolute; top: -4px; left: 0; right: 0; height: 8px; cursor: ns-resize; z-index: 3; }
.dock-resize:hover { background: linear-gradient(transparent 3px, var(--accent) 3px, var(--accent) 5px, transparent 5px); }
.dock-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  font-size: 13px;
}
#cpt-dock.collapsed .dock-head { border-bottom: none; }
.dock-title { font-size: 14px; }
.dock-title .given { color: var(--muted); margin: 0 2px; }
.dock-status { color: var(--muted); font-size: 12px; }
.dock-status.bad { color: var(--danger); font-weight: 600; }
.linkish { border: none; background: none; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font-size: inherit; }
.linkish:hover { border: none; }
.seg-toggle { display: inline-flex; }
.seg-toggle button { border-radius: 0; color: var(--muted); }
.seg-toggle button:first-child { border-radius: 6px 0 0 6px; }
.seg-toggle button:last-child { border-radius: 0 6px 6px 0; margin-left: -1px; }
.seg-toggle button.on { background: var(--accent-soft); color: var(--text); border-color: var(--accent); position: relative; }
label.check { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); cursor: pointer; }
button.collapse { font-size: 14px; color: var(--muted); }
button.collapse:hover { color: var(--text); }
.dock-empty { color: var(--muted); padding: 10px 14px; margin: 0; }

.cpt-scroll { flex: 1; min-height: 0; overflow: auto; outline: none; }
table.cpt-grid { border-collapse: separate; border-spacing: 0; margin: 0; max-width: 100%; font-size: 15px; font-variant-numeric: tabular-nums; }
.cpt-grid th, .cpt-grid td { border-bottom: 1px solid var(--border); padding: 0 10px; height: 30px; white-space: nowrap; }
.cpt-grid thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  text-align: left;
  font-weight: 600;
  height: auto;
  padding: 5px 8px;
  vertical-align: bottom;
  cursor: default;
}
.cpt-grid th.pcol { border-right: 1px solid var(--border); }
.cpt-grid th.pcol select { margin-top: 2px; font-size: 13px; padding: 0 2px; max-width: 120px; font-weight: normal; }
.cpt-grid th.bar-h { width: 360px; min-width: 160px; white-space: normal; cursor: pointer; }
.cpt-grid th.bar-h .muted { display: block; font-weight: normal; font-size: 12px; }
.cpt-grid th.state { text-align: right; min-width: 84px; cursor: pointer; }
.cpt-grid th.state:hover, .cpt-grid th.bar-h:hover { color: var(--accent); }
.sw { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: 0; }
.cpt-grid td.pcell { border-right: 1px solid var(--border); cursor: pointer; vertical-align: top; padding-top: 6px; }
.cpt-grid td.pcell:hover { background: var(--accent-soft); }
.cpt-grid td.bar-cell { padding: 0 10px; }
.cpt-grid td.cell { text-align: right; cursor: cell; position: relative; }
.cpt-grid td.cell.sel { background: var(--accent-soft); }
.cpt-grid td.cell.active { box-shadow: inset 0 0 0 2px var(--accent); }
.cpt-scroll:not(:focus-within) td.cell.active { box-shadow: inset 0 0 0 2px var(--border); }
.cpt-grid td.status { color: var(--danger); font-size: 13px; min-width: 80px; }
.cpt-grid tr.bad td.cell, .cpt-grid tr.bad td.bar-cell { background-color: color-mix(in srgb, var(--danger) 8%, transparent); }
.cpt-grid tr.bad td.cell.sel { background: var(--accent-soft); }
input.cell-edit {
  position: absolute;
  inset: 2px;
  width: calc(100% - 4px);
  text-align: right;
  border: none;
  outline: 2px solid var(--accent);
  border-radius: 2px;
  padding: 0 6px;
  background: var(--surface);
}

.bar {
  position: relative;
  height: 24px;
  border-radius: 5px;
  background: repeating-linear-gradient(45deg, var(--bg), var(--bg) 4px, var(--border) 4px, var(--border) 5px);
  overflow: visible;
  cursor: pointer;
}
.bar .seg {
  position: absolute;
  top: 0;
  bottom: 0;
  overflow: hidden;
  font-size: 13px;
  line-height: 24px;
  text-align: center;
  font-weight: 600;
  user-select: none;
}
.bar .handle {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 11px;
  margin-left: -5.5px;
  cursor: ew-resize;
  z-index: 1;
  touch-action: none;
}
.bar .handle::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 2px;
  background: var(--surface);
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.25);
  opacity: 0.85;
}
.bar .handle:hover::after { background: var(--accent); opacity: 1; }

.menu-anchor { position: relative; }
.menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 20;
  min-width: 260px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 6px 24px rgb(0 0 0 / 0.15);
}
.menu button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  border: none;
  border-radius: 5px;
  padding: 6px 10px;
  text-align: left;
}
.menu button span { color: var(--muted); font-size: 12px; }
.menu button:hover, .menu button:focus { background: var(--accent-soft); outline: none; }

.help-button {
  width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  line-height: 1;
}
.help-popover {
  width: min(440px, 90vw);
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 10px 40px rgb(0 0 0 / 0.25);
  font-size: 13px;
}
.help-popover::backdrop { background: rgb(0 0 0 / 0.15); }
.help-popover h3 { margin: 0 0 6px; font-size: 14px; }
.help-popover ul { padding-left: 18px; margin: 6px 0; }
.help-popover li { margin-bottom: 6px; }
.help-popover p { margin: 6px 0; }
.help-popover code { font-size: 12px; background: var(--bg); padding: 0 3px; border-radius: 3px; }
@keyframes cell-adjusted { from { background-color: color-mix(in srgb, var(--accent) 35%, transparent); } }
.cpt-grid td.cell.adjusted { animation: cell-adjusted 1.6s ease-out; }
.dock-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.row-actions { position: relative; display: inline-flex; }
.row-action-list { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.compact-only { display: none; }
/* One-line header (see fitHeader in cpt.js): nothing may shrink, so overflow can be measured. */
.dock-head.single, .dock-head.single .dock-tools { flex-wrap: nowrap; }
.dock-head.single > *, .dock-head.single .dock-tools > * { flex-shrink: 0; white-space: nowrap; }
.dock-head.compact .full-only { display: none; }
.dock-head.compact .compact-only { display: inline; }
.dock-head.compact button.compact-only { display: inline-block; }
.dock-head.compact .row-action-list {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 20;
  flex-direction: column;
  align-items: stretch;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 6px 24px rgb(0 0 0 / 0.18);
}
.dock-head.compact .row-actions.open .row-action-list { display: flex; }
.dock-head.compact .row-action-list .scope { font-size: 11px; padding: 0 2px 2px; }
.dock-head.compact .row-action-list button { text-align: left; }
#cpt-dock.compact .dist-hint { display: none; }
.nowrap { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

/* ---------------------------------------------------------------- probabilities & evidence */
button.toggle[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
.node .state-row { cursor: pointer; }
.node .row-hit { fill: transparent; }
.node .state-row:hover .row-hit { fill: var(--accent-soft); }
.node .slabel { font-size: 12px; }
.node .pct { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.node .pbar-bg { fill: var(--bg); stroke: var(--border); stroke-width: 0.5; }
.node .pbar { fill: var(--accent); opacity: 0.85; }
.node.observed rect.body { stroke: var(--observed); stroke-width: 2.5; }
.node.observed.selected rect.body { stroke: var(--accent); }
.node .state-row.observed .row-hit { fill: color-mix(in srgb, var(--observed) 15%, transparent); }
.node .state-row.observed .slabel, .node .state-row.observed .pct { font-weight: 700; fill: var(--observed); }
.node .state-row.observed .pbar { fill: var(--observed); }

#evidence-bar {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: calc(100% - 20px);
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  font-size: 13px;
  z-index: 4;
}
#evidence-bar[hidden] { display: none; }
.ev-label { font-weight: 600; color: var(--observed); }
/* The hint wraps within itself on narrow canvases, keeping the Soft evidence toggle beside it. */
.ev-hint { flex: 1 1 0; min-width: 14em; }
.ev-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 3px 1px 9px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--observed) 15%, transparent);
}
.ev-chip button.icon { font-size: 12px; }

/* ---------------------------------------------------------------- soft evidence */
.node.soft-observed rect.body { stroke: var(--observed); stroke-width: 2.5; stroke-dasharray: 6 3; }
.node.soft-observed.selected rect.body { stroke: var(--accent); }
#evidence-bar .sep { height: 18px; }
.ev-chip.soft { cursor: pointer; background: transparent; border: 1px dashed var(--observed); }
.ev-chip.soft:hover { background: color-mix(in srgb, var(--observed) 12%, transparent); }
#soft-editor {
  position: absolute;
  z-index: 6;
  width: 300px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 8px 30px rgb(0 0 0 / 0.2);
  font-size: 13px;
}
#soft-editor[hidden] { display: none; }
#soft-editor p { margin: 4px 0 8px; font-size: 12px; }
.soft-head { display: flex; align-items: center; gap: 6px; }
.soft-row { display: grid; grid-template-columns: 70px 1fr auto; align-items: center; gap: 8px; margin: 4px 0; }
.soft-row .slabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soft-row input[type=range] { width: 100%; accent-color: var(--observed); }
.soft-row input[type=number] { width: 64px; text-align: right; }
.soft-row .soft-num { display: inline-flex; align-items: center; gap: 2px; }
.soft-kind { margin: 8px 0 2px; }
.soft-actions { display: flex; gap: 6px; align-items: center; margin-top: 8px; }

/* ---------------------------------------------------------------- CPT row targeting */
.cpt-grid td.bar-cell .bar { width: 100%; }
.cpt-grid tbody tr.odd td:not(.pcell) { background-color: color-mix(in srgb, var(--text) 3%, transparent); }
.cpt-grid tbody tr.group-start td, .cpt-grid tbody tr.group-start td.pcell { border-top: 2px solid color-mix(in srgb, var(--text) 25%, transparent); }
.cpt-grid tbody tr.hot td:not(.pcell), .cpt-grid td.pcell.hot { background-color: color-mix(in srgb, var(--accent) 13%, transparent); }
.cpt-grid td.pcell.hot { color: var(--accent); font-weight: 600; }
.cpt-grid tbody tr.hot td.bar-cell { box-shadow: inset 3px 0 0 var(--accent); }
.cpt-scroll.dragging tbody tr:not(.hot) td:not(.pcell), .cpt-scroll.dragging td.pcell:not(.hot) { opacity: 0.35; }
.cpt-scroll.dragging, .cpt-scroll.dragging * { cursor: ew-resize !important; }
.drag-tip {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  padding: 5px 9px;
  border-radius: 7px;
  background: var(--text);
  color: var(--surface);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 4px 16px rgb(0 0 0 / 0.25);
  white-space: nowrap;
}
.drag-tip[hidden] { display: none; }
.drag-tip .tip-change { display: flex; gap: 12px; margin-top: 2px; }
.drag-tip .sw { margin-right: 4px; }

#gist-dialog { width: min(560px, 92vw); }
#gist-dialog p { font-size: 13px; line-height: 1.45; margin: 0 0 8px; }
#gist-dialog .gist-warning { padding: 8px 12px; border-radius: 8px; border: 1px solid color-mix(in srgb, #b86e00 45%, transparent); background: color-mix(in srgb, #b86e00 9%, transparent); }
#gist-link { width: 100%; box-sizing: border-box; margin: 10px 0 6px; padding: 6px 8px; font: 12px ui-monospace, monospace; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); }
#gist-page { color: var(--accent); }
#share-menu { min-width: 330px; }
