:root {
  color-scheme: dark;
  --bg: #11120f;
  --panel: #1b1b17;
  --panel-strong: #24241e;
  --paper: #e9dfc5;
  --ink: #f5efd9;
  --muted: #b7ad96;
  --line: #39372e;
  --accent: #c24f31;
  --accent-2: #2f8f83;
  --blue: #4578a6;
  --shadow: rgba(0, 0, 0, 0.35);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

body.is-sidebar-drawer-open {
  overflow: hidden;
}

body.is-editor-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  display: block;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(420px, 92vw);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  background: var(--panel);
  border-right: 1px solid var(--line);
  box-shadow: 0 0 28px var(--shadow);
  transform: translateX(-100%);
  transition: transform 180ms ease;
  pointer-events: none;
  z-index: 70;
}

.mobile-sidebar-backdrop {
  display: none;
  pointer-events: none;
}

.mobile-drawer-close {
  display: inline-flex;
  float: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-height: 34px;
  padding: 0;
  font-size: 1.35rem;
  line-height: 1;
}

body.is-sidebar-drawer-open .sidebar {
  transform: translateX(0);
  pointer-events: auto;
}

body.is-sidebar-drawer-open .mobile-sidebar-backdrop {
  display: block;
  pointer-events: auto;
}

.brand,
.panel {
  padding: 18px;
}

.brand {
  position: relative;
  border-bottom: 1px solid var(--line);
}

.brand-actions {
  margin-top: 12px;
}

.eyebrow,
.result-kind {
  margin: 0 0 7px;
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.4rem;
  line-height: 1;
}

h2 {
  margin-bottom: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
}

h3 {
  margin: 18px 0 8px;
  font-size: 0.9rem;
  color: var(--paper);
}

