/* ============================================================
   NARVA.JÕGI — cyberpunk informational site
   Design system: neon cyan/magenta on near-black, CRT, scan, grid
   ============================================================ */

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  /* Smooth anchor jumps for nav menu, hero CTA and any #hash link.
     scroll-padding-top compensates for the sticky header so section
     headings don't hide beneath it. Reduced-motion media block below
     already overrides scroll-behavior back to auto. */
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
  /* Belt-and-suspenders: pin the page bg colour on <html> too, so any gap
     where <body> doesn't fully cover the viewport (sub-pixel layout quirks,
     mobile overscroll, scrollbar gutter, etc.) still shows the right shade
     instead of the browser's default white. */
  background-color: var(--bg);
}
body {
  position: relative;     /* containing block for absolute-positioned page-wide bg */
  min-height: 100vh;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: transparent; border: 0; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-family: "Exo 2", sans-serif; font-weight: 600; letter-spacing: 0.02em; }

/* ---------- TOKENS ---------- */
:root {
  /* surfaces */
  --bg: #05060F;
  --bg-2: #0A0D1E;
  --bg-3: #101433;
  --panel: rgba(20, 26, 60, 0.45);
  --panel-bd: rgba(0, 240, 255, 0.18);

  /* text */
  --fg: #E4E8FF;
  --fg-dim: #8891B8;
  --fg-mute: #5A648A;

  /* neon */
  --cyan: #00F0FF;
  --magenta: #FF2BD6;
  --lime: #B4F542;
  --amber: #FFC24B;
  --red: #FF4060;

  /* glows (use via var()) */
  --glow-cyan: 0 0 8px rgba(0, 240, 255, 0.6), 0 0 22px rgba(0, 240, 255, 0.25);
  --glow-magenta: 0 0 8px rgba(255, 43, 214, 0.6), 0 0 22px rgba(255, 43, 214, 0.25);

  /* layout */
  --nav-h: 56px;
  --map-w: 220px;
  --maxw: 900px;
  --gutter: clamp(16px, 3vw, 32px);

  /* motion */
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- DECORATIVE LAYERS ---------- */
.grid-bg {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.055) 1px, transparent 1px),
    radial-gradient(1200px 800px at 80% -10%, rgba(255, 43, 214, 0.12), transparent 60%),
    radial-gradient(900px 700px at 10% 110%, rgba(0, 240, 255, 0.12), transparent 60%);
  background-size: 48px 48px, 48px 48px, auto, auto;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.95), rgba(0,0,0,.6) 40%, rgba(0,0,0,.95));
}
.crt {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 2;
  background: repeating-linear-gradient(to bottom,
    rgba(0,0,0,0) 0,
    rgba(0,0,0,0) 2px,
    rgba(0, 240, 255, 0.035) 3px,
    rgba(0,0,0,0) 4px);
  mix-blend-mode: overlay;
}
.noise {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 1;
  opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.6 0'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
}

/* ---------- I18N TOGGLE (CSS-DRIVEN) ---------- */
html[lang="et"] [lang="ru"] { display: none !important; }
html[lang="ru"] [lang="et"] { display: none !important; }

/* ---------- SKIP LINK ---------- */
.skip-link {
  position: absolute; top: -100px; left: 8px;
  padding: 8px 14px;
  background: var(--cyan); color: var(--bg);
  font-family: "JetBrains Mono", monospace; font-size: 13px;
  z-index: 100;
  border-radius: 2px;
}
.skip-link:focus { top: 8px; }

/* ---------- HEADER ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  column-gap: 16px;
  height: var(--nav-h);
  padding: 0 var(--gutter);
  background: rgba(5, 6, 15, 0.85);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--panel-bd);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--cyan); }
.brand-mark { filter: drop-shadow(0 0 6px rgba(0,240,255,.7)); flex: 0 0 auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name {
  font-family: "Exo 2", sans-serif;
  font-weight: 700; letter-spacing: 0.12em;
  font-size: 14px; color: var(--cyan);
  text-shadow: var(--glow-cyan);
}
.brand-meta {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px; color: var(--fg-mute);
  letter-spacing: 0.05em;
  font-style: italic;
  margin-top: 2px;
}

.site-nav {
  display: flex; gap: 2px;
  justify-self: center;
  font-family: "Exo 2", sans-serif;
  font-size: 12px; letter-spacing: 0.06em;
  text-transform: uppercase;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;
  max-width: 100%;
}
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a {
  padding: 8px 10px;
  white-space: nowrap;
  color: var(--fg-dim);
  border: 1px solid transparent;
  transition: color .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
  display: inline-flex; gap: 6px; align-items: baseline;
}
.site-nav a:hover, .site-nav a:focus-visible {
  color: var(--cyan);
  border-color: var(--panel-bd);
  background: rgba(0, 240, 255, 0.06);
  outline: none;
}
.site-nav a.is-active {
  color: var(--cyan);
  border-color: var(--cyan);
  background: rgba(0, 240, 255, 0.1);
  text-shadow: var(--glow-cyan);
}
.nav-num {
  font-family: "JetBrains Mono", monospace;
  color: var(--magenta); font-size: 10px;
}

.lang-toggle {
  display: flex; align-items: center; gap: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  padding: 4px 8px;
  border: 1px solid var(--panel-bd);
  border-radius: 2px;
}
.lang-toggle button {
  padding: 2px 4px;
  color: var(--fg-mute);
  transition: color .15s var(--ease), text-shadow .15s var(--ease);
}
.lang-toggle button[aria-pressed="true"] {
  color: var(--cyan);
  text-shadow: var(--glow-cyan);
}
.lang-toggle button:hover { color: var(--fg); }
.lang-sep { color: var(--fg-mute); }

/* ---------- SHARED MAP SPRITE (hidden source) ---------- */
.map-sprite {
  position: absolute;
  width: 0; height: 0;
  overflow: hidden;
  pointer-events: none;
}

/* ---------- weather chip in header ---------- */
.weather-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid rgba(0, 240, 255, 0.30);
  border-radius: 999px;
  background: rgba(0, 240, 255, 0.06);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  color: var(--fg);
  white-space: nowrap;
  letter-spacing: 0.5px;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.08);
}
.weather-chip .wt-ico {
  font-size: 14px;
  line-height: 1;
  filter: drop-shadow(0 0 4px rgba(0, 240, 255, 0.5));
}
.weather-chip .wt-temp {
  font-weight: 600;
  color: var(--cyan);
  text-shadow: 0 0 6px rgba(0, 240, 255, 0.45);
}
.weather-chip .wt-meta {
  color: var(--fg-dim);
  font-size: 11px;
}
.weather-chip .wt-place[lang]:not([data-active]) { display: none; }
html[lang="et"] .weather-chip .wt-place[lang="et"] { display: inline; }
html[lang="ru"] .weather-chip .wt-place[lang="ru"] { display: inline; }
.weather-chip .wt-sep { margin: 0 4px; opacity: 0.5; }
@media (max-width: 920px) {
  .weather-chip .wt-meta { display: none; }
  .weather-chip { padding: 5px 10px; }
}

/* ---------- coord inline map ---------- */
.st-coord[role="button"] { cursor: pointer; }
.st-coord.is-active {
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.55);
}
.coord-map {
  position: relative;
  max-height: 0;
  opacity: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 6px;
  border: 0 solid var(--panel-bd);
  transition:
    max-height 380ms cubic-bezier(0.22, 0.61, 0.36, 1),
    opacity 280ms ease,
    margin 380ms cubic-bezier(0.22, 0.61, 0.36, 1),
    border-width 380ms ease;
}
.coord-map.is-open {
  max-height: 380px;
  opacity: 1;
  margin: 14px 0 28px;
  border-width: 1px;
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.10), inset 0 0 1px rgba(0, 240, 255, 0.25);
}
.coord-map iframe {
  display: block;
  width: 100%;
  height: 340px;
  border: 0;
  filter: invert(0.92) hue-rotate(180deg) saturate(0.7) brightness(0.95);
}
.coord-map-ext {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 7px 12px;
  background: rgba(5, 6, 15, 0.88);
  color: var(--cyan);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 2px;
  text-decoration: none;
  z-index: 2;
  transition: background 160ms ease, border-color 160ms ease;
}
.coord-map-ext:hover {
  background: rgba(0, 240, 255, 0.10);
  border-color: var(--cyan);
}
@media (prefers-reduced-motion: reduce) {
  .coord-map { transition: none; }
}

