/* Vicus – paper list (light) next to a night map (dark). Grotesque for text, mono for facts. */
:root {
  --paper: #f2ede2;
  --paper-2: #e9e2d2;
  --paper-3: #fbf8f1;
  --ink: #1b1a17;
  --ink-2: #5b574e;
  --ink-3: #8b8578;
  --spot: #d7321f;
  --spot-soft: #ff8c7d;
  --sans: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --head-h: 92px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.4;
  background-image: radial-gradient(rgba(0, 0, 0, .035) 1px, transparent 1px); background-size: 3px 3px;
}
button, select { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; }
.ico { flex: none; }

.app { display: grid; grid-template-rows: auto 1fr; height: 100vh; height: 100dvh; }

/* ---------------------------------------------------------------- head */
.head { display: flex; align-items: center; gap: 10px 24px; flex-wrap: wrap; padding: 12px 22px 10px; border-bottom: 3px solid var(--ink); background: var(--paper); position: relative; z-index: 900; }
.wordmark { font-weight: 900; font-stretch: 80%; letter-spacing: -.05em; line-height: .8; font-size: 60px; }
.wordmark em { font-style: normal; color: var(--spot); }
.headmeta { flex: 1; min-width: 260px; }
.headmeta .line { font: 500 12px/1.3 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); }
.headmeta .line b { color: var(--ink); }
.headmeta .claim { font-size: 20px; font-weight: 650; font-stretch: 88%; letter-spacing: -.01em; margin-top: 3px; }
.headmeta .claim em { font-style: normal; color: var(--spot); }
.headctl { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }

.locctl { display: inline-flex; align-items: center; gap: 6px; font: 500 12.5px/1 var(--mono); }
.locctl .ico { color: var(--spot); }
.locctl select {
  appearance: none; background: transparent; border: 0; border-bottom: 1.5px solid var(--ink); border-radius: 0;
  padding: 3px 16px 3px 0; font: 600 12.5px/1.2 var(--mono); max-width: 270px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: right 5px center, right 0 center; background-size: 5px 5px; background-repeat: no-repeat;
}
.seg { display: inline-flex; border: 1.5px solid var(--ink); background: var(--paper-3); }
.seg button { background: none; border: 0; border-left: 1.5px solid var(--ink); padding: 6px 9px; font: 600 12px/1 var(--mono); }
.seg button:first-child { border-left: 0; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.seglbl { font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin-right: -6px; }

/* ---------------------------------------------------------------- split */
.split { display: grid; grid-template-columns: minmax(400px, 46%) 1fr; min-height: 0; }
.col-list { display: flex; flex-direction: column; min-height: 0; border-right: 3px solid var(--ink); }
.col-map { position: relative; min-height: 0; background: var(--ink); }
#map { position: absolute; inset: 0; }

/* tabs + icon filters (from draft E) */
.tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 2px solid var(--ink); flex: none; }
.tabs button { background: none; border: 0; padding: 11px 8px; font: 600 12.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; display: flex; align-items: center; justify-content: center; gap: 8px; }
.tabs button + button { border-left: 2px solid var(--ink); }
.tabs button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.tabs .state { font-weight: 700; color: var(--spot); }
.tabs button[aria-pressed="true"] .state { color: var(--spot-soft); }
.tabs .n { font-weight: 400; opacity: .7; }