.case-summary,
.muted {
  color: var(--muted);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.local-authoring-only {
  display: none !important;
}

.maplibregl-ctrl-attrib a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

body.is-local-authoring .local-authoring-only:not([hidden]) {
  display: revert !important;
}

.tab {
  min-height: 44px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  cursor: pointer;
}

.tab.is-active {
  color: var(--ink);
  background: var(--panel-strong);
}

.panel {
  display: none;
  overflow: auto;
}

.panel.is-active {
  display: block;
}

.prose {
  color: var(--paper);
  line-height: 1.55;
}

.inline-link {
  color: var(--paper);
  text-decoration: underline;
  text-decoration-color: rgba(194, 79, 49, 0.8);
  text-underline-offset: 0.14em;
  cursor: pointer;
}

.inline-link:hover,
.inline-link:focus-visible {
  color: white;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 18px 0;
}

.stats span,
.compact-item,
.result-item,
.solution-result,
.discoveries span {
  border: 1px solid var(--line);
  background: var(--panel-strong);
  border-radius: 6px;
}

.stats span {
  padding: 10px;
  color: var(--muted);
}

.stats strong {
  display: block;
  color: var(--ink);
  font-size: 1.25rem;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.86rem;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  color: var(--ink);
  background: #11120f;
  border: 1px solid var(--line);
  border-radius: 6px;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

.filters {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.filters input {
  width: auto;
  min-height: auto;
  margin-right: 6px;
}

.results,
.compact-list {
  display: grid;
  gap: 8px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-count {
  flex: 0 0 auto;
  padding: 7px 9px;
  color: var(--muted);
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.8rem;
}

.compact-heading h2 {
  margin-bottom: 0;
  font-size: 1rem;
}

.result-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 11px;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.result-item strong {
  color: var(--ink);
}

.result-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.result-meta span {
  padding: 4px 7px;
  color: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.74rem;
  line-height: 1.1;
}

.result-summary {
  color: var(--paper);
  line-height: 1.45;
}

.compact-item {
  display: grid;
  gap: 5px;
  padding: 11px;
  color: var(--muted);
  line-height: 1.4;
}

.compact-item strong {
  color: var(--ink);
}

.compact-item-button {
  width: 100%;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.compact-item-button:hover,
.compact-item-button:focus-visible {
  border-color: var(--accent);
  color: var(--ink);
}

.primary-button,
.danger-button,
.secondary-button,
.close-button,
.map-tools button,
.map-tool-link {
  min-height: 40px;
  padding: 9px 12px;
  color: white;
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.danger-button {
  color: white;
  background: #9f3528;
  border: 1px solid #c65645;
}

.secondary-button,
.map-tool-link {
  width: 100%;
  color: var(--paper);
  background: transparent;
  border: 1px solid var(--line);
  text-decoration: none;
}

.map-tool-link.inline-button {
  width: auto;
}

.inline-button {
  width: auto;
  margin-bottom: 10px;
}

.map-stage {
  position: relative;
  min-width: 0;
  min-height: 100vh;
}

.map {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.maplibregl-marker {
  transition: none !important;
  will-change: transform;
}

.mobile-menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-height: 44px;
  padding: 0;
  font-size: 1.2rem;
  line-height: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(27, 27, 23, 0.96);
  color: var(--ink);
  box-shadow: 0 18px 40px var(--shadow);
}

.mobile-sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 50;
}

.map-tools {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px;
  background: rgba(27, 27, 23, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  z-index: 30;
}

.map-action-row {
  display: contents;
}

.map-status-row {
  display: contents;
}

.map-search {
  min-width: min(320px, 42vw);
}

.map-search input {
  min-height: 38px;
}

.zoom-indicator {
  display: grid;
  gap: 2px;
  min-width: 72px;
  padding: 6px 8px;
  color: var(--muted);
  background: rgba(17, 18, 15, 0.7);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.78rem;
}

.zoom-indicator strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1;
}

.map-label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.map-label strong {
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.1;
}

.opacity-control {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.opacity-control input {
  width: 90px;
  min-height: auto;
  padding: 0;
}

.layer-panel,
.search-panel,
.newspaper-panel,
.editor-overlay-shell {
  position: absolute;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(27, 27, 23, 0.96);
  box-shadow: 0 18px 40px var(--shadow);
  z-index: 20;
}

.layer-panel {
  top: 96px;
  left: 16px;
  width: min(340px, calc(100vw - 32px));
  padding: 12px 14px;
}

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

.layer-filters {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 0;
}

.layer-filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.layer-filter-item input {
  margin-right: 0;
}

.layer-filter-swatch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: white;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  flex: 0 0 auto;
}

.layer-filter-label {
  min-width: 0;
}

.search-panel {
  top: 184px;
  left: 16px;
  width: min(380px, calc(100vw - 32px));
  max-height: 48vh;
  overflow: auto;
  padding: 14px;
}

.newspaper-panel {
  top: 104px;
  right: 16px;
  width: min(1120px, calc(100vw - 48px));
  min-width: 520px;
  max-height: calc(100vh - 120px);
  min-height: 420px;
  overflow: auto;
  padding: 24px;
  background: #f2ead5;
  color: #241d12;
  position: absolute;
}

.editor-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  padding: 16px;
  background: rgba(0, 0, 0, 0.48);
  z-index: 60;
}

.editor-overlay[hidden] {
  display: none;
}

.editor-overlay-shell {
  position: relative;
  inset: auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.editor-overlay-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.editor-overlay-bar h2 {
  margin-bottom: 0;
}

.editor-overlay-bar .inline-button {
  margin-bottom: 0;
}

.editor-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #11120f;
}

.newspaper-panel .muted,
.newspaper-panel .eyebrow {
  color: #6d5f46;
}

.newspaper-panel .close-button {
  color: #6d5f46;
  border-color: #cab78d;
}

.newspaper-masthead {
  padding-bottom: 10px;
  margin-bottom: 8px;
  border-bottom: 4px double #6d5f46;
  text-align: center;
  cursor: move;
}

.newspaper-masthead h2 {
  margin-bottom: 0;
  color: #241d12;
  font-family: "UnifrakturCook", Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 4.8vw, 4.6rem);
  font-weight: 700;
  line-height: 1;
}

.newspaper-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 6px 10px;
  margin-bottom: 16px;
  border-bottom: 1px solid #b9a882;
  color: #6d5f46;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.82rem;
  text-transform: none;
}

.newspaper-grid {
  padding-top: 8px;
}

.newspaper-columns {
  display: grid;
  gap: 14px;
}

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

.newspaper-columns.columns-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.newspaper-columns.columns-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.newspaper-columns.columns-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.newspaper-columns.columns-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.newspaper-columns.columns-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.newspaper-column {
  min-width: 0;
  padding-right: 12px;
  border-right: 1px solid #6d5f46;
}

.newspaper-column:last-child {
  padding-right: 0;
  border-right: 0;
}

.newspaper-stream-heading {
  break-inside: avoid;
  margin: 12px 0 6px;
  padding-top: 8px;
  border-top: 1px solid #6d5f46;
  color: #241d12;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.newspaper-entry {
  display: block;
  width: 100%;
  break-inside: avoid;
  margin: 0 0 8px;
  padding: 0 0 6px;
  color: #241d12;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(109, 95, 70, 0.22);
  border-radius: 0;
  cursor: pointer;
}

.newspaper-entry h3 {
  margin: 0 0 3px;
  color: #241d12;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.76rem;
  line-height: 1.08;
  font-weight: 700;
  text-transform: uppercase;
}

.newspaper-entry p {
  margin: 0;
  color: #382d1f;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.63rem;
  line-height: 1.12;
  text-align: justify;
  text-indent: 1em;
}

.newspaper-entry p.is-no-indent,
.newspaper-entry-lines p.is-no-indent,
.newspaper-article-body p.is-no-indent {
  text-indent: 0;
}

.newspaper-entry.is-classified h3 {
  font-size: 0.7rem;
  margin-bottom: 2px;
}

.newspaper-entry.is-classified p,
.newspaper-entry.is-inline-head-entry p,
.newspaper-entry.is-dropcap-entry p {
  text-indent: 0;
}

.newspaper-entry-lines {
  display: grid;
  gap: 1px;
}

.newspaper-entry-lines p {
  text-align: left;
  line-height: 1.08;
}

.newspaper-inline-head {
  color: #241d12;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.69rem;
  font-weight: 700;
  line-height: 1.08;
  text-transform: uppercase;
}

.newspaper-entry.is-inline-head-entry {
  line-height: 1.08;
}

.newspaper-entry.is-inline-head-entry .newspaper-entry-lines {
  display: inline;
}

.newspaper-entry.is-inline-head-entry .newspaper-entry-lines p {
  display: inline;
}

.newspaper-entry.is-inline-head-entry .newspaper-entry-lines p:not(.is-inline-first)::before {
  content: " ";
}

.newspaper-entry.is-underlined-head-entry h3,
.newspaper-entry.is-underlined-head-entry .newspaper-inline-head,
.newspaper-article-panel.is-underlined-head h3 {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.12em;
}

.newspaper-entry.is-dropcap-entry p::first-letter {
  float: left;
  margin: 0.02em 0.08em 0 0;
  color: #241d12;
  font-size: 1.75rem;
  line-height: 0.9;
  font-weight: 700;
}

.newspaper-article-panel {
  position: absolute;
  top: 18px;
  right: 18px;
  width: min(320px, calc(100% - 36px));
  max-height: min(72vh, calc(100% - 36px));
  margin: 0;
  padding: 18px 18px 16px;
  overflow: auto;
  background: rgba(255, 252, 244, 0.995);
  border: 1px solid #b9a882;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
  z-index: 25;
}

.newspaper-article-panel h3 {
  margin: 6px 0 12px;
  color: #241d12;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
}

.newspaper-article-body {
  display: block;
}

.newspaper-article-body p {
  margin: 0 0 14px;
  color: #241d12;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.95rem;
  line-height: 1.42;
  text-align: justify;
  text-indent: 1.1em;
}

.newspaper-article-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 14px;
}

.newspaper-article-panel.is-inline-head h3 {
  display: inline;
  margin: 0 0.35em 0 0;
  font-size: 0.82rem;
  line-height: 1.2;
  text-align: left;
  vertical-align: baseline;
}

.newspaper-article-panel.is-inline-head .newspaper-article-body {
  display: inline;
}

.newspaper-article-panel.is-inline-head .newspaper-article-body p {
  display: inline;
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.35;
  text-indent: 0;
}

.newspaper-article-panel.is-inline-head .newspaper-article-body p + p::before {
  content: " ";
}

.newspaper-article-panel.is-inline-head .newspaper-article-actions {
  display: flex;
  margin-top: 18px;
}

.newspaper-article-panel.is-dropcap h3 {
  display: none;
}

.newspaper-article-panel.is-headline-hidden h3 {
  display: none;
}

.newspaper-article-panel.is-dropcap .newspaper-article-body p:first-child {
  text-indent: 0;
}

.newspaper-article-panel.is-dropcap .newspaper-article-body p:first-child::first-letter {
  float: left;
  margin: 0.03em 0.08em 0 0;
  color: #241d12;
  font-size: 2.2rem;
  line-height: 0.86;
  font-weight: 700;
}

.newspaper-resize-handle {
  position: absolute;
  padding: 0;
  min-height: 0;
  background: transparent;
  border: 0;
  opacity: 0;
}

.newspaper-panel:hover .newspaper-resize-handle,
.newspaper-resize-handle:focus-visible {
  opacity: 1;
}

.newspaper-resize-handle.is-east {
  display: none;
}

.newspaper-resize-handle.is-south {
  left: 24px;
  right: 24px;
  bottom: -6px;
  height: 12px;
  cursor: ns-resize;
}

.newspaper-resize-handle.is-corner {
  display: none;
}

.newspaper-resize-handle.is-corner::before {
  content: none;
}

.theory-help {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.84rem;
}

.field.is-invalid input {
  border-color: #e26a4c;
}

.lead-panel {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  width: min(520px, calc(100vw - 470px));
  max-height: min(66vh, 620px);
  overflow: hidden;
  padding: 18px;
  background: rgba(27, 27, 23, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 40px var(--shadow);
  z-index: 20;
}

.lead-panel-scroll {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.lead-panel #leadKicker,
.lead-panel #leadTitle {
  padding-right: 44px;
}

.lead-panel-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
  background: rgba(27, 27, 23, 0.98);
}

.lead-panel-actions .inline-button,
.lead-panel-actions .primary-button {
  margin-bottom: 0;
}

.lead-panel[hidden] {
  display: none;
}

.lead-panel p {
  color: var(--paper);
  line-height: 1.55;
}

.close-button {
  float: right;
  width: 34px;
  min-height: 34px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
}

.lead-panel > .close-button {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  float: none;
}

.discoveries {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
}

.discoveries span {
  padding: 7px 9px;
  color: var(--paper);
  font-size: 0.82rem;
}

.poi-marker {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--accent);
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  color: white;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  transition: box-shadow 120ms ease, border-color 120ms ease, opacity 120ms ease, outline-color 120ms ease;
}