/* ---------- noscript banner ---------- */
.ns-banner {
  position: relative;
  z-index: 100;
  margin: 0 auto;
  padding: 14px 22px;
  max-width: 880px;
  border-bottom: 1px solid rgba(255, 194, 75, 0.4);
  background: linear-gradient(90deg, rgba(255, 194, 75, 0.10), rgba(5, 6, 15, 0.55) 60%);
  color: var(--fg);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}
.ns-banner span[lang]:not([data-active]) { display: none; }
html[lang="et"] .ns-banner span[lang="et"] { display: inline; }
html[lang="ru"] .ns-banner span[lang="ru"] { display: inline; }
/* No-JS fallback: <html lang="et"> default, both spans show — pick the matching one */
html:not([lang]) .ns-banner span[lang="et"] { display: inline; }
html:not([lang]) .ns-banner span[lang="ru"] { display: none; }

/* ---------- RIVER BACKGROUND (whole page, full landing height + parallax) ---------- */
.rivermap-bg {
  position: absolute;     /* spans the entire document, height set by JS */
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;          /* fallback; JS overrides to full document height */
  z-index: 0;             /* behind content & noise; above page bg */
  pointer-events: none;
  overflow: hidden;
  opacity: 0.55;
}
.rivermap-bg-svg {
  position: absolute;
  /* SVG is taller than its container (top/bottom negative) so there is
     vertical room for the parallax translate without leaving empty gaps.
     Values must match PARALLAX_RANGE in main.js. */
  top: -400px;
  bottom: -400px;
  right: 0;
  width: clamp(380px, 60vw, 1100px);
  display: block;
  will-change: transform;
  filter: saturate(1.1) contrast(1.05);
  mix-blend-mode: screen;
}
/* horizontal scanline overlay on top of bg map */
.rivermap-bg-scan {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0px,
    rgba(0,0,0,0) 3px,
    rgba(0, 240, 255, 0.03) 4px,
    rgba(0,0,0,0) 5px
  );
  mix-blend-mode: overlay;
  pointer-events: none;
}
/* fade the bg into main bg on the LEFT edge only — bg now spans the full
   document, so vertical fades would dim big chunks of the page instead of
   short viewport-edge wipes. */
.rivermap-bg-fade {
  position: absolute; inset: 0;
  background:
    linear-gradient(to right, rgba(5,6,15,1) 0%, rgba(5,6,15,0.5) 35%, rgba(5,6,15,0) 55%);
  pointer-events: none;
}

/* ---------- SIDEBAR RIVER MAP (overview) ---------- */
.rivermap {
  position: fixed;
  top: calc(var(--nav-h) + 16px);
  left: 16px;
  bottom: 16px;
  width: var(--map-w);
  z-index: 10;
  pointer-events: none;
}
.rivermap-inner {
  position: relative;
  width: 100%; height: 100%;
  background: linear-gradient(180deg, rgba(16, 20, 51, 0.55), rgba(5, 6, 15, 0.25));
  border: 1px solid var(--panel-bd);
  border-radius: 2px;
  padding: 10px 6px 22px;
  overflow: hidden;
  backdrop-filter: blur(2px);
}
.rivermap-side {
  width: 100%; height: 100%;
  pointer-events: none;
}
.rivermap-hits {
  position: absolute;
  inset: 10px 6px 22px;
  width: auto; height: calc(100% - 32px);
  pointer-events: none;
}
.rivermap-hits .rm-hit {
  pointer-events: auto;
  cursor: pointer;
  transition: fill .15s var(--ease);
}
.rivermap-hits .rm-hit:hover {
  fill: rgba(0, 240, 255, 0.08);
}

/* ---------- STATION NODE STATES (apply everywhere via <use>) ---------- */
/* styling elements INSIDE the shared <symbol> — shadow-DOM inherits these */
#narva-map .rm-station {
  transition: opacity .25s var(--ease);
}
#narva-map .rm-station .rm-halo,
#narva-map .rm-station .rm-ring,
#narva-map .rm-station .rm-dot,
#narva-map .rm-station .rm-num,
#narva-map .rm-station .rm-name {
  transition: fill .25s var(--ease),
              stroke .25s var(--ease),
              opacity .25s var(--ease),
              stroke-width .25s var(--ease);
}
/* active station: glow halo + bold ring */
#narva-map .rm-station.is-active .rm-halo {
  opacity: 0.35;
}
#narva-map .rm-station.is-active .rm-ring {
  stroke-width: 1.3;
}
#narva-map .rm-station.is-active .rm-dot {
  fill: #00e4ff;
}
#narva-map .rm-station.is-active .rm-num {
  font-size: 4.4px;
}
#narva-map .rm-station.is-active .rm-name {
  opacity: 1;
}
/* station-07 active uses magenta */
#narva-map .rm-station[data-target="station-07"].is-active .rm-halo { fill: #ff3ca8; opacity: 0.4; }
#narva-map .rm-station[data-target="station-07"].is-active .rm-dot  { fill: #ff3ca8; }
/* station-02 (warm canal) uses a warm pink — distinguishes the tributary */
#narva-map .rm-station[data-target="station-02"].is-active .rm-halo { fill: #ff6fbf; opacity: 0.4; }
#narva-map .rm-station[data-target="station-02"].is-active .rm-dot  { fill: #ff6fbf; }
#narva-map .rm-station[data-target="station-02"].is-active .rm-num  { fill: #ff6fbf; }

/* pulse animation for active station halo */
@keyframes rm-pulse {
  0%, 100% { transform: scale(1); opacity: 0.35; }
  50%      { transform: scale(1.25); opacity: 0.55; }
}
#narva-map .rm-station.is-active .rm-halo {
  transform-box: fill-box;
  transform-origin: center;
  animation: rm-pulse 2.8s var(--ease) infinite;
}
@media (prefers-reduced-motion: reduce) {
  #narva-map .rm-station.is-active .rm-halo { animation: none; }
}

/* ---------- SCROLL PROGRESS LINE (sidebar — follows the river path) ---------- */
.rivermap-progress {
  position: absolute;
  top: 10px; left: 6px;
  width: calc(100% - 12px);
  height: calc(100% - 32px);
  pointer-events: none;
  overflow: visible;
}
.rivermap-progress .rm-progress-stroke {
  fill: none;
  stroke: var(--magenta);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke-dashoffset .15s linear;
}
.rivermap-progress .rm-progress-glow {
  fill: none;
  stroke: var(--magenta);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.35;
  filter: blur(2px);
  transition: stroke-dashoffset .15s linear;
}
.rivermap-labels {
  position: absolute; inset: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px; color: var(--fg-mute);
  letter-spacing: 0.08em;
  pointer-events: none;
}
.rm-top { position: absolute; top: 2px; left: 0; right: 0; text-align: center; }
.rm-bot { position: absolute; bottom: 4px; left: 0; right: 0; text-align: center; }

/* ---------- MAIN ---------- */
main {
  position: relative;
  z-index: 3;
  margin-left: calc(var(--map-w) + 32px);
  padding: 0 var(--gutter);
  max-width: var(--maxw);
}
@media (max-width: 1100px) {
  .rivermap { display: none; }
  main { margin-left: 0; max-width: 100%; padding: 0 var(--gutter); }
  /* parallax bg stays but dimmer and pushed to edge */
  .rivermap-bg { opacity: 0.35; }
  .rivermap-bg-svg { width: 60vw; }
  .rivermap-bg-fade {
    background:
      linear-gradient(to right, rgba(5,6,15,1) 0%, rgba(5,6,15,0.8) 40%, rgba(5,6,15,0.2) 70%, rgba(5,6,15,0) 85%),
      linear-gradient(to bottom, rgba(5,6,15,0.6), rgba(5,6,15,0) 20%, rgba(5,6,15,0) 80%, rgba(5,6,15,0.8));
  }
}
@media (max-width: 720px) {
  .rivermap-bg { opacity: 0.28; }
  .rivermap-bg-svg { width: 75vw; }
}