/* one row, equal columns (set in app.js); 1px gaps on an ink background draw the lines */
.filters { display: grid; gap: 1px; background: var(--ink); border-bottom: 1px solid var(--ink); flex: none; }
.filters button {
  min-width: 0; background: var(--paper); border: 0; padding: 9px 4px 7px;
  display: grid; justify-items: center; gap: 5px; font: 500 10px/1 var(--mono); text-transform: uppercase; letter-spacing: .02em;
  position: relative; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.filters button[aria-pressed="true"] { background: var(--spot); color: var(--paper); }
.filters button .c { position: absolute; top: 3px; right: 4px; font: 700 9px/1 var(--mono); opacity: .7; }
.filters button:disabled { opacity: .3; cursor: default; }
.filters button.optout:not([aria-pressed="true"]) { color: var(--ink-3); }
/* labels in the condensed Archivo (the wordmark's font) so a single row keeps them */
.filters button .lbl { font: 650 10.5px/1 Archivo, sans-serif; font-stretch: 68%; letter-spacing: .01em; max-width: 100%; overflow: hidden; text-overflow: clip; }
.filters.narrow button { padding-left: 1px; padding-right: 1px; }
.filters.narrow button .lbl { font-size: 9.5px; font-stretch: 62%; letter-spacing: 0; }
.filters.compact button { padding: 10px 0 9px; gap: 0; }          /* icon + count only */
.filters.compact button .lbl { display: none; }
.filters.compact button .c { font-size: 8.5px; top: 2px; right: 2px; }
.filters.tiny button { padding: 9px 0 8px; }
.filters.tiny button .ico { width: 19px; height: 19px; }
.filters.tiny button .c { display: none; }
.listbar .catname { display: inline-flex; align-items: center; gap: 5px; color: var(--spot); }

.listbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 20px; border-bottom: 1px solid var(--ink); flex: none; font: 400 12px/1.3 var(--mono); color: var(--ink-2); }
.listbar b { color: var(--ink); }
.scroll { flex: 1; overflow-y: auto; min-height: 0; overscroll-behavior: contain; }

