/* Pix Cyrillic — fork of Pixellari with full Cyrillic coverage
   (https://github.com/lotva/pix-cyrillic). Loaded from jsDelivr's
   GitHub mirror so the prototype stays single-file. Handjet from
   Google Fonts stays as a fallback in case the CDN is unreachable. */
@font-face{
  font-family: 'Pix Cyrillic';
  src: url('https://cdn.jsdelivr.net/gh/lotva/pix-cyrillic@main/web/PixCyrillic.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: block;
}

/* ======================== THEME — NEON LIME ========================
   4-color base palette:
     #EFF8FF — pale blue (background / surfaces)
     #BBEF1F — lime green (secondary accent / highlights)
     #0D0303 — near-black (ink, borders, text)
     #FF0055 — hot pink (primary accent)
   Other CSS variables are derivatives of these four. */
:root{
  --bg:          #eff8ff;
  --bg-2:        #d8edff;
  --surface:     #ffffff;
  --surface-2:   #eff8ff;
  --ink:         #0d0303;
  --ink-2:       #2a1f1f;
  --muted:       #6e6363;
  --line:        #d6cfcf;
  --line-2:      #b8acac;
  --accent:      #ff0055;           /* hot pink */
  --accent-text: #ff0055;           /* same hot pink — token kept for future a11y pass */
  --accent-2:    #bbef1f;           /* lime green */
  --gold:        #bbef1f;           /* aliased to lime — kept name for legacy refs */
  --lime:        #bbef1f;
  --violet:      #bbef1f;
  --ok:          #bbef1f;
  --warn:        #bbef1f;
  --bad:         #ff0055;
  --glow:        none;
  --glow-cyan:   none;
  --glow-gold:   none;
  --shadow-1:    0 1px 0 rgba(13,3,3,.10);
  --shadow-2:    0 1px 0 rgba(13,3,3,.12);
  --radius:      2px;
  --pixel:       1px;
}

/* ======================== RESET ======================== */
*,*::before,*::after{ box-sizing:border-box; }
html,body{ margin:0; padding:0; height:100%; }
html{ -webkit-text-size-adjust:100%; }
body{
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.35;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  letter-spacing: normal;
}

/* Thin pixel grid background with colorful aura */
.pixel-grid{
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(13,3,3,.10) 1px, transparent 0),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-size: 4px 4px, auto;
}

button, input, select, textarea{ font: inherit; color: inherit; }
a{ color: var(--ink); text-decoration: none; }
a:hover{ color: var(--accent-text); }
img{ display:block; max-width:100%; image-rendering: pixelated; image-rendering: crisp-edges; }

/* ======================== APP LAYOUT ======================== */
#app{ position: fixed; inset: 0; display: grid; grid-template-rows: auto 1fr; }

/* ---------- TOP BAR ---------- */
header.topbar{
  position: relative;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  row-gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(239,248,255,.82));
  backdrop-filter: blur(8px) saturate(160%);
  -webkit-backdrop-filter: blur(8px) saturate(160%);
  border-bottom: var(--pixel) solid var(--line);
  box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, var(--shadow-1);
  /* Unify the vertical rhythm: every direct child control (brand,
     search, who, langswitch, buttons) renders at the same height
     so the header reads as a single horizontal band. */
  --topbar-h: 32px;
}
header.topbar > .brand,
header.topbar > .search,
header.topbar > .who,
header.topbar > .langswitch,
header.topbar > .btn{
  height: var(--topbar-h);
  box-sizing: border-box;
}
.brand{
  display: flex; align-items: center; gap: 4px;
  padding: 0 12px;
  border: var(--pixel) solid var(--ink);
  background: var(--bg);
  box-shadow: 2px 2px 0 var(--ink);
}
.brand .logo{
  width: 16px; height: 22px;
  background: transparent;
  border: 0;
  box-shadow: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  /* The spade glyph in Pix Cyrillic sits high in its em-box, so we
     center the icon's optical body by translating the box down a hair
     and letting line-height/flex handle the rest. */
}
.brand .logo .s{
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif;
  font-size: 22px;
  line-height: 1;
  color: var(--ink);
  text-shadow: none;
  display: block;
  /* Pix Cyrillic glyphs sit slightly high in their em-box; nudge the
     spade down a touch so it lines up with the wordmark optically. */
  transform: translateY(2px);
}
.brand .name{
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  /* Pix Cyrillic glyphs sit slightly high in their em-box; nudge the
     wordmark down a hair so it lines up with the optical center. */
  transform: translateY(2px);
}
.brand .name .dot{
  color: var(--ink);
  text-shadow: none;
}

/* Language switcher */
.langswitch{
  display: inline-flex; align-items: stretch;
  border: 1px solid var(--ink);
  background: #fff;
  box-shadow: 2px 2px 0 var(--ink);
}
.langswitch button{
  border: 0; background: transparent;
  padding: 0 10px;
  line-height: 1;
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  letter-spacing: normal;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .05s ease, box-shadow .05s ease, background .15s ease, filter .15s ease;
}
.langswitch button + button{ border-left: 1px solid var(--line); }
.langswitch button.active{
  background: #b4d8f0;
  color: var(--ink);
  text-shadow: none;
  box-shadow: none;
}

.topbar .spacer{ flex: 1; }