.poi-marker[hidden] {
  display: none;
}

.poi-marker.is-search-muted {
  opacity: 0.12;
}

.poi-marker.is-search-match {
  opacity: 1;
  border-color: #fff4b8;
  outline: 3px solid rgba(255, 244, 184, 0.72);
  outline-offset: 2px;
  box-shadow:
    0 0 0 6px rgba(47, 143, 131, 0.48),
    0 0 0 11px rgba(255, 244, 184, 0.22),
    0 6px 18px rgba(0, 0, 0, 0.55);
  z-index: 1;
}

.poi-marker.is-selected {
  opacity: 1;
  background: #f2b84b;
  border-color: #fff6c9;
  color: #18140b;
  outline: 5px solid rgba(255, 229, 154, 0.78);
  outline-offset: 3px;
  box-shadow:
    0 0 0 10px rgba(194, 79, 49, 0.38),
    0 0 0 15px rgba(255, 246, 201, 0.24),
    0 8px 22px rgba(0, 0, 0, 0.58);
  z-index: 2;
}

.poi-marker.is-start {
  width: 22px;
  height: 22px;
}

.poi-marker.is-visited {
  opacity: 0.7;
  border-color: var(--paper);
}

.poi-marker.is-hidden {
  background: #8a6c2c;
}