/* ---------------------------------------------------------------- entries (from draft D) */
#list { list-style: none; margin: 0; padding: 0; }
.entry { display: grid; grid-template-columns: 36px 1fr; gap: 0 14px; padding: 16px 22px 16px 18px; border-bottom: 1px solid var(--ink); cursor: pointer; scroll-margin-top: 50px; }
.entry .num { width: 34px; height: 34px; border: 2px solid var(--ink); border-radius: 50%; display: grid; place-items: center; background: var(--paper-3); font: 700 13px/1 var(--mono); }
.entry .num.area { border-style: dashed; }
.entry.hl .num, .entry.sel .num { background: var(--spot); border-color: var(--spot); color: var(--paper); }
.entry.sel { background: var(--paper-3); box-shadow: inset 5px 0 0 var(--spot); }
.entry.flash { animation: flash 2.2s ease-out; }
@keyframes flash { 0%, 30% { background: #ffe37a; } }
.kicker { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font: 600 11.5px/1.2 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--spot); }
.kicker .dist { margin-left: auto; letter-spacing: 0; text-transform: none; font-family: var(--sans); }
.badge { border: 1px solid currentColor; padding: 2px 5px 1px; font: 600 10.5px/1.2 var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.badge.solid { background: var(--spot); color: var(--paper); border-color: var(--spot); }
.bell { color: var(--ink); display: inline-flex; }
.dist { font-weight: 800; font-stretch: 75%; color: var(--spot); white-space: nowrap; letter-spacing: -.01em; }
.arrow { display: inline-flex; vertical-align: -1px; color: var(--spot); }
.entry h2 { font-weight: 800; font-stretch: 80%; letter-spacing: -.015em; line-height: 1.05; margin: 6px 0 5px; overflow-wrap: anywhere; }
.entry p.teaser { font-size: 15.5px; color: #34322c; max-width: 62ch; }
.meta { font: 400 12px/1.5 var(--mono); color: var(--ink-2); margin-top: 7px; }
.meta b { color: var(--ink); font-weight: 600; }
/* the nearer, the bigger */
.t1 h2 { font-size: clamp(30px, 3.1vw, 48px); font-weight: 900; font-stretch: 70%; line-height: .96; }
.t1 p.teaser { font-size: 17.5px; }
.t1 .kicker .dist { font-size: 34px; line-height: .8; }
.t2 h2 { font-size: 25px; }
.t2 .kicker .dist { font-size: 21px; }
.t3 { padding-top: 11px; padding-bottom: 11px; }
.t3 h2 { font-size: 18.5px; font-stretch: 88%; font-weight: 700; margin: 4px 0 2px; }
.t3 .kicker .dist { font-size: 16px; }
.t3 p.teaser { display: none; }
.entry .detail { display: none; margin-top: 10px; }
.entry.sel .detail, .entry.sel p.teaser { display: block; }
.detail .links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.detail .links a { font: 600 12px/1 var(--mono); border: 1.5px solid var(--ink); padding: 7px 9px; text-decoration: none; background: var(--paper); }
.detail .links a:hover { background: var(--ink); color: var(--paper); }
.detail .tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.detail .tags span { font: 500 11px/1 var(--mono); border: 1px solid var(--ink-3); padding: 4px 6px; color: var(--ink-2); }

.grp { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; padding: 8px 20px 7px; background: var(--paper-2); border-bottom: 1px solid var(--ink); font: 700 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.grp.now { background: var(--spot); color: var(--paper); }
.grp.area { background: var(--ink); color: var(--paper); }

.more-row { padding: 16px 20px 18px; border-bottom: 1px solid var(--ink); font: 400 12.5px/1.6 var(--mono); color: var(--ink-2); background: repeating-linear-gradient(-45deg, transparent 0 9px, rgba(27, 26, 23, .05) 9px 10px); }
.more-row b { color: var(--ink); }
.btn { display: inline-block; margin-top: 8px; background: var(--paper-3); border: 1.5px solid var(--ink); padding: 8px 11px; font: 600 12px/1 var(--mono); }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.solid { background: var(--ink); color: var(--paper); }
.btn.solid:hover { background: var(--spot); border-color: var(--spot); }
.empty { padding: 34px 22px; font-size: 18px; font-weight: 600; }
.loading { padding: 34px 22px; font: 500 13px/1.5 var(--mono); color: var(--ink-2); }

/* ---------------------------------------------------------------- notify tab (from draft E) */
.notify { padding: 20px 22px 26px; }
.notify h2 { font-size: 36px; line-height: .95; font-weight: 900; font-stretch: 72%; letter-spacing: -.02em; }
.notify h2 em { font-style: normal; color: var(--spot); }
.notify .lead { margin: 8px 0 14px; font-size: 15.5px; max-width: 54ch; }
.notify .status { font: 400 12px/1.5 var(--mono); color: var(--ink-2); margin: 10px 0 0; }
.notify h4 { font: 700 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; margin: 24px 0 0; padding-bottom: 7px; border-bottom: 2px solid var(--ink); display: flex; justify-content: space-between; }
.notify h4 button { background: none; border: 0; padding: 0; font: inherit; letter-spacing: 0; text-transform: none; text-decoration: underline; color: var(--ink-2); }
.onoff { border: 1.5px solid var(--ink); background: var(--paper-3); padding: 0; display: inline-flex; font: 700 11.5px/1 var(--mono); letter-spacing: .06em; }
.onoff span { padding: 7px 9px; }
.onoff[aria-checked="true"] span:first-child { background: var(--spot); color: var(--paper); }
.onoff[aria-checked="false"] span:last-child { background: var(--ink); color: var(--paper); }
.check { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; border-bottom: 1px solid rgba(27, 26, 23, .25); padding: 10px 2px; text-align: left; font-size: 16px; font-weight: 600; font-stretch: 90%; }
.check .box { width: 18px; height: 18px; border: 2px solid var(--ink); display: grid; place-items: center; font: 700 13px/1 var(--mono); flex: none; }
.check[aria-pressed="true"] .box { background: var(--spot); border-color: var(--spot); color: var(--paper); }
.check[aria-pressed="true"] .box::after { content: '×'; }
.check small { margin-left: auto; font: 400 11px/1 var(--mono); color: var(--ink-2); white-space: nowrap; }
.check .hint { display: block; font: 400 11.5px/1.3 var(--mono); color: var(--ink-2); margin-top: 2px; font-stretch: 100%; }

/* ---------------------------------------------------------------- sources footer */
.sources { padding: 0 22px 18px; font: 400 11px/1.6 var(--mono); color: var(--ink-3); border-top: 1px solid var(--ink-3); margin-top: 28px; }
.sources summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; }
.sources summary::-webkit-details-marker { display: none; }
.sources summary span:first-child { font-weight: 600; letter-spacing: .08em; text-transform: uppercase; text-decoration: underline; text-underline-offset: 3px; }
.sources summary span:first-child::after { content: ' ▸'; text-decoration: none; display: inline-block; }
.sources details[open] summary span:first-child::after { content: ' ▾'; }
.sources ul { margin: 0 0 10px; padding: 0; list-style: none; color: var(--ink-2); }
.sources li { display: flex; gap: 8px; }
.sources li .ok { color: #2f7d32; }
.sources li .fail { color: var(--spot); }
.sources a { color: var(--ink-2); }
.notify .permhelp { margin: -4px 0 14px; font: 400 12px/1.55 var(--mono); color: var(--ink-2); max-width: 46em; }
.notify .permhelp a { color: var(--spot); font-weight: 600; }
.more-row.note { background: var(--paper-3); border-left: 4px solid var(--spot); color: var(--ink); }
.more-row .spotlinks { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.footnav a { color: var(--ink-2); }
.footnav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding-top: 8px; border-top: 1px dotted var(--ink-3); }
.listbar .venuechip { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); text-transform: none; letter-spacing: 0; }
.listbar .venuechip b { color: var(--spot); }
.btn.small { padding: 5px 8px; font-size: 11px; margin-top: 0; }
.detail .links .vbtn { font: 600 12px/1 var(--mono); border: 1.5px solid var(--spot); color: var(--spot); padding: 6px 9px; background: var(--paper); display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.detail .links .vbtn:hover { background: var(--spot); color: var(--paper); }

/* ---------------------------------------------------------------- map overlays */
.mapchip { position: absolute; top: 14px; right: 14px; z-index: 500; display: flex; gap: 8px; }
.mapchip button { background: var(--paper); border: 1.5px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); padding: 7px 10px; font: 600 12px/1 var(--mono); }
.mapchip button:hover { background: var(--ink); color: var(--paper); }
.maphint { position: absolute; left: 14px; bottom: 14px; z-index: 500; background: rgba(27, 26, 23, .82); color: #d8d1c0; font: 400 11px/1.4 var(--mono); padding: 6px 8px; pointer-events: none; }
.leaflet-container { background: var(--ink); font-family: var(--mono); }
.leaflet-container a { color: inherit; }
.leaflet-control-attribution { background: rgba(27, 26, 23, .75) !important; color: #a39d8f; font-size: 10px; }
.leaflet-control-attribution a { color: #d8d1c0 !important; }
.theme-light .leaflet-control-attribution { background: rgba(242, 237, 226, .85) !important; color: var(--ink-2); }
.theme-light .leaflet-control-attribution a { color: var(--ink) !important; }
.leaflet-bar { border: 1.5px solid var(--ink) !important; border-radius: 0 !important; box-shadow: 3px 3px 0 var(--ink) !important; }
.leaflet-bar a { background: var(--paper); color: var(--ink); border-radius: 0 !important; border-bottom-color: var(--ink) !important; font-family: var(--mono); }
.leaflet-bar a:hover { background: var(--ink); color: var(--paper); }
.leaflet-tooltip.vm-tip { background: var(--paper); border: 1.5px solid var(--ink); border-radius: 0; box-shadow: 3px 3px 0 var(--spot); color: var(--ink); font: 700 13px/1.2 var(--sans); padding: 5px 8px; }
.leaflet-tooltip.vm-tip span { display: block; font: 400 10.5px/1.3 var(--mono); color: var(--ink-2); }
.leaflet-tooltip.vm-tip::before { display: none; }

.vm-marker { background: none; border: 0; }
.vm-marker .num {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--paper-3); border: 2px solid var(--ink);
  font: 700 12px/1 var(--mono); color: var(--ink); box-shadow: 0 0 0 1.5px var(--paper-3); transition: transform .15s;
}
.vm-marker.area .num { border-style: dashed; }
.vm-marker .num small { position: absolute; left: calc(100% - 6px); top: -7px; background: var(--ink); color: var(--paper); font: 700 9px/1 var(--mono); padding: 2px 3px; border: 1px solid var(--paper-3); }
.leaflet-tooltip.vm-tip { max-width: 320px; white-space: normal; }
.leaflet-tooltip.vm-tip span { margin-bottom: 4px; }
.vm-marker.live .num { border-color: var(--spot); color: var(--spot); box-shadow: 0 0 0 1.5px var(--paper-3), 0 0 0 6px rgba(215, 50, 31, .35); }
.vm-marker.new .num::after { content: ''; position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--spot); border: 2px solid var(--paper-3); }
.vm-marker.hl .num, .vm-marker.sel .num { background: var(--spot); border-color: var(--spot); color: var(--paper); transform: scale(1.25); }
.vm-marker .dot { display: block; width: 9px; height: 9px; border-radius: 50%; background: #a39d8f; border: 1.5px solid var(--ink); }
.theme-light .vm-marker .dot { background: #fbf8f1; }
.vm-marker.listed .dot { width: 12px; height: 12px; background: var(--paper-3); border: 2px solid var(--ink); }
.vm-marker.listed.live .dot { background: var(--spot); }
.vm-marker.hl .dot, .vm-marker.sel .dot { background: var(--spot); transform: scale(1.5); }
.vm-me { background: none; border: 0; cursor: grab; }
.vm-me i { position: absolute; inset: 3px; border-radius: 50%; background: var(--spot); border: 2.5px solid var(--paper-3); box-shadow: 0 0 0 2px var(--ink), 0 0 0 9px rgba(215, 50, 31, .25); }
.vm-me b { position: absolute; left: 50%; top: -19px; transform: translateX(-50%); background: var(--paper); color: var(--ink); font: 700 10px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 3px 5px; border: 1px solid var(--ink); }

/* ---------------------------------------------------------------- toast */
.extra {
  position: fixed; right: 22px; bottom: 22px; z-index: 2000; width: min(390px, calc(100vw - 40px));
  background: var(--paper); border: 2px solid var(--ink); box-shadow: 8px 8px 0 var(--ink);
  padding: 14px 16px 16px; transform: translateY(calc(100% + 120px)) rotate(-2deg); transition: transform .45s cubic-bezier(.2, 1.3, .4, 1); cursor: pointer;
}
.extra.show { transform: translateY(0) rotate(-1deg); }
.extra .lbl { display: inline-block; background: var(--spot); color: var(--paper); font: 700 12px/1 var(--mono); letter-spacing: .12em; padding: 5px 7px; text-transform: uppercase; }
.extra h4 { margin: 8px 0 4px; font-size: 22px; line-height: 1.05; font-weight: 800; font-stretch: 85%; letter-spacing: -.01em; }
.extra p { font: 400 12px/1.45 var(--mono); color: var(--ink-2); }
.extra .close { position: absolute; top: 8px; right: 10px; background: none; border: 0; font: 400 20px/1 var(--mono); }

/* ---------------------------------------------------------------- mobile */
@media (max-width: 860px) {
  .app { display: block; height: auto; }
  .head { padding: 10px 14px 8px; gap: 6px 12px; }
  .wordmark { font-size: 40px; }
  .headmeta { min-width: 0; }
  .headmeta .claim { font-size: 16px; }
  .headctl { width: 100%; justify-content: space-between; }
  .locctl select { max-width: 52vw; }
  .split { display: flex; flex-direction: column-reverse; }
  .col-map { position: sticky; top: 0; height: 42vh; z-index: 600; border-bottom: 3px solid var(--ink); }
  .col-list { border-right: 0; }
  .scroll { overflow: visible; }
  .entry { padding-left: 14px; padding-right: 14px; scroll-margin-top: calc(42vh + 10px); }
  .listbar, .notify, .sources, .more-row, .grp { padding-left: 14px; padding-right: 14px; }
  .grp { top: 42vh; }
  .maphint { display: none; }
  .vm-marker .num { width: 22px; height: 22px; font-size: 10px; border-width: 1.5px; }
  .extra { right: 12px; bottom: 12px; }
}