/* ---------- HERO ---------- */
.hero {
  min-height: calc(100vh - var(--nav-h));
  padding: 60px 0 80px;
  display: flex; flex-direction: column; justify-content: center;
  position: relative;
}
.hero-terminal {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; line-height: 1.6;
  color: var(--fg-mute);
  margin-bottom: 32px;
  display: flex; flex-direction: column; gap: 2px;
  background: rgba(0,0,0,0);
  padding: 10px 0px;
}
.term-line { opacity: 0; animation: termIn 0.4s var(--ease) forwards; }
.term-line:nth-child(1) { animation-delay: 0.1s; }
.term-line:nth-child(2) { animation-delay: 0.6s; }
.term-line:nth-child(3) { animation-delay: 1.1s; }
.term-line:nth-child(4) { animation-delay: 1.6s; color: var(--lime); text-shadow: 0 0 6px var(--lime); }
@keyframes termIn { to { opacity: 1; } }

.hero-title {
  display: flex; flex-direction: column; gap: 4px;
  font-size: clamp(56px, 13vw, 180px);
  line-height: 0.9;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 32px;
  background: rgba(0,0,0,0.55);
  padding: 10px 0px;
  width: 90%;
}
.hero-title .glitch {
  position: relative;
  display: inline-block;
  color: var(--fg);
  text-shadow:
    1px 0 var(--magenta),
    -1px 0 var(--cyan);
}
.hero-title .glitch::before,
.hero-title .glitch::after {
  content: attr(data-text);
  position: absolute; inset: 0;
  background: var(--bg);
  overflow: hidden;
}
.hero-title .glitch::before {
  left: 2px;
  text-shadow: -2px 0 var(--magenta);
  animation: glitch-top 3.2s steps(40) infinite;
}
.hero-title .glitch::after {
  left: -2px;
  text-shadow: 2px 0 var(--cyan);
  animation: glitch-bot 2.7s steps(40) infinite reverse;
}
@keyframes glitch-top {
  0%,90%,100% { clip-path: inset(0 0 100% 0); }
  92% { clip-path: inset(0 0 60% 0); transform: translateX(-2px); }
  94% { clip-path: inset(40% 0 30% 0); transform: translateX(2px); }
  96% { clip-path: inset(15% 0 70% 0); transform: translateX(-1px); }
}
@keyframes glitch-bot {
  0%,90%,100% { clip-path: inset(100% 0 0 0); }
  92% { clip-path: inset(60% 0 0 0); transform: translateX(2px); }
  94% { clip-path: inset(30% 0 20% 0); transform: translateX(-2px); }
  96% { clip-path: inset(70% 0 10% 0); transform: translateX(1px); }
}

.hero-sub {
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(12px, 1.4vw, 15px);
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
  margin-top: 16px;
  text-transform: lowercase;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  margin: 40px 0 32px;
  background: var(--panel-bd);
  border: 1px solid var(--panel-bd);
}
.stat {
  padding: 16px 18px;
  background: rgba(5, 6, 15, 0.8);
  display: flex; flex-direction: column; gap: 2px;
}
.stat-num {
  font-family: "Exo 2", sans-serif;
  font-weight: 700;
  font-size: clamp(28px, 4vw, 44px);
  color: var(--cyan);
  text-shadow: var(--glow-cyan);
  line-height: 1;
}
.stat-unit {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--fg-mute);
  margin-top: 4px;
}
.stat-lbl {
  font-family: "Inter", sans-serif;
  font-size: 12px;
  color: var(--fg-dim);
  margin-top: 8px;
}

.hero-lede {
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.55;
  max-width: 640px;
  color: var(--fg);
  margin: 0 0 32px;
  background: rgba(0,0,0,0.55);
  padding: 10px 0px;
}

.hero-scroll {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
  animation: bounce 2.4s ease-in-out infinite;
  margin-top: auto;
}
.hero-scroll svg { color: var(--cyan); }
@keyframes bounce {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50% { transform: translateY(8px); opacity: 1; }
}

/* ---------- STATION ---------- */
.station {
  padding: 100px 0 60px;
  position: relative;
  scroll-margin-top: var(--nav-h);
}
.station + .station { border-top: 1px dashed var(--panel-bd); }

.station-meta {
  display: flex; gap: 16px; align-items: baseline;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--fg-mute);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--panel-bd);
}
.st-num {
  color: var(--magenta);
  font-size: 16px;
  font-weight: 500;
  text-shadow: var(--glow-magenta);
}
.st-coord {
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 1px dotted rgba(102, 252, 241, 0.35);
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease), text-shadow 0.15s var(--ease);
}
a.st-coord:hover,
a.st-coord:focus-visible {
  color: var(--fg);
  border-bottom-color: var(--cyan);
  text-shadow: 0 0 8px rgba(102, 252, 241, 0.55);
  outline: none;
}
.term-coord {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
  transition: text-shadow 0.15s var(--ease), border-color 0.15s var(--ease);
}
.term-coord:hover,
.term-coord:focus-visible {
  text-shadow: 0 0 6px currentColor;
  outline: none;
}
.st-km { margin-left: auto; color: var(--fg-dim); }

.station-head { margin-bottom: 32px; }
.station-head h2 {
  font-size: clamp(32px, 5.5vw, 64px);
  line-height: 1;
  color: var(--fg);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.station-tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  color: var(--fg-dim);
  margin: 0;
  line-height: 1.5;
  max-width: 640px;
}

.station-art {
  margin: 0 0 32px;
  border: 1px solid var(--panel-bd);
  background: linear-gradient(180deg, rgba(16, 20, 51, 0.3), rgba(5, 6, 15, 0.6));
  padding: 16px;
  position: relative;
}
.station-art::before {
  content: "";
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--lime);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--lime);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}
.art-svg { width: 100%; height: auto; }
.art-cap {
  margin-top: 12px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--fg-mute);
  letter-spacing: 0.04em;
}

/* SVG illustration strokes */
.art-stroke {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 1.2;
  stroke-linejoin: round;
  stroke-linecap: round;
  filter: drop-shadow(0 0 3px rgba(0, 240, 255, 0.5));
}
.art-stroke.thin { stroke-width: 0.7; filter: none; }
.art-stroke.dim, .art-line.dim, .art-wave.dim { opacity: 0.4; filter: none; }
.art-line { fill: none; stroke: var(--cyan); stroke-width: 1; }
.art-wave { fill: none; stroke: var(--cyan); stroke-width: 1; opacity: 0.7; }
.art-accent { stroke: var(--magenta); fill: none; filter: drop-shadow(0 0 3px rgba(255, 43, 214, 0.5)); }
.art-beam { fill: rgba(255, 194, 75, 0.15); stroke: var(--amber); stroke-width: 0.5; }
.art-tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 7px;
  fill: var(--fg-mute);
  stroke: none;
  filter: none;
}
.art-big {
  font-family: "Exo 2", sans-serif;
  font-size: 16px;
  fill: var(--magenta);
  stroke: none;
  filter: none;
  font-weight: 700;
}

.station-lead {
  font-size: clamp(16px, 1.5vw, 18px);
  line-height: 1.6;
  color: var(--fg);
  margin: 0 0 24px;
  max-width: 640px;
}
.station-lead b { color: var(--cyan); font-weight: 600; }

.facts {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: grid;
  gap: 1px;
  background: var(--panel-bd);
  border: 1px solid var(--panel-bd);
}
.facts li {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 16px;
  padding: 12px 16px;
  background: rgba(5, 6, 15, 0.6);
  font-size: 14px;
  line-height: 1.5;
  align-items: baseline;
}
.fact-k {
  font-family: "JetBrains Mono", monospace;
  color: var(--lime);
  font-weight: 500;
  font-size: 13px;
  text-shadow: 0 0 6px rgba(180, 245, 66, 0.4);
}

.station-tip {
  padding: 14px 16px;
  border-left: 2px solid var(--magenta);
  background: rgba(255, 43, 214, 0.06);
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
  display: flex; gap: 12px; align-items: flex-start;
}
.station-tip b { color: var(--magenta); }
.tip-k {
  font-family: "JetBrains Mono", monospace;
  color: var(--magenta);
  font-weight: 600;
  flex: 0 0 auto;
}

