/* ══════════════════════════════════════════════════════
   map-core.css — Shared styles for all Harrison Bored
   Nether mapping tools (seed map, netherite finder, etc.)
   ══════════════════════════════════════════════════════ */

@font-face {
  font-family: 'Zurich';
  src: url('../ZurichCondMono.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ── Theme variables ── */
:root {
  --bg-grad-a: #2a28c4;
  --bg-grad-b: #2424b8;
  --bg-grad-c: #2020a8;
  --bg-grad-d: #1a1890;
  --nav-bg: rgba(30,26,160,0.5);
  --border: rgba(255,255,255,0.08);
  --border-light: rgba(255,255,255,0.14);
  --orange: #d4803a;
  --orange-dim: #a06028;
  --diamond: #6fe3e8; /* Diamond Finder accent — icy teal from its depth scale */
  --text: #e8e6f0;
  --text-muted: rgba(255,255,255,0.55);
  --text-sub: rgba(255,255,255,0.38);
  --text-faint: rgba(255,255,255,0.22);
  --map-bg: #0a0a14;
  --map-loading-bg: #0a0a14;
  --input-bg: rgba(255,255,255,0.05);
  --font-brand: 'Zurich', 'Courier New', monospace;
  --font-data: 'IBM Plex Mono', 'Courier New', monospace;
}

/* ── Dark mode overrides ── */
body.dark-mode {
  --bg-grad-a: #1a1212;
  --bg-grad-b: #1e1414;
  --bg-grad-c: #1c1010;
  --bg-grad-d: #150c0c;
  --nav-bg: rgba(20,12,12,0.7);
  --border: rgba(255,255,255,0.07);
  --border-light: rgba(255,255,255,0.12);
  --text: #ddd8d0;
  --text-muted: rgba(220,210,200,0.55);
  --text-sub: rgba(220,210,200,0.38);
  --text-faint: rgba(220,210,200,0.20);
  --map-bg: #080608;
  --map-loading-bg: #080608;
  --input-bg: rgba(255,255,255,0.04);
}
body.dark-mode .bg-layer {
  background: linear-gradient(180deg, var(--bg-grad-a) 0%, var(--bg-grad-b) 40%, var(--bg-grad-c) 70%, var(--bg-grad-d) 100%);
}

html { font-size: 15px; }
body {
  font-family: var(--font-data);
  background: #2226b0;
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.bg-layer {
  position: fixed; inset: 0; z-index: 0;
  background: linear-gradient(180deg, var(--bg-grad-a) 0%, var(--bg-grad-b) 40%, var(--bg-grad-c) 70%, var(--bg-grad-d) 100%);
  transition: background 0.4s ease;
}
.bg-grain {
  position: fixed; inset: 0; z-index: 1; opacity: 0.10; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}
.bg-vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(to right, rgba(10,8,60,0.15) 0%, transparent 12%, transparent 88%, rgba(10,8,60,0.15) 100%),
    linear-gradient(to bottom, rgba(10,8,60,0.10) 0%, transparent 10%, transparent 92%, rgba(10,8,60,0.12) 100%);
}

/* --- Consistently Styled Labels --- */
.info-heading, .dev-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--orange);
  margin-bottom: 1.2rem;
  font-weight: 600;
  display: block;
}

/* Ensure Zurich is preserved for main headers */
.tool-title, .info-title {
  font-family: 'Zurich', sans-serif;
}

/* ── Nav ── */
nav {
  position: relative; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem 2.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--nav-bg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: background 0.4s ease;
}
.nav-brand {
  display: flex; align-items: center; gap: 0.55rem;
  text-decoration: none; cursor: pointer; transition: opacity 0.2s;
}
.nav-brand:hover { opacity: 0.8; }
.nav-brand-icon { width: 32px; height: 26px; object-fit: contain; }
.nav-brand-text {
  font-family: var(--font-brand); font-size: 0.95rem;
  color: var(--text-muted); letter-spacing: 0.06em;
}
.nav-right {
  display: flex; align-items: center; gap: 2.2rem;
  position: absolute; left: 50%; transform: translateX(-50%);
}
.nav-actions { display: flex; align-items: center; gap: 0.8rem; }
.nav-links { display: flex; gap: 2.2rem; list-style: none; }
.nav-links a {
  font-family: var(--font-brand); font-size: 0.82rem;
  color: var(--text-muted); text-decoration: none; letter-spacing: 0.04em;
  transition: color 0.2s; cursor: pointer;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--orange); }
/* Diamond Finder's nav entry accents diamond-teal (its icy depth-scale
   palette) instead of the site orange, in both hover and current-page
   states, wherever it appears in the ribbon or dropdown. */
