/* ============================================================
   nextgen shared stylesheet — design tokens + topbar + guide content
   Every /nextgen page links this; page-specific styles stay inline.
   ============================================================ */

/* ---- Tokens (light) ---- */
:root{
  --navy:#0f172a; --on-navy:#cbd5e1; --muted-navy:#94a3b8; --navy-border:#475569;
  --blue:#2563eb; --blue-tint:#eef2ff; --tint-border:#dbe3ff; --cta-shadow:rgba(37,99,235,.28);
  --ink:#101828; --body:#475467; --muted:#667085; --faint:#98a2b3;
  --bg:#f6f7f9; --subtle:#f8fafc; --chip:#f4f5f7;
  --b-card:#eceef2; --b-subtle:#eef0f4; --b-input:#d8dce3; --b-div:#f1f2f4;
  --card:#ffffff; --link:#2563eb;
;--popup:var(--card);--popup-hi:var(--subtle)}
/* ---- Tokens (dark) — same design on navy surfaces ---- */
html[data-theme="dark"]{
  --blue:#3b82f6; --blue-tint:rgba(59,130,246,.16); --tint-border:rgba(59,130,246,.35);
  --ink:#e8eefb; --body:#cdd9ea; --muted:#9fb2cc; --faint:#7e93b2;
  --bg:#0f172a; --subtle:#28364f; --chip:#28364f;
  --b-card:#2e3d5a; --b-subtle:#334362; --b-input:#42557a; --b-div:#334362;
  --card:#1e2b4a; --link:#6ea8ff;
  --popup:#22334f; --popup-hi:rgba(255,255,255,.06);
}

/* Design 11a: lightened dark-mode popups — gradient surface, soft white-alpha
   borders, matched elevation for stop popups, mobile card, filter panel and
   forecast card. Lives here (version-busted) so pages can't serve stale tones. */