.station-outro {
  font-size: clamp(15px, 1.4vw, 17px);
  line-height: 1.6;
  color: var(--fg-dim);
  margin: 24px 0 0;
  max-width: 640px;
  font-style: italic;
}

/* ---------- STATION HACK / LIFEHACK glowing amber block ---------- */
.station-hack {
  position: relative;
  margin: 18px 0 14px;
  padding: 14px 18px 14px 52px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "label body"
    "label body";
  gap: 2px 14px;
  align-items: start;
  border: 1px solid rgba(255, 194, 75, 0.35);
  border-left: 3px solid var(--amber);
  border-radius: 2px;
  background:
    linear-gradient(90deg,
      rgba(255, 194, 75, 0.14) 0%,
      rgba(255, 194, 75, 0.05) 45%,
      rgba(5, 6, 15, 0.25) 100%);
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg);
  box-shadow:
    0 0 14px rgba(255, 194, 75, 0.20),
    0 0 30px -4px rgba(255, 194, 75, 0.15),
    inset 0 0 20px rgba(255, 194, 75, 0.05);
  overflow: hidden;
  isolation: isolate;
}
.station-hack::before {
  /* soft inner glow pulse corner */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 6% 50%, rgba(255, 194, 75, 0.22), transparent 40%);
  z-index: -1;
  pointer-events: none;
}
.station-hack .hack-ico {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  line-height: 1;
  color: var(--amber);
  text-shadow:
    0 0 6px rgba(255, 194, 75, 0.9),
    0 0 14px rgba(255, 194, 75, 0.55),
    0 0 28px rgba(255, 194, 75, 0.35);
  animation: hack-pulse 2.8s ease-in-out infinite;
}
@keyframes hack-pulse {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; filter: brightness(1.25); }
}
.station-hack .hack-label {
  grid-area: label;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--amber);
  text-shadow: 0 0 8px rgba(255, 194, 75, 0.55);
  align-self: center;
  padding-right: 14px;
  border-right: 1px dashed rgba(255, 194, 75, 0.35);
  white-space: nowrap;
}
.station-hack .hack-body {
  grid-area: body;
  color: var(--fg);
  align-self: center;
}
@media (max-width: 600px) {
  .station-hack {
    grid-template-columns: 1fr;
    grid-template-areas:
      "label"
      "body";
    padding-left: 44px;
    gap: 6px 0;
  }
  .station-hack .hack-label {
    border-right: 0;
    padding-right: 0;
    padding-bottom: 4px;
    border-bottom: 1px dashed rgba(255, 194, 75, 0.35);
    display: inline-block;
    justify-self: start;
  }
}
@media (prefers-reduced-motion: reduce) {
  .station-hack .hack-ico { animation: none; }
}

.station-mouth .station-head h2 {
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* warm-canal tributary — pink accent on station number and tag */
.station-warm .st-num {
  color: #ff6fbf;
  text-shadow: 0 0 18px rgba(255, 111, 191, 0.45);
}
.station-warm .station-tag {
  color: #f6a6d2;
}

/* ---------- ROSSON · magical interlude (bonus, no nav link) ----------
   Still 100% on the existing cyan/magenta palette — the "magic" is
   motion (slow twinkle + shimmer) and scattered star-glyphs, not a new
   colour. Respects prefers-reduced-motion. */
.station-rosson {
  position: relative;
  overflow: visible;
}
.station-rosson .st-num {
  color: var(--cyan);
  text-shadow: 0 0 18px rgba(0, 240, 255, 0.55);
  animation: rosson-star-pulse 2.8s ease-in-out infinite;
}
.station-rosson .station-head h2 {
  background: linear-gradient(
    90deg,
    var(--cyan) 0%,
    var(--magenta) 50%,
    var(--cyan) 100%
  );
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: rosson-shimmer 7s ease-in-out infinite;
}
.station-rosson .station-tag {
  color: #a8e8ff;
}
.station-rosson .tip-k {
  color: var(--magenta);
  text-shadow: 0 0 10px rgba(255, 43, 214, 0.55);
}
.station-rosson .fact-k {
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.35);
}

/* scattered twinkling stars layer */
.rosson-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.rosson-sparkles .sparkle {
  position: absolute;
  font-size: 10px;
  line-height: 1;
  opacity: 0.35;
  animation: rosson-twinkle 3.2s ease-in-out infinite;
  text-shadow: 0 0 6px currentColor;
}
.rosson-sparkles .s1 { top: 12%; left:  8%; color: var(--cyan);    font-size:  9px; animation-delay: 0s;   }
.rosson-sparkles .s2 { top: 28%; right: 14%; color: var(--magenta); font-size: 14px; animation-delay: 0.6s; }
.rosson-sparkles .s3 { top: 54%; left:  5%; color: var(--cyan);    font-size:  7px; animation-delay: 1.2s; }
.rosson-sparkles .s4 { top: 72%; right: 10%; color: var(--magenta); font-size: 11px; animation-delay: 1.8s; }
.rosson-sparkles .s5 { top: 88%; left: 44%; color: var(--cyan);    font-size:  7px; animation-delay: 2.4s; }
.rosson-sparkles .s6 { top:  8%; right:  6%; color: var(--magenta); font-size: 12px; animation-delay: 0.9s; }
.rosson-sparkles .s7 { top: 42%; left: 48%; color: var(--cyan);    font-size:  6px; animation-delay: 1.5s; }

@keyframes rosson-twinkle {
  0%, 100% { opacity: 0.10; transform: scale(0.7) rotate(0deg); }
  50%      { opacity: 0.80; transform: scale(1.15) rotate(45deg); }
}
@keyframes rosson-star-pulse {
  0%, 100% { text-shadow: 0 0 14px rgba(0, 240, 255, 0.5); }
  50%      { text-shadow: 0 0 28px rgba(0, 240, 255, 0.9),
                          0 0 40px rgba(255, 43, 214, 0.4); }
}
@keyframes rosson-shimmer {
  0%, 100% { background-position:   0% 0%; }
  50%      { background-position: 100% 0%; }
}

@media (prefers-reduced-motion: reduce) {
  .rosson-sparkles .sparkle,
  .station-rosson .st-num,
  .station-rosson .station-head h2 {
    animation: none;
  }
}

/* ---------- PRACTICE ---------- */
.practice {
  padding: 0 0 60px;
  border-top: 1px dashed var(--panel-bd);
  scroll-margin-top: var(--nav-h);
}
.practice-head {
  margin-bottom: 40px;
}
.practice-head h2 {
  font-size: clamp(32px, 5vw, 60px);
  color: var(--fg);
  margin-bottom: 8px;
}
.practice-head p {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  color: var(--fg-dim);
  margin: 0;
}
.practice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1px;
  background: var(--panel-bd);
  border: 1px solid var(--panel-bd);
}
.ptile {
  padding: 24px 20px;
  background: rgba(5, 6, 15, 0.7);
  display: flex; flex-direction: column; gap: 12px;
  transition: background .2s var(--ease);
}
.ptile:hover { background: rgba(10, 13, 30, 0.9); }
.p-ico {
  font-size: 22px;
  color: var(--cyan);
  line-height: 1;
  text-shadow: var(--glow-cyan);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}
.p-ico svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 0 5px rgba(0, 228, 255, 0.45));
}
.ptile h3 {
  font-size: 18px;
  color: var(--fg);
}
.ptile p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg-dim);
}