.topbar .who{
  display: flex; align-items: center; gap: 8px;
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1;
  color: var(--ink-2);
  padding: 0 10px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 2px 2px 0 var(--ink);
}
.topbar .who .dot{
  width: 7px; height: 7px; background: var(--ok);
  box-shadow: none;
  border-radius: 50%;
}
.topbar .who.guest .dot{ background: var(--gold); box-shadow: none; }
.topbar .who .role-admin{
  padding: 4px 6px 2px 6px; line-height: 1.1;
  border: var(--pixel) solid var(--accent); color: var(--accent-text);
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif; font-size: 14px; text-transform: none;
  text-shadow: none;
  background: linear-gradient(180deg, #fff, #eff8ff);
}
.topbar .who .role-guest{
  padding: 4px 6px 2px 6px; line-height: 1.1;
  border: var(--pixel) solid var(--gold); color: #5d7a00;
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif; font-size: 14px; text-transform: none;
  background: linear-gradient(180deg, #f4ffd0, #dff296);
}

/* ---------- BUTTONS ---------- */
/* Pix Cyrillic has a slightly uneven vertical rhythm, so we give the
   button a generous line-height and a tiny top-heavy padding tweak to
   pin the glyphs to the optical center. */
.btn{
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 14px 6px 14px;
  line-height: 1.1;
  border: var(--pixel) solid var(--ink);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  letter-spacing: normal;
  text-transform: none;
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform .05s ease, box-shadow .05s ease, background .15s ease;
  user-select: none;
  /* All controls (buttons, inputs, selects, date pickers, modal close
     icons, maplibre buttons) share the same 32px height for a fully
     consistent vertical rhythm across the whole UI. */
  min-height: 32px;
  box-sizing: border-box;
}
/* Unified hover for every button-like control: a small lift +
   brightness bump. Each variant keeps its own colors via
   filter:brightness, so the effect feels identical regardless of
   fill. All buttons inherit the same font, padding rhythm, and
   interaction feedback. */
.btn:hover,
.file-btn:hover,
.langswitch button:hover:not(.active),
.modal .hd .x:hover,
.details .hd .x:hover,
.pxdate-nav:hover{
  filter: brightness(1.08);
  transform: translate(-1px,-1px);
  box-shadow: 3px 3px 0 var(--ink);
}
.btn:active,
.file-btn:active,
.langswitch button:active,
.modal .hd .x:active,
.details .hd .x:active,
.pxdate-nav:active{
  transform: translate(2px,2px);
  box-shadow: 0 0 0 var(--ink);
  filter: none;
}
.pxdate-nav.disabled,
.pxdate-nav[disabled]{
  opacity: .3;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(1);
}
/* MapLibre buttons need !important to override their base box-shadow. */
.maplibregl-ctrl-group button:hover{
  filter: brightness(1.08) !important;
  transform: translate(-1px,-1px) !important;
  box-shadow: 3px 3px 0 var(--ink) !important;
  background: #fff !important;
}
.maplibregl-ctrl-group button:active{
  transform: translate(2px,2px) !important;
  box-shadow: 0 0 0 var(--ink) !important;
  filter: none !important;
}
.btn[disabled]{ opacity: .55; cursor: not-allowed; filter: none; transform: none; }

.btn-primary{
  background: linear-gradient(180deg, #ff336e, var(--accent));
  color: #fff;
  border-color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  text-shadow: none;
}
.btn-ghost{
  background: rgba(255,255,255,.75); box-shadow: 2px 2px 0 var(--line-2); border-color: var(--line);
}
.btn-danger{ background:#fff; color: var(--bad); border-color: var(--bad); box-shadow: 2px 2px 0 var(--bad); }
.btn-ok{
  background: linear-gradient(180deg, #d2f865, #99d20a);
  color: var(--ink); border-color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  text-shadow: none;
}
.btn-sm{ padding: 8px 10px 6px 10px; font-size: 14px; line-height: 1.1; min-height: 32px; }
.btn-accent{
  color: var(--ink);
  background: linear-gradient(180deg, #d8f568, var(--accent-2));
  border-color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  text-shadow: none;
}
.btn-gold{
  color:#3a4d00;
  background: linear-gradient(180deg, #d8f568, var(--gold));
  border-color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}

/* ---------- MAP ---------- */
#map{
  position: relative;
  width: 100%; height: 100%;
  background: var(--bg-2);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
#map .maplibregl-canvas-container,
#map .maplibregl-canvas{
  touch-action: none !important;
}
/* Pixel frame overlay around map */
#map::after{
  content: '';
  pointer-events: none;
  position: absolute; inset: 0;
  box-shadow:
    inset 0 0 0 1px var(--line),
    inset 0 0 0 2px rgba(255,255,255,.6);
  z-index: 450;
}
/* ------------------------------------------------------------
   DOM LABEL OVERLAY
   ------------------------------------------------------------
   MapLibre can only render fonts for which it has SDF glyphs on
   disk (OpenFreeMap serves Metropolis/Noto only — no Silkscreen).
   So instead of trying to ship a glyph server, we hide MapLibre's
   vector text and draw our own HTML labels on top of the canvas
   using the same `Silkscreen` pixel font the UI buttons use.
   Labels are absolutely positioned inside #dom-labels which sits
   over the map, and are refreshed on moveend/zoomend.
   ------------------------------------------------------------ */
#dom-labels{
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 410;
  opacity: 1;
  transition: opacity 140ms ease-out;
}
#dom-labels.is-hidden{ opacity: 0; transition: opacity 60ms linear; }
#dom-labels .map-label{
  position: absolute;
  left: 0; top: 0;
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif;
  font-weight: 400;
  color: var(--ink);
  text-transform: none;
  letter-spacing: normal;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  pointer-events: none;
  text-shadow:
     1px  0 #fff,
    -1px  0 #fff,
     0  1px #fff,
     0 -1px #fff,
     1px  1px #fff,
    -1px -1px #fff,
     1px -1px #fff,
    -1px  1px #fff;
  will-change: transform;
}
#dom-labels .map-label.country{
  font-size: 14px;
  color: var(--accent-text);
  text-shadow:
     1px  0 #fff, -1px  0 #fff, 0  1px #fff, 0 -1px #fff,
     1px  1px #fff,-1px -1px #fff, 1px -1px #fff,-1px  1px #fff,
     0 0 0 var(--ink);
}
#dom-labels .map-label.state{
  font-size: 14px;
  color: var(--ink);
  opacity: .85;
}
#dom-labels .map-label.city{
  font-size: 14px;
  color: var(--ink);
}
#dom-labels .map-label.town{
  font-size: 14px;
  color: var(--ink);
  opacity: .95;
}
#dom-labels .map-label.village,
#dom-labels .map-label.hamlet,
#dom-labels .map-label.suburb,
#dom-labels .map-label.neighbourhood{
  font-size: 14px;
  color: var(--ink-2);
  opacity: .9;
}
#dom-labels .map-label.water{
  font-size: 14px;
  color: #1d4a66;
  font-style: normal;
}
#dom-labels .map-label.street{
  font-size: 14px;
  color: var(--ink-2);
  opacity: .9;
}
/* Dither / pixel overlay over the tiles */
.map-dither{
  pointer-events: none;
  position: absolute; inset: 0;
  z-index: 400;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(13,3,3,.10) 0.6px, transparent 1px),
    radial-gradient(circle at 2px 2px, rgba(255,255,255,.18) 0.6px, transparent 1px);
  background-size: 3px 3px, 3px 3px;
  background-position: 0 0, 1px 1px;
  mix-blend-mode: multiply;
  opacity: .45;
}
.maplibregl-map{
  background: #eff8ff;
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif;
}
/* We recolor vector layers programmatically (see applyMapTheme in JS),
   so the canvas only needs a very gentle contrast tweak here. */