.nav-links a[href="/diamond-finder/"]:hover { color: var(--diamond, #6fe3e8); }
.nav-links a[href="/diamond-finder/"].active { color: var(--diamond, #6fe3e8); }

/* "Minecraft Tools" ribbon dropdown — desktop hovers to reveal, mobile shows
   both links inline (no hover on touch, so just leave it expanded there) */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
  font-family: var(--font-brand); font-size: 0.82rem;
  color: var(--text-muted); letter-spacing: 0.04em; cursor: pointer;
  text-decoration: none; display: inline-block;
  transition: color 0.2s;
}
.nav-dropdown-toggle:hover { color: var(--text); }
.nav-dropdown-toggle.active { color: var(--orange); }
.nav-dropdown-menu {
  display: none; list-style: none; position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%); margin: 0; padding: 1.15rem 0 0.35rem;
  background: rgba(30,26,160,0.93); border: 1px solid var(--border-light);
  border-radius: 6px; width: max-content; z-index: 110;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  text-align: center;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 26px, #000 100%);
  mask-image: linear-gradient(to bottom, transparent, #000 26px, #000 100%);
}
.nav-dropdown-menu li { padding: 0; }
.nav-dropdown-menu a { display: block; padding: 0.4rem 0.85rem; white-space: nowrap; }
.nav-dropdown:hover .nav-dropdown-menu { display: block; }

/* Dark mode toggle button */
.darkmode-btn {
  background: none; border: 1px solid var(--border-light); cursor: pointer;
  color: var(--text-muted); font-family: var(--font-data); font-size: 0.65rem;
  padding: 0.3rem 0.6rem; letter-spacing: 0.05em; transition: all 0.2s;
  display: flex; align-items: center; gap: 0.35rem;
}
.darkmode-btn:hover { border-color: var(--orange-dim); color: var(--orange); }
.darkmode-btn-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-faint); transition: background 0.3s;
}
body.dark-mode .darkmode-btn-dot { background: var(--orange); }

/* ── Tool page layout ── */
.tool-page { max-width: 1100px; margin: 0 auto; padding: 1.8rem 2.5rem 3rem; position: relative; z-index: 2; }

.tool-header { margin-bottom: 1.4rem; position: relative; }
.tool-title {
  font-family: var(--font-brand); font-size: 3.0rem;
  color: var(--text); letter-spacing: 0.03em;
}
.tool-subtitle {
  font-family: var(--font-data); font-size: 0.72rem;
  color: var(--text-sub); margin-top: 0.35rem; line-height: 1.5;
}

.controls-block { margin-bottom: 1.2rem; overflow: visible; }

/* Seed row */
.seed-row {
  display: flex; align-items: center; gap: 0.6rem; margin-bottom: 2rem; flex-wrap: wrap;
}
.control-group { display: flex; flex-direction: column; gap: 0.2rem; }
.control-group-horiz { display: flex; align-items: center; gap: 0.4rem; }
.live-coord-row { display: none; }
.live-coord-cell { display: none; }
.live-coord-label { display: none; }
.control-label {
  font-family: var(--font-data); font-size: 0.62rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em;
}
.seed-input {
  background: var(--input-bg); border: 1px solid var(--border-light);
  color: var(--text); font-family: var(--font-data); font-size: 0.8rem;
  padding: 0.42rem 0.7rem; width: 200px; outline: none; transition: border-color 0.2s;
}
.seed-input:focus { border-color: var(--orange-dim); }
.coord-input {
  background: var(--input-bg); border: 1px solid var(--border);
  color: var(--text); font-family: var(--font-data); font-size: 0.8rem;
  padding: 0.42rem 0.5rem; width: 80px; outline: none; text-align: center;
  transition: border-color 0.2s;
}
.coord-input:focus { border-color: var(--orange-dim); }
.edition-select {
  background: var(--input-bg); border: 1px solid var(--border);
  color: var(--text); font-family: var(--font-data); font-size: 0.72rem;
  padding: 0.38rem 0.5rem; outline: none; cursor: pointer;
  transition: border-color 0.2s; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='rgba(255,255,255,0.35)'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 6px center; padding-right: 22px;
}
.edition-select:focus { border-color: var(--orange-dim); }
.edition-select option { background: #1a1860; color: var(--text); }
.reset-btn {
  background: transparent; border: 1px solid var(--border-light);
  color: var(--text-faint); font-family: var(--font-brand); font-size: 0.78rem;
  padding: 0.42rem 1.0rem; cursor: pointer; letter-spacing: 0.05em;
  transition: all 0.2s;
}
.reset-btn:hover { border-color: var(--text-faint); color: var(--text-sub); }
.seed-input-wrap {
  position: relative; display: inline-flex;
}
.seed-input-wrap .seed-input {
  padding-right: 2.8rem;
}
.rand-btn {
  position: absolute; right: 1px; top: 1px; bottom: 1px;
  background: transparent; border: none; border-left: 1px solid var(--border-light);
  color: var(--text);
  padding: 0 0.5rem; cursor: pointer;
  transition: background 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.rand-btn:hover { background: rgba(255,255,255,0.04); }
.rand-btn:hover svg { opacity: 0.65; }

.seed-btn {
  background: rgba(212,128,58,0.08); border: 1px solid var(--orange-dim);
  color: var(--orange); font-family: var(--font-brand); font-size: 0.78rem;
  padding: 0.42rem 1.8rem; cursor: pointer; letter-spacing: 0.05em;
  transition: all 0.2s; margin-left: 0.8rem;
}
.seed-btn:hover { border-color: var(--orange); background: rgba(212,128,58,0.16); }

/* Y-level input (used for overhang on seed map, terrain level on netherite finder) */
.ylevel-input, .overhang-input {
  background: var(--input-bg); border: 1px solid var(--border-light);
  color: var(--text); font-family: var(--font-data); font-size: 0.75rem;
  padding: 0.38rem 0.45rem; width: 52px; text-align: center; outline: none;
  -moz-appearance: textfield; appearance: textfield;
  transition: border-color 0.2s;
}
.ylevel-input::-webkit-outer-spin-button,
.ylevel-input::-webkit-inner-spin-button,
.overhang-input::-webkit-outer-spin-button,
.overhang-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ylevel-input:focus, .overhang-input:focus { border-color: var(--orange-dim); }

/* Live coord readout */
.coord-wrap {
  position: relative;
  display: inline-flex;
  flex-direction: column;
}
.coord-group { display: flex; align-items: center; gap: 0.4rem; }
.live-coord {
  position: absolute;
  top: calc(100% + 0.3rem);
  width: 80px; right: 0; left: auto;
  text-align: center;
  font-family: var(--font-data); font-size: 0.92rem; font-weight: 600;
  color: var(--orange-dim); letter-spacing: 0.02em;
  white-space: nowrap; pointer-events: none;
  transition: color 0.15s;
}
.live-coord.active { color: var(--orange); }

/* Toggle row */
.toggle-row { display: flex; align-items: center; gap: 1.1rem; }
.toggle-item {
  font-family: var(--font-data); font-size: 0.62rem; font-weight: 500;
  color: var(--text-sub); display: flex; align-items: center; gap: 0.3rem;
  cursor: pointer; user-select: none; transition: color 0.2s;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.toggle-item:hover { color: var(--text-muted); }
.toggle-item.active { color: var(--text-muted); }
.toggle-dot { width: 6px; height: 6px; border-radius: 50%; border: 1px solid var(--text-sub); transition: all 0.2s; }
.toggle-dot.on { background: var(--orange-dim); border-color: var(--orange); }

/* Structure / overlay toggle wrapper — hosts hover dropdown */
.struct-toggle-wrap {
  position: relative;
}
/* Dropdown panel — appended to body at runtime, fixed position avoids all clipping */
.struct-filter-dropdown {
  display: none;
  position: fixed;
  z-index: 9999;
  background: rgba(8,7,18,0.82);
  border: 1px solid var(--border-light);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 0.45rem 0.6rem;
  min-width: 150px;
}
.struct-filter-dropdown.visible {
  display: flex;
  flex-direction: column;
}
.struct-filter-row {
  display: flex; align-items: center; gap: 0.35rem;
  font-family: var(--font-data); font-size: 0.60rem; font-weight: 500;
  color: var(--text-sub); cursor: pointer; user-select: none;
  text-transform: uppercase; letter-spacing: 0.04em;
  padding: 0.28rem 0.1rem;
  transition: color 0.15s;
}
.struct-filter-row.has-icon { justify-content: space-between; }
.struct-filter-row.has-icon > span:not(.toggle-dot) { flex: 1; }
.struct-filter-header {
  display: flex; align-items: center; justify-content: space-between; gap: 0.35rem;
  font-family: var(--font-data); font-size: 0.60rem; font-weight: 600;
  color: var(--text-sub); text-transform: uppercase; letter-spacing: 0.06em;
  padding: 0.28rem 0.1rem 0.1rem;
  pointer-events: none; user-select: none;
}
.struct-filter-header > span { flex: 1; }
.struct-filter-row:hover { color: var(--text-muted); }
.struct-filter-row.active { color: var(--text-muted); }
.struct-filter-divider {
  height: 1px; background: var(--border); margin: 0.3rem 0;
}
.struct-filter-icon {
  width: 16px; height: 16px;
  image-rendering: pixelated;
  opacity: 0.75;
  flex-shrink: 0;
}

/* Share button — top-right of map */
.share-btn {
  position: absolute; top: 30px; right: 10px; z-index: 10;
  background: rgba(7,6,15,0.78); border: 1px solid var(--border-light);
  color: var(--text-muted); font-family: var(--font-data); font-size: 0.58rem;
  padding: 0.32rem 0.65rem; cursor: pointer; letter-spacing: 0.06em;
  text-transform: uppercase; transition: all 0.2s;
  backdrop-filter: blur(4px); white-space: nowrap;
}
.share-btn:hover { border-color: var(--orange-dim); color: var(--orange); background: rgba(212,128,58,0.08); }
.share-btn.copied { border-color: var(--orange); color: var(--orange); }
.share-btn.hidden { opacity: 0; pointer-events: none; }

/* Map area */
.map-wrap { width: 100%; position: relative; margin-bottom: 0.5rem; }
.map-container {
  width: 100%; aspect-ratio: 16/10; max-height: 560px;
  background: var(--map-bg); border: 1px solid var(--border-light);
  position: relative; overflow: hidden; cursor: crosshair;
  transition: background 0.3s;
}
.map-container.cursor-pointer { cursor: pointer; }
.map-container canvas { display: block; width: 100%; height: 100%; }

/* Coordinate rulers */
.ruler-x {
  position: absolute; top: 0; left: 22px; right: 0; height: 20px;
  display: block; width: calc(100% - 22px);
  pointer-events: none; z-index: 5;
}
.ruler-z {
  position: absolute; top: 20px; left: 0; bottom: 0; width: 22px;
  display: block; height: calc(100% - 20px);
  pointer-events: none; z-index: 5;
}
.ruler-corner {
  position: absolute; top: 0; left: 0; width: 22px; height: 20px;
  z-index: 6; pointer-events: none;
  background: rgba(0,0,0,0.42);
  border-right: 1px solid rgba(255,255,255,0.14);
  border-bottom: 1px solid rgba(255,255,255,0.14);
}

/* Icon overlay — HTML layer on top of canvas (structures, debris, etc.) */
.struct-overlay, .icon-overlay {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}
.struct-icon, .map-icon, .debris-icon {
  /* Themable icon glow palette — override per-page or per-class to retint.
     Each value is "r, g, b" (no rgba wrapper) so opacity can vary per layer. */
  --icon-rest-glow:    245, 220, 180;   /* pale parchment — at-rest halo */
  --icon-active-glow:  255, 210, 130;   /* warm orange — star ray color */
  --icon-active-core:  255, 230, 180;   /* hot center of the sparkle */
  --icon-active-fade:  255, 170, 60;    /* mid-radius fade tone */

  position: absolute; transform: translate(-50%, -50%);
  pointer-events: all; cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.struct-icon img, .map-icon img, .debris-icon img {
  display: block; width: 48px; height: 48px;
  image-rendering: pixelated;
  /* Rest: pale parchment halo for at-a-glance visibility against every biome */
  filter:
    drop-shadow(0 0 4px rgba(var(--icon-rest-glow), 0.50))
    drop-shadow(0 0 1px rgba(var(--icon-rest-glow), 0.65))
    drop-shadow(0 1px 3px rgba(0,0,0,0.9));
}
.struct-icon:hover img, .map-icon:hover img, .debris-icon:hover img {
  /* Hover: subtle warm img-halo so the star sparkle behind dominates */
  filter:
    drop-shadow(0 0 2px rgba(var(--icon-active-glow), 0.55))
    drop-shadow(0 1px 3px rgba(0,0,0,0.85));
}
.struct-icon.selected img, .map-icon.selected img, .debris-icon.selected img {
  /* Selected: brighter img-halo, paired with a wider star sparkle */
  filter:
    drop-shadow(0 0 3px rgba(var(--icon-active-core), 0.75))
    drop-shadow(0 1px 3px rgba(0,0,0,0.85));
}

/* 4-point star sparkle behind icon — appears on hover & selected.
   Built from a radial gradient (hot core) plus two perpendicular thin
   linear gradients with transparent endpoints (tapered rays). */
.struct-icon::before, .map-icon::before, .debris-icon::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 90px; height: 90px;
  transform: translate(-50%, -50%) scale(0.55);
  background:
    radial-gradient(circle at center,
      rgba(var(--icon-active-core), 0.78) 0%,
      rgba(var(--icon-active-fade), 0.30) 13%,
      rgba(var(--icon-active-fade), 0) 48%),
    linear-gradient(to bottom,
      rgba(var(--icon-active-glow), 0) 3%,
      rgba(var(--icon-active-glow), 1) 50%,
      rgba(var(--icon-active-glow), 0) 97%),
    linear-gradient(to right,
      rgba(var(--icon-active-glow), 0) 3%,
      rgba(var(--icon-active-glow), 1) 50%,
      rgba(var(--icon-active-glow), 0) 97%);
  background-size: 100% 100%, 1.6px 100%, 100% 1.6px;
  background-position: center, center, center;
  background-repeat: no-repeat;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease-out, transform 0.18s ease-out;
}
.struct-icon:hover::before, .map-icon:hover::before, .debris-icon:hover::before {
  opacity: 0.9;
  transform: translate(-50%, -50%) scale(1);
}
.struct-icon.selected::before, .map-icon.selected::before, .debris-icon.selected::before {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.35);
}
.struct-icon .struct-label, .map-icon .icon-label {
  position: absolute; top: calc(100% + 3px); left: 50%; transform: translateX(-50%);
  font-family: var(--font-data); font-size: 8px; font-weight: 600;
  color: var(--text-muted); white-space: nowrap;
  background: rgba(7,6,15,0.82); padding: 1px 4px;
  pointer-events: none; opacity: 0; transition: opacity 0.15s;
}
.struct-icon:hover .struct-label, .map-icon:hover .icon-label { opacity: 1; }

/* Popup — one shared style for every selected-icon info box on every map
   page (structures, debris, diamonds): square corners (matches the map's
   own grid), solid near-opaque background, no blur, no zoom scaling. Fixed
   screen-pixel size regardless of map zoom, positioned with enough
   clearance above the icon that it never covers the icon it describes. */
.struct-popup, .icon-popup, .debris-popup {
  position: absolute; z-index: 20;
  background: rgba(12,10,22,0.94); border: 1px solid var(--border-light);
  padding: 0.55rem 0.75rem; pointer-events: none; min-width: 130px;
}
.struct-popup-name, .icon-popup-name, .debris-popup-name {
  font-family: var(--font-data); font-size: 0.72rem; font-weight: 600;
  color: var(--orange); margin-bottom: 0.2rem;
}
.struct-popup-coords, .icon-popup-coords, .debris-popup-coords {
  font-family: var(--font-data); font-size: 0.65rem;
  color: var(--text-muted);
}

/* Biome legend */
.biome-legend {
  position: absolute; bottom: 10px; left: 32px; z-index: 10;
  background: rgba(7,6,15,0.78); border: 1px solid rgba(255,255,255,0.08);
  padding: 0.45rem 0.6rem; pointer-events: none;
  backdrop-filter: blur(4px);
  transition: opacity 0.2s;
}
.biome-legend.hidden { opacity: 0; pointer-events: none; }
.biome-legend-title {
  font-family: var(--font-data); font-size: 0.52rem; font-weight: 600;
  color: var(--text-sub); text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
}
.biome-row {
  display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.22rem;
}
.biome-row:last-child { margin-bottom: 0; }
.biome-swatch { width: 8px; height: 8px; flex-shrink: 0; }
.biome-name {
  font-family: var(--font-data); font-size: 0.55rem;
  color: var(--text-sub); white-space: nowrap;
}

/* Legend minimize (standard across all map pages). A legend adopts this by
   wrapping its title + a .legend-min button in a .legend-head, and its rows
   in a .legend-body, then adding .legend-panel to its own root class. The
   .legend-min button always keeps its own pointer-events so it's clickable
   even inside a .biome-legend, which is pointer-events:none by default for
   pages with a short static legend (diamond-finder's scrolling biome list is
   the one page that page-scopes the whole panel to pointer-events:auto). */
.legend-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.6rem; margin-bottom: 0.35rem;
}
.legend-head .biome-legend-title { margin-bottom: 0; }
.legend-min {
  background: none; border: none; cursor: pointer; padding: 0 2px;
  font-family: var(--font-data); font-size: 0.6rem; line-height: 1;
  color: var(--text-sub); transition: color 0.15s;
  pointer-events: auto;
}
.legend-min:hover { color: var(--text); }
.legend-panel.collapsed .legend-head { margin-bottom: 0; }
.legend-panel.collapsed .legend-body { display: none; }

.map-loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: var(--map-loading-bg); z-index: 5; transition: opacity 0.5s;
}
.map-loading.hidden { opacity: 0; pointer-events: none; }
.map-loading-text {
  font-family: var(--font-data); font-size: 0.72rem;
  color: rgba(255,255,255,0.18); letter-spacing: 0.05em;
}

/* Status bar */
.map-status-row {
  display: flex; align-items: center; justify-content: flex-end;
  margin-bottom: 1.6rem; padding: 0 0.1rem;
}
.map-status { font-family: var(--font-data); font-size: 0.56rem; color: var(--text-faint); }

/* Info section */
.tool-info {
  display: flex; gap: 2.5rem; padding-top: 1.4rem;
  border-top: 1px solid var(--border);
}
.info-col { flex: 1; }
.info-text {
  font-family: var(--font-data); font-size: 0.65rem;
  color: var(--text-muted); line-height: 1.7;
}
.info-text a { color: var(--orange-dim); text-decoration: none; transition: color 0.2s; }
.info-text a:hover { color: var(--orange); }

/* Footer */
footer {
  position: relative; z-index: 2; border-top: 1px solid var(--border);
  padding: 1rem 2.5rem; display: flex; justify-content: space-between; align-items: center;
}
.footer-left { font-family: var(--font-data); font-size: 0.6rem; color: var(--text-faint); }
.footer-center { font-family: var(--font-data); font-size: 0.6rem; color: var(--text-faint); }
.footer-contact { color: var(--text-faint); text-decoration: none; transition: color 0.2s; }
.footer-contact:hover { color: var(--text-muted); }
.footer-right { display: flex; gap: 1.5rem; }
.footer-right a {
  font-family: var(--font-data); font-size: 0.6rem;
  color: var(--text-faint); text-decoration: none; transition: color 0.2s;
}
.footer-right a:hover { color: var(--text-muted); }

/* Waypoint markers */
.waypoint-marker {
  position: absolute; transform: translate(-50%, -100%);
  pointer-events: all; cursor: default; z-index: 15;
}
.waypoint-pin { display: flex; flex-direction: column; align-items: center; }
.waypoint-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #e8c060; border: 2px solid rgba(255,255,255,0.8);
  box-shadow: 0 0 6px rgba(232,192,96,0.6), 0 1px 3px rgba(0,0,0,0.8);
}
.waypoint-label {
  background: rgba(10,8,20,0.72); border: 1px solid rgba(232,192,96,0.35);
  border-radius: 6px;
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  padding: 2px 6px; margin-bottom: 3px;
  font-family: var(--font-data); font-size: 0.58rem; font-weight: 600;
  color: #e8c060; white-space: nowrap;
  text-align: center; line-height: 1.4;
  /* Interactive (no pointer-events:none): the marker's contextmenu handler
     must catch right-clicks on the label too, so right-clicking anywhere on
     the waypoint box removes it instead of falling through to the map and
     spawning a second waypoint. Left-drag still pans (bubbles to the map
     container's own listeners). */
}
.waypoint-label span { display: block; font-size: 0.5rem; color: rgba(232,192,96,0.65); font-weight: 400; }

