/* ui2.css — "Phosphor console", the new interface (s30).
 *
 * Every rule is scoped under `html.ui2`, a class set before first paint by the
 * inline script in index.html (default on; localStorage `und3r_ui` = 'old'
 * or ?ui=old turns it off). Without the class this file does nothing and
 * style.css renders the old interface untouched — the footer switch and the
 * `u` key flip between the two instantly.
 *
 * Same terminal soul, calmer chrome: monospace stays for signals, numbers and
 * labels; a condensed grotesk (Archivo) takes over names and sentences. Stroke
 * icons replace the emoji (labels are split into .emo + .lbl by i18n.js).
 */
@import url('https://fonts.googleapis.com/css2?family=Archivo:wdth,wght@62..125,400..700&display=swap');

/* Stroke icons (24 px grid) used as CSS masks — tinted with currentColor. */
html.ui2 {
  --i-share: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12'/%3E%3Cpath d='M7.5 7.5L12 3l4.5 4.5'/%3E%3Cpath d='M5 12v7a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-7'/%3E%3C/svg%3E");
  --i-theme: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8'/%3E%3Cpath d='M12 4a8 8 0 0 1 0 16z' fill='black'/%3E%3C/svg%3E");
  --i-panel: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='4.5' width='17' height='15' rx='2'/%3E%3Cpath d='M14.5 4.5v15'/%3E%3Cpath d='M8 10l2 2-2 2'/%3E%3C/svg%3E");
  --i-x: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E");
  --i-layers: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l9 5-9 5-9-5z'/%3E%3Cpath d='M3 13l9 5 9-5'/%3E%3C/svg%3E");
  --i-clock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M12 7.5V12l3 2'/%3E%3C/svg%3E");
  --i-target: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Ccircle cx='12' cy='12' r='4.5'/%3E%3Ccircle cx='12' cy='12' r='1' fill='black'/%3E%3C/svg%3E");
  --i-heart: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20s-7.5-4.6-7.5-10A4.3 4.3 0 0 1 12 7.4 4.3 4.3 0 0 1 19.5 10c0 5.4-7.5 10-7.5 10z'/%3E%3C/svg%3E");
  --i-pin: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-6.5-6-6.5-11a6.5 6.5 0 0 1 13 0c0 5-6.5 11-6.5 11z'/%3E%3Ccircle cx='12' cy='10' r='2.3'/%3E%3C/svg%3E");
  --i-news: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5h13v14H6a2 2 0 0 1-2-2z'/%3E%3Cpath d='M17 9h3v8a2 2 0 0 1-2 2'/%3E%3Cpath d='M7.5 9h6M7.5 12.5h6M7.5 16h4'/%3E%3C/svg%3E");
  --i-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4L2.8 19.5h18.4z'/%3E%3Cpath d='M12 10v4.5'/%3E%3Cpath d='M12 17.2v.1'/%3E%3C/svg%3E");
  --i-plane: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.8 19.2L16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z'/%3E%3C/svg%3E");
  --i-ship: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 21c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1 .6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1'/%3E%3Cpath d='M19.4 20A11.6 11.6 0 0 0 21 14l-9-4-9 4c0 2.9.9 5.3 2.8 7.8'/%3E%3Cpath d='M19 13V7a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v6'/%3E%3Cpath d='M12 10v4'/%3E%3Cpath d='M12 2v3'/%3E%3C/svg%3E");
  --i-orbit: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cellipse cx='12' cy='12' rx='10' ry='4' transform='rotate%28-25 12 12%29'/%3E%3C/svg%3E");
  --i-globe: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M3.5 12h17'/%3E%3Cpath d='M12 3.5c2.5 2.6 3.5 5.4 3.5 8.5s-1 5.9-3.5 8.5c-2.5-2.6-3.5-5.4-3.5-8.5s1-5.9 3.5-8.5z'/%3E%3C/svg%3E");
  --i-shield: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l7.5 3v5.5c0 4.5-3.2 8-7.5 9.5-4.3-1.5-7.5-5-7.5-9.5V6z'/%3E%3C/svg%3E");
  --i-spark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v4M12 17v4M3 12h4M17 12h4M6.5 6.5L9 9M15 15l2.5 2.5M17.5 6.5L15 9M9 15l-2.5 2.5'/%3E%3C/svg%3E");
  --i-quake: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12h4l2-6 3 12 2.5-9 1.5 3H21'/%3E%3C/svg%3E");
  --i-flame: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3c1 3.5 5 5.5 5 10a5 5 0 0 1-10 0c0-2.5 1.5-4 2.5-5 .3 1.5 1 2.5 2 3 .5-3 .5-5.5.5-8z'/%3E%3C/svg%3E");
  --i-cyclone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='2.5'/%3E%3Cpath d='M14.5 12A6.5 6.5 0 0 0 8 5.5'/%3E%3Cpath d='M9.5 12a6.5 6.5 0 0 0 6.5 6.5'/%3E%3Cpath d='M20 9.5a8.5 8.5 0 0 0-8-6'/%3E%3Cpath d='M4 14.5a8.5 8.5 0 0 0 8 6'/%3E%3C/svg%3E");
  --i-rocket: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z'/%3E%3Cpath d='M12 15l-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z'/%3E%3Cpath d='M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0'/%3E%3Cpath d='M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5'/%3E%3C/svg%3E");
  --i-dot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3.5' fill='black'/%3E%3C/svg%3E");
  --i-chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

/* ─── Tokens ─────────────────────────────────────────────────────────── */
html.ui2 {
  --u-sans: 'Archivo', 'Helvetica Neue', Helvetica, sans-serif;
  --u-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', monospace;
  --u-surface: rgba(7, 12, 14, 0.88);
  --u-solid: #090e10;
  --u-raised: rgba(255, 255, 255, 0.045);
  --u-raised-2: rgba(255, 255, 255, 0.08);
  --u-hair: rgba(150, 255, 215, 0.10);
  --u-hair-2: rgba(150, 255, 215, 0.20);
  --u-text-3: #7f8d98;          /* 5.7:1 on the panel */
  --u-cell: #0b1114;
  --u-ink: #03140e;             /* text on accent fills */
  --u-live: #d81f45;            /* white text 4.8:1 */
  --u-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  --u-r: 12px;
  /* signal colours (icons, counts, chips) */
  --sig-red: #ff5c77;
  --sig-amber: #ffb020;
  --sig-blue: #4cb4ff;
  --sig-violet: #b48cff;
  --sig-pink: #ff7ad1;
  --sig-orange: #ff8a3d;
}
html.ui2:not([data-theme="light"]) {
  --surface: rgba(7, 12, 14, 0.86);
  --border: rgba(150, 255, 215, 0.10);
  --border-strong: rgba(150, 255, 215, 0.22);
  --text: #dfe8ee;
  --text-dim: #9aa8b3;
  --text-bright: #f1f6f9;
}
/* Dusk theme keeps its palette; only the new-UI tokens adapt. */
html.ui2[data-theme="light"] {
  --u-surface: rgba(255, 255, 255, 0.94);
  --u-solid: #ffffff;
  --u-raised: rgba(15, 30, 45, 0.05);
  --u-raised-2: rgba(15, 30, 45, 0.09);
  --u-hair: rgba(20, 30, 45, 0.14);
  --u-hair-2: rgba(20, 30, 45, 0.28);
  --u-text-3: #4a5868;
  --u-cell: #f2f5f8;
  --u-ink: #ffffff;
  --u-live: #b3122b;
  --u-shadow: 0 10px 32px rgba(10, 30, 50, 0.22);
  --sig-red: #c0213f;
  --sig-amber: #9a5b00;
  --sig-blue: #0b5fa8;
  --sig-violet: #6a3fc0;
  --sig-pink: #a8306f;
  --sig-orange: #b04a0a;
}

/* ─── Base ───────────────────────────────────────────────────────────── */
html.ui2 body::after { opacity: 0.4; }               /* softer scanlines */
html.ui2 .emo { display: none; }                     /* emoji → stroke icons */
html.ui2 :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Names and sentences in the grotesk; data stays mono. */
html.ui2 :is(.layer-name, .panel-title, .preset-chip, .planet-btn, .info-title, .info-line,
  .news-now-title, .news-title, .news-chip, .news-close, .legend-name, .hud-bl a.status,
  .hud-bl button.status, .panel-reopen, .modal-panel, .kbd-help-panel, .onboard,
  .layer-search input, .search-empty, .info-act, .game-card, .rb-txt, .share-toast,
  .place-wx-txt, .place-wiki, .place-feat) {
  font-family: var(--u-sans);
  font-stretch: 92%;
}

/* One icon recipe: a masked ::before tinted with currentColor. Each element
   sets --ic (the shape) and optionally --ic-s (its size). */
html.ui2 :is(.btn-share, .btn-theme, .btn-collapse, .btn-game, .hud-bl .donate, .preset-chip,
  .time-btn[data-mode="replay"], .panel-reopen, .news-ico, .news-reopen, .info-pin)::before {
  content: '';
  display: inline-block;
  flex: none;
  width: var(--ic-s, 16px);
  height: var(--ic-s, 16px);
  background-color: currentColor;
  -webkit-mask: var(--ic) center / contain no-repeat;
  mask: var(--ic) center / contain no-repeat;
}

/* ─── Brand (top-left) ───────────────────────────────────────────────── */
html.ui2 .hud-tl { top: 24px; left: 28px; }
html.ui2 .logo {
  font-size: 25px;
  letter-spacing: -0.02em;
  text-shadow: 0 0 18px color-mix(in srgb, var(--accent) 35%, transparent);
}
html.ui2 .tagline {
  margin-top: 9px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--text-dim);
}
html.ui2[data-theme="light"] .hud-tl { border-radius: 10px; border-color: var(--u-hair); }
html.ui2[data-theme="light"] .logo { text-shadow: 0 1px 0 #fff; }
html.ui2[data-theme="light"] .legend { top: 104px; }

/* ─── Right panel ────────────────────────────────────────────────────── */
html.ui2 .panel {
  top: 20px;
  right: 20px;
  width: 344px;
  height: calc(100vh - 40px);
  height: calc(100dvh - 40px);
  max-height: none;
  background: var(--u-surface);
  border: 1px solid var(--u-hair);
  border-radius: var(--u-r);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--u-shadow);
  overflow: hidden;
  font-size: 13px;
}
html.ui2 .panel-header {
  flex: none;
  height: 62px;
  padding: 0 10px 0 18px;
  gap: 2px;
  border-bottom: 0;
  font-size: 13px;
  letter-spacing: 0;
}
html.ui2 .panel-header .dot { margin-right: 8px; }
html.ui2 .panel-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: lowercase;
  color: var(--text-bright);
}
html.ui2 .panel-title::first-letter { text-transform: uppercase; }
html.ui2 .btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 8px;
  color: var(--text-dim);
  transition: background 0.12s, color 0.12s;
}
html.ui2 .btn-icon:hover { background: var(--u-raised-2); color: var(--text-bright); }
html.ui2 .btn-lang { font-family: var(--u-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; }
html.ui2 :is(.btn-share, .btn-theme, .btn-collapse) { font-size: 0; --ic-s: 17px; }
html.ui2 .btn-share    { --ic: var(--i-share); }
html.ui2 .btn-theme    { --ic: var(--i-theme); }
html.ui2 .btn-collapse { --ic: var(--i-panel); }

html.ui2 .panel-body { padding: 0 0 12px; }
html.ui2 .panel-body::-webkit-scrollbar { width: 6px; }
html.ui2 .panel-body::-webkit-scrollbar-thumb { background: var(--u-hair-2); border-radius: 3px; }

/* Live / replay segmented control */
html.ui2 .time-ctrl { padding: 0 16px; margin: 0; border-bottom: 0; }
html.ui2 .time-mode {
  gap: 3px;
  padding: 3px;
  border-radius: 9px;
  background: var(--u-raised);
  border: 1px solid var(--u-hair);
}
html.ui2 .time-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 32px;
  padding: 0 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-family: var(--u-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-dim);
}
html.ui2 .time-btn:hover { color: var(--text-bright); border: 0; }
html.ui2 .time-btn.active {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  border: 0;
  text-shadow: none;
}
html.ui2 .time-btn[data-mode="replay"] { --ic: var(--i-clock); --ic-s: 14px; }
html.ui2 .time-date { margin-top: 8px; }
html.ui2 .time-date input[type="date"] {
  height: 36px;
  border-radius: 8px;
  background: var(--u-raised);
  border: 1px solid var(--u-hair);
  font-family: var(--u-mono);
}

