/* ══════════════════════════════════════════════════════════════════════════
   style.css — Gnoke GeoCompass
   Accent: Ocean Navy #1b4d6e
   Light theme: clean sea-foam white, navy topbar
   Dark theme:  deep maritime navy — NOT brown; high contrast, fully readable
   Copyright © 2026 Edmund Sparrow — GNU GPL v3
   ══════════════════════════════════════════════════════════════════════════ */


/* ── 1. TOKENS ──────────────────────────────────────────────────────────── */
:root {
  /* ── Page surfaces ── */
  --bg:        #f2f7fa;   /* sea-foam off-white */
  --bg2:       #e4eef4;
  --surface:   #ffffff;
  --surface2:  #f6fafb;
  --surface3:  #edf4f8;

  /* ── Text ── */
  --text:      #0d2b3e;   /* deep ocean, not pure black */
  --text2:     #2d5268;
  --muted:     #6a8fa3;

  /* ── Borders ── */
  --border:    #cfe0ea;
  --border2:   #b0ccd9;

  /* ── Accent — ocean navy ── */
  --accent:    #1b4d6e;
  --accent-dk: #143d57;
  --accent-lt: #daeaf4;
  --accent-txt:#0d2b3e;
  --accent-dim:color-mix(in srgb, #1b4d6e 10%, transparent);

  /* ── Status ── */
  --green:     #1a6647;
  --green-lt:  #d4f0e4;
  --red:       #b03030;
  --red-lt:    #fde8e8;
  --danger:    #dc2626;

  /* ── Topbar — fully themed, no hardcoded colours ── */
  --topbar-bg:    #1b4d6e;   /* accent fill in light mode */
  --topbar-bdr:   #143d57;
  --topbar-txt:   #ffffff;
  --topbar-muted: rgba(255,255,255,.55);
  --topbar-h:     52px;

  /* ── Typography ── */
  --font-sans:    'DM Sans', system-ui, sans-serif;
  --font-mono:    'DM Mono', monospace;
  --font-display: 'Playfair Display', serif;

  /* ── Shape & shadow ── */
  --radius:       10px;
  --radius-lg:    14px;
  --shadow:       0 1px 4px rgba(13,43,62,.07), 0 2px 12px rgba(13,43,62,.05);
  --shadow-lg:    0 4px 24px rgba(13,43,62,.14);
  --transition:   0.18s ease;
}


/* ── Dark theme — deep maritime navy, high contrast ── */
[data-theme="dark"] {
  /* Page surfaces — navy slate, not brown */
  --bg:        #0c1c2b;
  --bg2:       #101f2e;
  --surface:   #132333;
  --surface2:  #1a2d3e;
  --surface3:  #1f3347;

  /* Text — clean and readable against navy */
  --text:      #e8f3f9;   /* bright blue-white — high contrast */
  --text2:     #9bbfd4;
  --muted:     #6b9ab4;   /* visible blue-grey, not brown */

  /* Borders */
  --border:    #1e3347;
  --border2:   #264660;

  /* Accent adjustments for dark */
  --accent-lt: #0e2233;
  --accent-txt:#9bbfd4;
  --accent-dim:color-mix(in srgb, #1b4d6e 18%, transparent);

  /* Status */
  --green:     #2a9e6a;
  --green-lt:  #0d2c20;
  --red:       #e05252;
  --red-lt:    #2c0f0f;

  /* Topbar — darkest navy strip */
  --topbar-bg:    #0a1826;
  --topbar-bdr:   #132333;
  --topbar-txt:   #e8f3f9;
  --topbar-muted: #5a889e;
}


/* ── 2. RESET ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: var(--font-sans);
  background: var(--bg); color: var(--text);
  line-height: 1.55; min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overflow: hidden; display: flex; flex-direction: column;
  transition: background .2s, color .2s;
}
a { text-decoration: none; color: inherit; }
input, select, textarea, button { font-family: var(--font-sans); font-size: inherit; }


/* ── 3. LOADING OVERLAY ─────────────────────────────────────────────────── */
#loading-overlay {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 16px; z-index: 999;
}
.loader-dots { display: flex; gap: 6px; }
.loader-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); animation: blink 1.2s infinite;
}
.loader-dot:nth-child(2) { animation-delay: .2s; }
.loader-dot:nth-child(3) { animation-delay: .4s; }
@keyframes blink {
  0%, 80%, 100% { opacity: .2; transform: scale(.8); }
  40%           { opacity: 1;  transform: scale(1);  }
}
.loader-text {
  font-family: var(--font-mono); font-size: .7rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}