/* wide call-to-action tile — spans the full grid width */
.ptile.ptile--cta {
  grid-column: 1 / -1;
  padding: 32px 28px;
  gap: 14px;
  background: linear-gradient(135deg, rgba(0, 228, 255, 0.05), rgba(5, 6, 15, 0.85));
  box-shadow: inset 0 0 60px rgba(0, 228, 255, 0.06);
}
.ptile.ptile--cta .p-ico {
  font-size: 28px;
  width: 28px;
  height: 28px;
}
.ptile.ptile--cta h3 {
  font-size: 22px;
  line-height: 1.25;
  color: var(--cyan);
  text-shadow: var(--glow-cyan);
}
.ptile.ptile--cta p {
  font-size: 15px;
  line-height: 1.6;
  max-width: 72ch;
}
.ptile-cta-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
  font-size: 13px;
  letter-spacing: 0.3px;
}
.ptile-cta-links a {
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 1px dotted rgba(0, 228, 255, 0.4);
  padding-bottom: 1px;
}
.ptile-cta-head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.ptile-cta-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  align-items: start;
}
.ptile-cta-text {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.ptile-cta-text strong {
  color: var(--fg);
  font-weight: 500;
}
.ptile-cta-image {
  margin: 0;
  padding: 10px 10px 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}
.ptile-cta-image::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-left: 1px solid rgba(0, 240, 255, 0.35);
  border-top: 1px solid rgba(0, 240, 255, 0.35);
  width: 14px;
  height: 14px;
  pointer-events: none;
}
.ptile-cta-image::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  border-right: 1px solid rgba(0, 240, 255, 0.35);
  border-bottom: 1px solid rgba(0, 240, 255, 0.35);
  width: 14px;
  height: 14px;
  pointer-events: none;
}
.ptile-cta-image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 4;
  object-fit: cover;
  filter: saturate(0.85) contrast(1.02) brightness(0.92);
}
.ptile-cta-cap {
  margin: 0;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.6px;
  color: var(--fg-mute);
  text-align: center;
  text-transform: uppercase;
}
.ptile-cta-aside {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

/* bright GPS CTA: trailhead coords + Google Maps link */
.gps-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--fg);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.12), rgba(0, 240, 255, 0.03));
  border: 1px solid rgba(0, 240, 255, 0.55);
  border-radius: 2px;
  position: relative;
  box-shadow:
    0 0 0 1px rgba(0, 240, 255, 0.08),
    0 0 18px rgba(0, 240, 255, 0.18),
    inset 0 0 24px rgba(0, 240, 255, 0.06);
  transition: background .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.gps-cta:hover {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.22), rgba(0, 240, 255, 0.06));
  border-color: var(--cyan);
  box-shadow:
    0 0 0 1px rgba(0, 240, 255, 0.2),
    0 0 28px rgba(0, 240, 255, 0.35),
    inset 0 0 32px rgba(0, 240, 255, 0.1);
}
.gps-cta-ico {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan);
  filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.6));
}
.gps-cta-ico svg {
  width: 100%;
  height: 100%;
}
.gps-cta-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.gps-cta-kicker {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: 1.2px;
  color: var(--cyan);
  text-transform: uppercase;
}
.gps-cta-coord {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 14px;
  letter-spacing: 0.4px;
  color: var(--fg);
  text-shadow: var(--glow-cyan);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gps-cta-open {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.6px;
  color: var(--cyan);
  opacity: 0.8;
  text-transform: uppercase;
}
.gps-cta:hover .gps-cta-open { opacity: 1; }

.gps-cta-howto {
  font-size: 13px;
  line-height: 1.55;
  color: var(--fg-dim);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gps-cta-howto strong { color: var(--fg); font-weight: 500; }
.gps-cta-howto em { color: var(--fg); font-style: normal; opacity: 0.85; }
.gps-cta-howto-lead,
.gps-cta-howto-foot { margin: 0; }

.gps-routes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gps-routes li {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(0, 240, 255, 0.03);
  border-left: 2px solid rgba(0, 240, 255, 0.35);
}
.gps-route-num {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  color: var(--cyan);
  border: 1px solid rgba(0, 240, 255, 0.5);
  border-radius: 50%;
  background: rgba(0, 240, 255, 0.08);
  text-shadow: var(--glow-cyan);
}
.gps-route-body { min-width: 0; }

.gps-turn {
  display: inline;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12.5px;
  letter-spacing: 0.3px;
  color: var(--cyan);
  text-decoration: none;
  padding: 0 6px;
  border: 1px solid rgba(0, 240, 255, 0.35);
  background: rgba(0, 240, 255, 0.06);
  white-space: nowrap;
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.gps-turn::before {
  content: "◎ ";
  opacity: 0.7;
}
.gps-turn:hover {
  background: rgba(0, 240, 255, 0.14);
  border-color: var(--cyan);
  text-shadow: var(--glow-cyan);
}

@media (max-width: 760px) {
  .ptile-cta-body {
    grid-template-columns: 1fr;
  }
  .ptile-cta-aside {
    max-width: 460px;
  }
}
@media (max-width: 420px) {
  .gps-cta-coord { font-size: 12.5px; }
  .gps-cta { padding: 12px 14px; gap: 12px; }
  .gps-cta-ico { width: 28px; height: 28px; }
}
.ptile-cta-links a:hover {
  border-bottom-color: var(--cyan);
  text-shadow: var(--glow-cyan);
}
.ptile-cta-links span[aria-hidden] {
  opacity: 0.35;
}

/* inline informational hint — e.g. "all trails on rmk.ee/maps" */
.cta-hint {
  margin: 0;
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(0, 240, 255, 0.04);
  border-left: 2px solid rgba(0, 240, 255, 0.5);
  font-size: 13px;
  line-height: 1.55;
  color: var(--fg-dim);
}
.cta-hint-ico {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: var(--cyan);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.cta-hint-ico svg { width: 100%; height: 100%; }
.cta-hint a {
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 1px dotted rgba(0, 240, 255, 0.4);
  padding-bottom: 1px;
  white-space: nowrap;
}
.cta-hint a:hover {
  border-bottom-color: var(--cyan);
  text-shadow: var(--glow-cyan);
}

/* ---- GPS notices (tick warning + dog-friendly) ---- */
.gps-notices {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.notice {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(5, 6, 15, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left-width: 2px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--fg-dim);
}
.notice-ico {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.notice-ico svg { width: 100%; height: 100%; }
.notice-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.notice-title {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.notice-text {
  display: inline;
}
.notice-text strong {
  color: var(--fg);
  font-weight: 500;
}

/* warn variant — amber for tick / safety advisory */
.notice--warn {
  border-left-color: var(--amber);
  background: linear-gradient(90deg, rgba(255, 194, 75, 0.06), rgba(5, 6, 15, 0.55) 40%);
}
.notice--warn .notice-ico { color: var(--amber); filter: drop-shadow(0 0 4px rgba(255, 194, 75, 0.5)); }
.notice--warn .notice-title { color: var(--amber); }

/* ok variant — lime for permission / friendly */
.notice--ok {
  border-left-color: var(--lime);
  background: linear-gradient(90deg, rgba(180, 245, 66, 0.05), rgba(5, 6, 15, 0.55) 40%);
}
.notice--ok .notice-ico { color: var(--lime); filter: drop-shadow(0 0 4px rgba(180, 245, 66, 0.45)); }
.notice--ok .notice-title { color: var(--lime); }

/* info variant — cyan for mindful reminder / respectful note */
.notice--info {
  border-left-color: var(--cyan);
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.05), rgba(5, 6, 15, 0.55) 40%);
}
.notice--info .notice-ico { color: var(--cyan); filter: drop-shadow(0 0 4px rgba(0, 240, 255, 0.45)); }
.notice--info .notice-title { color: var(--cyan); }

/* ---------- FOOTER ---------- */
.site-footer {
  margin-top: 80px;
  padding: 60px var(--gutter) 40px;
  border-top: 1px solid var(--panel-bd);
  background: linear-gradient(180deg, transparent, rgba(5, 6, 15, 1));
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--fg-dim);
  position: relative; z-index: 3;
}
.site-footer.with-map { margin-left: calc(var(--map-w) + 32px); }
.site-footer h4 {
  font-size: 12px;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
  font-family: "JetBrains Mono", monospace;
  font-weight: 500;
}
.site-footer ul {
  list-style: none;
  padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.site-footer a {
  color: var(--fg);
  border-bottom: 1px dotted var(--fg-mute);
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.site-footer a:hover {
  color: var(--cyan);
  border-color: var(--cyan);
}
.foot-end {
  grid-column: 1 / -1;
  padding-top: 24px;
  border-top: 1px dashed var(--panel-bd);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--fg-mute);
  letter-spacing: 0.08em;
}
.mono { font-family: "JetBrains Mono", monospace; }

/* footer sig block: copy + report link */
.foot-sig { display: flex; flex-direction: column; gap: 10px; }
.foot-copy {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--fg-dim);
  letter-spacing: 0.06em;
}
.foot-report { font-size: 12px; }
.report-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  margin-left: -10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--magenta);
  border-bottom: 0;
  border-radius: 3px;
  text-decoration: none;
  transition: color .15s var(--ease), background .15s var(--ease), text-shadow .15s var(--ease);
}
.report-link:hover,
.report-link:focus-visible {
  color: #fff;
  background: rgba(255, 43, 214, 0.08);
  text-shadow: 0 0 8px rgba(255, 43, 214, 0.6);
  outline: none;
}
.report-ico {
  flex-shrink: 0;
  stroke: currentColor;
  transform: translateY(-1px);
  filter: drop-shadow(0 0 4px rgba(255, 43, 214, 0.35));
}

/* ---------- FEEDBACK MODAL ---------- */
.fb-modal {
  position: fixed; inset: 0;
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(12px, 3vw, 32px);
  animation: fb-fade-in .18s var(--ease);
}
.fb-modal[hidden] { display: none; }
@keyframes fb-fade-in { from { opacity: 0; } to { opacity: 1; } }

.fb-backdrop {
  position: absolute; inset: 0;
  background: radial-gradient(1000px 600px at 50% 30%, rgba(255, 43, 214, 0.08), transparent 60%),
              rgba(5, 6, 15, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.fb-panel {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 28px clamp(20px, 3vw, 32px) 24px;
  background: linear-gradient(180deg, rgba(16, 20, 51, 0.96), rgba(10, 13, 30, 0.96));
  border: 1px solid var(--panel-bd);
  border-radius: 4px;
  box-shadow:
    0 0 0 1px rgba(255, 43, 214, 0.12),
    0 20px 60px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(255, 43, 214, 0.12);
  animation: fb-slide .24s var(--ease);
}
@keyframes fb-slide {
  from { transform: translateY(12px) scale(.98); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.fb-panel::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  border-radius: 4px;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 2px,
    rgba(0, 240, 255, 0.03) 2px 3px,
    transparent 3px 4px
  );
  mix-blend-mode: overlay;
}

.fb-close {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--fg-mute);
  border-radius: 3px;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.fb-close:hover,
.fb-close:focus-visible {
  color: var(--cyan);
  background: rgba(0, 240, 255, 0.08);
  outline: none;
}

.fb-header { margin-bottom: 20px; }
.fb-kicker {
  font-size: 11px;
  color: var(--cyan);
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.fb-title {
  font-size: clamp(20px, 3vw, 26px);
  color: var(--fg);
  margin: 0 0 6px;
}
.fb-sub {
  font-size: 13px;
  color: var(--fg-dim);
  margin: 0;
  line-height: 1.5;
}

.fb-form { display: flex; flex-direction: column; gap: 14px; }
.fb-field { display: flex; flex-direction: column; gap: 6px; }
.fb-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--fg-dim);
  letter-spacing: 0.06em;
  text-transform: lowercase;
  display: inline-flex; align-items: baseline; gap: 4px;
}
.fb-req { color: var(--magenta); }

.fb-form input[type="text"],
.fb-form input[type="email"],
.fb-form textarea {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  color: var(--fg);
  background: rgba(5, 6, 15, 0.6);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 3px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
.fb-form textarea {
  resize: vertical;
  min-height: 96px;
  font-family: "Inter", sans-serif;
  line-height: 1.5;
}
.fb-form input:focus,
.fb-form textarea:focus {
  outline: none;
  border-color: var(--cyan);
  background: rgba(5, 6, 15, 0.85);
  box-shadow: 0 0 0 1px var(--cyan), 0 0 14px rgba(0, 240, 255, 0.2);
}
.fb-form input.is-invalid,
.fb-form textarea.is-invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 1px var(--red), 0 0 14px rgba(255, 64, 96, 0.25);
}

/* file input: hide native, style via hint */
.fb-field.fb-file { position: relative; }
.fb-field.fb-file input[type="file"] {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}
.fb-file-hint {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--fg-dim);
  background: rgba(5, 6, 15, 0.6);
  border: 1px dashed rgba(0, 240, 255, 0.25);
  border-radius: 3px;
  cursor: pointer;
  transition: border-color .15s var(--ease), color .15s var(--ease), background .15s var(--ease);
}
.fb-file-hint::before {
  content: "[+]";
  color: var(--cyan);
}
.fb-field.fb-file:hover .fb-file-hint,
.fb-field.fb-file input[type="file"]:focus + .fb-file-hint {
  color: var(--fg);
  border-color: var(--cyan);
  background: rgba(0, 240, 255, 0.05);
}
.fb-file-hint.has-file { color: var(--fg); border-style: solid; }
.fb-file-hint.has-file::before { content: "[✓]"; color: var(--lime); }

.fb-honeypot {
  position: absolute !important;
  left: -9999px; top: -9999px;
  width: 1px; height: 1px; opacity: 0;
}

.fb-actions {
  display: flex; gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}
.fb-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 110px;
  padding: 10px 18px;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  letter-spacing: 0.05em;
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: pointer;
  transition: color .15s var(--ease), background .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.fb-btn:disabled { opacity: .6; cursor: not-allowed; }
.fb-btn-ghost {
  color: var(--fg-dim);
  border-color: rgba(0, 240, 255, 0.2);
}
.fb-btn-ghost:hover:not(:disabled),
.fb-btn-ghost:focus-visible {
  color: var(--fg); border-color: var(--cyan);
  outline: none;
}
.fb-btn-send {
  color: var(--bg);
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.35);
}
.fb-btn-send:hover:not(:disabled),
.fb-btn-send:focus-visible {
  background: #fff; border-color: #fff;
  box-shadow: 0 0 26px rgba(0, 240, 255, 0.6);
  outline: none;
}
.fb-btn.is-loading .fb-btn-label { visibility: hidden; }
.fb-btn-spinner {
  position: absolute;
  width: 14px; height: 14px;
  border: 2px solid rgba(5, 6, 15, 0.3);
  border-top-color: var(--bg);
  border-radius: 50%;
  opacity: 0;
  animation: fb-spin .8s linear infinite;
}
.fb-btn.is-loading .fb-btn-spinner { opacity: 1; }
@keyframes fb-spin { to { transform: rotate(360deg); } }

.fb-status {
  min-height: 18px;
  margin-top: 4px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--fg-dim);
  letter-spacing: 0.03em;
}
.fb-status.is-ok { color: var(--lime); }
.fb-status.is-err { color: var(--red); }