/* Search */
html.ui2 .layer-search {
  position: sticky;
  top: 0;
  padding: 12px 16px 4px;
  background: var(--u-solid);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
html.ui2 .layer-search input {
  height: 40px;
  padding: 0 12px 0 38px;
  border-radius: 9px;
  font-size: 14px;
  color: var(--text-bright);
  background-color: var(--u-raised);
  border: 1px solid var(--u-hair);
  background-position: 13px center;
  background-size: 15px;
}
html.ui2 .layer-search input:focus {
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  background-color: var(--u-raised-2);
}
html.ui2 .layer-search input::placeholder { color: var(--u-text-3); }
html.ui2 .search-empty { font-style: normal; font-size: 13px; }

/* Quick views (presets) — a 4 × 2 grid of tiles */
html.ui2 .presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 16px 16px 4px;
  border-bottom: 0;
}
html.ui2 .presets::before {
  content: attr(data-label);
  grid-column: 1 / -1;
  margin-bottom: 2px;
  font-family: var(--u-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--u-text-3);
}
html.ui2 .preset-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  height: 58px;
  padding: 0 2px;
  border-radius: 9px;
  background: var(--u-raised);
  border: 1px solid var(--u-hair);
  color: var(--text);
  font-size: 11.5px;
  font-stretch: 80%;
  letter-spacing: 0;
  text-shadow: none;
  --ic-s: 18px;
  --pc: var(--accent);
}
html.ui2 .preset-chip .lbl { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
html.ui2 .preset-chip::before { color: var(--pc); }
html.ui2 .preset-chip:hover { background: var(--u-raised-2); border-color: var(--u-hair-2); color: var(--text-bright); }
html.ui2 .preset-chip.active {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--text-bright);
  text-shadow: none;
}
html.ui2 .preset-chip[data-preset="disasters"] { --ic: var(--i-alert);  --pc: var(--sig-red); }
html.ui2 .preset-chip[data-preset="air"]       { --ic: var(--i-plane);  --pc: var(--sig-amber); }
html.ui2 .preset-chip[data-preset="sea"]       { --ic: var(--i-ship);   --pc: var(--sig-blue); }
html.ui2 .preset-chip[data-preset="space"]     { --ic: var(--i-orbit);  --pc: var(--sig-violet); }
html.ui2 .preset-chip[data-preset="net"]       { --ic: var(--i-globe);  --pc: var(--sig-pink); }
html.ui2 .preset-chip[data-preset="threat"]    { --ic: var(--i-shield); --pc: var(--sig-orange); }
html.ui2 .preset-chip[data-preset="discover"]  { --ic: var(--i-spark);  --pc: var(--accent); }
html.ui2 .preset-chip[data-preset="_clear"]    { --ic: var(--i-x);      --pc: var(--text-dim); color: var(--text-dim); }
html.ui2 .preset-chip.clear:hover { border-color: color-mix(in srgb, var(--alert) 55%, transparent); color: var(--text-bright); }