/* ── 4. TOPBAR ──────────────────────────────────────────────────────────── */
#topbar {
  height: var(--topbar-h);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-bdr);
  display: flex; align-items: center;
  gap: 10px; padding: 0 16px;
  flex-shrink: 0; z-index: 100;
  transition: background .2s;
}

/* Hamburger */
#hamburger {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.08);
  color: var(--topbar-txt);
  font-size: 16px; cursor: pointer;
  display: none; align-items: center; justify-content: center;
  transition: background var(--transition);
}
#hamburger:hover { background: rgba(255,255,255,.15); }

/* Brand */
#brand {
  display: flex; align-items: baseline; gap: 6px;
  text-decoration: none; flex-shrink: 0; cursor: pointer;
}
#brand-gnoke {
  font-family: var(--font-mono);
  font-size: .62rem; letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(255,255,255,.65);   /* slightly dimmed on the navy bar */
}
#brand-app {
  font-family: var(--font-display);
  font-size: 1.05rem; font-weight: 700;
  color: var(--topbar-txt); letter-spacing: -.01em;
}

/* Context info */
#context-info {
  font-family: var(--font-mono); font-size: .68rem;
  letter-spacing: .04em; color: var(--topbar-muted); margin-left: 4px;
}

.topbar-spacer { flex: 1; }

/* Desktop menus */
.menu-group { display: flex; gap: 2px; }
.menu { position: relative; }
.menu-btn {
  background: transparent; border: none;
  color: var(--topbar-txt); font-family: var(--font-sans);
  font-size: .82rem; padding: 6px 10px;
  cursor: pointer; border-radius: 5px;
  transition: background var(--transition);
  opacity: .85;
}
.menu-btn:hover { background: rgba(255,255,255,.1); opacity: 1; }
.menu-content {
  display: none; position: absolute; top: calc(100% + 6px); left: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; min-width: 160px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  padding: 4px; z-index: 200;
}
.menu:hover .menu-content,
.menu:focus-within .menu-content { display: flex; flex-direction: column; }
.menu-content button, .menu-content a {
  background: none; border: none; text-align: left;
  padding: 8px 12px; font-family: var(--font-sans);
  font-size: .82rem; color: var(--text);
  cursor: pointer; border-radius: 5px; display: block;
  text-decoration: none; transition: background var(--transition);
}
.menu-content button:hover,
.menu-content a:hover { background: var(--accent-dim); color: var(--accent); }
.menu-content hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; }
.menu-content .danger-item { color: var(--danger); }

/* Topbar right */
#topbar-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* Status chip */
#status-chip {
  font-family: var(--font-mono); font-size: .6rem;
  letter-spacing: .1em; text-transform: uppercase;
  background: rgba(255,255,255,.1); color: rgba(255,255,255,.7);
  padding: 3px 8px; border-radius: 20px;
  opacity: 0; transition: opacity .3s; pointer-events: none;
}
#status-chip.show { opacity: 1; }

/* Icon buttons */
.icon-btn {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.08);
  color: var(--topbar-txt); cursor: pointer; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), border-color var(--transition);
}
.icon-btn:hover {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.4);
}


/* ── 5. PAGES ────────────────────────────────────────────────────────────── */
.pages { flex: 1; overflow: hidden; position: relative; }
.page  { position: absolute; inset: 0; overflow-y: auto; display: none; }
.page.active { display: block; animation: fadeUp .22s ease forwards; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-content {
  max-width: 860px; margin: 0 auto;
  padding: 28px 20px 60px;
}

.page-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 16px;
  margin-bottom: 24px; flex-wrap: wrap;
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: 1.7rem; font-weight: 700;
  color: var(--text); letter-spacing: -.02em;
}
.page-header .sub {
  font-family: var(--font-mono);
  font-size: .68rem; letter-spacing: .06em;
  color: var(--muted); margin-top: 4px;
}


/* ── 6. CARDS ────────────────────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  box-shadow: var(--shadow);
}
.card-title {
  font-family: var(--font-display);
  font-size: 1rem; font-weight: 600; color: var(--text);
  margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.hint { font-size: .82rem; font-weight: 300; color: var(--muted); line-height: 1.65; }
.hint strong { color: var(--text); font-weight: 600; }


/* ── 7. BUTTONS ──────────────────────────────────────────────────────────── */
.btn {
  padding: 9px 16px; border-radius: 8px; border: none;
  font-family: var(--font-sans); font-size: .82rem; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: opacity var(--transition), transform var(--transition),
              background var(--transition);
  white-space: nowrap;
}
.btn:active { opacity: .85; transform: scale(.98); }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dk); }

.btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-danger  { background: var(--danger); color: #fff; }

.btn-outline {
  background: transparent; color: var(--accent);
  border: 1.5px solid var(--accent);
}
.btn-outline:hover { background: var(--accent-lt); }

.btn-sm { padding: 6px 12px; font-size: .76rem; }


/* ── 8. FORM ELEMENTS ────────────────────────────────────────────────────── */
label {
  display: block; font-family: var(--font-mono);
  font-size: .68rem; font-weight: 500; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text2); margin-bottom: 5px;
}
input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
textarea,
select {
  width: 100%; padding: 8px 12px;
  border: 1.5px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text);
  font-size: .88rem; font-family: var(--font-sans);
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-lt);
}

/* ── Placeholder contrast ── */
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: var(--surface2);
  border-color: var(--border2);
}


/* ── 9. TABLES ───────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: left; }
th {
  background: var(--surface2);
  font-family: var(--font-mono); font-size: .62rem;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); font-weight: 500;
}
th.num, td.num { text-align: right; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface2); }
.empty-cell { text-align: center; color: var(--muted); padding: 2.5rem; }

.about-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.about-table td {
  padding: 7px 0; border-bottom: 1px solid var(--border); color: var(--muted);
}
.about-table td:first-child {
  font-family: var(--font-mono); font-size: .72rem; color: var(--text); width: 40%;
}
.about-table tr:last-child td { border-bottom: none; }


/* ── 10. MODALS ──────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,.45);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); width: 100%; max-width: 420px;
  padding: 20px; box-shadow: 0 16px 48px rgba(0,0,0,.22);
}
.modal-head {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 14px;
}
.modal-head h3 { font-size: .95rem; font-weight: 600; color: var(--text); }
.modal-close {
  background: none; border: none; font-size: 1rem;
  cursor: pointer; color: var(--muted); padding: 2px 6px; border-radius: 4px;
}
.modal-close:hover { color: var(--text); }
.modal-body { font-size: .84rem; color: var(--muted); line-height: 1.6; margin-bottom: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }


/* ── 11. TOAST ───────────────────────────────────────────────────────────── */
#toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--text); color: var(--bg);
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .04em;
  padding: 10px 18px; border-radius: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  white-space: nowrap; z-index: 999;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err  { background: var(--danger);   color: #fff; }
#toast.ok   { background: var(--green);    color: #fff; }


/* ── 12. MOBILE DRAWER ───────────────────────────────────────────────────── */
#drawer-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: 150;
}
#drawer-overlay.open { display: block; }

#drawer {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 270px; z-index: 160;
  background: var(--topbar-bg);
  border-right: 1px solid var(--topbar-bdr);
  transform: translateX(-100%); transition: transform .28s ease;
  display: flex; flex-direction: column; overflow-y: auto;
}
#drawer.open { transform: translateX(0); }

#drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
#drawer-brand { display: flex; align-items: baseline; gap: 6px; }
#drawer-gnoke {
  font-family: var(--font-mono); font-size: .62rem;
  letter-spacing: .22em; text-transform: uppercase;
  color: rgba(255,255,255,.6);
}
#drawer-app {
  font-family: var(--font-display);
  font-size: 1rem; font-weight: 700; color: #fff;
}
#drawer-close {
  background: none; border: none;
  color: rgba(255,255,255,.55); font-size: 1rem; cursor: pointer; padding: 4px 8px;
  transition: color var(--transition);
}
#drawer-close:hover { color: #fff; }

.drawer-section {
  font-family: var(--font-mono); font-size: .58rem; letter-spacing: .14em;
  text-transform: uppercase; color: rgba(255,255,255,.35); padding: 16px 16px 6px;
}
.drawer-btn {
  background: none; border: none; text-align: left; width: 100%;
  padding: 10px 16px; font-family: var(--font-sans); font-size: .86rem;
  color: rgba(255,255,255,.82); cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.drawer-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.drawer-btn.active {
  background: rgba(255,255,255,.12); color: #fff; font-weight: 600;
}
.drawer-btn.danger { color: #f87171; }


/* ── 13. RESPONSIVE ──────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  #hamburger    { display: flex; }
  .menu-group   { display: none; }
  #context-info { display: none; }
  .page-content { padding: 18px 14px 60px; }
  .card-grid    { grid-template-columns: 1fr; }
  .page-header h1 { font-size: 1.4rem; }
}

@media (min-width: 641px) {
  #hamburger { display: none; }
  #drawer, #drawer-overlay { display: none !important; }
}

/* ── PWA safe-area ── */
@media (display-mode: standalone) {
  #topbar {
    padding-top: env(safe-area-inset-top);
    height: calc(var(--topbar-h) + env(safe-area-inset-top));
  }
}


/* ══════════════════════════════════════════════════════════════════════════
   GEOCOMPASS — App-specific component styles
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Compass page layout ── */
.compass-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 420px;
  margin: 0 auto;
}

