:root {
  color-scheme: dark;
  --bg: #061015;
  --panel: #0a1921;
  --panel-raised: #0e222c;
  --panel-soft: #0b1c24;
  --line: rgba(154, 203, 216, 0.14);
  --line-strong: rgba(154, 203, 216, 0.25);
  --text: #edf8f7;
  --text-soft: #a8bdc1;
  --text-muted: #718b91;
  --sighting: #ff896f;
  --sighting-soft: rgba(255, 137, 111, 0.15);
  --control: #5de2d1;
  --control-soft: rgba(93, 226, 209, 0.14);
  --accent: #f3c06b;
  --danger: #ff7d7d;
  --radius: 14px;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.34);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button,
label,
summary {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
summary:focus-visible,
a:focus-visible,
canvas:focus-visible {
  outline: 2px solid var(--control);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.app-shell {
  height: 100dvh;
  min-height: 560px;
  display: grid;
  grid-template-rows: 78px minmax(0, 1fr);
  background:
    radial-gradient(circle at 18% -20%, rgba(32, 108, 120, 0.18), transparent 34%),
    var(--bg);
}

.topbar {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(270px, 1fr) auto auto;
  align-items: center;
  gap: 28px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 16, 22, 0.92);
  backdrop-filter: blur(18px);
  z-index: 20;
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(93, 226, 209, 0.42);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(93, 226, 209, 0.2) 0 13%, transparent 14%),
    conic-gradient(from 45deg, transparent, rgba(93, 226, 209, 0.18), transparent 45%);
  box-shadow: inset 0 0 20px rgba(93, 226, 209, 0.08);
  color: var(--control);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--control);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.2em;
}

h1 {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: clamp(17px, 2vw, 22px);
  font-weight: 680;
  letter-spacing: 0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.release-state {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  white-space: nowrap;
}

.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--control);
  box-shadow: 0 0 0 4px rgba(93, 226, 209, 0.11), 0 0 14px var(--control);
}

.release-separator {
  color: var(--text-muted);
}

.top-metrics {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0;
}

.top-metrics > div {
  min-width: 92px;
  padding: 0 17px;
  border-left: 1px solid var(--line);
}

.top-metrics dt {
  margin-bottom: 3px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.08em;
}

.top-metrics dd {
  margin: 0;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
  font-weight: 650;
}

.workspace {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 318px minmax(0, 1fr);
}

.sidebar {
  min-height: 0;
  overflow: auto;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: rgba(7, 21, 28, 0.96);
  scrollbar-color: rgba(93, 226, 209, 0.23) transparent;
  scrollbar-width: thin;
}

.notice-card,
.release-card,
.limits-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(18, 42, 52, 0.82), rgba(8, 25, 33, 0.82));
}

.notice-card {
  position: relative;
  overflow: hidden;
  padding: 14px 15px 15px;
  border-color: rgba(243, 192, 107, 0.22);
}

.notice-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent);
  content: "";
}

.notice-card p {
  margin: 0;
  color: #cfdbdb;
  font-size: 12px;
  line-height: 1.7;
}