/* Groups + planet switch */
html.ui2 .group { padding: 4px 8px 0; }
html.ui2 .group-planet { margin-top: 10px; }
html.ui2 .group-title {
  height: 36px;
  margin: 0;
  padding: 0 10px;
  font-family: var(--u-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--u-text-3);
}
html.ui2 .group-title-count { font-size: 10.5px; letter-spacing: 0; opacity: 1; color: var(--text-dim); }
html.ui2 .group-title-line { background: var(--u-hair); }
html.ui2 .group-title-chev { font-size: 11px; }
html.ui2 .planet-options {
  gap: 3px;
  margin: 2px 8px 8px;
  padding: 3px;
  border-radius: 9px;
  background: var(--u-raised);
  border: 1px solid var(--u-hair);
}
html.ui2 .planet-btn {
  height: 32px;
  padding: 0 4px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-dim);
}
html.ui2 .planet-btn:hover { color: var(--text-bright); border: 0; }
html.ui2 .planet-btn.active {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  border: 0;
  text-shadow: none;
}

/* Layer rows: the whole row is the switch */
html.ui2 .layer {
  gap: 12px;
  min-height: 52px;
  padding: 7px 10px;
  border-radius: 8px;
  background: none;
}
html.ui2 .layer::before { display: none; }
html.ui2 .layer:hover,
html.ui2 .layer.active { background: var(--u-raised); }
html.ui2 .layer.active:hover { background: var(--u-raised-2); }
html.ui2 .layer.disabled:hover { background: none; }
html.ui2 .layer-swatch {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  opacity: 1;
  box-shadow: none;
  background:
    radial-gradient(circle, var(--layer-color) 0 3.5px, transparent 4.5px),
    color-mix(in srgb, var(--layer-color) 10%, transparent);
}
html.ui2 .layer.active .layer-swatch {
  box-shadow: none;
  background:
    radial-gradient(circle, var(--layer-color) 0 4.5px, transparent 5.5px),
    color-mix(in srgb, var(--layer-color) 22%, transparent);
}
html.ui2 .layer-name { font-size: 14px; font-weight: 500; line-height: 1.25; color: var(--text); }
html.ui2 .layer.active .layer-name { color: var(--text-bright); }
html.ui2 .layer-desc { margin-top: 2px; font-family: var(--u-mono); font-size: 11px; color: var(--u-text-3); }
html.ui2 .layer-count {
  min-width: 0;
  font-family: var(--u-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--u-text-3);
}
html.ui2 .layer.active .layer-count { text-shadow: none; }
html.ui2 .layer:not(.active):not(.disabled) .layer-count { display: none; }
html.ui2 .layer-switch {
  display: block;
  position: relative;
  flex: none;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: var(--u-raised-2);
  box-shadow: inset 0 0 0 1px var(--u-hair);
  transition: background 0.15s;
}
html.ui2 .layer-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--u-text-3);
  transition: transform 0.15s, background 0.15s;
}
html.ui2 .layer.active .layer-switch { background: var(--accent); box-shadow: none; }
html.ui2 .layer.active .layer-switch::after { transform: translateX(14px); background: var(--u-ink); }
html.ui2 .layer.disabled .layer-switch { opacity: 0.5; }