/* Animations */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.anim { animation: fadeUp 0.5s ease-out both; }
.d1{animation-delay:.04s}.d2{animation-delay:.10s}.d3{animation-delay:.18s}.d4{animation-delay:.27s}.d5{animation-delay:.36s}

/* Dev log / changelog */
.dev-footer {
  max-width: 900px;
  margin: 6rem auto 2rem;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  border-top: 1px solid var(--border);
  padding-top: 3rem;
}
.dev-entry {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 0.8rem;
  font-size: 0.85rem;
  line-height: 1.4;
}
.dev-date {
  color: var(--text-muted);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.support p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.support-link {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--orange);
  transition: color 0.2s;
}
.support-link:hover {
  color: var(--orange);
}

/* ── Cross-promo banner — frontier broadside ── */
.promo-banner {
  position: absolute;
  top: 0; right: 0;
  z-index: 10;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s ease, filter 0.25s ease;
}
.promo-banner:hover { transform: translateY(-1px) scale(1.02); filter: brightness(1.1); }
.promo-banner:active { transform: translateY(1px) scale(0.99); }

.promo-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: linear-gradient(145deg, rgba(50,32,16,0.94) 0%, rgba(38,24,12,0.96) 100%);
  border: 2px solid #7a5535;
  border-radius: 5px;
  padding: 0.45rem 0.65rem;
  position: relative;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(180,130,70,0.12),
    inset 0 1px 0 rgba(255,200,100,0.06),
    0 3px 16px rgba(0,0,0,0.45);
}
.promo-card::before {
  content: ''; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px; opacity: 0.05; pointer-events: none;
}
.promo-card::after {
  content: ''; position: absolute; inset: 3px;
  border: 1px solid rgba(180,130,70,0.18); border-radius: 3px; pointer-events: none;
}