.notice-card .notice-kicker {
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.filter-section {
  padding: 19px 1px 18px;
  border-bottom: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.filter-section h2,
.release-card h2 {
  margin: 0 0 12px;
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.section-heading h2 {
  margin-bottom: 12px;
}

.text-button {
  margin: -4px 0 8px;
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: var(--control);
  cursor: pointer;
  font-size: 10px;
}

.text-button:hover {
  color: #9ff9ec;
}

.layer-option {
  display: grid;
  grid-template-columns: 16px 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(5, 17, 23, 0.42);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.layer-option:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.sighting-option:has(input:checked) {
  border-color: rgba(255, 137, 111, 0.28);
  background: var(--sighting-soft);
}

.control-option:has(input:checked) {
  border-color: rgba(93, 226, 209, 0.26);
  background: var(--control-soft);
}

.basemap-option:has(input:checked) {
  border-color: rgba(90, 169, 255, 0.3);
  background: rgba(65, 138, 204, 0.12);
}

.layer-option input,
.compact-check input,
.source-option input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--control);
}

.layer-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.sighting-dot {
  background: var(--sighting);
  box-shadow: 0 0 10px rgba(255, 137, 111, 0.7);
}

.control-dot {
  border: 1px solid rgba(255, 255, 255, 0.65);
  background: var(--control);
  box-shadow: 0 0 10px rgba(93, 226, 209, 0.65);
}

.basemap-grid {
  width: 10px;
  height: 10px;
  border: 1px solid #85bfff;
  border-radius: 2px;
  background:
    linear-gradient(90deg, transparent 43%, rgba(133, 191, 255, 0.72) 44% 56%, transparent 57%),
    linear-gradient(transparent 43%, rgba(133, 191, 255, 0.72) 44% 56%, transparent 57%);
  box-shadow: 0 0 9px rgba(90, 169, 255, 0.42);
}

.online-tag {
  padding: 3px 6px;
  border: 1px solid rgba(90, 169, 255, 0.24);
  border-radius: 999px;
  color: #94c8ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 8px;
}

.basemap-policy {
  margin: 9px 3px 0;
  color: var(--text-muted);
  font-size: 9px;
  line-height: 1.55;
}

.basemap-policy a {
  color: #8cbdf0;
  text-decoration: none;
}

.basemap-policy a:hover {
  text-decoration: underline;
}

.layer-copy {
  min-width: 0;
}

.layer-copy strong,
.layer-copy small {
  display: block;
}

.layer-copy strong {
  margin-bottom: 3px;
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
}

.layer-copy small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-count,
.muted-count {
  color: var(--text-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
}

.search-field > span,
.year-fields label > span {
  display: block;
  margin-bottom: 7px;
  color: var(--text-muted);
  font-size: 10px;
}

.search-field input,
.year-fields input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(3, 14, 19, 0.72);
  color: var(--text);
}

.search-field input {
  height: 39px;
  padding: 0 11px;
  font-size: 11px;
}

.search-field input::placeholder {
  color: #587078;
}

.search-field input:hover,
.year-fields input:hover {
  border-color: var(--line-strong);
}

.year-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 8px;
  margin-top: 13px;
}

.year-fields input {
  height: 36px;
  padding: 0 9px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.year-divider {
  padding-bottom: 9px;
  color: var(--text-muted);
}

.compact-check,
.source-option {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 10px;
}

.compact-check {
  margin-top: 12px;
}

.compact-check .muted-count {
  margin-left: auto;
}

.source-filters {
  display: grid;
  gap: 7px;
}

.source-option {
  padding: 8px 9px;
  border-radius: 8px;
  background: rgba(6, 19, 25, 0.5);
}

.source-option:hover {
  background: rgba(18, 43, 52, 0.6);
}

.source-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-count {
  margin-left: auto;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
}

.release-card {
  margin-top: 18px;
  padding: 14px;
}

.integrity-badge {
  margin: -3px 0 8px;
  padding: 3px 7px;
  border: 1px solid rgba(93, 226, 209, 0.24);
  border-radius: 999px;
  background: rgba(93, 226, 209, 0.08);
  color: var(--control);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.release-details {
  display: grid;
  gap: 8px;
  margin: 0;
}

.release-details > div {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
}

.release-details dt {
  color: var(--text-muted);
  font-size: 9px;
}

.release-details dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--text-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.limits-card {
  margin-top: 12px;
  padding: 0 14px 13px;
  color: var(--text-soft);
  font-size: 10px;
}

.limits-card summary {
  padding: 12px 0;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.limits-card ul {
  margin: 0 0 12px;
  padding-left: 17px;
}

.limits-card li {
  margin: 7px 0;
  line-height: 1.55;
}

.architecture-link {
  color: var(--control);
  text-decoration: none;
}

.architecture-link:hover {
  text-decoration: underline;
}

.map-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 54px minmax(0, 1fr) 27px;
  padding: 12px 14px 8px;
  background: #061118;
}

.map-statusbar {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 4px 10px;
}

.viewport-status,
.filter-summary {
  margin: 0;
}

.viewport-status {
  color: var(--text);
  font-size: 12px;
  font-weight: 630;
}

.filter-summary {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 9px;
}

.map-hint {
  color: var(--text-muted);
  font-size: 9px;
  white-space: nowrap;
}

.map-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(circle at 18% 25%, rgba(36, 62, 118, 0.13), transparent 48%),
    radial-gradient(circle at 82% 74%, rgba(15, 62, 84, 0.1), transparent 54%),
    linear-gradient(180deg, #030712, #01030a 74%);
  box-shadow: inset 0 0 70px rgba(0, 0, 0, 0.32), var(--shadow);
}

.map-stage::after {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px);
  background-size: 100% 4px;
  mix-blend-mode: soft-light;
  content: "";
}

.stage-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.stage-layer[hidden] {
  display: none;
}

#map-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}

#map-canvas.dragging {
  cursor: grabbing;
}

.map-tools {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 5;
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(7, 22, 29, 0.9);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(10px);
}

.map-tools button {
  width: 35px;
  height: 34px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 17px;
}

.map-tools button:last-child {
  border-bottom: 0;
}

.map-tools button:hover {
  background: rgba(93, 226, 209, 0.1);
  color: var(--control);
}

.map-tools .fit-button {
  font-size: 9px;
  font-weight: 650;
}

.view-toggle {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(7, 22, 29, 0.9);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(10px);
}

.view-toggle button {
  min-width: 62px;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 9px;
  font-weight: 650;
}

.view-toggle button:last-child {
  border-right: 0;
}

.view-toggle button:hover {
  color: var(--text);
  background: rgba(93, 226, 209, 0.08);
}

.view-toggle button.active {
  background: rgba(93, 226, 209, 0.15);
  color: var(--control);
}

.legend {
  position: absolute;
  bottom: 14px;
  left: 14px;
  z-index: 5;
  max-width: 270px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(5, 18, 24, 0.88);
  color: var(--text-soft);
  font-size: 9px;
  backdrop-filter: blur(10px);
}

.legend > div {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 12px;
}

.legend-mark {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 50%;
}

.sighting-mark {
  background: var(--sighting);
  box-shadow: 0 0 7px rgba(255, 137, 111, 0.65);
}

.control-mark {
  border: 1px solid #dffffb;
  background: var(--control);
  box-shadow: 0 0 7px rgba(93, 226, 209, 0.65);
}

.legend p {
  margin: 8px 0 0;
  color: var(--text-muted);
  line-height: 1.45;
}

.map-tooltip {
  position: absolute;
  z-index: 9;
  max-width: 260px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(3, 14, 19, 0.96);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.36);
  color: var(--text);
  pointer-events: none;
  font-size: 10px;
  line-height: 1.45;
}