html.ui2 .panel-footer {
  flex: none;
  align-items: center;
  height: 48px;
  padding: 0 18px;
  border-top: 1px solid var(--u-hair);
  font-family: var(--u-mono);
  font-size: 11px;
  letter-spacing: 0;
  color: var(--text-dim);
}
html.ui2 #totalCount { color: var(--text-bright); }

/* Re-open button (panel hidden) */
html.ui2 .panel-reopen {
  top: 20px;
  right: 20px;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--u-surface);
  border: 1px solid var(--u-hair);
  box-shadow: var(--u-shadow);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text-bright);
  --ic: var(--i-layers);
}
html.ui2 .panel.hidden ~ .panel-reopen { display: inline-flex; }
html.ui2 .panel-reopen:hover { border-color: var(--u-hair-2); color: var(--accent); }
html.ui2 .panel-reopen > span[data-i18n] { display: inline-block; text-transform: lowercase; }
html.ui2 .panel-reopen > span[data-i18n]::first-letter { text-transform: uppercase; }
html.ui2 .reopen-n:not([hidden]) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  font-family: var(--u-mono);
  font-size: 11px;
  font-weight: 600;
}

/* ─── LIVE headlines bar ─────────────────────────────────────────────── */
html.ui2 .news-bar {
  top: 22px;
  border-radius: 10px;
  background: var(--u-surface);
  border-color: var(--u-hair);
  box-shadow: var(--u-shadow);
}
html.ui2 .news-head { min-height: 46px; padding: 0 6px 0 8px; gap: 12px; }
html.ui2 .news-live {
  height: 26px;
  padding: 0 9px;
  border-radius: 6px;
  background: var(--u-live);
  font-family: var(--u-mono);
  font-size: 10.5px;
}
html.ui2 .news-now { gap: 10px; font-size: 14px; }
html.ui2 .news-now-title { font-weight: 600; color: var(--text-bright); }
html.ui2 .news-now .news-age { font-family: var(--u-mono); font-size: 11px; color: var(--text-dim); }
html.ui2 .news-badge { font-family: var(--u-mono); background: var(--u-live); }
html.ui2 .news-chev {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: var(--u-raised);
}
html.ui2 .news-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 0;
  color: var(--text-dim);
  --ic: var(--i-dot);
  --ic-s: 16px;
}
html.ui2 .news-ico[data-k="quake"]    { --ic: var(--i-quake);   color: var(--sig-red); }
html.ui2 .news-ico[data-k="disaster"] { --ic: var(--i-alert);   color: var(--sig-red); }
html.ui2 .news-ico[data-k="fire"]     { --ic: var(--i-flame);   color: var(--sig-orange); }
html.ui2 .news-ico[data-k="cyclone"]  { --ic: var(--i-cyclone); color: var(--sig-violet); }
html.ui2 .news-ico[data-k="launch"]   { --ic: var(--i-rocket);  color: var(--sig-violet); }
html.ui2 .news-ico[data-k="news"]     { --ic: var(--i-news);    color: var(--text-dim); }
html.ui2 .news-panel { border-top-color: var(--u-hair); }
html.ui2 .news-chips { gap: 6px; padding: 10px 10px 4px; }
html.ui2 .news-chip {
  height: 30px;
  padding: 0 11px;
  border-radius: 8px;
  border-color: var(--u-hair);
  font-size: 12.5px;
}
html.ui2 .news-chip.on {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}
html.ui2 .news-list { gap: 4px; padding: 6px 8px 8px; }
html.ui2 .news-item {
  gap: 11px;
  padding: 9px 10px;
  border-radius: 9px;
  background: var(--u-raised);
  border-color: transparent;
}
html.ui2 .news-item:hover,
html.ui2 .news-item:focus-visible { background: var(--u-raised-2); border-color: var(--u-hair-2); }
html.ui2 .news-item.is-red { border-left: 1px solid color-mix(in srgb, var(--alert) 55%, transparent); border-color: color-mix(in srgb, var(--alert) 55%, transparent); }
html.ui2 .news-title { font-size: 13.5px; }
html.ui2 .news-sub { font-family: var(--u-mono); font-size: 10.5px; color: var(--u-text-3); }
html.ui2 .news-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  border-color: var(--u-hair);
}
html.ui2 .news-foot { padding: 6px 10px; border-top-color: var(--u-hair); font-family: var(--u-mono); font-size: 10.5px; }
html.ui2 .news-close {
  height: 30px;
  padding: 0 10px;
  border-radius: 7px;
  border-color: var(--u-hair);
  font-size: 12.5px;
  letter-spacing: 0;
  text-transform: none;
}
html.ui2 .news-reopen {
  top: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--u-surface);
  border-color: var(--u-hair);
  color: var(--text);
  font-size: 0;
  --ic: var(--i-news);
  --ic-s: 18px;
}
html.ui2 .news-reopen[hidden] { display: none; }
/* Mid widths: the bar drops under the logo, the chips under the bar. */
@media (min-width: 721px) and (max-width: 1179px) {
  html.ui2 .news-bar { top: 86px; left: 28px; transform: none; width: min(460px, calc(100vw - 420px)); min-width: 0; }
  html.ui2 .news-reopen { left: 290px; transform: none; }
  html.ui2 body:has(.news-bar:not([hidden])) .legend { top: 146px; }
}
/* Wide screens: the bar sits right of the logo instead of dead centre. */
@media (min-width: 1180px) {
  html.ui2 .news-bar { left: 340px; transform: none; width: min(600px, calc(100vw - 340px - 404px)); }
  html.ui2 .news-reopen { left: 340px; transform: none; }
}