@media (max-width: 520px) {
  .fb-panel { padding: 24px 18px; }
  .fb-actions { flex-direction: column-reverse; }
  .fb-btn { width: 100%; }
}

/* ---------- FOOTER TECH (site label + author credit) ---------- */
.foot-tech { display: flex; flex-direction: column; gap: 4px; }
.foot-tech-line { display: block; }
.foot-tech a { letter-spacing: 0.02em; }

/* ---------- PRIVACY LINK (in footer) + PRIVACY MODAL BODY ---------- */
.privacy-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  margin-left: -10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--cyan);
  border-bottom: 0;
  border-radius: 3px;
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: color .15s var(--ease), background .15s var(--ease), text-shadow .15s var(--ease);
}
.privacy-link:hover,
.privacy-link:focus-visible {
  color: #fff;
  background: rgba(0, 228, 255, 0.08);
  text-shadow: 0 0 8px rgba(0, 228, 255, 0.55);
  outline: none;
  border-bottom: 0;
  border-color: transparent;
}
.privacy-ico {
  flex-shrink: 0;
  stroke: currentColor;
}
.pv-body {
  font-size: 14px;
  line-height: 1.65;
  color: var(--fg);
}
.pv-body p { margin: 0 0 14px; }
.pv-body p:last-child { margin-bottom: 0; }
.pv-body .pv-hero {
  font-size: 18px;
  color: var(--cyan);
  letter-spacing: 0.02em;
}
.pv-body .pv-hero b { color: #fff; }
.pv-body b { color: var(--cyan); font-weight: 600; }
.pv-actions {
  margin-top: 22px;
  justify-content: space-between;
  align-items: center;
}
.pv-to-feedback {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--magenta);
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
  padding-bottom: 1px;
  transition: color .15s var(--ease), text-shadow .15s var(--ease);
}
.pv-to-feedback:hover,
.pv-to-feedback:focus-visible {
  color: #fff;
  text-shadow: 0 0 8px rgba(255, 43, 214, 0.6);
  border-color: #fff;
  outline: none;
}
@media (max-width: 520px) {
  .pv-actions { flex-direction: column-reverse; align-items: stretch; gap: 12px; }
  .pv-to-feedback { justify-content: center; }
}

