/* Cartography uses a light drafting surface in both Telegram themes. */
.atlas {
  --map-water: #fbfcff;
  --map-other: #f1f3f6;
  --map-outline: #94a7c4;
  --map-land: #e0e9f8;
  --map-region: #a8bad5;
  --map-grid: #7999bf;
  --map-label: #253955;
  --map-label-stroke: #edf3fb;
  --map-dot: #2151da;
  --map-selected: #df263c;
  --map-callout: #b41932;
  --map-panel: #ffffff;
  background: var(--map-panel);
  border: 1px solid #c7d1e0;
  border-radius: 5px;
  color: #122236;
}
.atlas .maphead {
  min-height: 55px;
  border-bottom: 1px solid #d3dce9;
  background: linear-gradient(112deg, #f3f6fc, var(--map-panel) 65%);
}
.atlas .maphead h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #122236;
  font-size: clamp(16px, 1.5vw, 21px);
}
.maphead h2::before {
  content: "";
  width: 17px;
  height: 17px;
  box-sizing: border-box;
  border: 1px solid #2453d8;
  border-radius: 50%;
  background:
    linear-gradient(#2453d8, #2453d8) center / 1px 100% no-repeat,
    linear-gradient(#2453d8, #2453d8) center / 100% 1px no-repeat,
    radial-gradient(circle, #da2a41 0 2px, transparent 2.5px);
}
.atlas .picker select {
  min-height: 37px;
  max-width: 100%;
  color-scheme: light;
  background: #ffffff;
  border-color: #b6c3d7;
  border-radius: 3px;
  color: #162b4c;
}
.atlas .sheet {
  border: 0;
  background-color: var(--map-water);
  background-image: radial-gradient(#8a9cb344 .7px, transparent .9px);
  background-size: 13px 13px;
}
.atlas .sheet::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, #7188a9 0 1px, transparent 1px 12px) left top / 100% 4px no-repeat,
    repeating-linear-gradient(0deg, #7188a9 0 1px, transparent 1px 12px) left top / 4px 100% no-repeat;
  opacity: .45;
}
.atlas .city-dot { stroke: #ffffff; }
#map [data-city] { -webkit-tap-highlight-color: transparent; }
#map [data-city]:focus { outline: none; }
#map [data-city]:focus-visible .city-target {
  stroke: var(--map-selected);
  stroke-width: 2;
}
#map [data-city]:focus .city-dot,
#map [data-city][aria-pressed=true] .city-dot { stroke: none; }
.atlas [data-city][aria-pressed=true] .city-halo { opacity: .36; }
.atlas .zoom {
  z-index: 2;
  border: 1px solid #a7b8d1;
  border-radius: 3px;
  background: #ffffff;
  box-shadow: 0 3px 12px #192f4d14;
}
.atlas .zoom button {
  color: #1f3974;
  font: 20px/1 ui-monospace, Consolas, monospace;
  transition: background-color .16s ease;
}
.atlas .zoom button + button { border-color: #d4dfec; }
.atlas .zoom button:active, .atlas .zoom button:hover { color: white; background: #244dc4; }
.atlas .mapfoot {
  color: #425772;
  background: var(--map-panel);
  border-top: 1px solid #d0dae8;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.atlas .mapfoot i { width: 6px; height: 6px; box-shadow: 0 0 0 2px #2151da1e; }
.results {
  color-scheme: light;
  --paper: white;
  --ink: #142239;
  --text: #18273c;
  --accent: #234cc7;
  --muted: #52647d;
  --page: #fafbfd;
  --tint: #edf3fc;
  --control: #ffffff;
  --line: #ccd7e5;
  background: var(--paper);
  color: var(--text);
  --record-line: color-mix(in srgb, var(--ink) 22%, var(--paper));
  border-color: var(--record-line);
  border-radius: 5px;
}
.results .panelhead {
  position: relative;
  border-top: 3px solid var(--accent);
}
.results .panelhead::after {
  content: "";
  width: 34px;
  height: 7px;
  position: absolute;
  right: 18px;
  top: 16px;
  background: repeating-linear-gradient(120deg, var(--accent) 0 2px, transparent 2px 5px);
}
.results .kicker, .results .counter {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  letter-spacing: .045em;
}
.results .search {
  border-radius: 3px;
  min-height: 40px;
  background: var(--page);
}
.results .search span {
  position: relative;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  font-size: 0;
}
.results .search span::before {
  content: "";
  position: absolute;
  left: 0; top: 0;
  width: 10px; height: 10px;
  border: 1.7px solid currentColor;
  border-radius: 50%;
}
.results .search span::after {
  content: "";
  position: absolute;
  left: 11px; top: 13px;
  width: 6px; height: 1.7px;
  background: currentColor;
  transform: rotate(45deg);
}
.results .record {
  border-top-color: var(--record-line);
  padding-block: 16px;
}
.results .record h3 { margin-block: 6px; line-height: 1.28; }
.results .record .kicker { color: var(--muted); line-height: 1.45; }
.results .thumbnail { border-color: var(--record-line); border-radius: 3px; }
.results .thumbnail img { transition: transform .25s ease-out; }
.results .source {
  padding-block: 4px;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 36%, transparent);
}
.registry .results #entries { gap: 12px; }
.registry .results .record {
  padding: 16px;
  border: 1px solid var(--record-line);
  border-radius: 3px;
  background: linear-gradient(135deg, var(--paper) 87%, var(--tint));
}
.registry .results .record .kicker { color: var(--accent); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .results .thumbnail:hover img { transform: scale(1.055); }
}
@media (max-width: 760px) {
  .atlas .maphead { min-height: 49px; }
  .atlas .maphead .picker { max-width: 53%; }
  .atlas .zoom button { width: 40px; height: 39px; }
  .registry .results .record { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .atlas .zoom button, .results .thumbnail img { transition: none; }
}

/* Publication and equipment links share one visual language across views. */
.record-links, .selection-details .selection-links {
  display: flex;
  flex-wrap: wrap;
  clear: both;
  gap: 6px;
  margin-top: 12px;
}
.record-links .source, .selection-details .selection-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 8px 12px;
  border: 0;
  border-radius: 12px;
  background: var(--control);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.25;
  text-decoration: none;
}
.results .record-links .source, .selection-details .selection-links .selection-link {
  color: var(--ink);
  background: var(--control);
}
.record-links .source::before, .selection-details .selection-link::before {
  content: '';
  width: 17px;
  height: 17px;
  flex: none;
  background: var(--highlight-text);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4h6v6m0-6L10 14m0-9H6a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-4'/%3E%3C/svg%3E") center / contain no-repeat;
}
.record-links { margin-top: 8px; }
.results .record-links .source {
  box-sizing: border-box;
  min-height: 36px;
  padding: 5px 10px;
  gap: 6px;
  border-radius: 10px;
}
.record-links .source::before { width: 15px; height: 15px; }
@media (any-pointer: coarse) {
  .results .record-links .source {
    min-height: 44px;
    border-block: 4px solid transparent;
    background-clip: padding-box;
  }
}
.record-links .source[href^="https://t.me/"]::before,
.selection-details .selection-link[href^="https://t.me/"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21.6 3.4c.6.3.8.9.6 1.8l-3 14.3c-.2 1-.9 1.3-1.7.8l-5.2-3.9-2.6 2.5c-.3.3-.5.4-.8.4l.4-5.6L19.6 5.9c.4-.3.2-.5-.2-.3L6.6 13.7l-4.9-1.6c-.9-.3-.9-.9.2-1.3l18.6-7.3c.5-.2.8-.2 1.1-.1Z'/%3E%3C/svg%3E");
}
.results .record-links .source:focus-visible, .selection-details .selection-link:focus-visible {
  outline: 2px solid var(--highlight-text);
  outline-offset: 2px;
}
@media (hover: hover) {
  .results .record-links .source:hover, .selection-details .selection-links .selection-link:hover {
    background-color: var(--light-tint);
    text-decoration: none;
  }
}
.atlas [data-preview] .city-halo { opacity: .23; }
.atlas [data-preview] .city-dot { fill: var(--map-selected); }