.map-tooltip strong,
.map-tooltip span {
  display: block;
}

.map-tooltip span {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 9px;
}

.loading-panel,
.error-panel {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(4, 16, 22, 0.92);
  text-align: center;
  backdrop-filter: blur(8px);
}

.loading-panel strong {
  margin-top: 18px;
  color: var(--text);
  font-size: 13px;
}

.loading-panel > span {
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 10px;
}

.radar-loader {
  position: relative;
  width: 62px;
  height: 62px;
  overflow: hidden;
  border: 1px solid rgba(93, 226, 209, 0.3);
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 49.5%, rgba(93, 226, 209, 0.2) 50%, transparent 50.5%),
    linear-gradient(transparent 49.5%, rgba(93, 226, 209, 0.2) 50%, transparent 50.5%);
  box-shadow: inset 0 0 18px rgba(93, 226, 209, 0.08), 0 0 25px rgba(93, 226, 209, 0.08);
}

.radar-loader::before,
.radar-loader::after {
  position: absolute;
  border: 1px solid rgba(93, 226, 209, 0.17);
  border-radius: 50%;
  content: "";
}

.radar-loader::before {
  inset: 13px;
}

.radar-loader::after {
  inset: 25px;
}

.radar-loader span {
  position: absolute;
  inset: 50% 50% 0 0;
  transform-origin: 100% 0;
  background: linear-gradient(135deg, transparent 45%, rgba(93, 226, 209, 0.42));
  animation: radar-spin 1.45s linear infinite;
}

@keyframes radar-spin {
  to {
    transform: rotate(360deg);
  }
}

.error-panel {
  padding: 30px;
  background: rgba(22, 9, 12, 0.94);
}

.error-panel strong {
  color: var(--danger);
  font-size: 16px;
}

.error-panel p {
  max-width: 620px;
  margin: 10px 0 0;
  color: #d3bdc0;
  font-size: 11px;
  line-height: 1.65;
}

.error-panel code {
  color: #ffd2d2;
}

.detail-drawer {
  position: absolute;
  top: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 10;
  width: min(355px, calc(100% - 80px));
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: rgba(7, 22, 29, 0.96);
  box-shadow: -16px 0 46px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(16px);
  scrollbar-color: rgba(93, 226, 209, 0.23) transparent;
  scrollbar-width: thin;
}

.detail-heading {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 26, 34, 0.96);
}

.detail-heading span {
  color: var(--control);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.detail-heading button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.detail-heading button:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.detail-content {
  padding: 16px;
}

.detail-role {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
}

.detail-role.sighting {
  background: var(--sighting-soft);
  color: #ffb7a7;
}

.detail-role.control {
  background: var(--control-soft);
  color: #a1f7ec;
}

.detail-title {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  font-weight: 650;
  line-height: 1.4;
}

.detail-subtitle {
  margin: 7px 0 16px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.55;
}

.record-details {
  display: grid;
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--line);
}

.record-details > div {
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.record-details dt {
  color: var(--text-muted);
  font-size: 9px;
}

.record-details dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text-soft);
  font-size: 10px;
  line-height: 1.5;
}

.record-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
}