/* ─── Active layers: removable chips under the logo ──────────────────── */
html.ui2 .legend {
  top: 92px;
  left: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: auto;
  max-width: min(640px, calc(100vw - 440px));
  max-height: none;
  overflow: visible;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  font-size: 13px;
  pointer-events: none;
}
html.ui2 .legend-title { display: none; }
html.ui2 .legend-row {
  flex: none;
  height: 34px;
  padding: 0 9px 0 12px;
  gap: 8px;
  border-radius: 8px;
  background: var(--u-surface);
  border: 1px solid var(--u-hair);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
}
html.ui2 .legend-row:hover { opacity: 1; border-color: var(--u-hair-2); }
html.ui2 .legend-dot { box-shadow: none; }
html.ui2 .legend-name { flex: none; font-size: 13px; font-weight: 500; color: var(--text-bright); }
html.ui2 .legend-count { font-family: var(--u-mono); font-size: 12px; color: var(--text-dim); }
html.ui2 .legend-row::after {
  content: '';
  width: 12px;
  height: 12px;
  margin-left: 2px;
  background-color: var(--u-text-3);
  -webkit-mask: var(--i-x) center / contain no-repeat;
  mask: var(--i-x) center / contain no-repeat;
}
html.ui2 .legend-row:hover::after { background-color: var(--text-bright); }

/* ─── Event card (bottom-left) ───────────────────────────────────────── */
html.ui2 .info-panel {
  left: 28px;
  bottom: 76px;
  width: 372px;
  max-height: calc(100vh - 220px);
  padding: 14px 16px 16px;
  border-radius: var(--u-r);
  background: var(--u-surface);
  border: 1px solid var(--u-hair);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--info-color, var(--accent)) 60%, transparent), var(--u-shadow);
  font-size: 12px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