.promo-img {
  flex-shrink: 0;
  width: 44px; height: 44px;
  image-rendering: pixelated;
  border: 1px solid rgba(180,130,70,0.3);
  border-radius: 2px;
  position: relative; z-index: 1;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6));
}

.promo-text { position: relative; z-index: 1; }

.promo-headline {
  font-family: var(--font-brand);
  font-size: 0.82rem;
  color: #e8c060;
  line-height: 1.2;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.promo-headline em {
  font-style: normal;
  color: #d4803a;
}

.promo-cta {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--font-data);
  font-size: 0.5rem;
  letter-spacing: 0.04em;
  color: rgba(210,170,110,0.55);
  white-space: nowrap;
  transition: color 0.2s;
}
.promo-cta .promo-cta-arrow {
  display: inline-block;
  transition: transform 0.2s;
}
.promo-banner:hover .promo-cta { color: rgba(210,170,110,0.8); }
.promo-banner:hover .promo-cta-arrow { transform: translateX(3px); }

/* ── Floating ad banner ── */
.ad-banner {
  position: fixed;
  bottom: 1.2rem;
  right: 1.2rem;
  z-index: 200;
  cursor: pointer;
  border-radius: 10px;
  border: 2px solid rgba(180,130,70,0.55);
  overflow: hidden;
  box-shadow: 0 4px 32px rgba(0,0,0,0.6);
  transition: box-shadow 0.3s ease, transform 0.25s ease, border-color 0.3s ease;
  display: block;
  text-decoration: none;
}
.ad-banner:hover {
  border-color: rgba(212,128,58,0.9);
  box-shadow: 0 4px 32px rgba(0,0,0,0.7), 0 0 18px 4px rgba(212,128,58,0.35);
  transform: translateY(-2px);
}
.ad-banner img {
  display: block;
  height: 162px;
  width: auto;
  max-width: 90vw;
  object-fit: cover;
}
.ad-close {
  position: absolute;
  top: 5px; right: 6px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(180,130,70,0.4);
  color: rgba(210,170,110,0.7);
  font-size: 13px;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, box-shadow 0.2s, background 0.2s;
  z-index: 201;
  font-family: var(--font-data);
  user-select: none;
}
.ad-close:hover {
  color: #fff;
  border-color: rgba(212,128,58,0.9);
  background: rgba(30,15,5,0.85);
  box-shadow: 0 0 8px 2px rgba(212,128,58,0.45);
}
@media (max-width: 700px) {
  .ad-banner img { height: 108px; }
}

