:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1b1f23;
  background: #f4f2ed;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background: #f4f2ed;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: #21526b; text-decoration: none; }
a:hover { text-decoration: underline; }
code.code-inline {
  font-size: 12px;
  background: #eee9df;
  padding: 2px 6px;
  border-radius: 4px;
  overflow-wrap: anywhere;
}
.muted { color: #697176; }

/* ---------- layout ---------- */

.layout {
  height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 330px) minmax(0, 1fr);
  overflow: hidden;
}

.sidebar {
  height: 100vh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #d8d3c9;
  background: #fbfaf7;
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid #e1ddd4;
  color: inherit;
}
.brand a { color: inherit; }
.brand a:hover { text-decoration: none; }
.brand-nav { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.brand-nav a { color: #697176; font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.08em; }
.brand-nav a.brand-nav-secondary { font-size: 10.5px; }
.brand-nav-secondary-row {
  display: flex;
  flex: 1 0 100%;
  gap: 8px;
}
.brand-nav > a + a::before,
.brand-nav-secondary-row > a + a::before {
  content: "•";
  display: inline-block;
  margin-right: 8px;
  color: #a3a6a7;
  font-weight: 400;
  letter-spacing: 0;
}
.brand-nav a:hover { color: #1b1f23; }
.brand-nav a.active { color: #1b1f23; }

.sidebar-search { padding: 12px 14px 0; }
.sidebar-search input {
  width: 100%;
  min-height: 38px;
  border: 1px solid #cfc8bb;
  border-radius: 6px;
  background: #fff;
  padding: 0 10px;
}

.tree {
  margin-top: 4px;
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 8px 8px 16px;
}

.tree-incident, .tree-material {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  color: #1d252b;
  font-size: 13px;
}
.tree-incident { font-weight: 750; margin-top: 6px; }
.tree-incident.muted-header { color: #697176; }
.tree-material { font-weight: 450; }
.tree-incident:hover, .tree-material:hover { background: #efebe2; text-decoration: none; }
.tree a.active { background: #27323a; color: #fff; }
.tree a.active .tree-meta { color: #cfd7dc; }
.tree-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tree-meta { flex: 0 0 auto; color: #8a9197; font-size: 11px; font-weight: 450; }
.tree-meta b { font-weight: 750; }

.sidebar-footer {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid #e1ddd4;
}
.sidebar-create-controls { display: grid; gap: 8px; }
.access-mode {
  border: 1px solid #cfc8bb;
  border-radius: 6px;
  background: #f2eee5;
  padding: 8px 10px;
  color: #5d625f;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.sidebar-new {
  min-height: 34px;
  border: 1px solid #27323a;
  border-radius: 6px;
  background: #27323a;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}
.detail {
  min-width: 0;
  height: 100vh;
  overflow: auto;
}

.page { padding: 24px 28px 80px; }
.page-header { padding-bottom: 6px; }
h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.02;
}
.lede { max-width: 640px; color: #343b40; }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
  font-size: 13px;
  padding-bottom: 8px;
}
.crumb-sep { color: #9aa3aa; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0 4px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eee9df;
  border: 1px solid #ddd6c8;
  color: #4d443a;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  padding: 3px 10px;
}
.chip-x {
  border: 0;
  background: transparent;
  color: #8a8172;
  font-size: 14px;
  padding: 0;
  line-height: 1;
}
.chip-x:hover { color: #8a1f11; }
.chip-add {
  border: 1px dashed #cfc8bb;
  background: transparent;
  color: #697176;
  border-radius: 999px;
  font-size: 12px;
  padding: 3px 10px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(320px, 44vw) minmax(360px, 1fr);
  gap: 24px;
  align-items: start;
  padding-top: 10px;
}
.detail-grid.single-column { grid-template-columns: minmax(0, 760px); }

/* ---------- bands & fields ---------- */

.data-stack { display: grid; gap: 18px; min-width: 0; }
.band { border-top: 1px solid #cfc8bb; padding-top: 12px; min-width: 0; }
/* breathing room above the add-buttons that follow band content
   ("+ Weight", "+ Custody event", "+ Cite source" / "+ New source") */
.band > .mini-button,
.band > .inline-controls { margin-top: 14px; }
.band h2 {
  margin: 0 0 10px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #5a636a;
}

.fields { margin: 0; display: grid; gap: 0; }
.field {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(120px, 0.3fr) minmax(0, 1fr);
  gap: 14px;
  padding: 7px 0;
  border-bottom: 1px solid #e3ded5;
}
dt {
  color: #667078;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-top: 3px;
}
dd {
  min-width: 0;
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.editable { cursor: text; border-radius: 4px; display: inline-block; min-width: 40px; }
.editable:hover { background: #f2eee5; box-shadow: 0 0 0 3px #f2eee5; }
.editable.empty { color: #a9b0b5; }
.read-only-value { display: inline-block; min-width: 40px; }
.read-only-value.empty { color: #a9b0b5; }
.edit-input {
  width: 100%;
  border: 1px solid #46aaff;
  border-radius: 4px;
  padding: 4px 6px;
  background: #fff;
}
textarea.edit-input { resize: vertical; }
.edit-select {
  border: 1px solid #cfc8bb;
  border-radius: 6px;
  background: #fff;
  min-height: 30px;
  padding: 0 6px;
}
.edit-select.inline { display: inline-block; }

.inline-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mini-button {
  border: 1px solid #cfc8bb;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  font-weight: 650;
  padding: 4px 10px;
}
.mini-button:hover { border-color: #27323a; }
/* incident change/clear appear only while hovering the row */
.incident-controls .mini-button {
  opacity: 0;
  transition: opacity 0.15s ease;
}
.field:hover .incident-controls .mini-button { opacity: 1; }
.action-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  min-height: 34px;
  border: 1px solid #27323a;
  border-radius: 6px;
  background: #fff;
  color: #27323a;
  font-weight: 700;
  padding: 0 14px;
}
.action-button:hover { background: #27323a; color: #fff; }
.action-button:disabled {
  border-color: #cfc8bb;
  background: #eee9df;
  color: #6f767a;
  cursor: default;
}
.transcription-control {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}
.transcription-control > .editable { flex: 1 1 auto; min-width: 0; }
.transcription-control > .action-button { flex: 0 0 auto; margin-top: 0; }
.icon-action-button {
  justify-content: center;
  width: 36px;
  padding: 0;
}
.button-icon {
  display: inline-flex;
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
}
.button-icon svg {
  display: block;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.danger-zone { padding-top: 8px; }
.danger-button {
  border: 1px solid #c4b5ad;
  border-radius: 6px;
  background: transparent;
  color: #8a1f11;
  font-size: 12px;
  font-weight: 650;
  padding: 6px 12px;
}
.danger-button:hover { border-color: #8a1f11; }

/* ---------- images ---------- */

.image-panel {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 10px;
  min-width: 0;
}
.primary-image {
  min-height: 300px;
  max-height: calc(100vh - 300px);
  display: grid;
  place-items: center;
  background: #202427;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}
.primary-image a { display: contents; }
.primary-image img,
.primary-image canvas {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 300px);
  object-fit: contain;
}
.annotated-image-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: fit-content;
  max-width: 100%;
  max-height: calc(100vh - 300px);
}
.measurement-annotation-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.16s ease;
  z-index: 2;
}
.primary-image:hover .measurement-annotation-overlay,
.measurement-annotation-overlay.focused { opacity: 1; }
.image-fullscreen {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
}
.image-fullscreen:hover { background: rgba(0, 0, 0, 0.75); }
/* Linked-region rects on the asset page; shrink-wraps the img so the
   percent-positioned hotspots line up with it. */
.hotspot-wrap { position: relative; }
.primary-image a.region-hotspot {
  display: block;
  position: absolute;
  z-index: 2;
  border: 2px solid #f5c542;
  border-radius: 3px;
  background: rgba(245, 197, 66, 0.07);
  opacity: 0;
  transition: opacity 0.15s ease;
}
.primary-image:hover .region-hotspot,
.primary-image a.region-hotspot.focused { opacity: 1; }
.region-hotspot:hover { background: rgba(245, 197, 66, 0.2); }
.region-hotspot-name {
  position: absolute;
  top: 0;
  left: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 1px 6px;
  border-radius: 0 0 3px 0;
  background: rgba(0, 0, 0, 0.7);
  color: #f5c542;
  font-size: 11.5px;
  font-weight: 650;
}
.image-fullscreen svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.primary-actions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 10px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
}
/* overlay chrome appears only while hovering the image */
.image-fullscreen,
.primary-actions {
  opacity: 0;
  transition: opacity 0.15s ease;
}
.primary-image:hover .image-fullscreen,
.primary-image:hover .primary-actions,
.primary-image:hover + .primary-actions,
.primary-image + .primary-actions:hover {
  opacity: 1;
}
.primary-actions button {
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  font-weight: 750;
  font-size: 13px;
  padding: 6px 14px;
}
.primary-caption {
  color: #e6e9eb;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-thumbnail { border: 1px solid #3c4449; }
.file-thumbnail.dragging {
  outline: 4px solid #79aef2;
  outline-offset: -4px;
  background: #17283a;
}
.file-thumbnail.uploading::after {
  content: "Saving thumbnail…";
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  background: rgba(12, 16, 19, 0.82);
  color: #fff;
  font-size: 13px;
  font-weight: 750;
}
.file-thumbnail-empty {
  display: grid;
  place-items: center;
  gap: 16px;
  min-height: 300px;
  padding: 38px;
  color: #e8edf0;
  text-align: center;
}
.file-thumbnail-prompt { max-width: 250px; font-size: 13px; line-height: 1.45; }
.primary-image a.source-action-link,
.source-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 6px;
  background: #27323a;
  color: #fff;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.2;
  padding: 7px 13px;
}
.source-action-link:hover { background: #11171b; color: #fff; text-decoration: none; }
.file-thumbnail .file-thumbnail-actions { opacity: 1; }
.thumbnail-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 50%;
  background: rgba(18, 22, 25, 0.86);
  color: #fff;
  font-size: 20px;
  line-height: 1;
}
.thumbnail-delete:hover { background: #711f16; }

.image-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb, .image-drop-zone {
  position: relative;
  width: 68px;
  height: 68px;
  flex: 0 0 68px;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  background: #111;
  padding: 0;
}
.thumb.active { border-color: #1f6feb; }
.thumb.dragging { opacity: 0.45; }
.thumb.drop-target { border-color: #f5c542; }
/* images collated from fragment materials */
.thumb.fragment { border-style: dashed; border-color: #b9926b; }
.thumb.fragment.active { border-color: #1f6feb; }
.fragment-owner-link { color: #8a5f2b; font-weight: 650; }
.fragment-composition { display: grid; gap: 6px; }
.fragment-owner { font-size: 11.5px; color: #c9a86a; }
.thumb img, .thumb canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-drop-zone {
  display: grid;
  place-items: center;
  border: 2px dashed #9aa3aa;
  background: #f7f5ef;
  color: #27323a;
  cursor: pointer;
}
.image-drop-zone.wide {
  width: 100%;
  flex: 1 1 100%;
  height: 64px;
  margin: 12px 0;
  font-size: 13px;
  font-weight: 650;
}
.image-drop-zone.dragging { border-color: #1f6feb; background: #eaf2ff; }
.image-drop-zone span { padding: 0 12px; text-align: center; }
.file-input { display: none; }

.archive-home-page { position: relative; min-height: 100%; }
.archive-file-upload:disabled { cursor: wait; opacity: 0.7; }
.archive-upload-overlay {
  position: fixed;
  z-index: 20;
  top: 50%;
  left: calc(50% + 150px);
  display: grid;
  gap: 5px;
  min-width: min(420px, calc(100vw - 48px));
  border: 3px dashed #79aef2;
  border-radius: 12px;
  background: rgba(24, 38, 51, 0.96);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.28);
  padding: 28px 34px;
  color: #fff;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.97);
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.archive-upload-overlay strong { font-size: 18px; }
.archive-upload-overlay span { color: #d6e2ea; font-size: 13px; }
.archive-home-page.dragging-files .archive-upload-overlay,
.archive-home-page.uploading-files .archive-upload-overlay {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

@media (max-width: 760px) {
  .archive-upload-overlay { left: 50%; }
}

/* ---------- cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}
.card {
  display: grid;
  grid-template-rows: 120px auto;
  border: 1px solid #ddd6c8;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  color: inherit;
}
.card:hover { text-decoration: none; border-color: #27323a; }
.card-image { width: 100%; height: 120px; object-fit: cover; display: block; background: #202427; }
.card-image.document-thumbnail { object-fit: contain; background: #e8e5dd; }
.card-image.placeholder {
  display: grid;
  place-items: center;
  color: #8a9197;
  font-size: 12px;
  background: #eee9df;
}
.card-body {
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 3px;
  padding: 9px 11px 11px;
}
.card-body strong { font-size: 13px; line-height: 1.25; }
.file-card .card-body strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.card-author { color: #3f484e; font-size: 12px; line-height: 1.3; }
.card-meta { color: #697176; font-size: 11.5px; line-height: 1.3; }

.stat-row { display: flex; flex-wrap: wrap; gap: 12px; padding: 10px 0 20px; }
.stat {
  display: grid;
  gap: 2px;
  min-width: 110px;
  border: 1px solid #ddd6c8;
  border-radius: 8px;
  background: #fff;
  padding: 12px 16px;
  color: inherit;
}
.stat:hover { text-decoration: none; border-color: #27323a; }
.stat strong { font-size: 22px; }
.stat span { color: #697176; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }

/* ---------- rows ---------- */

.asset-rows { display: grid; gap: 6px; }
.asset-row, .search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #e3ded5;
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
  color: inherit;
}
.asset-row:hover, .search-row:hover { text-decoration: none; border-color: #27323a; }
.asset-row-thumb { width: 46px; height: 46px; border-radius: 5px; object-fit: cover; flex: 0 0 46px; background: #202427; }
.asset-row-file {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: #eee9df;
  color: #5a636a;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.asset-row-text { display: grid; gap: 1px; min-width: 0; }
.asset-row-text strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-row-text span { color: #697176; font-size: 12px; }
.search-row { margin-bottom: 6px; }
.search-snippet { color: #444c52; font-size: 12.5px; }
.search-snippet mark { background: #f5e5a1; padding: 0 1px; }

.link-row, .custody-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #e3ded5;
  font-size: 13.5px;
}
.custody-row { padding: 4px 0 10px; border-bottom: 1px solid #e3ded5; }
.custody-notes { font-size: 13px; color: #343b40; padding-top: 2px; }

.citation-row { padding: 4px 0 10px; border-bottom: 1px solid #e3ded5; }
.citation-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13.5px;
}
.search-row.citation-line { padding: 8px 12px; }
.citation-claim { font-size: 13px; color: #343b40; padding-top: 2px; }
.citation-field {
  font-size: 11px;
  font-weight: 700;
  background: #eee9df;
  color: #5a636a;
  border-radius: 4px;
  padding: 2px 7px;
}
.source-excerpt {
  white-space: pre-wrap;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.58;
  color: #272c30;
  border-left: 3px solid #c9b68e;
  background: #fbfaf7;
  padding: 14px 16px;
}
.source-file-control { align-items: baseline; }
.source-reference-list { display: grid; gap: 6px; }
.source-reference-row { align-items: flex-start; }
.source-reference-uid { flex: 0 0 auto; margin-top: 1px; font-size: 11px; }
.source-reference-copy { display: grid; gap: 2px; min-width: 0; }
.source-reference-copy strong { font-size: 13px; line-height: 1.35; }
.source-reference-copy .muted { font-size: 11.5px; line-height: 1.35; }
.source-image-panel .primary-image { max-height: calc(100vh - 150px); }
.source-image-panel .primary-image img { max-height: calc(100vh - 150px); }
.source-file-placeholder { padding: 28px; }

/* ---------- archive graph ---------- */

.graph-page { padding-bottom: 24px; }
.graph-page .lede { max-width: 760px; margin-bottom: 12px; }
.graph-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 12px;
  color: #5f686e;
  font-size: 11.5px;
}
.graph-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.graph-legend-swatch { width: 10px; height: 10px; border-radius: 50%; background: #777; }
.graph-legend-swatch.incident { background: #b85f42; clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%); }
.graph-legend-swatch.material { background: #2f806d; }
.graph-legend-swatch.fragment { background: #66a88e; border-radius: 1px; transform: rotate(45deg) scale(0.78); }
.graph-legend-swatch.asset { background: #3679a8; border-radius: 2px; }
.graph-legend-swatch.measurement { background: #8a68ad; }
.graph-legend-swatch.source { background: #b38530; border-radius: 1px; }
.graph-stage {
  --graph-incident: #b85f42;
  --graph-material: #2f806d;
  --graph-fragment: #66a88e;
  --graph-asset: #3679a8;
  --graph-measurement: #8a68ad;
  --graph-source: #b38530;
  --graph-surface: #faf9f5;
  --graph-foreground: #20272c;
  --graph-muted: #697176;
  --graph-edge: #67737b;
  --graph-icon: #fff;
  position: relative;
  width: 100%;
  height: calc(100vh - 205px);
  min-height: 560px;
  overflow: hidden;
  border: 1px solid #d8d3c9;
  border-radius: 9px;
  background: var(--graph-surface);
}
.graph-canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.graph-canvas:active { cursor: grabbing; }
.graph-tooltip {
  position: absolute;
  z-index: 3;
  display: grid;
  gap: 3px;
  width: max-content;
  max-width: min(330px, calc(100% - 16px));
  border: 1px solid #cbc5ba;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 7px 22px rgba(31, 36, 39, 0.15);
  padding: 8px 10px;
  color: #20272c;
  font-size: 12px;
  line-height: 1.35;
  pointer-events: none;
}
.graph-tooltip[hidden] { display: none; }
.graph-tooltip code { width: fit-content; color: #5f686e; font-size: 10.5px; }
.graph-tooltip strong { font-size: 13px; }
.graph-tooltip-meta { color: #697176; font-size: 11px; }
.graph-tooltip-detail {
  max-width: 310px;
  margin-top: 2px;
  padding-top: 5px;
  border-top: 1px solid #e0dcd4;
  color: #454e54;
}
.graph-instructions {
  position: absolute;
  z-index: 2;
  right: 10px;
  bottom: 9px;
  max-width: calc(100% - 20px);
  border-radius: 5px;
  background: rgba(250, 249, 245, 0.9);
  padding: 4px 7px;
  color: #697176;
  font-size: 10.5px;
  pointer-events: none;
}

/* ---------- about, changes & admin ---------- */

.about-page { max-width: 980px; }
.about-intro {
  max-width: 820px;
  margin: 12px 0 34px;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-size: clamp(18px, 2.3vw, 24px);
  line-height: 1.48;
  color: #30363a;
}
.about-page .band { margin-top: 26px; }
.about-version {
  display: inline-block;
  margin: 4px 0 8px;
  border: 1px solid #d6d0c5;
  border-radius: 999px;
  padding: 3px 8px;
  color: #697176;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.about-footer {
  max-width: 760px;
  margin-top: 42px;
  padding-top: 18px;
  border-top: 1px solid #cfc8bb;
}
.about-logout { color: #697176; font-size: 12px; }
.about-logout:hover { color: #1b1f23; }
.about-copy { max-width: 760px; margin: 0; line-height: 1.65; color: #343b40; }
.designation-list { display: grid; gap: 0; max-width: 780px; }
.designation-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #e3ded5;
}
.designation-row code {
  align-self: start;
  border-radius: 5px;
  background: #27323a;
  color: #fff;
  padding: 5px 7px;
  text-align: center;
  font-weight: 750;
}
.designation-row strong { font-size: 14px; }
.designation-row p { margin: 3px 0 0; color: #4e575d; line-height: 1.5; font-size: 13.5px; }

.changes-list { display: grid; max-width: 980px; border-top: 1px solid #d8d3c9; }
.change-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.28fr) minmax(0, 1fr);
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid #ded9cf;
}
.change-row time { color: #697176; font-size: 12px; padding-top: 2px; }
.change-description { font-size: 14px; line-height: 1.45; }
.change-meta { display: flex; gap: 10px; padding-top: 4px; color: #7c858b; font-size: 11.5px; }
.change-actor { color: #5f5142; }
.pagination-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.pagination-controls .mini-button:disabled { opacity: 0.45; cursor: default; }
.pagination-status { min-width: 92px; color: #697176; font-size: 12px; text-align: center; }

.admin-page { max-width: 1120px; }
.admin-page .band { margin-top: 28px; }
.admin-vouchers { display: grid; max-width: 900px; }
.admin-voucher-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #e3ded5;
}
.admin-voucher-row > div { display: grid; gap: 3px; font-size: 13px; }
.admin-voucher-row > .admin-voucher-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}
.voucher-secret {
  width: fit-content;
  margin-top: 4px;
  border-radius: 4px;
  background: #eee9df;
  padding: 4px 7px;
  color: #263039;
  font-size: 12px;
  overflow-wrap: anywhere;
  user-select: all;
}
.admin-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 900px;
  margin-top: 14px;
}
.admin-form input:not([type="checkbox"]) {
  flex: 1 1 220px;
  min-height: 38px;
  border: 1px solid #cfc8bb;
  border-radius: 6px;
  background: #fff;
  padding: 0 10px;
}
.voucher-write-toggle {
  display: inline-flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 8px;
  color: #3f494f;
  font-size: 13px;
  white-space: nowrap;
}
.voucher-write-toggle input { width: 17px; height: 17px; margin: 0; }
.voucher-access {
  display: inline-block;
  width: fit-content;
  border-radius: 999px;
  padding: 2px 7px;
  background: #e7ecec;
  color: #3e5555;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.voucher-access.write { background: #e3eee5; color: #285c35; }
.admin-form .action-button { margin-top: 0; }
.admin-secret-dialog p { margin: 0; color: #535c62; font-size: 13px; line-height: 1.45; }
.admin-secret-form { display: grid; gap: 8px; }
.admin-secret-form input {
  width: 100%;
  min-height: 40px;
  border: 1px solid #cfc8bb;
  border-radius: 6px;
  background: #fff;
  padding: 0 10px;
}
.admin-secret-form .action-button { justify-self: start; }
.admin-activity { display: grid; max-width: 1040px; border-top: 1px solid #d8d3c9; }
.admin-event {
  display: grid;
  grid-template-columns: minmax(175px, 0.8fr) minmax(100px, 0.45fr) minmax(110px, 0.55fr) minmax(100px, 0.5fr) minmax(180px, 1fr);
  gap: 12px;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid #e3ded5;
  font-size: 12px;
}
.admin-event.failed strong { color: #8a1f11; }
.admin-event time, .admin-event span { color: #626b71; }
.admin-event code { font-size: 11px; overflow-wrap: anywhere; }
.admin-event-path { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.measure-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  border-bottom: 1px solid #e3ded5;
}
.measure-row.wide { font-size: 13.5px; }
.measure-row.linked-measurement {
  border-radius: 4px;
  cursor: pointer;
  padding-left: 4px;
  padding-right: 4px;
}
.measure-row.linked-measurement:hover,
.measure-row.linked-measurement:focus-visible { background: #eee9df; outline: none; }
.measure-index {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 22px;
  padding: 0 6px;
  border-radius: 4px;
  background: #f5c542;
  color: #1b1f23;
  font-size: 11px;
  font-weight: 800;
}
.measure-delete {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: #9aa3aa;
  font-size: 16px;
  line-height: 1;
}
.measure-delete:hover { color: #8a1f11; }
.measure-empty { color: #697176; font-size: 13px; padding: 8px 0; }

.empty-panel { color: #697176; font-size: 13px; padding: 14px 0; }
.empty-list, .empty-detail, .detail-placeholder, .fatal { color: #697176; padding: 24px; }
.fatal { color: #8a1f11; }

/* ---------- modal / picker ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 22, 24, 0.6);
  display: grid;
  place-items: center;
  z-index: 50;
}
.picker {
  width: min(560px, 92vw);
  max-height: 76vh;
  overflow: auto;
  background: #fbfaf7;
  border-radius: 10px;
  padding: 18px;
  display: grid;
  gap: 12px;
}
.picker h3 { margin: 0; font-size: 15px; }
.picker-input {
  width: 100%;
  min-height: 40px;
  border: 1px solid #cfc8bb;
  border-radius: 6px;
  padding: 0 10px;
}
.picker-results { display: grid; gap: 4px; }
.picker-row {
  display: grid;
  grid-template-columns: 74px 1fr auto;
  align-items: center;
  gap: 10px;
  text-align: left;
  border: 1px solid #e3ded5;
  border-radius: 6px;
  background: #fff;
  padding: 8px 10px;
}
.picker-row:hover { border-color: #27323a; }
.picker-type {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  color: #5a636a;
}
.picker-context { color: #8a9197; font-size: 12px; }
.picker-empty { color: #697176; font-size: 13px; padding: 6px 2px; }

/* ---------- fullscreen lightbox ---------- */

.lightbox { display: grid; place-items: center; }
.lightbox img, .lightbox canvas {
  max-width: 96vw;
  max-height: 94vh;
  object-fit: contain;
}
.lightbox-close {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 60;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 26px;
  line-height: 1;
}
.lightbox-close:hover { background: rgba(0, 0, 0, 0.8); }

/* ---------- link-region editor ---------- */

.region-overlay {
  width: 92vw;
  height: 90vh;
  display: grid;
  grid-template-rows: auto 1fr;
  background: #20262a;
  border-radius: 10px;
  overflow: hidden;
}
.region-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
}
.region-hint { flex: 1; color: #cfd7dc; font-size: 13px; }
.region-canvas-wrap { position: relative; min-height: 0; }
.region-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

/* ---------- measurements page ---------- */

.measure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.measure-card {
  display: grid;
  border: 1px solid #ddd6c8;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  color: inherit;
}
.measure-card:hover { text-decoration: none; border-color: #27323a; }
.measure-card-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  background: #202427;
}
.measure-card-caption { display: grid; gap: 2px; padding: 9px 11px 11px; }
.measure-card-caption strong { font-size: 14px; }

/* ---------- measure overlay ---------- */

.measure-overlay {
  width: 96vw;
  height: 94vh;
  display: grid;
  grid-template-columns: 290px 1fr;
  background: #20262a;
  border-radius: 10px;
  overflow: hidden;
}
.measure-panel {
  background: #fbfaf7;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
}
.measure-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.measure-heading h3 {
  margin: 0;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.modal-close {
  border: 1px solid #27323a;
  border-radius: 6px;
  background: #27323a;
  color: #fff;
  font-weight: 700;
  padding: 6px 14px;
}
.measure-modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.measure-mode-button {
  min-height: 34px;
  border: 1px solid #27323a;
  border-radius: 6px;
  background: #fff;
  font-weight: 750;
  font-size: 13px;
}
.measure-mode-button.active { background: #27736d; border-color: #27736d; color: #fff; }
.measure-mode-button:disabled { border-color: #d7d0c5; background: #eee9df; color: #80786d; cursor: default; }
.measure-substatus { color: #5a636a; font-size: 12px; min-height: 16px; }
.measure-field { display: grid; gap: 5px; font-size: 13px; font-weight: 700; }
.measure-field span {
  color: #667078;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.measure-field input, .measure-field select {
  width: 100%;
  min-height: 36px;
  border: 1px solid #cfc8bb;
  border-radius: 6px;
  background: #fff;
  padding: 0 10px;
}
.measure-unit-row { display: grid; grid-template-columns: 1fr 76px; gap: 8px; }
.measure-heading-sub {
  color: #667078;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  border-top: 1px solid #e1ddd4;
  padding-top: 10px;
}
.measure-list { display: grid; gap: 2px; }
.measure-canvas-wrap { position: relative; min-width: 0; }
.measure-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

/* ---------- element pills & spectrum previews ---------- */

.element-pills { display: inline-flex; flex-wrap: wrap; gap: 5px; }
.element-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #ddd6c8;
  background: #fbfaf7;
  border-radius: 999px;
  padding: 2px 9px 2px 6px;
  font-size: 12px;
  font-weight: 650;
  color: #3a423f;
  white-space: nowrap;
}
.element-pill b { font-weight: 500; color: #697176; }
.element-pill-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }

.spectrum-previews { display: grid; gap: 10px; }
.spectrum-preview {
  display: block;
  background: #10141a;
  border: 1px solid #232d3a;
  border-radius: 10px;
  padding: 8px 10px 9px;
  color: inherit;
}
.spectrum-preview:hover { border-color: #3d4f63; text-decoration: none; }
.spectrum-preview-canvas { display: block; width: 100%; height: 84px; }
.spectrum-preview-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding-top: 7px;
}
.spectrum-preview-title { font-size: 12px; color: #a9b8cb; font-weight: 650; }
.spectrum-preview .element-pill { background: #151b23; border-color: #2a3542; color: #c2cfdf; }
.spectrum-preview .element-pill b { color: #71829a; }

/* ---------- incident location card ---------- */

.incident-map {
  height: 260px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #ddd6c8;
  background: #e8e4db;
}

/* ---------- timeline ---------- */

.timeline { padding-top: 4px; }
.timeline-year {
  margin: 26px 0 4px;
  border-top: 1px solid #cfc8bb;
  padding-top: 12px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #5a636a;
}
.timeline-row {
  display: grid;
  grid-template-columns: minmax(130px, 160px) 88px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px solid #e3ded5;
}
.timeline-date { color: #5a636a; font-size: 13px; font-variant-numeric: tabular-nums; }
.timeline-type {
  justify-self: start;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 4px;
  padding: 2px 7px;
}
.timeline-type.incident { background: #f5c542; color: #1b1f23; }
.timeline-type.custody { background: #eee9df; color: #5a636a; }
.timeline-body { display: grid; gap: 1px; min-width: 0; font-size: 13.5px; }
.timeline-meta { color: #697176; font-size: 12.5px; }
.timeline-notes { color: #444c52; font-size: 12.5px; }

/* ---------- map ---------- */

.map-page { position: relative; height: 100vh; }
/* Must out-rank maplibre-gl.css's `.maplibregl-map { position: relative }`. */
.map-page .map-canvas { position: absolute; inset: 0; }

.map-marker {
  display: block;
  width: 44px;
  height: 44px;
  border: 2px solid #fff;
  border-radius: 9px;
  overflow: hidden;
  background: #202427;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}
.map-marker:hover { border-color: #f5c542; z-index: 5; }
.map-marker img,
.map-marker canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.map-marker.no-image {
  display: grid;
  place-items: center;
  background: #27323a;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.map-popup { display: grid; gap: 2px; font-family: inherit; }
.map-popup strong { font-size: 13px; }
.map-popup span { color: #697176; font-size: 12px; }
.maplibregl-popup-content { padding: 8px 12px; border-radius: 8px; }

.map-note {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 5;
  max-width: min(420px, 70%);
  background: rgba(251, 250, 247, 0.92);
  border: 1px solid #ddd6c8;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  color: #5a636a;
}

/* ---------- toasts / login ---------- */

#toast-holder {
  position: fixed;
  bottom: 18px;
  right: 18px;
  display: grid;
  gap: 8px;
  z-index: 100;
}
.toast {
  background: #27323a;
  color: #fff;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 650;
  padding: 10px 16px;
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.25s ease;
  max-width: 340px;
}
.toast.visible { opacity: 1; transform: none; }
.toast.error { background: #8a1f11; }

.login-screen {
  height: 100vh;
  display: grid;
  place-items: center;
}
.login-box {
  display: grid;
  gap: 12px;
  width: min(360px, 90vw);
  background: #fbfaf7;
  border: 1px solid #ddd6c8;
  border-radius: 10px;
  padding: 28px;
}
.login-box h1 { font-size: 18px; }
.login-hint { margin: 0; color: #5f686e; font-size: 13px; line-height: 1.45; }
.login-box input {
  min-height: 40px;
  border: 1px solid #cfc8bb;
  border-radius: 6px;
  padding: 0 10px;
}
.login-box button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: #27323a;
  color: #fff;
  font-weight: 700;
}
.login-box button:disabled { opacity: 0.55; cursor: not-allowed; }
.login-error { color: #8a1f11; font-size: 13px; min-height: 16px; }

/* ---------- APT viewer ---------- */

.apt-page {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) 232px;
  height: 100vh;
  min-height: 0;
  background: #070807;
  color: #dce1dd;
}
.apt-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 24px;
  padding: 14px 18px 10px;
  border-bottom: 1px solid #1d2530;
}
.apt-title h1 { margin: 2px 0 4px; font-size: 19px; color: #f0f4fa; }
.apt-back { color: #8fa8c4; font-size: 12.5px; }
.apt-back:hover { color: #c5d5e8; text-decoration: none; }
.apt-meta { font-size: 12px; color: #71829a; }
.apt-controls { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.apt-control-row { display: flex; align-items: center; gap: 10px; }
.apt-counts { font-size: 12px; color: #71829a; }
.apt-select {
  background: #151b23;
  color: #dde5f0;
  border: 1px solid #2a3542;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12.5px;
}
.apt-range { width: 110px; accent-color: #7fa8d4; }
.apt-toggle { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: #a9b8cb; }
.apt-toggle input { accent-color: #7fa8d4; }
.apt-page .mini-button {
  background: #151b23;
  color: #a9b8cb;
  border: 1px solid #2a3542;
}
.apt-page .mini-button:hover { background: #1c242f; color: #dde5f0; }

.apt-legend { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 560px; }
.apt-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #12171e;
  color: #c2cfdf;
  border: 1px solid #232d3a;
  border-radius: 999px;
  padding: 3px 10px 3px 6px;
  font-size: 12px;
}
.apt-chip:hover { border-color: #3d4f63; }
.apt-chip.active { border-color: #e8bd63; color: #f5e2b8; background: #1c1a12; }
.apt-chip-dot { width: 9px; height: 9px; border-radius: 50%; }

.apt-canvas { position: relative; min-height: 0; }
.apt-canvas canvas { position: absolute; inset: 0; display: block; }
.apt-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 2;
  font-size: 13.5px;
  color: #8fa8c4;
  pointer-events: none;
}

.apt-spectrum-holder { border-top: 1px solid #1d211f; min-height: 0; background: #111312; }
.spectrum-panel { position: relative; width: 100%; height: 100%; }
.spectrum-canvas { display: block; width: 100%; height: 100%; cursor: crosshair; }
.apt-spectrum-holder .empty-panel { margin: 16px; }

.apt-slider-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #8f9892;
}

.apt-axis-label {
  position: absolute;
  top: 0;
  left: 0;
  font-size: 11px;
  color: #d8dfda;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  white-space: nowrap;
  z-index: 2;
}
/* overview APT strip */
.apt-strip { display: flex; gap: 12px; flex-wrap: wrap; }
.apt-strip-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 150px;
  background: #10141a;
  border: 1px solid #232d3a;
  border-radius: 10px;
  padding: 8px;
  color: #dde5f0;
}
.apt-strip-card:hover { border-color: #3d4f63; text-decoration: none; }
.apt-strip-card img { width: 100%; height: 74px; object-fit: cover; border-radius: 6px; background: #0b0d10; }
.apt-strip-name { font-size: 12.5px; font-weight: 650; margin-top: 4px; }
.apt-strip-meta { font-size: 11.5px; color: #71829a; }
.band-note { font-size: 12.5px; color: #697176; margin: 10px 0 0; }

/* APT dataset index page */
.apt-index-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.apt-index-card {
  display: flex;
  flex-direction: column;
  background: #10141a;
  border: 1px solid #232d3a;
  border-radius: 12px;
  overflow: hidden;
  color: #dde5f0;
}
.apt-index-card:hover { border-color: #3d4f63; text-decoration: none; }
.apt-index-card img { width: 100%; height: 130px; object-fit: cover; background: #0b0d10; }
.apt-index-body { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 12px; }
.apt-index-body strong { font-size: 14px; }
.apt-index-meta { font-size: 12px; color: #71829a; }

/* PDF preview */
.primary-image.pdf { display: flex; flex-direction: column; }
.pdf-frame { width: 100%; height: 70vh; border: 0; background: #fff; border-radius: 8px 8px 0 0; }

/* material-page APT cards */
.apt-cards { display: flex; flex-direction: column; gap: 10px; }
.apt-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #10141a;
  border: 1px solid #232d3a;
  border-radius: 10px;
  padding: 10px 14px 10px 10px;
  color: #dde5f0;
}
.apt-card:hover { border-color: #3d4f63; text-decoration: none; }
.apt-card img {
  width: 110px;
  height: 62px;
  object-fit: cover;
  border-radius: 6px;
  background: #0b0d10;
}
.apt-card-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.apt-card-body strong { font-size: 13.5px; }
.apt-card-body span { font-size: 12px; color: #71829a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apt-card-go { font-size: 12.5px; color: #8fa8c4; white-space: nowrap; }

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; height: auto; min-height: 100vh; overflow: visible; }
  .sidebar { position: relative; height: auto; max-height: 50vh; border-right: 0; border-bottom: 1px solid #d8d3c9; }
  .detail { height: auto; overflow: visible; }
  .detail-grid { grid-template-columns: 1fr; }
  .graph-stage { height: 70vh; min-height: 480px; }
  .timeline-row { grid-template-columns: 1fr; gap: 2px; }
  .image-panel { position: static; }
  .measure-overlay { grid-template-columns: 1fr; grid-template-rows: auto 1fr; width: 100vw; height: 100vh; border-radius: 0; }
  .change-row { grid-template-columns: 1fr; gap: 4px; }
  .admin-event { grid-template-columns: 1fr 1fr; gap: 3px 12px; }
  .admin-event-path { grid-column: 1 / -1; }
}