@media (min-width: 1101px) {
  .site-footer { margin-left: calc(var(--map-w) + 32px); }
}

/* ---------- FOCUS ---------- */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- MOBILE ---------- */
@media (max-width: 720px) {
  .site-nav { display: none; }
  .brand-meta { display: none; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .facts li { grid-template-columns: 1fr; gap: 4px; }
  .station { padding: 70px 0 40px; }
  .practice { padding: 70px 0 40px; }
}

@media (max-width: 480px) {
  .hero-title { font-size: clamp(44px, 16vw, 80px); }
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .crt { display: none; }
  .hero-title .glitch::before, .hero-title .glitch::after { display: none; }
  .station-art::before { opacity: 0.6; }
}

/* ---------- COMMENTS WIDGET ---------- */
.cmt-box {
  margin-top: 28px;
  border: 1px solid rgba(102, 252, 241, 0.18);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(8, 14, 22, 0.78), rgba(8, 14, 22, 0.55));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow: hidden;
  font-family: inherit;
}

.cmt-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 18px;
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 13px;
  transition: background 0.2s ease;
}
.cmt-toggle:hover { background: rgba(102, 252, 241, 0.06); }
.cmt-toggle.is-open { background: rgba(102, 252, 241, 0.08); }

.cmt-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #66fcf1;
  box-shadow: 0 0 10px rgba(102, 252, 241, 0.7);
  flex: 0 0 auto;
}
.cmt-dot.is-new {
  background: #ff6fbf;
  box-shadow: 0 0 12px rgba(255, 111, 191, 0.8);
  animation: cmt-pulse 1.6s ease-in-out infinite;
}

@keyframes cmt-pulse {
  0%, 100% { transform: scale(1);   opacity: 1;   }
  50%      { transform: scale(1.4); opacity: 0.55;}
}

.cmt-title {
  flex: 1 1 auto;
  color: #eaf6f6;
  font-weight: 600;
}
.cmt-count {
  color: #8aa;
  font-size: 12px;
  letter-spacing: 0.05em;
}
.cmt-chev {
  color: #66fcf1;
  font-size: 14px;
  transition: transform 0.2s ease;
}

.cmt-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 0;
  opacity: 0;
  padding: 0 18px;
  border-top: 0 solid rgba(102, 252, 241, 0.14);
  overflow: hidden;
  transition:
    max-height 380ms cubic-bezier(0.22, 0.61, 0.36, 1),
    opacity 280ms ease,
    padding 380ms cubic-bezier(0.22, 0.61, 0.36, 1),
    border-top-width 380ms ease;
  will-change: max-height, opacity;
}
.cmt-box.is-open .cmt-panel {
  max-height: 4000px;
  opacity: 1;
  padding: 16px 18px 18px;
  border-top-width: 1px;
}
@media (prefers-reduced-motion: reduce) {
  .cmt-panel { transition: none; }
}

.cmt-hint {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: #8aa;
  letter-spacing: 0.03em;
}
.cmt-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #66fcf1;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.cmt-live-pulse {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #66fcf1;
  box-shadow: 0 0 8px rgba(102, 252, 241, 0.9);
  animation: cmt-pulse 1.6s ease-in-out infinite;
}

.cmt-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 4px;
}
.cmt-list::-webkit-scrollbar { width: 6px; }
.cmt-list::-webkit-scrollbar-thumb { background: rgba(102, 252, 241, 0.25); border-radius: 4px; }

.cmt-item {
  background: rgba(8, 18, 28, 0.55);
  border: 1px solid rgba(102, 252, 241, 0.1);
  border-radius: 10px;
  padding: 10px 12px;
}
.cmt-item-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 12px;
}
.cmt-item-nick {
  color: #66fcf1;
  font-weight: 600;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}
.cmt-item-time {
  color: #6a8a8a;
  font-size: 11px;
  white-space: nowrap;
}
.cmt-item-body {
  margin: 0;
  color: #cde;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.cmt-empty {
  color: #6a8a8a;
  font-size: 13px;
  font-style: italic;
  text-align: center;
  padding: 16px 0 6px;
}

.cmt-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cmt-form-row {
  display: flex;
  gap: 8px;
}
.cmt-nick, .cmt-body {
  background: rgba(4, 10, 16, 0.7);
  border: 1px solid rgba(102, 252, 241, 0.18);
  border-radius: 8px;
  color: #eaf6f6;
  font: inherit;
  font-size: 14px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
  resize: vertical;
}
.cmt-nick { flex: 1 1 auto; min-width: 0; }
.cmt-body { min-height: 56px; line-height: 1.4; }
.cmt-nick:focus, .cmt-body:focus {
  border-color: #66fcf1;
  box-shadow: 0 0 0 3px rgba(102, 252, 241, 0.12);
}
.cmt-nick::placeholder, .cmt-body::placeholder { color: #567; }

.cmt-submit {
  flex: 0 0 auto;
  background: linear-gradient(135deg, #66fcf1, #45a29e);
  border: 0;
  color: #062c2a;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 12px;
  padding: 0 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.05s ease;
  min-height: 40px;
}
.cmt-submit:hover:not(:disabled) { filter: brightness(1.08); }
.cmt-submit:active:not(:disabled) { transform: translateY(1px); }
.cmt-submit:disabled { opacity: 0.6; cursor: progress; }

.cmt-err {
  color: #ffb4d0;
  background: rgba(255, 111, 191, 0.08);
  border: 1px solid rgba(255, 111, 191, 0.35);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}

/* Honeypot — visually gone, still discoverable by crawlers/bots. */
.cmt-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 560px) {
  .cmt-form-row { flex-direction: column; }
  .cmt-submit { min-height: 42px; padding: 10px; }
  .cmt-panel  { padding: 14px; }
  .cmt-toggle { padding: 12px 14px; }
}

/* --- Reisid / Путешествия — rose-tinted forum skin ------------------------
   Same widget, warm pink instead of cyan — echoes the warm-canal palette
   (#ff6fbf) so the "travellers' forum" reads as a different social space. */
.practice .cmt-box {
  border-color: rgba(255, 111, 191, 0.34);
  box-shadow: 0 0 28px rgba(255, 111, 191, 0.09) inset;
}
.practice .cmt-toggle:hover    { background: rgba(255, 111, 191, 0.07); }
.practice .cmt-toggle.is-open  { background: rgba(255, 111, 191, 0.10); }
.practice .cmt-panel           { border-top-color: rgba(255, 111, 191, 0.22); }
.practice .cmt-dot {
  background: #ff6fbf;
  box-shadow: 0 0 10px rgba(255, 111, 191, 0.75);
}
.practice .cmt-chev,
.practice .cmt-live,
.practice .cmt-item-nick       { color: #ff6fbf; }
.practice .cmt-live-pulse {
  background: #ff6fbf;
  box-shadow: 0 0 8px rgba(255, 111, 191, 0.9);
}
.practice .cmt-item            { border-color: rgba(255, 111, 191, 0.18); }
.practice .cmt-list::-webkit-scrollbar-thumb { background: rgba(255, 111, 191, 0.30); }
.practice .cmt-nick,
.practice .cmt-body            { border-color: rgba(255, 111, 191, 0.28); }
.practice .cmt-nick:focus,
.practice .cmt-body:focus {
  border-color: #ff6fbf;
  box-shadow: 0 0 0 3px rgba(255, 111, 191, 0.14);
}
.practice .cmt-submit {
  background: linear-gradient(135deg, #ff6fbf, #c0398c);
  color: #2a0620;
}

@media (prefers-reduced-motion: reduce) {
  .cmt-dot.is-new, .cmt-live-pulse { animation: none; }
}

/* ---------- COMMENTS WIDGET: EXTENDED CONTROLS ----------------------------
   Formatting toolbar, emoji picker, photo attachment + drag&drop,
   live message counter, rendered markdown inside each comment body. */

/* widget box needs to anchor the drop overlay & emoji popover */
.cmt-box { position: relative; }

/* --- Text area wrapper (holds toolbar, textarea, emoji popover) --- */
.cmt-text-wrap {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* --- Formatting toolbar --- */
.cmt-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px;
  background: rgba(4, 10, 16, 0.55);
  border: 1px solid rgba(102, 252, 241, 0.18);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}
.cmt-toolbar-sep {
  width: 1px;
  margin: 2px 2px;
  background: rgba(102, 252, 241, 0.18);
  align-self: stretch;
}
.cmt-tb-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 28px;
  padding: 0 6px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #aec;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}
.cmt-tb-btn:hover,
.cmt-tb-btn:focus-visible {
  background: rgba(102, 252, 241, 0.12);
  color: #66fcf1;
  border-color: rgba(102, 252, 241, 0.3);
  outline: none;
}
.cmt-tb-btn:active { transform: translateY(1px); }
.cmt-tb-btn.is-active {
  background: rgba(102, 252, 241, 0.18);
  color: #66fcf1;
  border-color: rgba(102, 252, 241, 0.4);
}
.tb-bold   { font-weight: 700; }
.tb-italic { font-style: italic; }
.tb-strike { text-decoration: line-through; }
.tb-code   { font-family: "JetBrains Mono", monospace; }

/* Textarea joins directly under toolbar — seamless top edge. */
.cmt-toolbar + .cmt-body,
.cmt-text-wrap .cmt-body {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-top: 0;
}

/* --- Emoji picker popover — FIXED dropdown, lives on <body>.
   JS sets width (50% of textarea), top, left on open so it stays in view.
   Compact 6-column grid keeps the popover short enough to drop over textarea. */
.cmt-emoji-picker {
  position: fixed;
  z-index: 60;
  max-height: 200px;
  overflow-y: auto;
  padding: 6px;
  background: rgba(8, 14, 22, 0.96);
  border: 1px solid rgba(102, 252, 241, 0.3);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.cmt-emoji-picker[hidden] { display: none; }
.cmt-emoji-picker::-webkit-scrollbar { width: 6px; }
.cmt-emoji-picker::-webkit-scrollbar-thumb { background: rgba(102, 252, 241, 0.25); border-radius: 4px; }
.cmt-emoji-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 19px;
  cursor: pointer;
  line-height: 1;
  transition: background 0.1s ease, transform 0.1s ease;
}
.cmt-emoji-btn:hover,
.cmt-emoji-btn:focus-visible {
  background: rgba(102, 252, 241, 0.18);
  transform: scale(1.18);
  outline: none;
}

/* --- Attachment preview row --- */
.cmt-attachment {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(4, 10, 16, 0.65);
  border: 1px solid rgba(102, 252, 241, 0.22);
  border-radius: 8px;
}
.cmt-attachment[hidden] { display: none; }
.cmt-attachment-img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(102, 252, 241, 0.25);
  flex: 0 0 auto;
  background: rgba(0, 0, 0, 0.35);
}
.cmt-attachment-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: #aec;
  overflow: hidden;
}
.cmt-attachment-name {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  color: #eaf6f6;
  font-weight: 500;
}
.cmt-attachment-size {
  color: #6a8a8a;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.03em;
}
.cmt-attachment-remove {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 111, 191, 0.12);
  color: #ff9ccf;
  border: 1px solid rgba(255, 111, 191, 0.32);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.08s ease;
}
.cmt-attachment-remove:hover { background: rgba(255, 111, 191, 0.22); }
.cmt-attachment-remove:active { transform: translateY(1px); }