/* ── Fullscreen button — glass style matching legend / share ── */
.fullscreen-btn {
  position: absolute;
  bottom: 8px; right: 8px;
  top: auto; left: auto;
  z-index: 15;
  background: rgba(7,6,15,0.78);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  font-family: var(--font-data);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.32rem 0.65rem;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  user-select: none;
  white-space: nowrap;
}
.fullscreen-btn:hover {
  border-color: var(--orange-dim);
  color: var(--orange);
  background: rgba(212,128,58,0.08);
}
.map-container:-webkit-full-screen { width: 100vw !important; height: 100vh !important; }
.map-container:-moz-full-screen    { width: 100vw !important; height: 100vh !important; }
.map-container:fullscreen          { width: 100vw !important; height: 100vh !important; }
/* Pseudo-fullscreen fallback for iPhone Safari (no Fullscreen API on non-video elements) */
.map-container.pseudo-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important; /* dynamic viewport — survives iOS URL bar show/hide */
  max-width: none !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  z-index: 9999 !important;
  margin: 0 !important;
  border-radius: 0 !important;
}
body.pseudo-fullscreen-active { overflow: hidden; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .dev-footer { grid-template-columns: 1fr; gap: 2rem; }
}

/* ── Hamburger menu (mobile only) ── */
.nav-hamburger {
  display: none;
  background: none; border: none; cursor: pointer; padding: 4px;
  flex-direction: column; gap: 4px; justify-content: center;
  z-index: 102;
}
.nav-hamburger span {
  display: block; width: 20px; height: 2px;
  background: var(--text-muted);
  transition: transform 0.25s, opacity 0.25s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 700px) {
  nav { padding: 0.7rem 1.2rem; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .nav-brand-text { display: none; }

  .nav-hamburger { display: flex; }

  .nav-right {
    position: fixed; top: 0;
    /* left: 50% survives from the base (desktop, centered) .nav-right rule
       above unless reset here - with left, right, AND width all set on a
       fixed box, the spec drops "right" and positions from "left" instead,
       so the panel lands ~mid-screen instead of flush against the true
       right edge. */
    left: auto; right: 0;
    width: 180px; height: 100vh;
    background: rgba(12,10,22,0.97);
    border-left: 1px solid var(--border);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    flex-direction: column; align-items: flex-start;
    padding: 4rem 1.4rem 2rem;
    gap: 0.6rem;
    transform: translateX(100%);
    transition: transform 0.3s ease, visibility 0.3s;
    visibility: hidden;
    z-index: 101;
  }
  .nav-right.open { transform: translateX(0); visibility: visible; }
  /* Real tap targets, not just the bare text line - each link was only
     ~16px tall with ~10px gaps (measured on a live device), well under the
     ~44px touch-target guideline, so an imprecise tap could land on the
     wrong adjacent link ("hit-box" mis-clicks per Harrison's report).
     Padding does the spacing now, so gap can shrink without the rows
     visually crowding. */
  .nav-links { flex-direction: column; gap: 0.1rem; }
  .nav-links > li > a, .nav-dropdown-toggle {
    display: block; padding: 0.55rem 0; font-size: 0.92rem;
  }

  /* no hover on touch — just leave the Minecraft Tools sub-links expanded */
  .nav-dropdown { display: flex; flex-direction: column; gap: 0; }
  .nav-dropdown-toggle { font-size: 0.78rem; color: var(--text-sub, var(--text-muted)); padding-bottom: 0.3rem; }
  .nav-dropdown-menu {
    display: flex; flex-direction: column; gap: 0;
    position: static; transform: none; margin: 0 0 0 0.8rem;
    background: none; border: none; padding: 0; min-width: 0;
    backdrop-filter: none;
    /* the desktop top-fade mask (above) survives into this stacked mobile
       list unless reset - it faded the first nested link toward invisible
       against the dark panel. */
    mask-image: none; -webkit-mask-image: none;
  }
  /* A fixed dash anchors the eye at a consistent point instead of relying
     on each destination name's own glyph shape - the Zurich font's capital
     letters render with different left-side bearing per letter (measured:
     up to ~7px difference between "N" and "D"), which reads as inconsistent
     indentation even though the underlying box positions are identical. */
  .nav-dropdown-menu a {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 0; font-size: 0.88rem;
  }
  .nav-dropdown-menu a::before {
    content: '\2013'; color: var(--text-faint); flex-shrink: 0;
  }

  /* Dark mode + hamburger stay visible in ribbon */
  .nav-actions { display: flex; align-items: center; gap: 0.8rem; }
  .darkmode-btn { font-size: 0.55rem; padding: 0.22rem 0.5rem; }

  .tool-page { padding: 1.2rem 1rem 2rem; }
  .seed-input { width: 140px; }
  .coord-input { width: 64px; }
  .seed-row { gap: 0.4rem; }
  .tool-info { flex-direction: column; gap: 1rem; }
  footer { padding: 0.8rem 1.2rem; flex-wrap: wrap; gap: 0.4rem; }
  .struct-icon img, .map-icon img, .debris-icon img { width: 36px; height: 36px; }
  .struct-icon::before, .map-icon::before, .debris-icon::before { width: 72px; height: 72px; }
  /* left was 6px, well inside the 22px-wide Z ruler strip along the map's
     left edge (.ruler-z), so the legend painted right over the live Z
     coordinates there. 26px clears it. */
  .biome-legend { bottom: 6px; left: 26px; padding: 0.28rem 0.38rem; }
  /* Live X/Z readout under the coordinate inputs is a hover-tracking
     feature with no equivalent on touch (no persistent pointer position),
     and a tap's synthetic mousemove event could activate it and leave it
     stuck showing, overlapping nearby controls (e.g. Advanced Options).
     Disabled outright on mobile per Harrison's call - desktop-only feature. */
  .live-coord { display: none !important; }
  .biome-legend-title { font-size: 0.38rem; margin-bottom: 0.2rem; }
  .biome-swatch { width: 5px; height: 5px; }
  .biome-name { font-size: 0.38rem; }
  .biome-row { gap: 0.25rem; margin-bottom: 0.14rem; }
  .promo-banner { position: relative; top: auto; right: auto; margin-top: 0.6rem; margin-bottom: 0.4rem; }

  /* Fullscreen button — icon only on mobile */
  .fullscreen-btn .fs-label { display: none; }
  .fullscreen-btn .fs-icon { font-size: 1.1rem; }
  .fullscreen-btn { padding: 0.3rem 0.5rem; line-height: 1; }
}

/* Overlay to close menu when tapping outside */
.nav-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 100;
}
/* Right edge stops where the 180px nav panel begins — prevents overlay from
   swallowing touch events that should reach the nav links on iOS. */
