:root {
  --green: #0b3b2e;
  --green-2: #176347;
  --green-3: #2f7d57;
  --mint: #e8f2ec;
  --cream: #fbf7ec;
  --cream-2: #f3eddc;
  --gold: #ffb627;
  --gold-soft: #fff0bd;
  --coral: #ff5d5d;
  --coral-soft: #ffe3df;
  --cobalt: #2f6fed;
  --ink: #152420;
  --muted: #64716c;
  --line: #dfe5df;
  --white: #fff;
  --shadow-sm: 0 8px 24px rgba(11, 59, 46, .08);
  --shadow-lg: 0 22px 62px rgba(11, 59, 46, .14);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;
  color: var(--ink);
  background: var(--cream);
  font: 16px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--cream); }
body.modal-open { overflow: hidden; }
body::selection { background: var(--gold-soft); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2, h3 { font-family: "Arial Rounded MT Bold", "Trebuchet MS", Inter, sans-serif; color: var(--ink); letter-spacing: -.035em; }
h1 { margin: .3rem 0 .7rem; font-size: clamp(2.2rem, 5vw, 4.5rem); line-height: .98; }
h2 { margin: 0 0 .7rem; font-size: clamp(1.45rem, 2.5vw, 2rem); line-height: 1.12; }
h3 { margin: 0 0 .45rem; font-size: 1.07rem; line-height: 1.25; }
p { margin: .4rem 0 1rem; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.microcopy, .disclaimer { color: var(--muted); font-size: .78rem; line-height: 1.45; }
.disclaimer { max-width: 720px; margin-top: 24px; }
.mono, .price, .balance-value, .probability-label, .metric strong, td.numeric {
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-variant-numeric: tabular-nums;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--green-2);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .13em;
  font-size: .74rem;
}
.eyebrow-light { color: #b8f0d4; }

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px max(22px, 4vw);
  background: var(--green);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: 0 1px 0 rgba(255,255,255,.08);
}
.brand { color: var(--white); font-weight: 950; font-size: 1.12rem; letter-spacing: -.04em; white-space: nowrap; }
.brand span { color: var(--gold); }
.brand small { margin-left: 8px; font-size: .7rem; font-weight: 750; letter-spacing: 0; opacity: .72; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.icon-button {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: white;
}
.top-button { min-height: 44px; background: var(--white) !important; color: var(--green) !important; border-color: transparent !important; }

.auth-layout {
  min-height: calc(100vh - 76px);
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(380px, .82fr);
  background:
    radial-gradient(circle at 12% 22%, rgba(255,182,39,.15) 0 90px, transparent 91px),
    linear-gradient(118deg, var(--green) 0 57%, var(--cream) 57% 100%);
}
.auth-story {
  align-self: center;
  max-width: 720px;
  padding: clamp(46px, 8vw, 110px);
  color: rgba(255,255,255,.84);
}
.auth-story h1 { color: white; font-size: clamp(3rem, 7vw, 6.4rem); }
.auth-story h1 em { color: var(--gold); font-style: normal; }
.auth-story > p { max-width: 600px; font-size: clamp(1.05rem, 2vw, 1.35rem); }
.auth-benefits { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.auth-benefits span { padding: 9px 13px; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; font-size: .85rem; }
.auth-panel {
  width: min(460px, calc(100% - 36px));
  align-self: center;
  justify-self: center;
  padding: clamp(26px, 4vw, 42px);
  box-shadow: var(--shadow-lg);
}
.auth-panel h2 { margin-top: 8px; font-size: clamp(2rem, 4vw, 3rem); }
.auth-actions .btn { flex: 1 1 170px; }
.form-error { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--coral-soft); color: #8b2929; font-size: .88rem; }

.onboarding {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 25, 19, .78);
  backdrop-filter: blur(10px);
}
.onboarding-card {
  width: min(620px, 100%);
  min-height: min(650px, 88vh);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: clamp(28px, 6vw, 60px);
  border-radius: var(--radius-xl);
  background: var(--green);
  color: rgba(255,255,255,.82);
  box-shadow: 0 28px 90px rgba(0,0,0,.35);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.onboarding-card h1 { color: white; font-size: clamp(2.7rem, 8vw, 5.5rem); }
.onboarding-card h1 em { color: var(--gold); font-style: normal; }
.onboarding-visual {
  width: 160px;
  height: 160px;
  display: grid;
  place-items: center;
  margin: 10px auto 32px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffd46f, var(--gold) 60%, #d99100 61%);
  color: var(--green);
  font-size: 4rem;
  box-shadow: 0 16px 0 rgba(0,0,0,.12);
}
.onboarding-dots { display: flex; justify-content: center; gap: 8px; margin: 24px 0; }
.onboarding-dots span { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.25); }
.onboarding-dots span.active { width: 28px; border-radius: 99px; background: var(--gold); }
.onboarding-actions { display: flex; gap: 10px; }
.onboarding-actions .btn { flex: 1; }
.onboarding-actions .secondary { background: transparent; color: white; border-color: rgba(255,255,255,.38); }

.shell { display: grid; grid-template-columns: 246px minmax(0, 1fr); min-height: calc(100vh - 76px); }
.sidebar {
  position: sticky;
  top: 76px;
  height: calc(100vh - 76px);
  display: flex;
  flex-direction: column;
  padding: 28px 18px;
  background: rgba(255,255,255,.78);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(16px);
  z-index: 20;
}
.sidebar-heading { margin: 0 14px 10px; color: #8a938f; font-size: .68rem; font-weight: 850; text-transform: uppercase; letter-spacing: .14em; }
#nav { display: grid; gap: 5px; }
#nav button {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 13px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-weight: 720;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
#nav button:hover { color: var(--green); background: var(--mint); transform: translateX(2px); }
#nav button.active { color: var(--green); background: var(--mint); font-weight: 900; }
.nav-icon { width: 24px; text-align: center; font-size: 1.1rem; }
.sidebar-note {
  display: grid;
  gap: 5px;
  margin-top: auto;
  padding: 15px;
  border-radius: var(--radius-md);
  background: var(--green);
  color: white;
}
.sidebar-note span { color: rgba(255,255,255,.68); font-size: .75rem; line-height: 1.4; }
#view { min-width: 0; padding: clamp(28px, 4.5vw, 64px); outline: none; }
.page-wrap { width: min(1220px, 100%); margin: 0 auto; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-head h1 { margin-bottom: 0; }
.page-head-copy { max-width: 760px; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.card {
  background: rgba(255,255,255,.94);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.card.soft { background: rgba(255,255,255,.62); box-shadow: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.section-block { margin-top: 34px; }
.section-title { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.section-title h2 { margin: 0; }

.btn {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: var(--green-2);
  color: white;
  font-weight: 850;
  line-height: 1.1;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(11,59,46,.15); }
.btn:active { transform: translateY(0); }
.btn:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(47,111,237,.36); outline-offset: 2px; }
.btn.secondary { background: white; color: var(--green); border-color: var(--green-3); }
.btn.gold, .btn.yes { background: var(--gold); color: #2e2308; }
.btn.no { background: var(--coral); color: #4e1010; }
.btn.ghost { background: transparent; color: var(--green); border-color: var(--line); box-shadow: none; }
.btn.danger { background: var(--coral-soft); color: #812525; }
.btn.small { min-height: 40px; padding: 8px 13px; font-size: .84rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions.split > * { flex: 1; }

.field { display: grid; gap: 7px; margin: 14px 0; color: var(--ink); font-weight: 740; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid #bdc9c3;
  border-radius: var(--radius-sm);
  background: white;
  color: var(--ink);
  font-weight: 500;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #99a39f; }
.field-note { color: var(--muted); font-size: .78rem; font-weight: 500; }
.input-stepper { display: grid; grid-template-columns: 48px 1fr 48px; align-items: stretch; gap: 8px; }
.input-stepper button { min-height: 48px; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--green); font-size: 1.4rem; }
.input-stepper input { text-align: center; }

.stat-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.stat-card { min-height: 128px; display: flex; flex-direction: column; justify-content: space-between; }
.stat-card span { color: var(--muted); font-size: .83rem; font-weight: 720; }
.stat-card strong { font-family: "IBM Plex Mono", Consolas, monospace; font-size: clamp(1.6rem, 3vw, 2.25rem); letter-spacing: -.06em; }
.balance-card {
  position: relative;
  overflow: hidden;
  min-height: 174px;
  color: white;
  background: var(--green);
  border-color: transparent;
}
.balance-card::after { content: ""; position: absolute; right: -35px; bottom: -70px; width: 180px; height: 180px; border: 30px solid rgba(255,182,39,.16); border-radius: 50%; }
.balance-card h2, .balance-card .muted { color: white; }
.balance-card .muted { opacity: .7; }
.balance-value { display: block; margin: 8px 0 2px; font-size: clamp(2rem, 5vw, 3.3rem); font-weight: 900; letter-spacing: -.07em; }
.balance-card.locked { color: var(--ink); background: white; border-style: dashed; }
.balance-card.locked h2, .balance-card.locked .muted { color: inherit; }
.balance-card.locked::after { border-color: rgba(47,111,237,.08); }

.filters { display: flex; gap: 8px; margin: 18px 0 24px; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters button {
  min-height: 44px;
  flex: 0 0 auto;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  font-weight: 760;
}
.filters button.active { background: var(--green); border-color: var(--green); color: white; }

.markets-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(315px, 1fr)); gap: 18px; }
.market-card { position: relative; overflow: hidden; display: grid; gap: 17px; padding: 23px; }
.market-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: linear-gradient(90deg, var(--gold), var(--green-3)); }
.market-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ticker { margin: 0; color: var(--green-2); font-weight: 950; letter-spacing: .05em; }
.pill { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 5px 10px; border-radius: 999px; background: var(--mint); color: var(--green); font-size: .75rem; font-weight: 850; }
.pill.gold { background: var(--gold-soft); color: #795400; }
.pill.coral { background: var(--coral-soft); color: #8b2b2b; }
.pill.cobalt { background: #e4ecff; color: #234f9f; }
.market-card h2 { min-height: 2.5em; margin-bottom: 0; font-size: 1.35rem; }
.market-signal { display: grid; grid-template-columns: 108px 1fr; align-items: center; gap: 18px; }
.probability-ring { position: relative; width: 106px; height: 106px; flex: 0 0 auto; }
.probability-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.probability-ring circle { fill: none; stroke-width: 10; }
.probability-ring .ring-track { stroke: #ebe7dc; }
.probability-ring .ring-value { stroke: var(--gold); stroke-linecap: round; transition: stroke-dasharray .3s ease; }
.probability-ring.no-ring .ring-value { stroke: var(--coral); }
.probability-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; font-size: 1.35rem; font-weight: 950; letter-spacing: -.08em; }
.probability-label small { display: block; margin-top: -2px; font-family: Inter, sans-serif; color: var(--muted); font-size: .61rem; font-weight: 750; letter-spacing: 0; }
.market-meta { display: grid; gap: 7px; }
.market-meta strong { font-size: 1.05rem; }
.market-meta span { color: var(--muted); font-size: .82rem; }
.market-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.empty-state { grid-column: 1 / -1; min-height: 230px; display: grid; place-content: center; text-align: center; }
.empty-symbol { width: 64px; height: 64px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 50%; background: var(--mint); font-size: 1.8rem; }

.welcome-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr);
  gap: 24px;
  align-items: center;
  padding: clamp(26px, 5vw, 52px);
  color: white;
  background: var(--green);
  border-color: transparent;
}
.welcome-card h1 { color: white; }
.welcome-card p { max-width: 640px; color: rgba(255,255,255,.72); }
.welcome-card .eyebrow { color: #a8e8c9; }
.welcome-balance { position: relative; z-index: 1; padding: 23px; border-radius: var(--radius-lg); background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); }
.welcome-balance span { display: block; color: rgba(255,255,255,.7); font-size: .8rem; }
.welcome-balance strong { display: block; color: var(--gold); font: 900 clamp(2rem, 4vw, 3rem)/1.1 "IBM Plex Mono", Consolas, monospace; letter-spacing: -.08em; }
.quick-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.quick-link { min-height: 88px; display: grid; align-content: center; gap: 2px; text-align: left; }
.quick-link strong { color: var(--green); }
.quick-link span { color: var(--muted); font-size: .76rem; }

.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 18px; background: rgba(4,25,19,.76); backdrop-filter: blur(8px); }
.modal-panel { width: min(760px, 100%); max-height: calc(100vh - 36px); overflow: auto; border-radius: var(--radius-xl); background: var(--cream); box-shadow: 0 28px 90px rgba(0,0,0,.35); }
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 18px 22px; background: rgba(251,247,236,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.modal-body { padding: clamp(22px, 4vw, 38px); }
.close-button { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--green); font-size: 1.25rem; }
.market-detail-hero { display: grid; grid-template-columns: 135px 1fr; align-items: center; gap: 24px; margin-bottom: 24px; }
.market-detail-hero .probability-ring { width: 132px; height: 132px; }
.market-detail-hero h1 { font-size: clamp(1.9rem, 5vw, 3.2rem); }
.choice-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.choice-toggle button { min-height: 62px; border: 2px solid transparent; border-radius: 16px; font-weight: 900; }
.choice-toggle .yes-choice { background: var(--gold-soft); color: #684900; }
.choice-toggle .no-choice { background: var(--coral-soft); color: #842929; }
.choice-toggle button.selected { border-color: currentColor; box-shadow: inset 0 0 0 2px white; }
.quote-box { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 15px 0; }
.quote-item { padding: 13px; border-radius: 13px; background: white; border: 1px solid var(--line); }
.quote-item span { display: block; color: var(--muted); font-size: .72rem; }
.quote-item strong { font: 850 1rem/1.25 "IBM Plex Mono", Consolas, monospace; }
.fees-note { padding: 12px 14px; border-radius: 12px; background: #eef2ff; color: #334d7c; font-size: .8rem; }
.existing-position { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 18px; }
.existing-position summary { cursor: pointer; color: var(--green); font-weight: 850; }

.history-list { display: grid; gap: 10px; }
.history-row { display: grid; grid-template-columns: 48px minmax(0,1fr) auto; gap: 13px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.history-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--mint); color: var(--green); font-weight: 900; }
.history-icon.no { background: var(--coral-soft); color: #842929; }
.history-row p { margin: 0; }
.history-row small { color: var(--muted); }
.history-amount { text-align: right; font: 800 .86rem/1.35 "IBM Plex Mono", Consolas, monospace; }
.history-amount.positive { color: var(--green-2); }

.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: end; margin: 24px 0; }
.podium-card { min-height: 170px; display: grid; place-content: center; gap: 5px; text-align: center; }
.podium-card.first { min-height: 205px; background: linear-gradient(145deg, #fff9dd, white); border-color: #efd275; }
.podium-rank { width: 46px; height: 46px; display: grid; place-items: center; margin: 0 auto 7px; border-radius: 50%; background: var(--cream-2); color: var(--green); font: 900 1.15rem/1 "IBM Plex Mono", Consolas, monospace; }
.podium-card.first .podium-rank { background: var(--gold); color: var(--ink); }
.podium-card strong { font-size: 1.05rem; }
.podium-card span { color: var(--muted); font-size: .8rem; }
.rank-list { display: grid; gap: 8px; }
.rank-row { display: grid; grid-template-columns: 46px minmax(0,1fr) 120px 110px; align-items: center; gap: 12px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.rank-row.current { position: sticky; bottom: 12px; z-index: 2; background: var(--green); color: white; border-color: var(--green); box-shadow: var(--shadow-lg); }
.rank-row.current .muted { color: rgba(255,255,255,.7); }
.rank-number { font: 900 1rem/1 "IBM Plex Mono", Consolas, monospace; }

.profile-hero { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; }
.avatar { width: 78px; height: 78px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: var(--green); font-size: 1.65rem; font-weight: 950; }
.settings-list { display: grid; gap: 10px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 58px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row span { color: var(--muted); font-size: .8rem; }
.switch { position: relative; width: 50px; height: 29px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { position: absolute; inset: 0; border-radius: 999px; background: #cbd3cf; transition: background .16s ease; }
.switch-track::after { content: ""; position: absolute; width: 23px; height: 23px; left: 3px; top: 3px; border-radius: 50%; background: white; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .16s ease; }
.switch input:checked + .switch-track { background: var(--green-3); }
.switch input:checked + .switch-track::after { transform: translateX(21px); }
.badge-list { display: flex; gap: 10px; flex-wrap: wrap; }
.achievement { width: 92px; min-height: 96px; display: grid; place-content: center; gap: 4px; text-align: center; border: 1px solid var(--line); border-radius: 16px; background: white; color: var(--muted); }
.achievement.earned { background: var(--gold-soft); border-color: #e7c150; color: var(--ink); }
.achievement b { font-size: 1.5rem; }
.achievement span { font-size: .67rem; }

.notice-list { display: grid; gap: 10px; }
.notice { display: grid; grid-template-columns: 50px minmax(0,1fr); gap: 14px; align-items: start; }
.notice-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--gold-soft); }
.notice p { margin: 0 0 3px; }
.notice time { color: var(--muted); font-size: .75rem; }

.metric strong { display: block; margin-top: 10px; font-size: 2.1rem; letter-spacing: -.06em; }
.tablewrap { overflow: auto; padding: 8px 14px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
tr:last-child td { border-bottom: 0; }
.toast { position: fixed; z-index: 100; right: 22px; bottom: 22px; max-width: min(390px, calc(100vw - 44px)); padding: 13px 17px; border-radius: 13px; background: var(--ink); color: white; box-shadow: var(--shadow-lg); }
.loading { display: grid; place-items: center; min-height: 50vh; color: var(--muted); }
.loading::before { content: ""; width: 38px; height: 38px; margin-bottom: 12px; border: 4px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 980px) {
  .auth-layout { grid-template-columns: 1fr; background: linear-gradient(180deg, var(--green) 0 45%, var(--cream) 45% 100%); }
  .auth-story { padding: 58px 32px 86px; }
  .auth-story h1 { font-size: clamp(2.9rem, 10vw, 5rem); }
  .auth-panel { margin: -56px auto 52px; }
  .welcome-card { grid-template-columns: 1fr; }
  .grid.three { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 760px) {
  body { padding-bottom: 78px; }
  .topbar { min-height: 64px; padding: 9px 14px; }
  .brand small { display: none; }
  .top-button { min-height: 42px; padding: 9px 11px; font-size: .77rem; }
  .install-app { display: none !important; }
  .shell { display: block; min-height: calc(100vh - 64px); }
  .sidebar {
    position: fixed;
    inset: auto 0 0;
    z-index: 50;
    height: auto;
    min-height: 72px;
    display: block;
    padding: 6px max(7px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(7px, env(safe-area-inset-left));
    border: 0;
    border-top: 1px solid var(--line);
    background: rgba(255,255,255,.96);
    box-shadow: 0 -8px 30px rgba(11,59,46,.09);
  }
  .sidebar-heading, .sidebar-note { display: none; }
  #nav { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; }
  #nav button { min-width: 0; min-height: 59px; display: grid; place-items: center; align-content: center; gap: 1px; padding: 4px 2px; border-radius: 12px; text-align: center; font-size: .61rem; }
  #nav button:hover { transform: none; }
  #nav button.mobile-hide { display: none; }
  #nav button.trade-nav { position: relative; top: -18px; width: 62px; height: 62px; min-height: 62px; margin: auto; border-radius: 50%; background: var(--gold); color: var(--green); box-shadow: 0 10px 25px rgba(116,79,0,.22); }
  #nav button.trade-nav .nav-icon { font-size: 1.45rem; }
  #view { padding: 24px 16px 34px; }
  .page-head { display: block; }
  .page-actions { margin-top: 16px; }
  .card { border-radius: 18px; padding: 18px; }
  .grid.two, .grid.three, .stat-strip { grid-template-columns: 1fr; }
  .markets-grid { grid-template-columns: 1fr; }
  .market-card h2 { min-height: 0; }
  .market-signal { grid-template-columns: 94px 1fr; }
  .probability-ring { width: 92px; height: 92px; }
  .quick-links { grid-template-columns: 1fr; }
  .quick-link { min-height: 72px; }
  .market-detail-hero { grid-template-columns: 92px 1fr; gap: 15px; }
  .market-detail-hero .probability-ring { width: 90px; height: 90px; }
  .quote-box { grid-template-columns: 1fr; }
  .history-row { grid-template-columns: 44px minmax(0,1fr); }
  .history-amount { grid-column: 2; text-align: left; }
  .podium { gap: 7px; }
  .podium-card { min-height: 145px; padding: 12px 6px; }
  .podium-card.first { min-height: 170px; }
  .podium-card strong { font-size: .82rem; }
  .rank-row { grid-template-columns: 36px minmax(0,1fr) 75px; padding: 12px; }
  .rank-row .rank-gains { display: none; }
  .profile-hero { grid-template-columns: auto 1fr; }
  .profile-hero .btn { grid-column: 1 / -1; }
  .modal { align-items: end; padding: 0; }
  .modal-panel { max-height: 92vh; border-radius: 26px 26px 0 0; }
  .modal-body { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
  .toast { right: 12px; bottom: calc(86px + env(safe-area-inset-bottom)); }
}

@media (max-width: 430px) {
  .auth-story { padding-inline: 22px; }
  .auth-benefits { display: grid; }
  .auth-panel { width: calc(100% - 24px); padding: 22px; }
  .auth-actions { display: grid; }
  .market-actions { grid-template-columns: 1fr; }
  .choice-toggle button { min-height: 56px; }
  .podium-card:nth-child(1) { order: 2; }
  .podium-card:nth-child(2) { order: 1; }
  .podium-card:nth-child(3) { order: 3; }
}

@media (max-height: 760px) and (min-width: 761px) {
  .onboarding-card { min-height: 0; padding: 28px 42px; }
  .onboarding-visual { width: 96px; height: 96px; margin-bottom: 18px; font-size: 2.7rem; }
  .onboarding-card h1 { font-size: 3.25rem; }
  .onboarding-card p { margin-bottom: .5rem; }
  .onboarding-dots { margin: 14px 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
