:root {
  color-scheme: dark;
  --bg: #111113;
  --panel: #18181d;
  --raised: #202026;
  --line: #35353f;
  --muted: #aeabb6;
  --ink: #f5f0e8;
  --red: #ff655c;
  --gold: #edc28b;
  --person: #82d1c5;
  --organization: #e2b583;
  --event: #ef9086;
  --institution: #b1a9eb;
  --mono: "Cascadia Mono", Consolas, monospace;
  --sans: Inter, "Segoe UI", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
}
body.board-view {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 400px;
}
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; background: none; border: 1px solid transparent; text-align: left; }
a { color: var(--ink); text-underline-offset: 4px; }
a:hover { color: var(--red); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
button:disabled, select:disabled { cursor: default; opacity: .55; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.top {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2.8vw, 40px);
  padding: 0 clamp(14px, 2.6vw, 38px);
  background: #17171b;
  border-bottom: 1px solid var(--line);
  min-height: 60px;
  flex-shrink: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  font-weight: 900;
  letter-spacing: -.07em;
  line-height: 1;
  white-space: nowrap;
  text-transform: uppercase;
}
.brand img { flex: none; }
.brand-dot { color: var(--red); }
a.brand { text-decoration: none; }
.tabs {
  display: flex;
  align-self: stretch;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}
.tabs :is(button, a) {
  display: inline-flex;
  align-items: center;
  padding: 12px clamp(8px, 1.2vw, 17px);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  font-size: .86rem;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
}
.tabs :is(button, a):hover, .tabs :is([aria-pressed="true"], [aria-current="true"]) { color: var(--ink); }
.tabs :is([aria-pressed="true"], [aria-current="true"]) { border-bottom-color: var(--red); }
.export {
  margin-left: auto;
  white-space: nowrap;
  font-size: .79rem;
  font-weight: 650;
}
.language {
  display: flex;
  gap: .65rem;
  font: 700 .76rem var(--mono);
}
.language a { color: var(--muted); text-decoration: none; }
.language [aria-current] { color: var(--red); }

.workspace {
  position: relative;
  min-width: 0;
}
.board-view .workspace {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}
.command-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  flex-shrink: 0;
  gap: 10px;
  padding: 10px clamp(14px, 2.6vw, 38px);
  border-bottom: 1px solid var(--line);
  background: #151519;
}
.control, .control-field, .search, .filter-field select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--raised);
}
.control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 11px;
  font-size: .84rem;
  font-weight: 700;
  white-space: nowrap;
}
.control:hover, .control[aria-expanded="true"] { border-color: var(--red); }
.control svg, .search svg {
  width: 16px;
  height: 16px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
}
.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 590px;
  min-width: 140px;
  flex: 1 1 210px;
  padding-left: 10px;
  color: var(--muted);
}
.search input {
  min-width: 0;
  width: 100%;
  padding: 6px 9px 6px 0;
  color: var(--ink);
  background: none;
  border: 0;
  font-size: .84rem;
}
.search:focus-within { border-color: var(--red); }
.search input:focus-visible { outline: none; }
.search-suggestions { position: absolute; z-index: 20; top: calc(100% + 4px); left: -1px; right: -1px; margin: 0; padding: 4px; list-style: none; background: var(--raised); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 10px 28px #0009; }
.search-suggestions[hidden] { display: none; }
.search-suggestions li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 7px 9px; border-radius: 4px; color: var(--ink); font-size: .84rem; cursor: pointer; }
.search-suggestions li small { flex: none; color: var(--muted); font-size: .72rem; }
.search-suggestions li:is(:hover, [aria-selected=true]) { background: var(--line); }
.search-suggestions li[aria-selected=true] { box-shadow: inset 2px 0 0 var(--red); }
.graph-controls { display: flex; align-items: center; gap: 8px; min-width: 0; }
.board-view.connection-view .workspace { display: grid; grid-template-columns: 292px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
.connection-view .command-bar { grid-column: 1 / -1; grid-row: 1; }
.connection-view .board { grid-column: 2; grid-row: 2; }
.connection-panel { grid-column: 1; grid-row: 2; min-height: 0; padding: 14px 16px; overflow-y: auto; border-right: 1px solid var(--line); background: #18181d; }
.connection-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.connection-heading h2 { font-size: 1rem; font-weight: 700; }
.connection-heading .close-control { width: 30px; height: 30px; }
.connection-form { display: grid; grid-template-columns: minmax(0, 1fr) 38px; gap: 12px 8px; align-items: end; }
.connection-form > .connection-field, .connection-form > button:not(#connection-swap) { grid-column: 1 / -1; }
.connection-filter-toggle { display: flex; align-items: center; gap: 7px; grid-column: 1 / -1; font-size: .77rem; color: var(--muted); }
.connection-filter-toggle input { accent-color: var(--red); }
.connection-form > .connection-field:has(#connection-to) { grid-column: 1; grid-row: 2; }
#connection-swap { grid-column: 2; grid-row: 2; min-width: 0; padding: 5px; }
.connection-field { display: flex; min-width: 0; flex-direction: column; gap: 4px; font-size: .76rem; color: var(--muted); }
.connection-field :is(input, select) { width: 100%; min-width: 0; min-height: 38px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: var(--raised); font: .85rem var(--sans); }
.connection-hint, .connection-note { margin-top: 8px; font-size: .76rem; color: var(--muted); }
.connection-status { font-size: .83rem; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--ink); }
.connection-status:empty { display: none; }
.connection-result { margin-top: 7px; font-size: .8rem; }
.connection-result summary { cursor: pointer; width: fit-content; text-decoration: underline; text-underline-offset: 3px; }
.connection-result .page-actions { margin: 8px 0 0; }
.connection-result .page-actions .control { min-height: 30px; font-size: .75rem; }
.connection-path { margin: 9px 0; line-height: 1.9; }
.connection-path .claim-link { font-size: inherit; }
.control-field {
  display: flex;
  align-items: center;
  padding: 0 6px 0 10px;
  min-width: 0;
  color: var(--muted);
  font-size: .76rem;
}
.control-field select, .filter-field select {
  color: var(--ink);
  background-color: var(--raised);
}
.control-field select {
  padding: 6px;
  border: 0;
  min-width: 0;
  max-width: clamp(120px, 18vw, 290px);
  font-size: .84rem;
}
.result-count {
  margin-left: auto;
  white-space: nowrap;
  color: var(--muted);
  font: .75rem var(--mono);
}
.micro {
  font: 700 .72rem/1.4 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

.board {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 49% 44%, #80272123, transparent 60%),
    radial-gradient(circle, #44404a 1px, transparent 1px) 0 0 / 22px 22px,
    #121217;
}
.map { position: absolute; inset: 0; touch-action: none; cursor: grab; user-select: none; }
.map:focus-visible { outline-offset: -3px; }
.map.dragging, .map.dragging [role="button"] { cursor: grabbing; }
.map > svg { display: block; }
.graph-node { cursor: pointer; --node: var(--organization); }
.person { --node: var(--person); }
.organization { --node: var(--organization); }
.event { --node: var(--event); }
.institution { --node: var(--institution); }
.graph-node .node-halo { fill: var(--node); opacity: .1; }
.graph-node .node-disc { fill: #202026; stroke: var(--node); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.graph-node .node-core { fill: var(--node); }
.graph-node.root { --node: var(--red); }
.graph-node.route-target { --node: var(--person); }
.graph-node.root .node-halo { opacity: .24; }
.graph-node text {
  pointer-events: none;
  fill: var(--ink);
  paint-order: stroke;
  stroke: #15151a;
  stroke-width: 4px;
  stroke-linejoin: round;
  font: 650 14px var(--sans);
}
.graph-node .branch-indicator { fill: #25252c; stroke: var(--node); }
.graph-node .branch-symbol { fill: var(--ink); stroke-width: 0; font-size: 10px; font-weight: 800; }
.branch-control { margin: 2px 6px 12px 0; }
.graph-node.root text { font-weight: 800; fill: #fff4ea; }
.graph-node.label-culled:not(.hovered):not(.selected):not(.endpoint):not(:focus-visible) .node-label { visibility: hidden; }
.graph-node:is(.hovered, .selected, .endpoint, :focus-visible) .node-label { fill: #fff4ea; }
.graph-node:is(.hovered, .selected, :focus-visible) .node-halo { opacity: .38; }
.graph-node:is(.hovered, .selected, :focus-visible) .node-disc { stroke-width: 2.5px; }
.map [role="button"]:focus-visible { outline: none; }
.graph-link { cursor: pointer; }
.link-stroke, .link-hit { fill: none; vector-effect: non-scaling-stroke; }
.link-stroke { stroke: #8b747a; stroke-width: 1.3px; opacity: .73; }
.link-hit { stroke: transparent; stroke-width: 14px; pointer-events: stroke; }
.graph-link.contested .link-stroke { stroke: var(--gold); stroke-dasharray: 5 5; }
.graph-link.connected .link-stroke { stroke: #ff9c8c; opacity: 1; stroke-width: 2px; }
.graph-link:is(.hovered, .selected, :focus-visible) .link-stroke { stroke: var(--red); opacity: 1; stroke-width: 3px; }

.graph-caption, .graph-legend, .zoom-controls { position: absolute; }
.graph-caption { top: 15px; left: clamp(14px, 2.6vw, 38px); pointer-events: none; }
.graph-caption p { margin-top: 5px; font-size: .76rem; color: var(--muted); }
.layout-controls { position: absolute; top: 12px; right: clamp(14px, 2.6vw, 38px); }
.layout-controls .control { background: #1a1a20; font-size: .81rem; min-height: 34px; }
.layout-controls svg circle { fill: #1a1a20; }
.graph-legend, .zoom-controls, .graph-tooltip {
  background: #1a1a20;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.graph-legend {
  left: clamp(14px, 2.6vw, 38px);
  bottom: 17px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 15px;
  padding: 7px 10px;
  pointer-events: none;
  color: var(--muted);
  font-size: .73rem;
}
.graph-legend span { display: inline-flex; align-items: center; gap: 6px; }
.graph-legend span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--node); }
.graph-legend .contested::before { width: 14px; height: 0; border-radius: 0; border-top: 2px dashed var(--gold); }
.zoom-controls { display: flex; right: clamp(14px, 2.6vw, 38px); bottom: 17px; }
.zoom-controls button { padding: 5px 10px; min-width: 32px; text-align: center; font-size: .81rem; }
.zoom-controls button:is(:first-child, :last-child) { font-size: 1.03rem; }
.zoom-controls button + button { border-left-color: var(--line); }
.zoom-controls button:hover { color: var(--red); }
.graph-tooltip {
  position: absolute;
  z-index: 2;
  max-width: min(290px, calc(100% - 24px));
  padding: 8px 11px;
  box-shadow: 0 8px 24px #0007;
  pointer-events: none;
  font-size: .82rem;
}
.graph-tooltip small { display: block; margin-top: 3px; color: var(--muted); }
.map-preview { display: none; }
@keyframes show-map-preview {
  from { opacity: 0; transform: translateY(5px); }
}

.panel {
  position: absolute;
  z-index: 3;
  top: 58px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(100dvh - 141px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 20px 60px #0009;
}
body:not(.board-view) .panel {
  position: fixed;
  top: max(118px, 13dvh);
}
.filters-panel { left: 14px; width: min(315px, calc(100% - 28px)); }
.inspector-panel { right: 14px; width: min(445px, calc(100% - 28px)); }
.panel-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
}
.panel-bar h2 { font-size: .79rem; letter-spacing: .07em; text-transform: uppercase; }
.close-control { width: 31px; height: 31px; text-align: center; border-radius: 4px; font-size: 1.18rem; }
.close-control:hover { border-color: var(--line); }
.panel-content { overflow: auto; overscroll-behavior: contain; padding: 16px; }
.filter-field {
  display: grid;
  gap: 4px;
  margin-bottom: 13px;
  color: var(--muted);
  font-size: .81rem;
}
.filter-field select { width: 100%; padding: 5px 8px; }
.thread {
  display: flex;
  justify-content: space-between;
  gap: 9px;
  width: 100%;
  padding: 7px 8px;
  border-left: 2px solid transparent;
  font-size: .84rem;
  color: var(--muted);
}
.thread:hover, .thread[aria-pressed="true"] { background: var(--raised); color: var(--ink); }
.thread[aria-pressed="true"] { border-left-color: var(--red); }
#threads { margin-bottom: 14px; }
#threads .micro { margin: 14px 0 6px; }
.notice { margin: 12px 0; padding: 8px 10px; background: var(--raised); color: var(--muted); font-size: .83rem; }
.notice summary { color: var(--ink); cursor: pointer; }
.notice p { margin-top: 5px; }

.inspector h2, .reading-header h2 { font: normal clamp(1.55rem, 3vw, 2.3rem)/1.12 var(--serif); letter-spacing: -.035em; }
.inspector h2 { margin: 7px 0 10px; font-size: 1.66rem; overflow-wrap: anywhere; }
.inspector p { margin: 0 0 10px; font-size: .91rem; }
.inspector .limits { border-left: 2px solid #805851; padding-left: 9px; color: var(--muted); }
.statuses { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge {
  border: 1px solid #60545c;
  border-radius: 3px;
  padding: 2px 6px;
  color: var(--ink);
  font: 700 .69rem var(--mono);
  white-space: nowrap;
}
.badge.contested { border-color: #876342; color: var(--gold); }
.badge.record { border-color: #657a69; color: #c5dfc9; }
.badge.statement { border-color: #825753; color: #ffc1b9; }
.source-list { margin: 8px 0 15px; padding: 0; list-style: none; }
.source-list li { padding: 8px 0; border-top: 1px solid var(--line); font-size: .85rem; }
.source-list small { display: block; color: var(--muted); font-size: .77rem; }
.claim-link { border-bottom: 1px solid #835555; padding: 0; font-size: .85rem; }
.claim-link:hover { color: var(--red); }
.chip { display: inline-block; padding: 4px 7px; margin: 2px 4px 2px 0; border: 1px solid var(--line); font-size: .77rem; color: var(--muted); text-decoration: none; }
.chip:hover { border-color: var(--red); color: var(--ink); }
.related { margin: 10px 0; }
.inspector .side-title { margin: 13px 0 4px; }
.inspector .relation-path { color: var(--muted); font-size: .85rem; }
.inspector .center-control { margin: 2px 0 12px; }

.reading { max-width: 1250px; margin: 0 auto; padding: clamp(17px, 3vw, 42px); }
.reading-header { margin-bottom: 17px; }
.reading-header p { margin-top: 5px; color: var(--muted); font-size: .9rem; }
.timeline { border-top: 1px solid var(--line); }
.entry {
  display: grid;
  grid-template-columns: 165px minmax(0, 1fr) auto;
  align-items: start;
  gap: 13px;
  width: 100%;
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.entry:hover, .entry[aria-current="true"] { background: var(--raised); color: var(--ink); }
.entry small, .entry time { color: var(--muted); font-size: .83rem; }
.entry small, .date2 { display: block; }
.entry time { font-family: var(--mono); }
.date2 { margin-top: 3px; font-size: .73rem; }
.index { display: grid; gap: 9px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.index > article, .index > button, .index > a { padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 5px; }
.index > a { text-decoration: none; }
.index > button:hover, .index > a:hover { border-color: var(--red); }
.index small { display: block; margin: 4px 0; color: var(--muted); font-size: .82rem; }
.empty { padding: 16px 0; color: var(--muted); }
.foot { margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.site-contribute { flex-shrink: 0; padding: 5px clamp(14px, 2.6vw, 38px); border-top: 1px solid var(--line); background: #151519; color: var(--muted); font-size: .74rem; line-height: 1.5; }
.site-contribute a { color: inherit; text-decoration: none; }
.site-contribute a:hover { color: var(--ink); }
.site-contribute span:first-child { text-decoration: underline; text-underline-offset: 3px; }
.site-contribute { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 18px; }
.site-credits { margin: 0; }
.antifa-open { margin-left: auto; padding: 0; border: 0; background: none; color: var(--red); font: inherit; font-style: italic; cursor: pointer; }
.antifa-open:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.antifa-dialog { margin: auto; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: #000; color: var(--ink); max-width: min(92vw, 960px); max-height: 92vh; overflow: visible; }
.antifa-dialog::backdrop { background: rgb(0 0 0 / .78); }
.antifa-frame { position: relative; }
.antifa-frame video { display: block; max-width: min(92vw, 960px); max-height: 92vh; border-radius: 6px; }
.antifa-close { position: absolute; top: 8px; right: 8px; z-index: 1; border: 1px solid var(--line); background: rgb(21 21 25 / .85); color: var(--ink); cursor: pointer; }
.antifa-close:hover { color: var(--red); }
.content-note { color: var(--muted); padding: 4px 14px; font-size: .8rem; }
.reading-navigation { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-left: auto; font-size: .84rem; }
.record-page { max-width: 850px; }
.record-page h1 { font: normal clamp(1.75rem, 5vw, 3.05rem)/1.1 var(--serif); margin-bottom: 16px; }
.record-page h2 { font-size: 1.15rem; margin-bottom: 6px; }
.record-page p { margin-bottom: 10px; }
.record-page section { margin: 20px 0; }
.record-relation, .record-dates { color: var(--muted); font-size: .88rem; }
.readable-records { padding: 0; list-style: none; }
.readable-records li { padding: 9px 0; border-top: 1px solid var(--line); }
.readable-records small { display: block; color: var(--muted); }
.entity-summary { color: var(--muted); }
.page-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 0 0 16px; }
.page-actions [role="status"]:empty { display: none; }
.entity-directory { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 0 24px; padding: 0; list-style: none; }
.entity-directory li { padding: 10px 0; border-top: 1px solid var(--line); }
.entity-directory small { display: block; color: var(--muted); font-size: .8rem; }

@media (max-width: 730px), (hover: none) and (pointer: coarse) and (max-width: 1000px) {
  .board-view.connection-view .workspace { grid-template-columns: minmax(0, 1fr); }
  .connection-view .board { grid-column: 1; }
  .connection-panel { z-index: 4; width: min(320px, calc(100% - 28px)); box-shadow: 10px 0 28px #0008; }
  .connection-field :is(input, select) { font-size: 16px; }
  #normal-graph-controls { flex-wrap: wrap; }
  .board { --map-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  .top { flex-wrap: wrap; gap: 0 13px; padding-top: 8px; }
  .top .brand { flex: 1; }
  .tabs { order: 3; flex-basis: 100%; }
  .tabs :is(button, a) { padding: 8px 10px; min-height: 40px; }
  .reading-navigation { flex-basis: 100%; order: 3; padding: 6px 0 9px; }
  .command-bar { gap: 6px; }
  .command-bar :is(.control, .control-field, .search) { min-height: 42px; }
  .search input { font-size: 16px; }
  .graph-controls { flex: 1 1 210px; }
  .focus-field { flex: 1; }
  .focus-field select { max-width: min(230px, 100%); flex: 1; }
  .result-count { display: none; }
  .graph-caption { top: 10px; max-width: calc(100% - 152px); }
  .graph-caption p { display: none; }
  .layout-controls { top: 8px; }
  .layout-controls .control { min-height: 40px; }
  .graph-legend { max-width: calc(100% - 182px); bottom: var(--map-bottom); gap: 2px 7px; padding: 5px; font-size: .65rem; }
  .zoom-controls { bottom: var(--map-bottom); }
  .zoom-controls button { min-width: 44px; min-height: 44px; }
  .map-preview {
    position: absolute;
    z-index: 2;
    right: 10px;
    bottom: calc(var(--map-bottom) + 54px);
    left: 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 4px 8px;
    padding: 8px 8px 8px 12px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 28px #0008;
    animation: show-map-preview 140ms ease-out;
  }
  .map-preview-copy { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
  .map-preview-copy strong {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    overflow-wrap: anywhere;
    font-size: .93rem;
    line-height: 1.25;
  }
  .map-preview-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
  .map-preview-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
  .map-preview-actions .control { min-height: 44px; }
  #map-preview-details { border-color: #8b5251; background: #322122; }
  .close-control { width: 44px; height: 44px; }
  .panel, body:not(.board-view) .panel {
    position: fixed;
    top: auto;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    max-height: 64dvh;
  }
  .board-view .inspector-panel { max-height: 52dvh; }
  .inspector-panel, .filters-panel { right: 8px; left: 8px; width: auto; }
  .entry { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; }
  .entry time { grid-column: 1 / -1; }
  .entry .date2 { display: inline; margin-left: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .map-preview { animation: none; }
}

@media (min-width: 731px) and (max-width: 1000px) and (hover: none) and (pointer: coarse) {
  body.board-view { min-height: 0; }
  .top { flex-wrap: nowrap; padding-top: 0; }
  .top .brand { flex: none; }
  .tabs { order: 0; flex: 1; }
  .map-preview { left: auto; width: 340px; }
}

@media (max-width: 380px) {
  .tabs :is(button, a) { font-size: .76rem; }
  .command-bar { padding-inline: 8px; }
  .graph-legend { font-size: .6rem; }
}