.detail-link,
.detail-copy-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(93, 226, 209, 0.07);
  color: var(--control);
  cursor: pointer;
  font-size: 9px;
  text-decoration: none;
}

.detail-link:hover,
.detail-copy-button:hover {
  border-color: rgba(93, 226, 209, 0.45);
  background: rgba(93, 226, 209, 0.12);
}

.cluster-summary {
  margin: 0 0 13px;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.65;
}

.cluster-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cluster-list button {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(3, 15, 20, 0.52);
  color: var(--text-soft);
  cursor: pointer;
  text-align: left;
}

.cluster-list button:hover {
  border-color: var(--line-strong);
  background: rgba(15, 40, 49, 0.72);
}

.cluster-list strong {
  overflow: hidden;
  color: var(--text);
  font-size: 10px;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cluster-list span {
  color: var(--text-muted);
  font-size: 9px;
}

.cluster-overflow {
  margin: 11px 0 0;
  color: var(--text-muted);
  font-size: 9px;
}

.map-footer {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  overflow: hidden;
  padding: 7px 4px 0;
  color: #5d767d;
  font-size: 8px;
  white-space: nowrap;
}

.map-footer span:last-child {
  margin-left: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.map-footer a {
  color: #77949b;
  text-decoration: none;
}

.map-footer a:hover {
  color: var(--control);
  text-decoration: underline;
}

noscript {
  position: fixed;
  inset: 20px;
  z-index: 100;
  padding: 30px;
  border: 1px solid var(--danger);
  border-radius: 12px;
  background: var(--panel);
}

@media (max-width: 1120px) {
  .topbar {
    gap: 14px;
    padding: 0 17px;
  }

  .top-metrics > div {
    min-width: 78px;
    padding: 0 12px;
  }

  .workspace {
    grid-template-columns: 292px minmax(0, 1fr);
  }

  .map-hint,
  #projection-credit {
    display: none;
  }
}

@media (max-width: 850px) {
  html,
  body {
    overflow: auto;
  }

  .app-shell {
    height: auto;
    min-height: 100dvh;
    grid-template-rows: 68px auto;
  }

  .topbar {
    position: sticky;
    top: 0;
    grid-template-columns: minmax(220px, 1fr) auto;
  }

  .top-metrics {
    display: none;
  }

  .workspace {
    display: flex;
    flex-direction: column;
  }

  .sidebar {
    max-height: 42dvh;
    flex: 0 0 auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .map-panel {
    min-height: 68dvh;
    grid-template-rows: 50px minmax(520px, 68dvh) 27px;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 0 12px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .eyebrow {
    display: none;
  }

  h1 {
    font-size: 16px;
  }

  .release-state {
    font-size: 9px;
  }

  .release-state .release-separator,
  #header-release {
    display: none;
  }

  .map-panel {
    padding: 8px;
  }

  .map-statusbar {
    padding-left: 2px;
  }

  .legend {
    right: 10px;
    bottom: 10px;
    left: 10px;
    max-width: none;
  }

  .detail-drawer {
    top: 8px;
    right: 8px;
    bottom: 8px;
    width: calc(100% - 16px);
  }

  .map-footer span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.country-dot {
  background: rgba(255, 236, 176, 0.92);
  box-shadow: 0 0 8px rgba(255, 224, 138, 0.55);
}

.record-narrative {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-left: 2px solid rgba(255, 137, 111, 0.55);
  border-radius: 0 10px 10px 0;
  background: rgba(255, 137, 111, 0.07);
}

.record-narrative p {
  margin: 0;
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.65;
  /* Source wording, shown verbatim: keep its own line breaks. */
  white-space: pre-wrap;
}

.record-narrative-note {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 9.5px;
  letter-spacing: 0.02em;
}

.record-narrative-missing {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 11px;
}

.record-readings {
  margin-bottom: 14px;
}

.cluster-narrative {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.5;
}

.map-tooltip span {
  white-space: pre-line;
}

.rights-list li {
  margin-bottom: 9px;
  line-height: 1.6;
}

.rights-list strong {
  color: var(--text);
}

#data-credit {
  color: var(--text-muted);
}

.texture-pack {
  margin-top: 10px;
}

.texture-pack-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.texture-pack-panel {
  margin-top: 8px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 24, 32, 0.55);
}

.texture-pack-panel p {
  margin: 0 0 7px;
  color: var(--text-muted);
  font-size: 10.5px;
  line-height: 1.6;
}

.texture-pack-panel code {
  display: block;
  overflow-x: auto;
  margin-bottom: 7px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.34);
  color: var(--text);
  font-size: 10.5px;
  white-space: nowrap;
}

.texture-pack-hint code {
  display: inline;
  padding: 1px 4px;
  white-space: normal;
}