.maplibregl-canvas{
  /* No CSS filter — filters force a separate compositor layer that can
     interfere with pointer-event hit testing on some browsers. */
}
.maplibregl-ctrl-top-left,
.maplibregl-ctrl-top-right,
.maplibregl-ctrl-bottom-left,
.maplibregl-ctrl-bottom-right{
  z-index: 420 !important;
}
.maplibregl-ctrl-group{
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  margin: 14px !important;
}
.maplibregl-ctrl-group button{
  background: #fff !important;
  color: var(--ink) !important;
  border: var(--pixel) solid var(--ink) !important;
  box-shadow: 2px 2px 0 var(--ink) !important;
  width: 32px !important; height: 32px !important;
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif !important;
  border-radius: 0 !important;
  margin-bottom: 6px !important;
  transition: transform .05s ease, box-shadow .05s ease, background .15s ease, filter .15s ease;
  user-select: none;
  box-sizing: border-box !important;
}
.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon,
.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon,
.maplibregl-ctrl-compass .maplibregl-ctrl-icon{ filter: none; }
.maplibregl-ctrl-attrib{
  background: rgba(255,255,255,.88) !important;
  border: 1px solid var(--line) !important;
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif !important;
  font-size: 12px !important;
  padding: 2px 6px !important;
  border-radius: 0 !important;
}
.maplibregl-ctrl-attrib a{ color: var(--ink-2) !important; }
/* Compact attribution — collapsed state shows a pixel "i" button,
   expanded state extends the pill to the LEFT with attribution text
   on the same baseline as the button. */
.maplibregl-ctrl-attrib.maplibregl-compact{
  position: relative !important;
  min-height: 32px !important;
  z-index: 420 !important;
  height: 32px !important;
  box-sizing: border-box !important;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  margin: 0 14px 14px 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  overflow: visible !important;
}
.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button{
  position: static !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  flex: 0 0 32px !important;
  border: var(--pixel) solid var(--ink) !important;
  background: #fff !important;
  background-image: none !important;
  box-shadow: 2px 2px 0 var(--ink) !important;
  border-radius: 0 !important;
  cursor: pointer !important;
  padding: 0 !important;
  margin: 0 !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  transition: transform .05s ease, box-shadow .05s ease, filter .15s ease;
}
.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button::before{
  content: 'i';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  font-weight: 700;
  font-style: italic;
  color: var(--accent-text);
  line-height: 1;
  text-shadow: none;
  padding-top: 2px;
}
.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button:hover{
  filter: brightness(1.08);
  transform: translate(-1px,-1px);
  box-shadow: 3px 3px 0 var(--ink) !important;
}
.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button:active{
  transform: translate(2px,2px);
  box-shadow: 0 0 0 var(--ink) !important;
}
/* Collapsed: hide the attribution text entirely, show just the button. */
.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{
  display: none !important;
}
/* Expanded: show the text pill on the same line as the button, to the
   left of the "i". */