.poi-marker:focus-visible {
  outline: 4px solid #fff4b8;
  outline-offset: 4px;
  box-shadow:
    0 0 0 8px rgba(47, 143, 131, 0.7),
    0 6px 18px rgba(0, 0, 0, 0.58);
  z-index: 3;
}

.poi-marker::before {
  content: "?";
  transform: translateY(-0.5px);
}

.poi-marker.is-private_residence,
.layer-filter-swatch.is-private_residence { background: #9a4f68; }
.poi-marker.is-private_residence::before { content: "⌂"; }

.poi-marker.is-diplomatic,
.layer-filter-swatch.is-diplomatic { background: #7a5bb0; }
.poi-marker.is-diplomatic::before { content: "⚑"; }

.poi-marker.is-railway_stations,
.layer-filter-swatch.is-railway_stations { background: #237f76; }
.poi-marker.is-railway_stations::before { content: "R"; }

.poi-marker.is-underground_stations,
.layer-filter-swatch.is-underground_stations { background: #1d6fb8; }
.poi-marker.is-underground_stations::before { content: "U"; }

.poi-marker.is-transport_services,
.layer-filter-swatch.is-transport_services { background: #3f7f4d; }
.poi-marker.is-transport_services::before { content: "T"; }

.poi-marker.is-retailers,
.layer-filter-swatch.is-retailers { background: #b56f2c; }
.poi-marker.is-retailers::before { content: "S"; }

.poi-marker.is-banking_finance,
.layer-filter-swatch.is-banking_finance { background: #c58b28; }
.poi-marker.is-banking_finance::before { content: "£"; }

.poi-marker.is-health_welfare,
.layer-filter-swatch.is-health_welfare { background: #4d8f72; }
.poi-marker.is-health_welfare::before { content: "✚"; }

.poi-marker.is-government,
.layer-filter-swatch.is-government { background: #865aa0; }
.poi-marker.is-government::before { content: "♔"; }
.poi-marker.is-government::before {
  font-size: 1.02rem;
  transform: translateY(-1.5px);
}

.poi-marker.is-law_order,
.layer-filter-swatch.is-law_order { background: #b34e43; }
.poi-marker.is-law_order::before { content: "⚖"; }
.poi-marker.is-law_order::before {
  font-size: 0.98rem;
  transform: translateY(-1px);
}

.poi-marker.is-science_industry,
.layer-filter-swatch.is-science_industry { background: #4b8b9f; }
.poi-marker.is-science_industry::before { content: "⚙"; }

.poi-marker.is-press_records,
.layer-filter-swatch.is-press_records { background: #526aa6; }
.poi-marker.is-press_records::before { content: "✒"; }

.poi-marker.is-entertainment,
.layer-filter-swatch.is-entertainment { background: #bd5a8a; }
.poi-marker.is-entertainment::before { content: "♬"; }

.poi-marker.is-landmarks,
.layer-filter-swatch.is-landmarks { background: #7c7044; }
.poi-marker.is-landmarks::before { content: "★"; }

.poi-marker.is-museums_education,
.layer-filter-swatch.is-museums_education { background: #3b75a2; }
.poi-marker.is-museums_education::before { content: "A"; }

.poi-marker.is-markets,
.layer-filter-swatch.is-markets { background: #8f7930; }
.poi-marker.is-markets::before { content: "K"; }

.poi-marker.is-trade_warehousing,
.layer-filter-swatch.is-trade_warehousing { background: #8b6b3f; }
.poi-marker.is-trade_warehousing::before { content: "W"; }

.poi-marker.is-hotels_lodging,
.layer-filter-swatch.is-hotels_lodging { background: #8d5a45; }
.poi-marker.is-hotels_lodging::before { content: "H"; }

.poi-marker.is-food_drink_clubs,
.layer-filter-swatch.is-food_drink_clubs { background: #557c3f; }
.poi-marker.is-food_drink_clubs::before { content: "♣"; }

.poi-marker.is-churches_religion,
.layer-filter-swatch.is-churches_religion { background: #6f678d; }
.poi-marker.is-churches_religion::before { content: "✝"; }

.poi-marker.is-parks_gardens,
.layer-filter-swatch.is-parks_gardens { background: #5a873f; }
.poi-marker.is-parks_gardens::before { content: "♧"; }

.poi-marker.is-other,
.layer-filter-swatch.is-other { background: #6a6452; }

.poi-marker.is-selected {
  opacity: 1;
  background: #f2b84b;
  border-color: #fff6c9;
  color: #18140b;
}

.theory-form {
  display: grid;
  gap: 2px;
}

.is-theory-locked > .theory-form,
.is-theory-locked > #submitTheory {
  display: none;
}

.solution-result {
  margin-top: 14px;
  padding: 14px;
}

.is-theory-locked > .solution-result {
  margin-top: 0;
}

.theory-review-actions {
  flex-wrap: wrap;
  margin-top: 12px;
}

.solution-details {
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.solution-details summary,
.self-check-details summary {
  padding: 14px 0;
  color: var(--paper);
  font-weight: 700;
  cursor: pointer;
}

.solution-details[open] summary,
.self-check-details[open] summary {
  margin-bottom: 10px;
}

.self-check-details {
  margin-bottom: 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.question-list {
  display: grid;
  gap: 6px;
}

.reset-confirmation {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #8d493c;
  border-radius: 6px;
  background: rgba(159, 53, 40, 0.16);
}

.reset-confirmation p {
  margin-bottom: 8px;
}

.reset-confirmation .panel-actions {
  flex-wrap: wrap;
}

.score-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 14px;
  margin-bottom: 12px;
}

.correct {
  color: #58c987;
}

.incorrect {
  color: #e26a4c;
}

@media (max-width: 860px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    width: min(420px, 92vw);
  }

  .mobile-menu-button,
  .mobile-drawer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .map-stage {
    min-height: 100vh;
  }

  .tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-drawer-close {
    position: absolute;
    top: 14px;
    right: 14px;
  }

  .lead-panel {
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    width: auto;
    max-height: min(68dvh, 620px);
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 35;
  }

  .lead-panel.is-visit-report {
    max-height: calc(100dvh - max(20px, env(safe-area-inset-bottom)));
  }

  body.is-visit-report-open .map-tools {
    visibility: hidden;
    pointer-events: none;
  }

  .map-tools {
    top: 10px;
    left: 10px;
    right: 10px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: stretch;
    gap: 8px;
    padding: 8px;
  }

  .map-tools .mobile-menu-button {
    grid-column: 1;
    grid-row: 1;
  }

  .map-tools .map-search {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }

  .map-tools .map-action-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-column: 1 / -1;
    grid-row: 2;
    gap: 8px;
  }

  .map-tools .map-status-row {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    grid-column: 1 / -1;
    grid-row: 3;
    align-items: center;
    gap: 8px;
  }

  .map-tools .zoom-indicator,
  .map-tools .map-label {
    display: flex;
    align-items: baseline;
    gap: 5px;
    min-width: 0;
    padding: 5px 7px;
    white-space: nowrap;
    background: rgba(17, 18, 15, 0.7);
    border: 1px solid var(--line);
    border-radius: 6px;
  }

  .map-tools .zoom-indicator {
    min-width: 0;
  }

  .map-tools .opacity-control {
    display: grid;
    grid-template-columns: auto minmax(54px, 1fr);
    gap: 6px;
    min-width: 0;
  }

  .map-tools .opacity-control input {
    width: 100%;
  }

  body.is-map-overlay-open .map-tools {
    visibility: hidden;
    pointer-events: none;
  }

  .search-panel {
    left: 10px;
    right: 10px;
    width: auto;
  }

  .layer-panel {
    top: 10px;
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 45;
  }

  .search-panel {
    top: 164px;
    max-height: min(42vh, 360px);
    z-index: 32;
  }

  .newspaper-panel {
    top: 10px;
    right: 10px;
    left: 10px;
    width: auto;
    min-width: 0;
    min-height: 0;
    max-height: calc(100vh - 20px);
    padding: 16px;
    overscroll-behavior: contain;
    z-index: 45;
  }

  .editor-overlay {
    padding: 10px;
  }

  .editor-overlay-bar {
    padding: 12px;
  }

  .newspaper-columns {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .newspaper-stream-heading {
    margin-top: 10px;
  }

  .newspaper-article-panel {
    position: fixed;
    top: 72px;
    left: 10px;
    right: 10px;
    bottom: auto;
    width: auto;
    max-height: min(68vh, calc(100vh - 20px));
    padding: 14px 16px;
    z-index: 55;
  }

  .newspaper-article-body {
    column-count: 1;
  }

  .theory-form textarea,
  .question-list textarea {
    min-height: 84px;
  }

  .newspaper-resize-handle {
    display: none;
  }
}