html.ui2 .info-panel.empty { display: none; }
html.ui2 .info-panel.pinned {
  border-left-width: 1px;
  box-shadow: inset 0 2px 0 var(--info-color, var(--accent)), var(--u-shadow);
}
html.ui2 .info-group {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-family: var(--u-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--info-color, var(--accent));
}
html.ui2 .info-pin {
  float: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  --ic: var(--i-pin);
  --ic-s: 12px;
}
html.ui2 .info-x {
  float: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: -8px -8px -8px auto;
  border-radius: 8px;
  font-size: 13px;
}
html.ui2 .info-x:hover { background: var(--u-raised-2); }
html.ui2 .info-pin + .info-x { margin-left: 4px; }
html.ui2 .info-title {
  margin-bottom: 4px;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.22;
  color: var(--text-bright);
  text-shadow: none;
}
html.ui2 .info-line { font-size: 13.5px; line-height: 1.4; color: var(--text-dim); }
html.ui2 .info-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 12px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--u-hair);
}
html.ui2 .info-details > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 11px;
  background: var(--u-cell);
}
html.ui2 .info-details > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
html.ui2 .info-details > div > span:first-child {
  font-family: var(--u-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--u-text-3);
}
html.ui2 .info-details > div > span:last-child {
  font-family: var(--u-mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-bright);
}
html.ui2 .info-img { border-radius: 8px; border-color: var(--u-hair); }
html.ui2 .info-acts { gap: 8px; margin-top: 12px; }
html.ui2 .info-act {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 13px;
  border-radius: 8px;
  border: 1px solid var(--u-hair-2);
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-bright);
}
html.ui2 .info-act:first-child { background: var(--accent); border-color: transparent; color: var(--u-ink); font-weight: 600; }
html.ui2 .info-act:hover { background: var(--u-raised-2); }
html.ui2 .info-act:first-child:hover { background: var(--accent); filter: brightness(1.08); }
html.ui2 .place-feat { border-radius: 8px; overflow: hidden; border-color: var(--u-hair); }

/* ─── Tooltips ───────────────────────────────────────────────────────── */
html.ui2 :is(.dtt, .tooltip) {
  border-radius: 8px;
  border: 1px solid var(--u-hair-2);
  padding: 8px 11px;
  background: var(--u-surface);
}

/* ─── Footer status bar ──────────────────────────────────────────────── */
html.ui2 .hud-bl {
  left: 28px;
  bottom: 20px;
  height: 40px;
  align-items: center;
  gap: 2px;
  padding: 0 4px 0 14px;
  border-radius: 10px;
  background: var(--u-surface);
  border: 1px solid var(--u-hair);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  font-size: 13px;
  letter-spacing: 0;
}
html.ui2 .hud-bl > .status:first-child { font-family: var(--u-mono); font-size: 11.5px; color: var(--text-dim); }
html.ui2 .hud-bl .dot-on { width: 7px; height: 7px; }
html.ui2 #utcClock {
  height: 16px;
  margin: 0 6px 0 10px;
  padding: 0 12px;
  border-left: 1px solid var(--u-hair-2);
  border-right: 1px solid var(--u-hair-2);
  font-family: var(--u-mono);
  font-size: 11.5px;
  color: var(--text-bright);
}
html.ui2 .hud-bl a.status,
html.ui2 .hud-bl button.status {
  height: 32px;
  margin: 0;
  padding: 0 9px;
  gap: 7px;
  border-radius: 7px;
  font-size: 13px;
  letter-spacing: 0;
  color: var(--text-dim);
  opacity: 1;
  text-shadow: none;
}
html.ui2 .hud-bl a.status:hover,
html.ui2 .hud-bl button.status:hover { background: var(--u-raised-2); color: var(--text-bright); text-decoration: none; }
html.ui2 .hud-bl .btn-game {
  height: 30px;
  margin-left: 6px;
  background: color-mix(in srgb, var(--sig-amber) 13%, transparent);
  color: var(--sig-amber) !important;
  font-weight: 600;
  --ic: var(--i-target);
  --ic-s: 15px;
}
html.ui2 .hud-bl .donate {
  color: var(--sig-red);
  font-weight: 600;
  --ic: var(--i-heart);
  --ic-s: 15px;
}
html.ui2 .hud-bl .donate:hover { text-shadow: none; color: var(--sig-red); }
html.ui2 .hud-bl .ui-toggle {
  gap: 0;
  height: 30px;
  margin-left: 6px;
  padding: 3px;
  border-radius: 8px;
  background: var(--u-raised);
  border: 1px solid var(--u-hair);
}
html.ui2 .hud-bl .ui-toggle:hover { background: var(--u-raised); }
html.ui2 .ui-toggle .ui-opt {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border: 0;
  border-radius: 5px;
  font-family: var(--u-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--u-text-3);
}
html.ui2 .ui-toggle:hover .ui-old { color: var(--text-bright); }
html.ui2 .ui-toggle[aria-pressed="true"] .ui-new {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
}

/* ─── Zoom: compact cluster at the bottom-right of the map ───────────── */
@media (min-width: 721px) {
  html.ui2 .zoom-ctrl {
    left: auto;
    right: 384px;
    top: auto;
    bottom: 20px;
    transform: none;
    gap: 0;
    width: 44px;
    padding: 0;
    border-radius: 10px;
    background: var(--u-surface);
    border: 1px solid var(--u-hair);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    transition: right 0.25s ease;
  }
  html.ui2 .panel.hidden ~ .zoom-ctrl { right: 20px; }
  html.ui2 .zoom-slider { display: none; }
  html.ui2 .zoom-btn {
    width: 44px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 400;
    color: var(--text-bright);
  }
  html.ui2 #zoomIn  { order: 0; }
  html.ui2 .zoom-label { order: 1; }
  html.ui2 #zoomOut { order: 2; }
  html.ui2 .zoom-btn:hover { background: var(--u-raised-2); color: var(--accent); box-shadow: none; }
  html.ui2 .zoom-label { line-height: 18px; font-family: var(--u-mono); font-size: 10.5px; letter-spacing: 0; color: var(--text-dim); }
}
/* Mid-width desktops: the footer reaches the zoom cluster — lift it, and
   let the footer scroll sideways rather than slide under the panel. */