.maplibregl-ctrl-attrib.maplibregl-compact.maplibregl-compact-show{
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}
.maplibregl-ctrl-attrib.maplibregl-compact.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{
  display: inline-flex !important;
  align-items: center !important;
  height: 32px !important;
  padding: 0 12px !important;
  margin-right: 6px !important;
  background: #fff !important;
  border: 1px solid var(--ink) !important;
  box-shadow: 2px 2px 0 var(--ink) !important;
  font-size: 12px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  order: 0;
}
.maplibregl-ctrl-attrib.maplibregl-compact.maplibregl-compact-show .maplibregl-ctrl-attrib-button{
  order: 1;
}
.maplibregl-ctrl-logo{ display: none !important; }
/* Popup used for search-marker label */
.maplibregl-popup-content{
  background: #fff !important;
  border: 1px solid var(--ink) !important;
  box-shadow: 2px 2px 0 var(--ink) !important;
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif !important;
  font-size: 14px !important;
  line-height: 1.1 !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  color: var(--ink) !important;
  border-radius: 0 !important;
  padding: 7px 8px 5px 8px !important;
}
.maplibregl-popup-tip{ display: none !important; }
.maplibregl-popup-close-button{ display: none !important; }
/* Marker element reset — we use our own .pin/.target DOM */
.maplibregl-marker{ will-change: transform; }

