:root {
  --navy-950: #052744; --navy-900: #073b69; --navy-800: #0a4d86;
  --blue-600: #087ee8; --blue-500: #13a5ff; --cyan-300: #7dd9ff;
  --ink-900: #0b2239; --ink-700: #314b63; --ink-500: #698096;
  --line: #d9e7f3; --surface: #fff; --page: #f3f8fc;
  --green: #098850; --green-soft: #e5f7ef;
  --shadow-lg: 0 30px 80px rgba(2,38,68,.19);
  --shadow-md: 0 14px 34px rgba(23,63,96,.1);
  --radius-xl: 28px; --radius-lg: 20px; --radius-md: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink-900); background: var(--page);
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--page); }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--page); }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.ambient { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(circle at 8% 10%, rgba(30,171,255,.17), transparent 27rem), radial-gradient(circle at 92% 88%, rgba(13,86,151,.12), transparent 30rem); }

.entry-shell { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 28px 18px; background: linear-gradient(135deg, rgba(3,45,79,.98), rgba(6,72,123,.93)), var(--navy-900); }
.entry-shell::before, .entry-shell::after { content: ""; position: fixed; border-radius: 999px; border: 1px solid rgba(125,217,255,.14); }
.entry-shell::before { width: 620px; height: 620px; right: -310px; top: -340px; }
.entry-shell::after { width: 420px; height: 420px; left: -270px; bottom: -250px; }
.entry-card { width: min(100%, 520px); padding: 34px; border: 1px solid rgba(255,255,255,.75); border-radius: var(--radius-xl); background: rgba(255,255,255,.97); box-shadow: var(--shadow-lg); }
.brand-lockup { display: flex; align-items: center; gap: 12px; color: var(--navy-900); font-weight: 850; letter-spacing: .025em; }
.brand-mark { width: 34px; height: 32px; display: flex; align-items: flex-end; gap: 3px; }
.brand-mark i { display: block; width: 8px; border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg, var(--cyan-300), var(--blue-600)); }
.brand-mark i:nth-child(1) { height: 14px; } .brand-mark i:nth-child(2) { height: 23px; } .brand-mark i:nth-child(3) { height: 31px; }
.entry-copy { margin: 38px 0 24px; }
.eyebrow { color: var(--blue-600); font-size: .72rem; font-weight: 850; letter-spacing: .12em; }
h1, h2, p { margin-top: 0; }
.entry-copy h1 { margin: 10px 0 13px; max-width: 430px; font-size: clamp(2rem, 7vw, 3rem); line-height: 1.02; letter-spacing: -.045em; }
.entry-copy p { margin-bottom: 0; color: var(--ink-700); line-height: 1.6; }
.demo-notice { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid #b9ddf5; border-radius: var(--radius-md); background: #eef8ff; }
.notice-icon { flex: 0 0 auto; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: white; background: var(--blue-600); font-weight: 900; }
.demo-notice strong, .demo-notice span { display: block; }
.demo-notice strong { font-size: .88rem; color: var(--navy-900); }
.demo-notice div > span { margin-top: 2px; font-size: .78rem; color: var(--ink-500); }
.demo-notice strong.is-ready { color: var(--green); }
.entry-form { display: grid; gap: 10px; margin-top: 24px; }
.entry-form label { font-size: .82rem; color: var(--ink-700); font-weight: 750; }
.entry-form input { width: 100%; min-height: 50px; padding: 0 15px; border: 1px solid #bfd2e1; border-radius: 12px; outline: none; color: var(--ink-900); background: white; transition: border-color .2s, box-shadow .2s; }
.entry-form input:focus { border-color: var(--blue-600); box-shadow: 0 0 0 4px rgba(8,126,232,.13); }
.primary-button { min-height: 54px; margin-top: 5px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; border: 0; border-radius: 13px; color: white; background: linear-gradient(110deg, var(--navy-900), var(--blue-600)); font-weight: 800; box-shadow: 0 12px 24px rgba(5,72,128,.22); }
.primary-button:hover { filter: brightness(1.05); transform: translateY(-1px); }
.primary-button:active { transform: translateY(0); }
.secondary-button { width: 100%; min-height: 50px; border: 1px solid #a9c9e2; border-radius: 13px; color: var(--navy-900); background: white; font-weight: 800; }
.secondary-button:hover { background: #eef8ff; }
.entry-divider { display: flex; align-items: center; gap: 12px; margin: 19px 0 13px; color: var(--ink-500); font-size: .72rem; }
.entry-divider::before, .entry-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.auth-feedback { min-height: 19px; margin: 2px 0 0; color: var(--ink-500); font-size: .75rem; line-height: 1.45; }
.auth-feedback[data-kind="error"] { color: #b3261e; }
.auth-feedback[data-kind="warning"] { color: #8a5800; }
.auth-feedback[data-kind="loading"] { color: var(--blue-600); }
.entry-footer { margin-top: 22px; display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 15px; color: var(--ink-500); font-size: .7rem; }
.entry-footer b { color: var(--green); }

.app-shell { position: relative; z-index: 1; min-height: 100vh; }
.topbar { position: sticky; z-index: 10; top: 0; padding-top: env(safe-area-inset-top); color: white; background: rgba(5,47,83,.96); box-shadow: 0 4px 20px rgba(2,36,62,.18); backdrop-filter: blur(12px); }
.topbar-inner { width: min(100% - 32px, 1120px); min-height: 70px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.brand-lockup--compact { color: white; font-size: .92rem; }
.brand-lockup--compact .brand-mark { transform: scale(.83); transform-origin: left center; margin-right: -5px; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.refresh-button { min-height: 38px; padding: 0 13px; border: 1px solid rgba(255,255,255,.42); border-radius: 10px; color: white; background: rgba(255,255,255,.12); font-weight: 800; }
.refresh-button:disabled { opacity: .58; cursor: wait; }
.demo-pill { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; color: #dff5ff; background: rgba(255,255,255,.08); font-size: .66rem; font-weight: 800; letter-spacing: .05em; }
.demo-pill span { width: 7px; height: 7px; border-radius: 50%; background: #51e0a2; box-shadow: 0 0 0 4px rgba(81,224,162,.12); }
.icon-button { width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.18); border-radius: 11px; color: white; background: rgba(255,255,255,.09); font-size: 1.1rem; }
.dashboard { width: min(100% - 32px, 1120px); margin: 0 auto; padding: 38px 0 max(36px, env(safe-area-inset-bottom)); }
.welcome-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.welcome-row h1 { margin: 6px 0 5px; font-size: clamp(2rem, 6vw, 3.1rem); line-height: 1; letter-spacing: -.045em; }
.welcome-row p { margin: 0; color: var(--ink-500); }
.read-only-badge { display: flex; align-items: center; gap: 10px; min-width: 230px; padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255,255,255,.82); }
.read-only-badge > span { color: var(--blue-600); }
.read-only-badge strong, .read-only-badge small { display: block; }
.read-only-badge strong { font-size: .8rem; } .read-only-badge small { margin-top: 2px; color: var(--ink-500); font-size: .68rem; }

.balance-card { position: relative; overflow: hidden; min-height: 188px; display: flex; align-items: center; gap: 20px; padding: 29px; border-radius: var(--radius-xl); color: white; background: linear-gradient(118deg, #06355f 0%, #075c9f 57%, #0796e8 100%); box-shadow: 0 20px 46px rgba(5,70,122,.2); }
.balance-icon { position: relative; z-index: 1; flex: 0 0 auto; display: grid; place-items: center; width: 72px; height: 72px; border-radius: 22px; color: white; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.16); font-size: 2rem; transform: rotate(-2deg); }
.balance-copy { position: relative; z-index: 1; display: grid; gap: 7px; }
.balance-copy > span { color: #ccecff; font-size: .72rem; font-weight: 850; letter-spacing: .09em; }
.balance-copy strong { font-size: clamp(2.35rem, 8vw, 4.2rem); line-height: 1; letter-spacing: -.045em; }
.balance-copy small { color: #d9f1ff; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #5be0a7; }
.balance-decoration { position: absolute; width: 360px; height: 360px; right: -110px; top: -135px; border: 55px solid rgba(255,255,255,.06); border-radius: 50%; }

.snapshot-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 13px; padding: 17px 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(255,255,255,.9); box-shadow: var(--shadow-md); }
.snapshot-meta div { min-width: 0; }
.snapshot-meta span, .snapshot-meta strong { display: block; }
.snapshot-meta span { color: var(--ink-500); font-size: .65rem; font-weight: 850; letter-spacing: .08em; }
.snapshot-meta strong { margin-top: 5px; overflow-wrap: anywhere; font-size: .88rem; }
.snapshot-meta small { grid-column: 1 / -1; color: var(--ink-500); font-size: .72rem; }
.snapshot-meta small.is-stale { color: #9a5b00; font-weight: 800; }

.content-section { margin-top: 34px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
.section-heading h2, .state-lab h2 { margin: 5px 0 0; font-size: 1.45rem; letter-spacing: -.025em; }
.count-badge { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-700); background: white; font-size: .73rem; font-weight: 750; }
.sources-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.source-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; min-width: 0; padding: 19px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(255,255,255,.94); box-shadow: var(--shadow-md); transition: transform .2s, box-shadow .2s; }
.source-card:hover { transform: translateY(-2px); box-shadow: 0 18px 38px rgba(23,63,96,.14); }
.source-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; color: var(--navy-900); background: #e8f5ff; font-size: 1.25rem; font-weight: 900; }
.source-meta { min-width: 0; }
.source-meta strong, .source-meta span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-meta strong { font-size: .95rem; } .source-meta span { margin-top: 4px; color: var(--ink-500); font-size: .76rem; }
.source-value { text-align: right; }
.source-value strong { display: block; font-size: 1.06rem; white-space: nowrap; }
.source-status { display: inline-flex; align-items: center; gap: 5px; margin-top: 5px; color: var(--green); font-size: .69rem; font-weight: 800; text-transform: uppercase; }
.source-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.source-status.is-inactive { color: var(--ink-500); }

.state-panel { display: none; min-height: 250px; place-items: center; padding: 30px 20px; border: 1px dashed #bfd4e5; border-radius: var(--radius-lg); text-align: center; background: rgba(255,255,255,.78); }
.state-panel.is-visible { display: grid; }
.state-illustration { display: grid; place-items: center; width: 68px; height: 68px; margin: auto auto 15px; border-radius: 21px; background: #e8f5ff; color: var(--blue-600); font-size: 1.8rem; font-weight: 900; }
.state-panel h3 { margin: 0 0 8px; font-size: 1.15rem; }
.state-panel p { max-width: 410px; margin: 0; color: var(--ink-500); line-height: 1.55; }
.retry-button { margin-top: 18px; min-height: 42px; padding: 0 16px; border: 1px solid #9fc7e6; border-radius: 11px; color: var(--navy-900); background: white; font-weight: 800; }
.state-lab { margin-top: 30px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px; border: 1px solid #d4e5f2; border-radius: var(--radius-lg); background: linear-gradient(110deg, #eef8ff, #fff); }
.state-lab p { margin: 7px 0 0; color: var(--ink-500); font-size: .84rem; }
.segmented-control { display: flex; flex-wrap: wrap; gap: 7px; padding: 5px; border-radius: 13px; background: #dfeefa; }
.state-button { min-height: 39px; padding: 0 13px; border: 0; border-radius: 9px; color: var(--ink-700); background: transparent; font-size: .75rem; font-weight: 800; }
.state-button.is-active { color: white; background: var(--navy-900); box-shadow: 0 6px 14px rgba(4,50,88,.2); }
.page-footer { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 28px; color: var(--ink-500); text-align: left; }
.page-footer p { margin: 0; font-size: .76rem; line-height: 1.5; }
.shield { flex: 0 0 auto; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--green); background: var(--green-soft); font-weight: 900; }

@media (max-width: 760px) {
  .topbar-inner, .dashboard { width: min(100% - 24px, 1120px); }
  .topbar-inner { min-height: 62px; } .brand-lockup--compact { font-size: .78rem; }
  .demo-pill { padding: 7px 9px; font-size: .58rem; } .dashboard { padding-top: 27px; }
  .welcome-row { align-items: flex-start; flex-direction: column; gap: 15px; }
  .read-only-badge { width: 100%; }
  .balance-card { min-height: 174px; padding: 23px 20px; gap: 15px; border-radius: 22px; }
  .balance-icon { width: 58px; height: 58px; border-radius: 17px; }
  .balance-copy strong { font-size: clamp(2.15rem, 12vw, 3.5rem); }
  .sources-grid { grid-template-columns: 1fr; }
  .state-lab { align-items: stretch; flex-direction: column; }
  .segmented-control { display: grid; grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 460px) {
  .entry-shell { padding: 12px; } .entry-card { padding: 25px 20px; border-radius: 22px; }
  .entry-copy { margin-top: 30px; } .brand-lockup { font-size: .86rem; }
  .entry-footer { justify-content: flex-start; } .brand-lockup--compact > span:last-child { display: none; }
  .balance-card { align-items: flex-start; } .balance-icon { width: 48px; height: 48px; }
  .balance-copy > span { font-size: .62rem; } .balance-copy small { font-size: .67rem; }
  .source-card { grid-template-columns: auto minmax(0, 1fr); }
  .source-value { grid-column: 2; text-align: left; } .source-value strong { margin-top: 4px; }
  .snapshot-meta { grid-template-columns: 1fr; }
  .snapshot-meta small { grid-column: 1; }
  .segmented-control { grid-template-columns: 1fr; } .page-footer { align-items: flex-start; }
  .welcome-row h1, .welcome-row p { overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