.nav-overlay.open { display: block; right: 180px; }

/* ── Reference section (Tier 2 SEO content) ── */
.tool-reference {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.tool-reference h2 {
  font-family: var(--font-data);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 1.1rem;
}
.tool-reference-intro {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-muted);
  margin-bottom: 1.6rem;
  max-width: 56rem;
}
.tool-reference-intro p { margin-bottom: 0.7rem; }
.tool-reference-intro p:last-child { margin-bottom: 0; }
.ref-details {
  border-top: 1px solid var(--border);
}
.ref-details:last-of-type {
  border-bottom: 1px solid var(--border);
}
.ref-summary {
  font-family: var(--font-data);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  padding: 0.95rem 0.2rem;
  list-style: none;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  transition: color 0.2s;
}
.ref-summary:hover { color: var(--orange); }
.ref-summary::-webkit-details-marker { display: none; }
.ref-summary::before {
  content: '+';
  display: inline-block;
  width: 0.85rem;
  font-size: 1rem;
  color: var(--orange-dim);
  font-weight: 400;
  transition: color 0.2s;
}
.ref-details[open] > .ref-summary::before {
  content: '−';
  color: var(--orange);
}
.ref-details[open] > .ref-summary { color: var(--orange); }
.ref-body {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text-muted);
  padding: 0 0.2rem 1.2rem 1.5rem;
  max-width: 56rem;
}
.ref-body p { margin-bottom: 0.7rem; }
.ref-body p:last-child { margin-bottom: 0; }
.ref-body strong { color: var(--text); font-weight: 600; }
.ref-body em { color: var(--text); font-style: italic; }
.ref-body code {
  font-family: var(--font-data);
  font-size: 0.82rem;
  background: rgba(255,255,255,0.05);
  padding: 0.05rem 0.35rem;
  border: 1px solid var(--border);
  color: var(--text);
}
.ref-body ul { margin: 0.4rem 0 0.7rem 1.2rem; }
.ref-body li { margin-bottom: 0.4rem; }
.ref-body a { color: var(--orange-dim); text-decoration: underline; text-decoration-color: var(--orange-dim); }
.ref-body a:hover { color: var(--orange); text-decoration-color: var(--orange); }