html[data-theme="dark"] .ng-popup .leaflet-popup-content-wrapper,
html[data-theme="dark"] .selcard,
html[data-theme="dark"] .poi-panel,
html[data-theme="dark"] #fc-card{background:linear-gradient(180deg,#22334f 0%,#1a2942 100%);border-color:rgba(255,255,255,.10)}
html[data-theme="dark"] .ng-popup .leaflet-popup-tip{background:#1a2942;border-color:rgba(255,255,255,.10)}
html[data-theme="dark"] .sp-fac{background:rgba(255,255,255,.05);border-color:rgba(255,255,255,.08)}
html[data-theme="dark"] .sp-nohead{background:rgba(255,255,255,.04);border-bottom:1px solid rgba(255,255,255,.07)}
html[data-theme="dark"] .poi-panel .ph.hd{background:#22334f;border-bottom-color:rgba(255,255,255,.07)}
html[data-theme="dark"] .sp-actions .add{background:rgba(59,130,246,.34);color:#cfe0ff;border-color:rgba(110,168,255,.55)}

/* ============ Shared top bar (injected by ng_topbar.js) ============ */
.ng-topbar{position:sticky;top:0;height:64px;background:var(--navy);display:flex;align-items:center;padding:0 20px;gap:16px;z-index:2000;flex:none}
.ng-topbar .logo{height:75px;display:block;margin-bottom:-34px;position:relative;z-index:2001;filter:drop-shadow(0 3px 6px rgba(15,23,42,.35))}
.ng-topbar .apptitle{font-size:14px;font-weight:600;color:var(--on-navy);white-space:nowrap}
.ng-topbar .search{width:280px;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.1);border-radius:10px;padding:8px 12px;font-size:13px;color:#e2e8f0;font-family:inherit;outline:none}
.ng-topbar .search::placeholder{color:var(--muted-navy)}
.ng-topbar .right{margin-left:auto;display:flex;align-items:center;gap:18px;color:var(--on-navy);font-size:13.5px;font-weight:600}
.ng-topbar .right>span,.ng-topbar .right>a{cursor:pointer;white-space:nowrap;color:var(--on-navy);text-decoration:none}
.ng-topbar .right>a:hover{text-decoration:underline}
.ng-topbar .helpq{width:26px;height:26px;border:1.5px solid var(--navy-border);border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:13px;flex:none;text-decoration:none;color:inherit;cursor:pointer}
.ng-topbar .helpq:hover{border-color:#fff;color:#fff}
.ng-topbar .avatar{width:34px;height:34px;border-radius:50%;background:#dbeafe;color:#2563eb;font-size:13px;font-weight:800;display:flex;align-items:center;justify-content:center;flex:none;cursor:pointer}
/* the same box whether it holds a gravatar image or the initials fallback */
img.avatar{object-fit:cover;display:block;border:1px solid rgba(255,255,255,.25)}

/* Dropdown shells (language + profile) */
.ng-dd-wrap{position:relative}
.ng-dd{display:none;position:absolute;top:42px;right:0;background:var(--card);border:1px solid var(--b-card);border-radius:12px;padding:8px;box-shadow:0 8px 24px rgba(16,24,40,.25);flex-direction:column;gap:6px;min-width:52px;z-index:2100}
.ng-dd.open{display:flex}
.ng-dd img.flag{width:38px;height:auto;cursor:pointer;border-radius:3px;border:1px solid transparent;transition:border-color .15s,transform .15s;display:block}
.ng-dd img.flag:hover{border-color:var(--blue);transform:scale(1.05)}
/* Flag and theme toggle are 20% larger than they started: at the old size they were
   awkward to hit with a thumb in the mobile bar. The padding is part of the target,
   not decoration — it is what makes them comfortably tappable. */
#lang-current{width:29px;height:auto;border-radius:3px;display:block;cursor:pointer}
#ng-theme{font-size:1.2em;line-height:1;display:inline-flex;align-items:center;justify-content:center;
  min-width:30px;min-height:30px;padding:2px;border-radius:8px;-webkit-tap-highlight-color:transparent}
.ng-dd.menu{min-width:180px;padding:6px}
.ng-dd.menu a{display:block;padding:9px 12px;border-radius:8px;font-size:13.5px;font-weight:600;color:var(--ink);text-decoration:none;white-space:nowrap}
.ng-dd.menu a:hover{background:var(--chip)}
.ng-dd.menu .who{padding:8px 12px 10px;border-bottom:1px solid var(--b-div);margin-bottom:4px}
.ng-dd.menu .who b{display:block;font-size:13.5px;color:var(--ink)}
.ng-dd.menu .who span{font-size:11.5px;color:var(--muted)}

@media (max-width:700px){
  .ng-topbar{height:56px;padding:0 14px;gap:12px}
  .ng-topbar .logo{height:57px;max-width:190px;object-fit:contain;margin-bottom:-24px}
  .ng-topbar .apptitle,.ng-topbar .helpq,.ng-topbar .d-only{display:none}
  /* Search on a phone without the bar growing: the field is a 40px stub showing just the 🔍
     from its own placeholder, and on focus the wrapper goes absolute across the bar so the
     field can fill the width — over the logo and icons rather than pushing them anywhere.
     The bar keeps its 56px, always one row. 15px text because iOS zooms the page for
     anything smaller. */
  .ng-topbar .search{width:40px;box-sizing:border-box;font-size:15px;padding:9px 10px;
    transition:width .18s ease}
  .ng-topbar .ng-search-wrap{flex:0 0 auto}
  /* 2002, not 5: the logo is position:relative with z-index:2001 so it can hang below the
     bar and still sit above the page, so anything meant to cover it has to outrank that. */
  .ng-topbar .ng-search-wrap:focus-within{position:absolute;left:14px;right:14px;z-index:2002}
  /* Opaque while it floats: the resting field is rgba(255,255,255,.08) over the navy bar,
     which would let the logo show straight through the expanded one. */
  .ng-topbar .ng-search-wrap:focus-within .search{width:100%;background:#152238;
    border-color:rgba(255,255,255,.22);box-shadow:0 6px 18px rgba(0,0,0,.35)}
  .ng-topbar .ng-sug{width:100%;max-width:none}
  .ng-topbar .right{gap:14px;font-size:15px}
  #lang-current{width:27px}
  #ng-theme{min-width:38px;min-height:38px;font-size:1.25em}
  .ng-topbar .avatar{width:30px;height:30px;font-size:12px}
}

/* ============ Guide/content pages (body.ng-guide) ============ */
body.ng-guide{font-family:'Plus Jakarta Sans',sans-serif;background:var(--bg);color:var(--body);min-height:100vh;line-height:1.7;margin:0}
.ng-guide .container{max-width:860px;margin:0 auto;padding:32px 24px 60px}
.ng-guide .back{display:inline-block;margin-bottom:20px;color:var(--link);text-decoration:none;font-size:13.5px;font-weight:600}
.ng-guide .back:hover{text-decoration:underline}
.ng-guide h1{font-size:30px;font-weight:800;color:var(--ink);margin-bottom:6px;letter-spacing:-.01em}
.ng-guide .subtitle{color:var(--muted);font-size:15px;margin-bottom:8px}
.ng-guide .updated{color:var(--faint);font-size:12px;margin-bottom:20px}
.ng-guide h2{font-size:20px;font-weight:800;color:var(--ink);margin:40px 0 14px;padding-top:4px;border:none}
.ng-guide h2::before{content:'';display:block;width:34px;height:4px;background:var(--blue);border-radius:999px;margin-bottom:10px}
.ng-guide h3{font-size:15px;font-weight:700;color:var(--ink);margin:22px 0 8px}
.ng-guide p{margin-bottom:12px;font-size:14px}
.ng-guide ul,.ng-guide ol{margin:8px 0 16px 22px;font-size:14px}
.ng-guide li{margin-bottom:6px}
.ng-guide strong{color:var(--ink);font-weight:700}
.ng-guide a{color:var(--link)}
.ng-guide .info-box{background:var(--card);border:1px solid var(--b-card);border-radius:16px;padding:16px 18px;margin:16px 0;font-size:13.5px;box-shadow:0 1px 2px rgba(16,24,40,.04)}
.ng-guide .info-box.warn{border-left:3px solid #f4b740}
.ng-guide .info-box.tip{border-left:3px solid #69b578}
.ng-guide .checklist{list-style:none;margin:12px 0 20px 0;padding:0;background:var(--card);border:1px solid var(--b-card);border-radius:16px;overflow:hidden;box-shadow:0 1px 2px rgba(16,24,40,.04)}
.ng-guide .checklist li{padding:10px 16px 10px 42px;position:relative;border-bottom:1px solid var(--b-div);margin:0;font-size:13.5px}
.ng-guide .checklist li:last-child{border-bottom:none}
.ng-guide .checklist li::before{content:'☐';position:absolute;left:16px;top:9px;color:var(--blue);font-size:15px}
.ng-guide .toc{background:var(--card);border:1px solid var(--b-card);border-radius:16px;padding:18px 22px;margin-bottom:28px;box-shadow:0 1px 2px rgba(16,24,40,.04)}
.ng-guide .toc h3{margin:0 0 10px;font-size:12px;font-weight:600;color:var(--blue);text-transform:uppercase;letter-spacing:.09em}
.ng-guide .toc ul{list-style:none;margin:0;padding:0;columns:2}
.ng-guide .toc li{margin-bottom:4px;padding:0;border:none}
.ng-guide .toc li::before{display:none}
.ng-guide .toc a{text-decoration:none;font-size:13px;font-weight:600;color:var(--body)}
.ng-guide .toc a:hover{color:var(--blue);text-decoration:underline}
.ng-guide .cta-box{text-align:center;margin:40px 0;padding:28px;background:var(--card);border:1px solid var(--b-card);border-radius:16px;box-shadow:0 8px 24px rgba(16,24,40,.12)}
.ng-guide .cta-box h3{color:var(--ink);font-size:17px;font-weight:800;margin:0 0 8px}
.ng-guide .cta-box p{color:var(--muted);font-size:13.5px;margin-bottom:14px}
.ng-guide .cta-box a{display:inline-block;padding:12px 26px;background:var(--blue);color:#fff;border-radius:11px;font-weight:700;font-size:14px;text-decoration:none;box-shadow:0 6px 18px var(--cta-shadow);transition:background .15s ease-out}
.ng-guide .cta-box a:hover{filter:brightness(.92)}
.ng-guide .footer{text-align:center;margin-top:48px;padding-top:24px;border-top:1px solid var(--b-card);color:var(--faint);font-size:12.5px}
.ng-guide .footer a{color:var(--muted);text-decoration:none;margin:0 8px}
.ng-guide .footer a:hover{color:var(--ink)}
.ng-guide .hero-img{width:100%;border-radius:20px;margin:4px 0 28px;aspect-ratio:16/6;object-fit:cover;display:block;box-shadow:0 8px 24px rgba(16,24,40,.12)}
.ng-guide .section-img{width:100%;border-radius:16px;margin:16px 0 20px;aspect-ratio:16/7;object-fit:cover;display:block;box-shadow:0 1px 2px rgba(16,24,40,.04)}
.ng-guide table{width:100%;border-collapse:separate;border-spacing:0;margin:14px 0 20px;font-size:13px;background:var(--card);border:1px solid var(--b-card);border-radius:13px;overflow:hidden;box-shadow:0 1px 2px rgba(16,24,40,.04)}
.ng-guide th{background:var(--subtle);color:var(--body);padding:10px 12px;text-align:left;font-weight:700;border-bottom:1px solid var(--b-card)}
.ng-guide td{padding:9px 12px;border-bottom:1px solid var(--b-div)}
.ng-guide tr:last-child td{border-bottom:none}
.ng-guide tr:hover td{background:var(--subtle)}
@media (max-width:600px){
  .ng-guide .container{padding:22px 16px 40px}
  .ng-guide h1{font-size:23px}
  .ng-guide .toc ul{columns:1}
  .ng-guide table{font-size:12px}
  .ng-guide th,.ng-guide td{padding:6px 8px}
  .ng-guide .hero-img{aspect-ratio:16/9;border-radius:16px}
}