@media (min-width: 721px) and (max-width: 1240px) {
  html.ui2 .zoom-ctrl { bottom: 72px; }
  html.ui2 .hud-bl {
    max-width: calc(100vw - 412px);
    overflow-x: auto;
    scrollbar-width: none;
    pointer-events: auto;
  }
  html.ui2 .hud-bl::-webkit-scrollbar { display: none; }
  html.ui2 .hud-bl > * { flex: none; }
  html.ui2 .hud-bl > .status:first-child span[data-i18n] { display: none; }
}

/* MapLibre controls: our zoom cluster replaces the +/− group; the map
   attribution sits in the 20 px strip under the panel instead of behind it. */
html.ui2 .maplibregl-ctrl-bottom-right .maplibregl-ctrl-group { display: none; }
@media (min-width: 721px) {
  html.ui2 .maplibregl-ctrl-bottom-right { right: 14px; bottom: 0; }
  html.ui2 .maplibregl-ctrl-bottom-right .maplibregl-ctrl-attrib { margin: 0 0 1px; }
}

/* ─── Dialogs, onboarding, toasts ────────────────────────────────────── */
html.ui2 .modal-panel {
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--u-hair-2);
  border-left-width: 1px;
  box-shadow: var(--u-shadow);
}
html.ui2 .modal-header {
  padding: 12px 10px 12px 16px;
  border-bottom-color: var(--u-hair);
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
}
html.ui2 .modal-title { font-weight: 600; color: var(--text-bright); }
html.ui2 .modal-title .cursor { color: var(--accent); }
html.ui2 .modal-close { width: 36px; height: 36px; margin: 0; padding: 0; border-radius: 8px; }
html.ui2 .modal-close:hover { background: var(--u-raised-2); }
html.ui2 .modal-body { padding: 16px; gap: 14px; }
html.ui2 .modal-label { font-family: var(--u-mono); font-size: 10.5px; letter-spacing: 0.12em; color: var(--u-text-3); }
html.ui2 .modal-row :is(select, input[type="text"], textarea) {
  padding: 10px 12px;
  border-radius: 8px;
  border-color: var(--u-hair-2);
  background: var(--u-raised);
  font-family: var(--u-sans);
  font-stretch: 92%;
  font-size: 14px;
}
html.ui2 .modal-row :is(select, input[type="text"], textarea):focus { border-color: var(--accent); background: var(--u-raised-2); }
html.ui2 .modal-submit {
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 9px;
  background: var(--accent);
  color: var(--u-ink);
  font-family: var(--u-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
html.ui2 .modal-submit:hover:not(:disabled) { background: var(--accent); color: var(--u-ink); box-shadow: none; filter: brightness(1.08); }

html.ui2 .kbd-help-panel {
  min-width: 340px;
  padding: 20px 22px;
  border-radius: 14px;
  border: 1px solid var(--u-hair-2);
  border-left-width: 1px;
}
html.ui2 .kbd-help-title {
  margin-bottom: 10px;
  font-family: var(--u-sans);
  font-stretch: 92%;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-bright);
}
html.ui2 .kbd-help-title::first-letter { text-transform: uppercase; }
html.ui2 .kbd-help-row { padding: 7px 0; border-bottom: 1px solid var(--u-hair); font-size: 14px; }
html.ui2 .kbd-help-row kbd, html.ui2 .onboard kbd {
  display: inline-block;
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--u-raised-2);
  border: 1px solid var(--u-hair-2);
  font-family: var(--u-mono);
  font-size: 11.5px;
  text-align: center;
  color: var(--text-bright);
}
html.ui2 .kbd-help-hint { font-family: var(--u-mono); font-size: 11px; }

html.ui2 .onboard {
  bottom: 80px;
  max-width: 400px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--u-hair-2);
  border-left-width: 1px;
  box-shadow: var(--u-shadow);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
}
html.ui2 .onboard-title { margin-bottom: 8px; font-family: var(--u-mono); font-size: 11px; letter-spacing: 0.1em; }
html.ui2 .onboard-actions { flex-wrap: wrap; margin-top: 14px; }
html.ui2 .onboard-btn {
  height: 38px;
  padding: 0 14px;
  border-radius: 9px;
  border-color: var(--u-hair-2);
  font-family: var(--u-sans);
  font-stretch: 92%;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text);
}
html.ui2 .onboard-btn.primary {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent);
}

html.ui2 .share-toast { border-radius: 10px; border: 1px solid var(--u-hair-2); font-size: 14px; }
html.ui2 .radio-bar { border-radius: 12px; }
html.ui2 .rb-btn { width: 34px; height: 34px; border-radius: 8px; border-color: var(--u-hair-2); }
html.ui2 .game-card {
  border-radius: 14px;
  border: 1px solid var(--u-hair);
  box-shadow: inset 0 2px 0 #ffd166, var(--u-shadow);
  font-size: 13px;
}
html.ui2 .game-photo { margin-top: -12px; }
html.ui2 .game-btn { height: 38px; padding: 0 14px; border-radius: 9px; font-family: var(--u-sans); font-size: 13.5px; }
html.ui2 .radar-chip { border-radius: 8px; font-family: var(--u-mono); }