@media (max-width: 640px) {
  .ref-summary { font-size: 0.85rem; padding: 0.85rem 0.1rem; }
  .ref-body { font-size: 0.85rem; padding: 0 0.1rem 1rem 1.3rem; }
}

/* ── Advanced settings (shared across all tool pages) ──
   Restyled 2026-07-19 from a small dim underlined link into a visible
   bordered control: these panels hold parameters most visitors actually
   want (Y ranges, min vein size, terrain levels), not niche debug knobs,
   so the entry point should read as a feature, not fine print. */
.advanced-details { margin-top: 0.15rem; margin-bottom: 0.9rem; }
.advanced-summary {
  font-family: var(--font-data); font-size: 0.78rem; font-weight: 600;
  color: var(--orange); cursor: pointer; letter-spacing: 0.05em;
  text-transform: uppercase;
  list-style: none; user-select: none;
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.42rem 0.85rem;
  border: 1px solid rgba(212,128,58,0.45);
  background: rgba(212,128,58,0.07);
  transition: border-color 0.2s, background 0.2s;
}
.advanced-summary::before {
  content: '\25B8'; /* ▸ */
  font-size: 0.85rem; line-height: 1;
  transition: transform 0.2s;
}
.advanced-details[open] > .advanced-summary::before { transform: rotate(90deg); }
.advanced-summary:hover {
  border-color: var(--orange); background: rgba(212,128,58,0.14);
}
.advanced-summary::-webkit-details-marker { display: none; }
.advanced-panel {
  display: flex; align-items: center; gap: 0.6rem;
  margin-top: 0.6rem; padding: 0.6rem 0.8rem;
  border: 1px solid var(--border); background: rgba(255,255,255,0.015);
  flex-wrap: wrap;
}
.adv-slider {
  width: 120px; margin-left: 0.45rem; accent-color: var(--orange);
  cursor: pointer; vertical-align: middle;
}

