:root {
  --bg: #07111f;
  --bg-2: #0b1728;
  --card: #111e31;
  --card-2: #15243a;
  --line: rgba(255,255,255,.08);
  --text: #f5f8fc;
  --muted: #91a2b8;
  --green: #2cc975;
  --amber: #f5b642;
  --red: #f35f68;
  --blue: #67a6ff;
  --teal: #46c4cc;
  --shadow: 0 14px 36px rgba(0,0,0,.24);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
button, input, select { font: inherit; }
button { color: inherit; }
.app-shell { width: min(100%, 520px); margin: 0 auto; min-height: 100vh; background: radial-gradient(circle at 50% -10%, #173052 0, var(--bg) 38%); }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 12px; background: linear-gradient(180deg, rgba(7,17,31,.98), rgba(7,17,31,.82), transparent); backdrop-filter: blur(10px); }
.brand-lockup { display: flex; align-items: center; gap: 11px; }
.brand-icon { width: 42px; height: 42px; border-radius: 12px; box-shadow: 0 8px 18px rgba(0,0,0,.22); }
.eyebrow { font-size: 10px; letter-spacing: .16em; color: var(--muted); font-weight: 800; }
.brand { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.icon-btn { border: 1px solid var(--line); background: rgba(255,255,255,.05); width: 42px; height: 42px; border-radius: 14px; font-size: 23px; cursor: pointer; }
main { padding: 4px 16px 98px; }
.view { display: none; }
.view.active { display: block; }
.hero-card { border-radius: 26px; padding: 20px; min-height: 238px; box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,.10); overflow: hidden; position: relative; }
.hero-card::after { content: ""; position: absolute; width: 220px; height: 220px; right: -80px; bottom: -120px; border-radius: 50%; background: rgba(255,255,255,.08); }
.signal-cash { background: linear-gradient(145deg, #5c1721, #a52837 55%, #de4c59); }
.signal-moderate { background: linear-gradient(145deg, #5e3a08, #a86a0d 55%, #e6a428); }
.signal-aggressive { background: linear-gradient(145deg, #0a4a31, #10794d 55%, #20af69); }
.hero-topline { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; position: relative; z-index: 1; }
.status-badge { font-size: 10px; font-weight: 900; letter-spacing: .1em; padding: 7px 10px; border-radius: 999px; background: rgba(0,0,0,.2); border: 1px solid rgba(255,255,255,.16); }
.updated { font-size: 11px; color: rgba(255,255,255,.82); }
.hero-label { font-size: 12px; font-weight: 800; letter-spacing: .14em; color: rgba(255,255,255,.76); position: relative; z-index: 1; }
.hero-signal { font-size: 48px; line-height: .98; font-weight: 950; letter-spacing: -.055em; margin: 7px 0 9px; position: relative; z-index: 1; }
.hero-exposure { font-size: 19px; font-weight: 750; position: relative; z-index: 1; }
.hero-sub { font-size: 13px; line-height: 1.4; margin-top: 12px; color: rgba(255,255,255,.82); max-width: 84%; position: relative; z-index: 1; }
.comparison-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.mini-card, .section-card { background: linear-gradient(180deg, rgba(20,36,58,.96), rgba(14,28,47,.98)); border: 1px solid var(--line); border-radius: 20px; }
.mini-card { padding: 15px; }
.mini-label { font-size: 10px; letter-spacing: .13em; color: var(--muted); font-weight: 800; }
.mini-signal { font-size: 22px; font-weight: 900; margin-top: 6px; }
.mini-detail { font-size: 11px; color: var(--muted); margin-top: 3px; }
.alignment-pill { display: inline-flex; align-items: center; margin: 10px 0 0; padding: 7px 10px; border-radius: 999px; background: rgba(103,166,255,.12); border: 1px solid rgba(103,166,255,.20); color: #b8d4ff; font-size: 10px; font-weight: 850; letter-spacing: .07em; }
.section-card { padding: 17px; margin-top: 12px; }
.section-title-row { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 15px; }
h2 { margin: 0; font-size: 16px; letter-spacing: -.01em; }
.muted { color: var(--muted); font-size: 11px; }
.score-row + .score-row { margin-top: 16px; }
.score-label { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 7px; }
.score-label strong { font-size: 16px; }
.bar { height: 9px; background: rgba(255,255,255,.07); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--teal)); transition: width .35s ease; }
.reason-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.reason-list li { position: relative; padding-left: 18px; font-size: 13px; line-height: 1.45; color: #dfe7f1; }
.reason-list li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); position: absolute; left: 0; top: 6px; box-shadow: 0 0 0 4px rgba(245,182,66,.10); }
.check-list { display: grid; gap: 9px; }
.check-item { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.35; }
.check-item:first-child { border-top: 0; padding-top: 0; }
.check-dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 900; background: rgba(243,95,104,.12); color: var(--red); border: 1px solid rgba(243,95,104,.25); }
.check-item.met .check-dot { background: rgba(44,201,117,.12); color: var(--green); border-color: rgba(44,201,117,.25); }
.install-card { width: 100%; border: 1px solid rgba(103,166,255,.2); background: rgba(103,166,255,.08); border-radius: 19px; margin-top: 12px; padding: 14px; display: grid; grid-template-columns: 36px 1fr 20px; align-items: center; text-align: left; gap: 9px; cursor: pointer; }
.install-icon { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: rgba(103,166,255,.17); color: #cce0ff; font-size: 20px; }
.install-card strong { display: block; font-size: 13px; }
.install-card span { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.chevron { color: var(--muted); font-size: 24px; }
.page-title { font-size: 28px; font-weight: 900; letter-spacing: -.04em; padding: 8px 2px 2px; }
.gate-grid { display: grid; gap: 10px; }
.gate-card { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: center; padding: 12px; background: rgba(255,255,255,.035); border-radius: 14px; }
.gate-light { width: 9px; height: 36px; border-radius: 999px; background: var(--green); }
.gate-card.active .gate-light { background: var(--red); }
.gate-name { font-size: 13px; font-weight: 750; }
.gate-desc { color: var(--muted); font-size: 10px; margin-top: 2px; }
.gate-state { font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.metric-table { display: grid; }
.metric-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); align-items: center; }
.metric-row:first-child { border-top: 0; padding-top: 0; }
.metric-name { font-size: 12px; color: #dce6f2; }
.metric-value { display: flex; align-items: center; gap: 9px; font-size: 12px; font-weight: 800; }
.score-chip { min-width: 40px; text-align: center; padding: 4px 7px; border-radius: 8px; background: rgba(255,255,255,.06); color: var(--muted); font-size: 10px; }
.health-list { display: grid; gap: 8px; }
.health-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.health-row:first-child { border-top: 0; }
.health-source { font-size: 11px; }
.health-meta { font-size: 10px; color: var(--muted); margin-top: 2px; }
.health-status { font-size: 9px; font-weight: 900; letter-spacing: .08em; padding: 5px 7px; border-radius: 999px; }
.health-status.live { color: #95f0bd; background: rgba(44,201,117,.12); }
.health-status.fallback { color: #ffc3c8; background: rgba(243,95,104,.12); }
.health-status.manual { color: #ffdb93; background: rgba(245,182,66,.12); }
.timeline { display: grid; }
.timeline-row { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.timeline-row:first-child { border-top: 0; }
.timeline-dot { width: 9px; height: 9px; border-radius: 50%; }
.timeline-signal { font-size: 12px; font-weight: 850; }
.timeline-date { font-size: 10px; color: var(--muted); }
.timeline-tag { font-size: 9px; color: var(--muted); }
.form-card label { display: grid; gap: 7px; margin-top: 14px; font-size: 12px; color: #dce6f2; }
input, select { width: 100%; border: 1px solid var(--line); background: rgba(255,255,255,.05); color: var(--text); padding: 13px 12px; border-radius: 12px; outline: none; }
input:focus, select:focus { border-color: rgba(103,166,255,.6); box-shadow: 0 0 0 3px rgba(103,166,255,.08); }
.helper { margin: -4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.manual-badge { font-size: 9px; font-weight: 900; letter-spacing: .08em; color: #ffdb93; background: rgba(245,182,66,.12); border-radius: 999px; padding: 5px 7px; }
.primary-btn { width: 100%; border: 0; border-radius: 14px; padding: 15px; margin-top: 12px; font-weight: 850; background: linear-gradient(135deg, #4c8ff5, #5aa9ff); color: white; box-shadow: 0 10px 24px rgba(76,143,245,.22); cursor: pointer; }
.about-card p { font-size: 12px; line-height: 1.5; color: #dce6f2; }
.about-card .muted { color: var(--muted); }
.bottom-nav { position: fixed; z-index: 20; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%, 520px); display: grid; grid-template-columns: repeat(4, 1fr); background: rgba(8,18,32,.94); border-top: 1px solid var(--line); backdrop-filter: blur(18px); padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); }
.nav-btn { border: 0; background: transparent; color: var(--muted); display: grid; gap: 2px; place-items: center; padding: 5px; cursor: pointer; }
.nav-btn span { font-size: 20px; line-height: 1; }
.nav-btn small { font-size: 9px; font-weight: 750; }
.nav-btn.active { color: #cfe1ff; }
dialog { border: 0; border-radius: 22px; padding: 0; width: min(calc(100% - 32px), 420px); color: var(--text); background: var(--card); box-shadow: 0 30px 80px rgba(0,0,0,.5); }
dialog::backdrop { background: rgba(0,0,0,.65); backdrop-filter: blur(5px); }
.dialog-content { padding: 24px; position: relative; }
.dialog-close { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255,255,255,.07); font-size: 20px; }
.dialog-icon { font-size: 32px; }
.dialog-content h3 { margin: 12px 0; }
.dialog-content ol { padding-left: 22px; color: #dce6f2; line-height: 1.65; font-size: 13px; }
.dialog-content p { color: var(--muted); font-size: 11px; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 90px; transform: translate(-50%, 16px); background: #eaf2ff; color: #12233b; border-radius: 999px; padding: 10px 14px; font-size: 11px; font-weight: 800; opacity: 0; pointer-events: none; transition: .2s ease; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (display-mode: standalone) { .install-card { display: none; } }