/* ─── Phones ─────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  html.ui2 .hud-tl { top: 12px; left: 16px; transform: none; }
  html.ui2 .logo { font-size: 20px; }
  html.ui2 .tagline { display: none; }
  html.ui2[data-theme="light"] .hud-tl { padding: 6px 10px; }

  html.ui2 .news-bar { top: 52px; left: 12px; right: 12px; border-radius: 12px; }
  html.ui2 .news-head { min-height: 46px; gap: 10px; }
  html.ui2 .news-live { height: 24px; padding: 0 7px; font-size: 10px; letter-spacing: 0.08em; }
  html.ui2 .news-now { font-size: 14px; }
  html.ui2 .news-chev { width: 36px; height: 36px; }
  html.ui2 .news-item { padding: 11px 10px; }
  html.ui2 .news-reopen { top: 10px; right: 12px; left: auto; transform: none; width: 44px; height: 44px; }

  /* Active chips: one swipeable row under the headlines */
  html.ui2 .legend {
    top: 108px;
    left: 12px;
    right: 12px;
    max-width: none;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  html.ui2 .legend::-webkit-scrollbar { display: none; }
  html.ui2 .legend-row { height: 36px; border-radius: 10px; }

  /* Panel → bottom sheet */
  html.ui2 .panel {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: auto;
    max-height: 82vh;
    max-height: 82dvh;
    padding-top: 10px;
    padding-bottom: env(safe-area-inset-bottom);
    border: 0;
    border-top: 1px solid var(--u-hair-2);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.55);
  }
  html.ui2 .panel::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    width: 36px;
    height: 4px;
    margin-left: -18px;
    border-radius: 2px;
    background: var(--u-hair-2);
  }
  html.ui2 .panel.hidden { transform: translateY(105%); }
  html.ui2 .panel-header { height: 52px; padding: 0 6px 0 16px; }
  html.ui2 .panel-title { font-size: 19px; }
  html.ui2 .btn-icon { width: 44px; height: 44px; }
  html.ui2 .btn-collapse { --ic: var(--i-x); --ic-s: 19px; }
  html.ui2 .layer-search input { height: 44px; padding-right: 12px; font-size: 16px; }
  html.ui2 .time-btn { height: 38px; font-size: 11.5px; }
  html.ui2 .planet-btn { height: 38px; font-size: 14px; }
  html.ui2 .preset-chip { height: 64px; font-size: 12px; --ic-s: 20px; }
  html.ui2 .layer { min-height: 60px; }
  html.ui2 .layer-name { font-size: 15px; }
  html.ui2 .layer-desc { font-size: 11.5px; }
  html.ui2 .layer-switch { width: 40px; height: 24px; }
  html.ui2 .layer-switch::after { width: 20px; height: 20px; }
  html.ui2 .layer.active .layer-switch::after { transform: translateX(16px); }

  /* Re-open: a pill above the footer */
  html.ui2 .panel-reopen {
    top: auto;
    right: auto;
    left: 50%;
    bottom: calc(66px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    height: 48px;
    padding: 0 18px 0 16px;
    gap: 10px;
    border-radius: 999px;
    border-color: var(--u-hair-2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    font-size: 15px;
    --ic-s: 19px;
  }

  /* Footer: one swipeable bar */
  html.ui2 .hud-bl {
    left: 12px;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    height: 46px;
    padding: 0 6px 0 12px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    border-radius: 12px;
    pointer-events: auto;
  }
  html.ui2 .hud-bl::-webkit-scrollbar { display: none; }
  html.ui2 .hud-bl > * { flex: none; order: 3; }
  html.ui2 .hud-bl > .status:first-child,
  html.ui2 #utcClock { order: 1; }
  html.ui2 .hud-bl .ui-toggle { order: 2; margin: 0 6px 0 0; }   /* visible without swiping */
  html.ui2 .hud-bl > .status:first-child span[data-i18n] { display: none; }
  html.ui2 #utcClock { margin: 0 8px 0 8px; padding: 0 10px; border-right: 0; }
  html.ui2 .hud-bl a.status,
  html.ui2 .hud-bl button.status { height: 38px; }
  html.ui2 .hud-bl .btn-game { height: 34px; }
  html.ui2 .hud-bl .ui-toggle { height: 34px; }
  html.ui2 .ui-toggle .ui-opt { height: 26px; }

  /* Event card → bottom sheet (pinned only) */
  html.ui2 .info-panel {
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-height: 58vh;
    padding: 20px 16px calc(18px + env(safe-area-inset-bottom));
    border: 0;
    border-top: 1px solid color-mix(in srgb, var(--info-color, var(--accent)) 45%, transparent);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5);
  }
  html.ui2 .info-panel.pinned { box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5); }
  html.ui2 .info-title { font-size: 21px; }
  html.ui2 .info-act { height: 44px; padding: 0 16px; font-size: 14px; }
  html.ui2 .info-x { width: 44px; height: 44px; }

  html.ui2 .maplibregl-ctrl-bottom-right { bottom: calc(118px + env(safe-area-inset-bottom)); }

  html.ui2 .onboard { bottom: calc(126px + env(safe-area-inset-bottom)); max-width: none; width: calc(100vw - 24px); }
  html.ui2 .onboard-btn { height: 44px; }
}