/* ── Compass ring ── */
.compass-wrap {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 8px 24px rgba(27,77,110,.22));
}

/* ── Heading readout ── */
.heading-readout {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  width: 100%;
  box-shadow: var(--shadow);
}
.heading-deg {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.04em;
  line-height: 1;
}
.heading-cardinal {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .14em;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 4px;
}

/* ── Destination readout strip ── */
.dest-readout {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
}
.dest-arrow-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}
.dest-readout-text { flex: 1; min-width: 0; }
.dest-label {
  font-family: var(--font-mono);
  font-size: .62rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}
.dest-value {
  font-size: .86rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── GPS info strip ── */
.gps-strip {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .04em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.gps-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted); flex-shrink: 0;
  transition: background .3s, box-shadow .3s;
}
.gps-dot.active {
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-lt);
}
.gps-dot.error { background: var(--red); }

/* ── Compass enable button ── */
.btn-enable {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius);
  border: none;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-sans);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background var(--transition), transform var(--transition);
}
.btn-enable:hover  { background: var(--accent-dk); }
.btn-enable:active { transform: scale(.98); }
.btn-enable.active {
  background: var(--green);
  cursor: default;
}

/* ── Navigate page — preset grid ── */
.preset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.preset-btn {
  padding: 10px 8px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text2);
  font-family: var(--font-sans);
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}
.preset-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-lt);
}

/* ── Current destination card ── */
.dest-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.dest-card-name {
  font-weight: 600;
  font-size: .9rem;
  color: var(--text);
  margin-bottom: 4px;
}
.dest-card-coords {
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .04em;
  color: var(--muted);
}
.dest-card.has-dest {
  border-color: var(--accent);
  background: var(--accent-lt);
}
.dest-card.has-dest .dest-card-name { color: var(--accent); }

/* ── Search page ── */
.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.search-bar input { flex: 1; }

.search-status {
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .04em;
  color: var(--muted);
  min-height: 18px;
  margin-bottom: 12px;
}
.search-status.searching { color: var(--accent); }
.search-status.found     { color: var(--green); }
.search-status.error     { color: var(--red); }

/* ── Search result items ── */
.result-list { display: flex; flex-direction: column; gap: 10px; }
.result-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition),
              background var(--transition);
}
.result-item:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(27,77,110,.12);
  background: var(--surface2);
}
.result-item-head {
  display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px;
}
.result-item-text { flex: 1; min-width: 0; }
.result-item-name {
  font-size: .86rem; font-weight: 600; color: var(--text); margin-bottom: 2px;
}
.result-item-full {
  font-size: .74rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px;
}
.result-item-coords {
  font-family: var(--font-mono); font-size: .64rem;
  letter-spacing: .03em; color: var(--muted); opacity: .8;
}
.result-map-thumb {
  width: 80px; height: 60px;
  border-radius: 6px; overflow: hidden;
  border: 1px solid var(--border); flex-shrink: 0;
}
.result-map-thumb iframe {
  width: 80px; height: 60px; border: none; pointer-events: none;
}

/* ── Orientation indicator pip (top of compass ring) ── */
.top-pip {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 10px solid var(--accent);
  z-index: 2;
}

/* ── Updater badge styles ── */
.upd-spinner {
  display: inline-block; width: 11px; height: 11px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: upd-spin .7s linear infinite; vertical-align: middle;
}
@keyframes upd-spin { to { transform: rotate(360deg); } }

.upd-result { margin-top: 14px; animation: upd-in .22s ease; }
@keyframes upd-in {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}
.upd-badge {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: 10px; border: 1.5px solid;
}
.upd-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.upd-badge > div { display: flex; flex-direction: column; gap: 3px; }
.upd-badge strong { font-size: .85rem; font-weight: 600; color: var(--text); }
.upd-meta {
  font-family: var(--font-mono); font-size: .64rem;
  letter-spacing: .05em; color: var(--muted);
}
.upd-link {
  display: inline-block; margin-top: 4px;
  font-size: .75rem; font-weight: 600; color: var(--accent);
  text-decoration: none; transition: opacity .15s;
}
.upd-link:hover { opacity: .7; }
.upd-ok  { background: var(--green-lt); border-color: rgba(26,102,71,.25); }
.upd-new { background: var(--accent-lt); border-color: rgba(27,77,110,.3); }
.upd-err { background: var(--red-lt);   border-color: rgba(176,48,48,.25); }