/* ── Related tools cards ("More from Harrison Bored") ── */
.related-tools { margin-top: 1.5rem; margin-bottom: 2.5rem; }
.related-tools-label {
  font-family: var(--font-data); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--orange-dim); margin-bottom: 0.85rem;
}
.related-tools-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.related-card {
  display: flex; flex-direction: column; padding: 1.05rem 1.15rem;
  border: 1px solid var(--border); background: rgba(255,255,255,0.018);
  text-decoration: none; color: inherit; position: relative;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.related-card:hover {
  border-color: rgba(212,128,58,0.6); background: rgba(212,128,58,0.04);
  transform: translateY(-2px);
}
.related-card-icon {
  position: absolute; top: 1.05rem; right: 1.15rem;
  width: 34px; height: 34px;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}
.related-card-eyebrow {
  font-family: var(--font-data); font-size: 0.65rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--orange-dim); margin-bottom: 0.35rem;
  padding-right: 2.75rem;
}
.related-card-title {
  font-family: var(--font-data); font-size: 1.05rem; font-weight: 600;
  color: var(--text); margin-bottom: 0.45rem; letter-spacing: 0.01em;
  padding-right: 2.75rem;
}
.related-card:hover .related-card-title { color: var(--orange); }
.related-card-desc {
  font-size: 0.88rem; line-height: 1.55; color: var(--text-muted);
  margin-bottom: 0.85rem; flex: 1;
}
.related-card-cta {
  font-family: var(--font-data); font-size: 0.72rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--orange-dim);
  display: inline-flex; align-items: center; gap: 0.4rem;
  transition: color 0.2s, gap 0.2s;
}
.related-card:hover .related-card-cta { color: var(--orange); gap: 0.55rem; }
.related-card-cta::after {
  content: '\2192'; font-size: 0.95rem; display: inline-block;
  transition: transform 0.2s;
}
.related-card:hover .related-card-cta::after { transform: translateX(2px); }
/* Diamond Finder's card accents teal on hover, matching its nav treatment */
.related-card[href="/diamond-finder/"]:hover { border-color: rgba(111,227,232,0.55); background: rgba(111,227,232,0.05); }
.related-card[href="/diamond-finder/"]:hover .related-card-title,
.related-card[href="/diamond-finder/"]:hover .related-card-cta { color: var(--diamond); }
@media (max-width: 700px) {
  .related-tools-grid { grid-template-columns: 1fr; gap: 0.7rem; }
  .related-card { padding: 0.95rem 1rem; }
  .related-card-title { font-size: 1rem; }
  .related-card-desc { font-size: 0.85rem; }
}
