/* App bar, first-visit welcome card and the "How it works" dialog (web/intro.js). Tokens from style.css. */
:root { --appbar-h: 60px; }
#app { height: calc(100% - var(--appbar-h)); }

.appbar { position: relative; z-index: 1000; height: var(--appbar-h); display: flex; align-items: center; gap: 16px; padding: 0 12px 0 12px; background: var(--color-surface); border-bottom: 1px solid var(--color-border); }
.appbar-brand { display: flex; align-items: center; gap: 10px; color: var(--color-text); text-decoration: none; flex-shrink: 0; }
.appbar-brand img { border-radius: 8px; }
.appbar-name { display: flex; flex-direction: column; }
.appbar-name b { font-size: 16px; line-height: 20px; font-weight: 650; letter-spacing: -.01em; }
.appbar-name span { font-size: 11px; line-height: 14px; color: var(--color-text-muted); }

.live-chip { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 10px; border-radius: 999px; flex-shrink: 0; font: 600 11px/1 var(--font-mono); letter-spacing: .06em; color: var(--color-text-muted); background: rgba(100,116,139,.14); border: 1px solid rgba(100,116,139,.4); }
.live-dot { position: relative; width: 8px; height: 8px; border-radius: 999px; background: var(--color-unknown); }
.live-chip.is-ok { color: #86efac; background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.35); }
.live-chip.is-ok .live-dot { background: var(--color-ok); }
.live-chip.is-ok .live-dot::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--color-ok); animation: sc-live 1.6s ease-out infinite; }
.live-chip.is-warn { color: #fcd34d; background: rgba(245,158,11,.14); border-color: rgba(245,158,11,.45); }
.live-chip.is-warn .live-dot { background: var(--color-warning); }
.live-chip.is-danger { color: #fca5a5; background: rgba(239,68,68,.14); border-color: rgba(239,68,68,.45); }
.live-chip.is-danger .live-dot { background: var(--color-danger); }
@keyframes sc-live { from { transform: scale(1); opacity: .8; } to { transform: scale(2.8); opacity: 0; } }

.appnav { flex: 1; display: flex; justify-content: center; gap: 4px; min-width: 0; }
.appnav a { height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 10px; color: var(--color-text-secondary); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background var(--duration-fast) var(--ease-standard); }
.appnav a:hover { background: rgba(216,229,238,.08); color: var(--color-text); }
.appnav a[aria-current="page"] { background: var(--color-surface-raised); color: var(--color-text); }
.appnav a.nav-op { color: var(--color-text-muted); }
.appnav svg, .appbar-actions svg { flex-shrink: 0; }
.appbar a:focus-visible, .appbar button:focus-visible { outline: 2px solid var(--color-signal); outline-offset: 2px; }

.appbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.appbar .btn { min-height: 44px; padding: 0 14px; font-size: 14px; font-weight: 600; border-radius: 10px; display: inline-flex; align-items: center; gap: 8px; }
.appbar .btn-primary { font-weight: 700; }
.appbar .btn-primary:hover { background: var(--color-signal-highlight); }
.appbar .auth .btn { text-decoration: none; }
.appbar .menu-toggle { display: none; }

@media (max-width: 1320px) { .appbar-name span { display: none; } .appnav a { padding: 0 10px; } }
@media (max-width: 1180px) { .appnav .nav-label-long { display: none; } }
@media (max-width: 900px) {
  :root { --appbar-h: 56px; }
  .appbar { gap: 8px; padding: 0 6px 0 10px; }
  .live-chip .live-text { display: none; }
  .live-chip { padding: 0 8px; border: 0; background: transparent; }
  .appbar-actions { margin-left: auto; }
  .intro-open-label { display: none; }
  #intro-open { width: 44px; padding: 0; justify-content: center; }
  .appbar .menu-toggle { display: inline-flex; width: 44px; padding: 0; justify-content: center; }
  .appnav { position: absolute; top: var(--appbar-h); left: 0; right: 0; display: none; flex-direction: column; gap: 2px; padding: 8px; background: var(--color-surface); border-bottom: 1px solid var(--color-border); box-shadow: var(--shadow-panel); }
  .appbar.nav-open .appnav { display: flex; }
  .appnav a { justify-content: flex-start; }
  .appbar .auth-user { display: none; }
}

/* the map's floating bar no longer carries the logo */
.brand { padding-left: 12px; }

/* first-visit welcome */
.welcome { position: absolute; left: 16px; bottom: 64px; z-index: 1010; width: 400px; max-width: calc(100% - 32px); display: flex; flex-direction: column; gap: 14px; padding: 20px; background: rgba(13,27,43,.95); backdrop-filter: blur(10px); border: 1px solid rgba(34,211,238,.35); border-radius: 14px; box-shadow: var(--shadow-panel); }
.welcome-head { display: flex; align-items: flex-start; gap: 12px; }
.welcome h2 { margin: 0 0 6px; font-size: 17px; line-height: 22px; font-weight: 650; }
.welcome p { margin: 0; font-size: 14px; line-height: 20px; color: var(--color-text-secondary); }
.welcome-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.welcome .btn, .intro .btn { min-height: 44px; padding: 0 16px; font-size: 14px; font-weight: 600; border-radius: 10px; display: inline-flex; align-items: center; text-decoration: none; }
.welcome .btn-primary, .intro .btn-primary { font-weight: 700; }
.icon-btn { width: 44px; height: 44px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; padding: 0; background: transparent; border: 0; border-radius: 10px; color: var(--color-text-muted); cursor: pointer; }
.icon-btn:hover { background: rgba(216,229,238,.08); color: var(--color-text); }
.legend-open { margin-left: auto; min-height: 44px; border-radius: 999px; padding: 0 14px; display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.legend-dots { display: inline-flex; gap: 4px; }
.legend-dots i { width: 10px; height: 10px; border-radius: 999px; }
@media (max-width: 900px) { .welcome { top: 60px; bottom: auto; left: 12px; width: auto; right: 12px; max-width: none; } .legend-open .legend-dots { display: none; } }

/* the "How it works" dialog */
.intro { width: min(880px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 0; background: var(--color-surface); color: var(--color-text); border: 1px solid rgba(216,229,238,.14); border-radius: 16px; box-shadow: 0 24px 64px rgba(0,0,0,.5); }
.intro::backdrop { background: rgba(5,11,20,.72); backdrop-filter: blur(2px); }
.intro[open] { display: flex; flex-direction: column; }
.intro-head { display: flex; align-items: flex-start; gap: 14px; padding: 28px 32px 0; }
.intro-head img { border-radius: 10px; }
.intro-head h2 { margin: 0; font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -.01em; }
.intro-head .tagline { font-size: 13px; line-height: 18px; color: var(--color-text-muted); }
.intro-head .icon-btn { margin-left: auto; border: 1px solid rgba(216,229,238,.14); color: var(--color-text-secondary); }
.intro-lede { margin: 16px 32px 0; max-width: 760px; font-size: 16px; line-height: 24px; color: var(--color-text-secondary); }
.intro-tabs { display: flex; gap: 4px; margin: 20px 32px 0; border-bottom: 1px solid var(--color-border); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.intro-tabs button { height: 44px; padding: 0 16px; margin-bottom: -1px; background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--color-text-muted); font: 600 14px var(--font-sans); white-space: nowrap; cursor: pointer; }
.intro-tabs button:hover { color: var(--color-text); }
.intro-tabs button[aria-selected="true"] { color: var(--color-text); border-bottom-color: var(--color-signal); }
.intro-tabs button:focus-visible { outline: 2px solid var(--color-signal); outline-offset: -2px; }
.intro-body { flex: 1; min-height: 0; overflow-y: auto; padding: 24px 32px; }
.intro-panel { display: flex; flex-direction: column; gap: 20px; }
.intro-panel[hidden] { display: none; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.step { display: flex; flex-direction: column; gap: 12px; padding: 20px; background: var(--color-surface-raised); border: 1px solid rgba(216,229,238,.10); border-radius: 12px; }
.step-top { display: flex; align-items: center; justify-content: space-between; }
.step-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.step-icon.signal { background: rgba(34,211,238,.14); color: var(--color-signal); }
.step-icon.fusion { background: rgba(168,85,247,.16); color: #c084fc; }
.step-icon.warn { background: rgba(245,158,11,.16); color: #fbbf24; }
.step-num { font: 12px var(--font-mono); color: var(--color-text-muted); }
.step h3 { margin: 0; font-size: 17px; line-height: 22px; font-weight: 600; }
.step p { flex: 1; margin: 0; font-size: 14px; line-height: 20px; color: var(--color-text-secondary); }
.step a, .qr-box a { color: var(--color-signal-highlight); font-size: 14px; font-weight: 600; text-decoration: none; }
.step a:hover, .qr-box a:hover { text-decoration: underline; }

.qr-box { display: flex; align-items: center; gap: 20px; padding: 16px 20px; border: 1px dashed rgba(216,229,238,.22); border-radius: 12px; }
.qr-box .qr { flex-shrink: 0; background: #fff; padding: 8px; border-radius: 8px; line-height: 0; } /* true white quiet zone for reliable scanning */
.qr-box strong { display: block; font-size: 15px; }
.qr-box p { margin: 4px 0; font-size: 14px; line-height: 20px; color: var(--color-text-muted); }
.qr-box .mono { font-size: 13px; }

.legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; margin: 0; padding: 0; list-style: none; }
.legend li { display: flex; gap: 14px; align-items: flex-start; }
.legend svg { flex-shrink: 0; }
.legend b { display: block; font-size: 15px; font-weight: 600; }
.legend span { font-size: 14px; line-height: 20px; color: var(--color-text-muted); }
.now { display: flex; gap: 16px; align-items: center; padding: 16px 20px; background: var(--color-surface-raised); border-radius: 12px; font-size: 14px; line-height: 20px; color: var(--color-text-secondary); }
.now b { flex-shrink: 0; font: 600 11px var(--font-mono); letter-spacing: .08em; color: var(--color-ok); }

.why-lede h3 { margin: 0 0 6px; font-size: 20px; line-height: 26px; font-weight: 700; }
.why-lede p { margin: 0; font-size: 15px; line-height: 22px; color: var(--color-text-secondary); }
.values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.values div { padding: 16px 18px; background: var(--color-surface-raised); border-radius: 12px; }
.values b { font-size: 15px; font-weight: 600; }
.values p { margin: 4px 0 0; font-size: 14px; line-height: 20px; color: var(--color-text-muted); }
.proof { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; }
.proof div { display: flex; flex-direction: column-reverse; gap: 2px; }
.proof dt { font-size: 13px; color: var(--color-text-muted); }
.proof dd { margin: 0; font: 600 22px var(--font-mono); color: var(--color-signal); }
.disclaimer { margin: 0; font-size: 12px; line-height: 18px; color: var(--color-text-muted); }

.intro-foot { display: flex; align-items: center; gap: 12px; padding: 16px 32px; border-top: 1px solid var(--color-border); }
.intro-foot span { flex: 1; font-size: 13px; color: var(--color-text-muted); }
.intro-foot b { color: var(--color-text-secondary); font-weight: 600; }

@media (max-width: 900px) {
  .intro { width: 100%; max-width: 100%; max-height: 100%; height: 100%; margin: 0; border-radius: 0; border: 0; }
  .intro-head { padding: 20px 20px 0; }
  .intro-lede { margin: 12px 20px 0; font-size: 15px; line-height: 22px; }
  .intro-tabs { margin: 16px 20px 0; }
  .intro-tabs button { padding: 0 10px; font-size: 13px; }
  .intro-body { padding: 20px; }
  .steps, .legend, .values { grid-template-columns: minmax(0, 1fr); }
  .proof { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qr-box { display: none; } /* already on a phone */
  .intro-foot { padding: 12px 20px; flex-wrap: wrap; }
  .intro-foot span { display: none; }
  .intro-foot .btn { flex: 1; justify-content: center; }
}
/* the "Get the app" dialog (web/get-app.js): the How it works frame, two options and a QR code for laptops */
.get-app { width: min(720px, calc(100% - 32px)); }
.get-app .intro-body { display: flex; flex-direction: column; gap: 20px; }
.app-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.app-option { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 20px; background: var(--color-surface-raised); border: 1px solid rgba(216,229,238,.10); border-radius: 12px; }
.app-option-head { align-self: stretch; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.app-option h3 { margin: 0; font-size: 17px; line-height: 22px; font-weight: 600; }
.app-tag { font: 500 11px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-muted); }
.app-option p { flex: 1; margin: 0; font-size: 14px; line-height: 20px; color: var(--color-text-secondary); }
.app-note { font-size: 12px; line-height: 16px; color: var(--color-text-muted); }
@media (max-width: 1320px) { .get-app-label { display: none; } #get-app-open { width: 44px; padding: 0; justify-content: center; } }
@media (min-width: 901px) and (max-width: 1000px) { .appnav a svg { display: none; } } /* text-only links leave room for that button until the menu takes over */
@media (max-width: 900px) { .get-app { width: 100%; } .app-options { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .live-chip.is-ok .live-dot::after { animation: none; } }