/* ---------- SEARCH ---------- */
.search{
  position: relative;
  flex: 1 1 240px;
  max-width: 340px;
  min-width: 180px;
}
.search{
  height: 100%;
  display: flex;
  align-items: stretch;
}
.search .search-input{
  width: 100%;
  height: 100%;
  padding: 0 10px 0 36px;
  line-height: 1;
  border: 1px solid var(--ink);
  background: #fff;
  box-shadow: 2px 2px 0 var(--ink);
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  color: var(--ink);
  outline: none;
  border-radius: 0;
  box-sizing: border-box;
}
.search .search-input::placeholder{ color: var(--muted); }
.search .search-input:focus{
  border-color: var(--accent);
  box-shadow: 2px 2px 0 var(--ink);
}
.search .search-icon{
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.search .search-icon svg{
  width: 18px;
  height: 18px;
  display: block;
  shape-rendering: crispEdges;
}
.search-results{
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  background: #fff;
  border: 1px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  max-height: 320px; overflow: auto;
  display: none;
  z-index: 700;
}
.search-results.open{ display: block; }
.search-results .item{
  padding: 10px 12px 8px 12px;
  line-height: 1.1;
  border-bottom: 1px dashed var(--line);
  cursor: pointer;
  transition: background .12s ease;
}
.search-results .item:last-child{ border-bottom: 0; }
.search-results .item:hover{ background: #eff8ff; }
.search-results .item .name{
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  text-transform: none;
  letter-spacing: normal;
  color: var(--ink);
  margin-bottom: 3px;
}
.search-results .item .addr{
  color: var(--muted);
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.35;
}
.search-results .empty{
  padding: 13px 12px 11px 12px;
  line-height: 1.1;
  text-align: center;
  color: var(--muted);
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
}
.search-results .loader{
  padding: 13px 12px 11px 12px;
  line-height: 1.1;
  text-align: center;
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif;
  font-size: 14px; letter-spacing: normal; text-transform: none;
  color: var(--accent-text);
  text-shadow: none;
}

/* Pulsing target marker for geocoded result */
.target-wrap{ pointer-events: none; }
.target{
  position: relative;
  width: 32px; height: 32px;
}
.target .ring{
  position: absolute; inset: 0;
  border: 2px solid var(--accent);
  border-radius: 50%;
  box-shadow: none;
  animation: cm-pulse 1.6s ease-out infinite;
}
.target .core{
  position: absolute; left: 50%; top: 50%;
  width: 6px; height: 6px;
  transform: translate(-50%,-50%);
  background: var(--accent);
  border-radius: 50%;
  box-shadow: none;
}
@keyframes cm-pulse{
  0%  { transform: scale(.75); opacity: .9; }
  100%{ transform: scale(1.9);  opacity: 0;  }
}
/* Pin wrapper for MapLibre markers: allow overflow for tails/shadows */
.pin-wrap{ pointer-events: auto; }
.pin-wrap .pin{ pointer-events: auto; }

/* ---------- CUSTOM MARKERS ---------- */
.pin{
  width: 36px; height: 44px;
  position: relative;
  cursor: pointer;
  transition: transform .08s ease;
}
.pin:hover{ transform: translateY(-2px); }
.pin .card{
  width: 36px; height: 36px;
  background: #fff;
  border: 1px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  display: grid; place-items: center;
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  position: relative;
  line-height: 1;
}
/* Pix Cyrillic glyphs (incl. suit symbols) sit high in their box, so
   nudge them down to optical center inside the card. */
.pin .card .r{ position: absolute; top: 4px; left: 4px; font-size: 9px; line-height: 1; }
.pin .card .s{ font-size: 16px; line-height: 1; transform: translateY(3px); }
.pin .card.red{ color: var(--accent); text-shadow: none; }
.pin .card.black{ color: var(--ink); }
.pin .card::before{
  content: none;
}
.pin .tail{
  position: absolute; left: 50%; bottom: 0;
  transform: translate(-50%, 0);
  width: 4px; height: 8px;
  background: var(--ink);
}
.pin.pending .card{ border-style: dashed; opacity: .9; }
.pin.pending::after{
  content: '?'; position: absolute; top: -7px; right: -7px;
  width: 18px; height: 18px;
  box-sizing: border-box;
  padding-top: 4px;
  background: linear-gradient(180deg, #d8f568, var(--gold));
  border: 1px solid var(--ink);
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  line-height: 1;
  text-align: center;
  color: #2c3a00;
  box-shadow: 1px 1px 0 var(--ink);
}

/* ---------- MODAL ---------- */
/* Centered modal dialogs with a dimmed backdrop. */
.modal-back{
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(13,3,3,.45);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-back.open{ display: flex; }
.modal{
  width: min(420px, 100%);
  max-height: 92vh;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink), var(--shadow-2);
  position: relative;
  display: flex;
  flex-direction: column;
}
.modal.lg{ width: min(500px, 100%); }
.modal .hd{
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, #fff, var(--surface));
  flex: 0 0 auto;
}
.modal .hd h2{
  margin: 0;
  padding-top: 2px;
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.1;
  letter-spacing: normal;
  text-transform: none;
}
.modal .hd .x{
  margin-left: auto;
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  padding-top: 2px;
  line-height: 1;
  border: var(--pixel) solid var(--ink);
  background: #fff; cursor: pointer;
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform .05s ease, box-shadow .05s ease, background .15s ease, filter .15s ease;
  user-select: none;
  box-sizing: border-box;
}
.modal .bd{
  padding: 16px;
  display: grid;
  gap: 12px;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
}
.modal .ft{
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  display: flex; gap: 10px; justify-content: flex-end;
  background: var(--surface-2);
  flex: 0 0 auto;
}

/* Tabs in auth modal */
.tabs{ display: flex; gap: 0; border-bottom: 1px solid var(--line); }
.tabs .tab{
  flex: 1; text-align:center;
  padding: 9px 10px 7px 10px;
  line-height: 1.1;
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif; font-size: 14px; letter-spacing: normal; text-transform: none;
  cursor: pointer; border-right: 1px solid var(--line);
  background: var(--surface-2); color: var(--muted);
  min-height: 32px;
  box-sizing: border-box;
}
.tabs .tab:last-child{ border-right: 0; }
.tabs .tab.active{
  background: #fff; color: var(--ink);
  box-shadow: inset 0 -3px 0 var(--accent);
  text-shadow: none;
}

/* Form controls */
.field{ display: grid; gap: 4px; }
.field label{
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif; font-size: 14px;
  line-height: 1.2;
  color: var(--muted); text-transform: none; letter-spacing: normal;
}
/* Asymmetric padding + line-height 1.1 nudges Pix Cyrillic glyphs to
   the optical center of the field. */
.field input, .field select, .field textarea{
  background: #fff;
  border: 1px solid var(--line);
  padding: 8px 12px 6px 12px;
  line-height: 1.1;
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  border-radius: 0;
  min-height: 32px;
  box-sizing: border-box;
}
.field select{
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 34px;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='9' height='6' viewBox='0 0 9 6'><path fill='%23ff1f66' d='M0 0h9L4.5 6z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}
.field select::-ms-expand{ display: none; }
.field input:focus, .field select:focus, .field textarea:focus{
  border-color: var(--accent);
  box-shadow: 2px 2px 0 var(--ink);
}
.field textarea{
  resize: vertical;
  /* Multi-line override of the global min-height: textarea is the
     only field that needs to grow taller than the standard 32px row. */
  min-height: 80px;
  padding: 9px 12px 7px 12px;
  line-height: 1.35;
}
.row{ display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ==== Custom pixel dropdown (replaces native <select>) ==== */
.pxselect{ position: relative; }
.pxselect > select{ display: none !important; }
.pxselect-btn{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  padding: 8px 12px 6px 12px;
  line-height: 1.1;
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  border-radius: 0;
  text-align: left;
  outline: none;
  min-height: 32px;
  box-sizing: border-box;
}
.pxselect-btn:hover{ border-color: var(--ink); }
.pxselect.open .pxselect-btn,
.pxselect-btn:focus{
  border-color: var(--accent);
  box-shadow: 2px 2px 0 var(--ink);
}
.pxselect-arrow{
  display: inline-block;
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--accent);
  transition: transform .12s;
  flex: 0 0 auto;
}
.pxselect.open .pxselect-arrow{ transform: rotate(180deg); }
.pxselect-label{
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pxselect-menu{
  position: absolute;
  left: 0; right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  z-index: 60;
  display: none;
  padding: 4px 0;
  max-height: 260px;
  overflow: auto;
}
.pxselect.open .pxselect-menu{ display: block; animation: pxFadeIn .12s ease-out; }
@keyframes pxFadeIn{
  from{ opacity: 0; transform: translateY(-2px); }
  to  { opacity: 1; transform: translateY(0); }
}
.pxselect-opt{
  padding: 9px 12px 7px 22px;
  line-height: 1.1;
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  color: var(--ink);
  cursor: pointer;
  border-left: 3px solid transparent;
  position: relative;
  white-space: nowrap;
}
.pxselect-opt:hover{
  background: var(--surface-2);
  border-left-color: var(--accent);
}
.pxselect-opt.selected{
  background: linear-gradient(90deg, rgba(255,0,85,.10), transparent 70%);
  border-left-color: var(--accent);
  color: var(--ink);
  font-weight: 600;
}
.pxselect-opt.selected::before{
  content: '✓';
  position: absolute;
  left: 8px; top: 50%;
  transform: translateY(-50%);
  color: var(--accent-text);
  font-weight: 700;
  text-shadow: none;
}
.pxselect-opt.active:not(.selected){
  background: var(--surface-2);
  border-left-color: var(--accent);
}

/* ==== Custom pixel date picker (replaces native <input type=date>) ==== */
.pxdate{ position: relative; }
.pxdate > input[type="date"]{ display: none !important; }
.pxdate-btn{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  padding: 8px 12px 6px 12px;
  line-height: 1.1;
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  border-radius: 0;
  text-align: left;
  outline: none;
  min-height: 32px;
  box-sizing: border-box;
}
.pxdate-btn:hover{ border-color: var(--ink); }
.pxdate.open .pxdate-btn,
.pxdate-btn:focus{
  border-color: var(--accent);
  box-shadow: 2px 2px 0 var(--ink);
}
.pxdate-ico{
  flex: 0 0 auto;
  color: var(--accent-text);
  font-size: 14px;
  line-height: 1;
  text-shadow: none;
  transform: translateY(1px);
}
.pxdate-label{
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pxdate-pop{
  position: fixed;
  left: 0;
  top: 0;
  min-width: 260px;
  max-width: calc(100vw - 16px);
  background: #fff;
  border: 1px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  z-index: 2000; /* above modals so clipping never hides it */
  display: none;
  padding: 10px;
  user-select: none;
}
.pxdate-pop.open{ display: block; animation: pxFadeIn .12s ease-out; }
.pxdate.open .pxdate-pop{ display: block; }
.pxdate-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.pxdate-title{
  flex: 1 1 auto;
  text-align: center;
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  color: var(--ink);
  padding: 4px 0 2px 0;
  line-height: 1.1;
  letter-spacing: normal;
}
.pxdate-nav{
  width: 28px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 0 1px 0;
  border: var(--pixel) solid var(--ink);
  background: #fff;
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  cursor: pointer;
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.1;
  flex: 0 0 auto;
  user-select: none;
  transition: transform .05s ease, box-shadow .05s ease, background .15s ease, filter .15s ease;
}
.pxdate-grid{
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.pxdate-dow{
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 5px 0 3px 0;
  line-height: 1.1;
  text-transform: uppercase;
}
.pxdate-day{
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  color: var(--ink);
  text-align: center;
  padding: 6px 0 4px 0;
  line-height: 1.1;
  cursor: pointer;
  border: 1px solid transparent;
  background: #fff;
  min-height: 26px;
}
.pxdate-day.other{ color: var(--muted); opacity: .5; }
.pxdate-day.disabled{
  color: var(--muted);
  opacity: .35;
  cursor: not-allowed;
  pointer-events: none;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}
.pxdate-day:hover:not(.empty):not(.disabled){
  background: var(--surface-2);
  border-color: var(--accent);
}
.pxdate-day.today{
  border-color: var(--accent-2);
  color: var(--accent-2);
}
.pxdate-day.selected{
  background: linear-gradient(180deg, #ff336e, var(--accent));
  color: #fff;
  border-color: var(--ink);
  box-shadow: 1px 1px 0 var(--ink);
  text-shadow: none;
}
.pxdate-foot{
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}
.pxdate-link{
  background: none;
  border: none;
  padding: 4px 4px 2px 4px;
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  color: var(--accent-text);
  cursor: pointer;
  line-height: 1.1;
  text-shadow: none;
}
.pxdate-link:hover{ filter: brightness(1.1); text-decoration: underline; }
.pxdate-link.muted{ color: var(--muted); text-shadow: none; }

/* ==== Custom file button (replaces native <input type=file>) ==== */
.file-input{ display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.file-btn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 6px 14px;
  line-height: 1.1;
  border: var(--pixel) solid var(--ink);
  background: #fff;
  color: var(--ink);
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  letter-spacing: normal;
  text-transform: none;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform .05s ease, box-shadow .05s ease, background .15s ease, filter .15s ease;
  user-select: none;
  min-height: 32px;
  box-sizing: border-box;
}
.file-btn .file-btn-ico{
  color: var(--accent-text);
  font-size: 16px;
  font-weight: 700;
  text-shadow: none;
  line-height: 1;
}
.file-name{
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 260px;
}
.file-name.has{ color: var(--ink); }

.note{
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif; font-size: 14px;
  line-height: 1.3;
  color: var(--muted);
}
.error{
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif; font-size: 14px;
  line-height: 1.1;
  color: var(--bad);
  border: 1px dashed var(--bad);
  padding: 8px 8px 6px 8px;
  background: rgba(255,0,85,.08);
}
.note.success{
  color: #1a8c3a;
  border: 1px dashed #1a8c3a;
  padding: 8px 8px 6px 8px;
  background: rgba(26,140,58,.08);
}

/* ---- Forgot password link ---------------------------------------- */
.link-forgot{
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
  align-self: center;
  transform: translateY(2px);
}
.link-forgot:hover{ color: var(--ink); }

/* ---- Card preview (form modal + details hero) ---------------------
   Styled to resemble a real playing card: corners with stacked rank
   and suit symbol, and a center area that shows either a single
   large pip (for A / J / Q / K / Joker) or an arranged grid of pips
   for 2–10, matching classic French-deck layouts. */
.preview-card{
  width: 84px; height: 116px;
  background: #fff;
  border: var(--pixel) solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif;
  position: relative;
}
.preview-card::before{
  content: none;
}
.preview-card.red{ color: var(--accent); text-shadow: none; }
.preview-card.black{ color: var(--ink); }
.preview-card.pending{ opacity: .9; }

/* Corner rank + suit (stacked vertically like on a real card).
   Sized small enough that even a two-character "10" doesn't push
   the corner box into the pip area. */
.preview-card .corner{
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif;
  text-align: center;
}
.preview-card .corner .corner-r{
  font-size: 10px;
  line-height: 1;
  letter-spacing: -0.5px;
}
.preview-card .corner .corner-s{
  font-size: 9px;
  line-height: 1;
  margin-top: 1px;
}
.preview-card .tl{ top: 5px; left: 5px; }
.preview-card .br{ bottom: 5px; right: 5px; transform: rotate(180deg); transform-origin: center; }

/* Single large pip — used for A, J, Q, K, Joker. */
.preview-card .big{
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -40%);
  font-size: 44px;
  line-height: 1;
  pointer-events: none;
}

/* Pip grid for 2–10 — pips positioned as percentages of the inner
   plate. The plate is inset enough that the extreme pips (corners
   of the layout) clear the corner labels in every direction. */
.preview-card .pips{
  position: absolute;
  top: 32px; bottom: 32px;
  left: 25px; right: 25px;
  pointer-events: none;
}
.preview-card .pip{
  position: absolute;
  font-size: 11px;
  line-height: 1;
  transform: translate(-50%, -50%);
}
.preview-card .pip.pip-rot{
  transform: translate(-50%, -50%) rotate(180deg);
}

/* ---------- CARD DETAILS PANEL ---------- */
.details{
  position: fixed;
  right: 14px; top: 70px; bottom: 14px;
  width: min(380px, calc(100vw - 28px));
  z-index: 600;
  background: var(--surface);
  border: 1px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink), var(--shadow-2);
  display: none;
  flex-direction: column;
}
.details.open{ display: flex; }
.details .hd{
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(180deg,#fff,var(--surface));
}
.details .hd h3{
  margin: 0;
  padding-top: 2px;
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif; font-size: 14px;
  line-height: 1.1;
  letter-spacing: normal; text-transform: none;
}
.details .hd .x{
  margin-left: auto;
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  padding-top: 2px;
  line-height: 1;
  border: var(--pixel) solid var(--ink);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  transition: transform .05s ease, box-shadow .05s ease, background .15s ease, filter .15s ease;
  user-select: none;
  box-sizing: border-box;
}
.details .body{ padding: 14px; overflow: auto; display: grid; gap: 12px; }
.details .hero{
  display: flex; gap: 14px; align-items: flex-start;
}
.details .meta{ display: grid; gap: 4px; font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif; font-size: 14px; color: var(--ink-2); }
.details .meta .k{ color: var(--muted); }
.details .desc{
  padding: 10px;
  border: 1px dashed var(--line-2);
  background: #fff;
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif;
  font-size: 16px; line-height: 1.5;
  white-space: pre-wrap;
}
.details .photo{
  border: 1px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  max-height: 220px; overflow: hidden;
  background: #fff;
}
.details .photo img{ width: 100%; height: 100%; object-fit: cover; image-rendering: auto; }
.details .actions{ display: flex; gap: 8px; flex-wrap: wrap; }

/* Status badge */
.badge{
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 6px 3px 6px;
  line-height: 1.1;
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif; font-size: 14px;
  text-transform: none;
  border: 1px solid var(--ink);
  background: #fff;
}
.badge.approved{ color: var(--ok); border-color: var(--ok); box-shadow: 1px 1px 0 var(--ok); }
.badge.pending{ color: var(--warn); border-color: var(--warn); box-shadow: 1px 1px 0 var(--warn); }
.badge.rejected{ color: var(--bad); border-color: var(--bad); box-shadow: 1px 1px 0 var(--bad); }

/* Comments */
.comments{ display: grid; gap: 10px; }
.comment{
  padding: 9px 10px 7px 10px;
  line-height: 1.1;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 2px 2px 0 var(--line-2);
}
.comment .author{
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif; font-size: 14px;
  text-transform: none; letter-spacing: normal;
  color: var(--ink);
}
.comment .time{ color: var(--muted); font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif; font-size: 14px; }
.comment .text{
  margin-top: 4px;
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif; font-size: 16px;
  color: var(--ink-2); white-space: pre-wrap;
}
.comment-form{ display: grid; gap: 8px; }

/* ---------- MODERATION PANEL ---------- */
.mod-list{ display: grid; gap: 10px; }
.mod-item{
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 2px 2px 0 var(--line-2);
}
.mod-item .mini-card{
  width: 64px; height: 88px;
  border: 1px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif;
  background: #fff;
  position: relative;
  color: var(--ink);
}
.mod-item .mini-card.red{ color: var(--accent-text); }
.mod-item .mini-card .corner{
  position: absolute;
  display: inline-flex; flex-direction: column; align-items: center;
  line-height: 1;
  width: 8px;
}
.mod-item .mini-card .corner .corner-r{ font-size: 8px; line-height: 1; letter-spacing: -0.5px; }
.mod-item .mini-card .corner .corner-s{ font-size: 7px; line-height: 1; margin-top: 1px; }
.mod-item .mini-card .tl{ top: 3px; left: 3px; }
.mod-item .mini-card .br{ bottom: 3px; right: 3px; transform: rotate(180deg); transform-origin: center; }
.mod-item .mini-card .big{
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 28px; line-height: 1;
}
.mod-item .mini-card .pips{
  position: absolute;
  top: 22px; bottom: 22px;
  left: 18px; right: 18px;
}
.mod-item .mini-card .pip{
  position: absolute; font-size: 8px; line-height: 1;
  transform: translate(-50%, -50%);
}
.mod-item .mini-card .pip.pip-rot{
  transform: translate(-50%, -50%) rotate(180deg);
}
.mod-item .info{ font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif; font-size: 14px; line-height: 1.25; color: var(--ink-2); display: grid; gap:3px; }
.mod-item .info .title{ font-family:'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif; font-size: 14px; line-height: 1.2; color: var(--ink); text-transform: none; letter-spacing: normal; }
.mod-item .ctrls{ display: grid; gap: 6px; align-content: start; }
.empty{
  text-align: center;
  padding: 22px 20px 18px 20px;
  line-height: 1.1;
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif; color: var(--muted); font-size: 16px;
  border: 1px dashed var(--line-2);
}

/* Toast */
.toast{
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  z-index: 2000;
  background: var(--ink); color: #fff;
  border: 1px solid var(--ink);
  box-shadow: 3px 3px 0 var(--accent);
  padding: 11px 14px 9px 14px;
  line-height: 1.1;
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif; font-size: 14px;
  letter-spacing: normal; text-transform: none;
  opacity: 0; transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}
.toast.show{ opacity: 1; transform: translate(-50%, 0); }

/* Hint pill in the map corner */
.hint{
  position: absolute; left: 14px; bottom: 14px; z-index: 500;
  background: rgba(255,255,255,.95);
  border: 1px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  padding: 10px 12px 8px 12px;
  line-height: 1.35;
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif; font-size: 14px;
  color: var(--ink-2);
  max-width: 280px;
  pointer-events: none;
}
.hint b{ color: var(--accent-text); text-shadow: none; }

/* ======================== RESPONSIVE ======================== */
@media (max-width: 920px){
  .search{ order: 99; flex: 1 1 100%; max-width: none; }
}
@media (max-width: 720px){
  header.topbar{ padding: 6px 10px; gap: 8px; --topbar-h: 32px; }
  .brand{ padding: 0 8px; }
  .brand .name{ font-size: 14px; }
  .brand .logo{ width: 14px; height: 22px; }
  .brand .logo .s{ font-size: 18px; }
  .btn{ padding: 0 10px; font-size: 14px; }
  .details{
    top: auto; bottom: 0; right: 0; left: 0;
    width: 100%;
    max-height: 72vh;
    border-left: 0; border-right: 0; border-bottom: 0;
    box-shadow: 0 -3px 0 var(--ink);
  }
  .hint{ left: 8px; right: 8px; bottom: 8px; max-width: none; }
  .row{ grid-template-columns: 1fr; }
}
@media (max-width: 420px){
  .topbar .who .name{ display: none; }
  .modal .hd h2{ font-size: 14px; }
}

/* scrollbars */
.modal::-webkit-scrollbar, .details .body::-webkit-scrollbar{ width: 10px; height: 10px; }
.modal::-webkit-scrollbar-track, .details .body::-webkit-scrollbar-track{ background: var(--surface-2); }
.modal::-webkit-scrollbar-thumb, .details .body::-webkit-scrollbar-thumb{ background: var(--line-2); border: 2px solid var(--surface-2); }
.modal::-webkit-scrollbar-thumb:hover, .details .body::-webkit-scrollbar-thumb:hover{ background: var(--ink); }

/* ========== PROFILE / ACHIEVEMENTS ========== */
.topbar .who{ cursor: pointer; }
.topbar .who:hover{ border-color: var(--accent); }

.profile-stats{
  display: flex; gap: 24px; margin-bottom: 18px;
  padding: 12px 16px;
  background: var(--surface-2); border: 1px solid var(--line);
  box-shadow: 2px 2px 0 var(--ink);
}
.pstat{ display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pstat-val{
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif;
  font-size: 28px; color: var(--accent); line-height: 1;
}
.pstat-lbl{
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif;
  font-size: 12px; color: var(--ink-2); text-transform: uppercase;
}

.ach-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 480px){
  .ach-grid{ grid-template-columns: repeat(2, 1fr); }
}
.ach-item{
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 14px 8px 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: center;
  opacity: 0.4;
  filter: grayscale(1);
  transition: opacity .2s, filter .2s;
}
.ach-item.unlocked{
  opacity: 1; filter: none;
  background: linear-gradient(135deg, #fffbe6 0%, #fff 60%);
  box-shadow: inset 0 0 0 1px rgba(199,167,50,0.15);
}
.ach-icon{
  font-size: 30px; line-height: 1;
}
.ach-name{
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif;
  font-size: 13px; color: var(--ink); line-height: 1.2;
}
.ach-desc{
  font-family: 'Pix Cyrillic', 'Handjet', ui-sans-serif, system-ui, sans-serif;
  font-size: 11px; color: var(--ink-2); line-height: 1.2;
}