/* --- Drag & drop overlay (desktop) --- */
.cmt-drop-overlay {
  position: absolute;
  inset: 4px;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 20, 32, 0.88);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  border: 2px dashed rgba(102, 252, 241, 0.55);
  border-radius: 12px;
  color: #66fcf1;
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.cmt-box.is-dragover .cmt-drop-overlay {
  opacity: 1;
  transform: scale(1);
}

/* --- Inline image inside a rendered comment --- */
.cmt-item-img-wrap {
  display: block;
  margin-top: 10px;
  border-radius: 8px;
  overflow: hidden;
  max-width: 320px;
  border: 1px solid rgba(102, 252, 241, 0.2);
  transition: border-color 0.15s ease, transform 0.2s ease;
}
.cmt-item-img-wrap:hover {
  border-color: rgba(102, 252, 241, 0.5);
  transform: translateY(-1px);
}
.cmt-item-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 260px;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.35);
}

/* --- Rendered markdown tags inside a comment body --- */
.cmt-item-body strong { color: #eaf6f6; font-weight: 700; }
.cmt-item-body em     { font-style: italic; color: #cde; }
.cmt-item-body del    { color: #6a8a8a; text-decoration: line-through; }
.cmt-item-body code {
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
  padding: 1px 6px;
  background: rgba(102, 252, 241, 0.08);
  border: 1px solid rgba(102, 252, 241, 0.2);
  border-radius: 4px;
  color: #66fcf1;
}
.cmt-item-body a {
  color: #66fcf1;
  border-bottom: 1px dotted rgba(102, 252, 241, 0.55);
  transition: color 0.15s ease, border-color 0.15s ease;
  overflow-wrap: anywhere;
}
.cmt-item-body a:hover {
  color: #a8fff8;
  border-bottom-style: solid;
  border-bottom-color: #a8fff8;
}

/* --- PRACTICE (rose forum) overrides for all new elements --- */
.practice .cmt-toolbar          { border-color: rgba(255, 111, 191, 0.26); }
.practice .cmt-toolbar-sep      { background: rgba(255, 111, 191, 0.22); }
.practice .cmt-tb-btn           { color: #f0bfda; }
.practice .cmt-tb-btn:hover,
.practice .cmt-tb-btn:focus-visible {
  background: rgba(255, 111, 191, 0.14);
  color: #ff6fbf;
  border-color: rgba(255, 111, 191, 0.4);
}
.practice .cmt-tb-btn.is-active {
  background: rgba(255, 111, 191, 0.22);
  color: #ff6fbf;
  border-color: rgba(255, 111, 191, 0.5);
}
/* Picker lives on <body> for correct fixed-position behavior — skin it via
   an explicit modifier class passed by JS. */
.cmt-emoji-picker--rose          { border-color: rgba(255, 111, 191, 0.4); }
.cmt-emoji-picker--rose::-webkit-scrollbar-thumb { background: rgba(255, 111, 191, 0.3); }
.cmt-emoji-picker--rose .cmt-emoji-btn:hover,
.cmt-emoji-picker--rose .cmt-emoji-btn:focus-visible { background: rgba(255, 111, 191, 0.22); }
.practice .cmt-attachment       { border-color: rgba(255, 111, 191, 0.32); }
.practice .cmt-attachment-img   { border-color: rgba(255, 111, 191, 0.32); }
.practice .cmt-drop-overlay {
  background: rgba(28, 6, 20, 0.88);
  border-color: rgba(255, 111, 191, 0.6);
  color: #ff6fbf;
}
.practice .cmt-item-img-wrap    { border-color: rgba(255, 111, 191, 0.25); }
.practice .cmt-item-img-wrap:hover { border-color: rgba(255, 111, 191, 0.55); }
.practice .cmt-item-body code {
  background: rgba(255, 111, 191, 0.08);
  border-color: rgba(255, 111, 191, 0.25);
  color: #ff6fbf;
}
.practice .cmt-item-body a {
  color: #ff6fbf;
  border-bottom-color: rgba(255, 111, 191, 0.55);
}
.practice .cmt-item-body a:hover {
  color: #ffc0e0;
  border-bottom-color: #ffc0e0;
}

@media (max-width: 560px) {
  .cmt-emoji-picker { grid-template-columns: repeat(5, 1fr); }
  .cmt-toolbar { padding: 5px; gap: 3px; }
  .cmt-tb-btn { min-width: 32px; height: 30px; } /* larger tap targets */
  .cmt-attachment-img { width: 48px; height: 48px; }
  .cmt-drop-overlay { font-size: 12px; letter-spacing: 0.04em; }
}

@media (prefers-reduced-motion: reduce) {
  .cmt-emoji-btn:hover,
  .cmt-item-img-wrap:hover { transform: none; }
  .cmt-drop-overlay { transition: none; }
}


