:root {
  --ink: #11131c;
  --body: #34384a;
  --muted: #74798a;
  --faint: #aeb4c4;
  --line: #e1e5ef;
  --surface: #ffffff;
  --surface-soft: #f7f8fc;
  --surface-glass: rgba(255, 255, 255, 0.78);
  --canvas-top: #eef2f8;
  --canvas-mid: #f3f6fb;
  --canvas-bottom: #edf3fa;
  --accent-blue: #4f6df5;
  --accent-violet: #7466ff;
  --accent-cyan: #5ed8ff;
  --accent-green: #08b26b;
  --accent-red: #e54562;
  --accent-amber: #d99b27;
  --deep-blue: #1c2b70;
  --radius-sm: 14px;
  --radius-md: 22px;
  --radius-lg: 30px;
  --shadow-card: 0 24px 70px rgba(65, 73, 116, 0.16);
  --shadow-soft: 0 14px 34px rgba(82, 91, 140, 0.1);
  --blur: blur(22px);
  font-family: Manrope, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html,
body {
  min-height: 100%;
  margin: 0;
  background-color: var(--canvas-bottom);
}
html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  background:
    radial-gradient(circle at 16% 0%, rgba(116, 102, 255, 0.16), transparent 34%),
    radial-gradient(circle at 88% 10%, rgba(94, 216, 255, 0.14), transparent 30%),
    linear-gradient(180deg, var(--canvas-top) 0%, var(--canvas-mid) 46%, var(--canvas-bottom) 100%);
  background-color: var(--canvas-bottom);
}
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(116, 102, 255, .62) rgba(226, 232, 244, .72);
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track {
  background: rgba(226, 232, 244, .72);
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb {
  border: 2px solid rgba(226, 232, 244, .72);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-violet), var(--accent-blue));
}
*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #5d50e8, #315ff0);
}
body {
  min-height: 100dvh;
  min-width: 320px;
  overflow-x: clip;
  color: var(--body);
  background:
    radial-gradient(circle at 16% 0%, rgba(116, 102, 255, 0.2), transparent 34%),
    radial-gradient(circle at 88% 10%, rgba(94, 216, 255, 0.18), transparent 30%),
    linear-gradient(180deg, var(--canvas-top) 0%, var(--canvas-mid) 46%, var(--canvas-bottom) 100%);
  background-color: var(--canvas-bottom);
  font-size: 15px;
  line-height: 1.5;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255,255,255,.32) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255,255,255,.28) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.45), transparent 72%);
}
a { color: inherit; }
button, input { font: inherit; }
button {
  appearance: none;
  -webkit-appearance: none;
}
button, a, input { touch-action: manipulation; }
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(116, 102, 255, .34);
  outline-offset: 3px;
}

.app-shell {
  width: min(1188px, calc(100% - 48px));
  margin: 0 auto;
}
.page-stack {
  display: grid;
  gap: 18px;
  padding: 22px 0 72px;
}

.topbar {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}
.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(255,255,255,.38), rgba(255,255,255,0)),
    linear-gradient(135deg, var(--accent-violet), var(--accent-blue));
  box-shadow: 0 16px 34px rgba(79, 109, 245, .34);
  font-weight: 900;
  font-size: 20px;
}
.brand-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}
.brand-copy strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.05;
}
.brand-copy span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.nav-pill,
.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 16px;
  color: var(--ink);
  background: rgba(255,255,255,.74);
  text-decoration: none;
  font-weight: 900;
  font-size: 13px;
  box-shadow: 0 8px 22px rgba(75, 82, 122, .06);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.nav-pill:hover,
.btn:hover,
.app-card:hover {
  transform: translateY(-2px);
}
.nav-pill.active,
.btn.primary,
.pill.active,
.calc-choice.active,
.risk-choice.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-violet), var(--accent-blue));
  box-shadow: 0 16px 34px rgba(79, 109, 245, .26);
}
.btn.primary {
  border: 0;
}
.btn.ghost {
  color: var(--deep-blue);
  background: rgba(255,255,255,.54);
}
.btn.wide { width: 100%; }

.app-card {
  position: relative;
  min-width: 0;
  border: 1px solid rgba(255,255,255,.84);
  border-radius: var(--radius-lg);
  background: var(--surface-glass);
  box-shadow: var(--shadow-card);
  backdrop-filter: var(--blur);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.app-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 0 0, rgba(255,255,255,.9), transparent 34%),
    linear-gradient(135deg, rgba(255,255,255,.3), transparent 52%);
}
.app-card > * { position: relative; }
.hero-panel > *,
.home-grid > *,
.grid-even > *,
.grid-2 > *,
.kpi-grid > *,
.controls > *,
.home-result-grid > *,
.advanced-panel > * {
  min-width: 0;
}

.hero-panel {
  min-height: 260px;
  padding: 34px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .85fr);
  gap: 28px;
  align-items: end;
}
.hero-copy h1,
.screen-heading h1,
.page-intro h1 {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: clamp(32px, 5vw, 62px);
  line-height: .98;
}
.hero-copy p,
.screen-heading p,
.page-intro p {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--muted);
  font-weight: 700;
}
.eyebrow,
.card-chip,
.label,
.calc-label,
.kpi .label,
.home-metric span,
.calc-note > span:first-child {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}
.hero-ticker {
  display: grid;
  gap: 10px;
}
.ticker-item,
.stat,
.home-metric,
.kpi {
  border: 1px solid rgba(225, 229, 239, .86);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.78);
  box-shadow: var(--shadow-soft);
}
.ticker-item {
  padding: 16px;
  display: grid;
  gap: 4px;
}
.ticker-item span,
.stat span {
  color: var(--muted);
  font-weight: 900;
  font-size: 12px;
}
.ticker-item strong,
.stat strong {
  color: var(--ink);
  font-size: 23px;
  line-height: 1.1;
}
.ticker-item.wide strong { font-size: 16px; }

.home-grid,
.grid-even,
.grid-2,
.kpi-grid,
.controls,
.home-result-grid,
.advanced-panel {
  display: grid;
  gap: 16px;
}
.home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: minmax(0, 1.55fr) minmax(320px, .85fr); }
.market-card {
  min-height: 360px;
  padding: 28px;
  color: #fff;
  text-decoration: none;
  display: grid;
  align-content: start;
  gap: 18px;
}
.market-card::before {
  background:
    radial-gradient(circle at 10% 12%, rgba(255,255,255,.34), transparent 30%),
    radial-gradient(circle at 76% 78%, rgba(255,255,255,.2), transparent 28%),
    linear-gradient(135deg, rgba(255,255,255,.18), transparent 50%);
}
.calculator-entry {
  background:
    linear-gradient(135deg, rgba(106, 92, 255, .95), rgba(32, 42, 118, .98)),
    radial-gradient(circle at 25% 100%, rgba(94, 216, 255, .42), transparent 34%);
}
.xau-entry {
  background:
    linear-gradient(135deg, rgba(44, 123, 255, .96), rgba(12, 29, 84, .98)),
    radial-gradient(circle at 30% 94%, rgba(255,255,255,.28), transparent 32%);
}
.card-chip {
  width: fit-content;
  color: rgba(255,255,255,.82);
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  background: rgba(255,255,255,.12);
}
.card-headline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.card-headline h2,
.market-card h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(27px, 3vw, 38px);
  line-height: 1.05;
}
.market-card p {
  max-width: 560px;
  margin: 0;
  color: rgba(255,255,255,.82);
  font-weight: 700;
}
.round-action {
  min-width: 86px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255,255,255,.9);
  font-size: 12px;
  font-weight: 900;
}
.market-spark {
  height: 86px;
  display: flex;
  align-items: end;
  gap: 10px;
  padding: 10px 0;
}
.market-spark span {
  flex: 1;
  min-width: 16px;
  border-radius: 999px 999px 10px 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.2));
  box-shadow: 0 14px 28px rgba(255,255,255,.16);
}
.market-spark span:nth-child(1) { height: 36%; }
.market-spark span:nth-child(2) { height: 62%; }
.market-spark span:nth-child(3) { height: 44%; }
.market-spark span:nth-child(4) { height: 78%; }
.market-spark span:nth-child(5) { height: 56%; }
.card-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: auto;
}
.market-card .stat {
  min-height: 84px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 15px 16px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.24), rgba(255,255,255,.1)),
    rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.24);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.3),
    0 18px 34px rgba(10, 18, 54, .14);
}
.market-card .stat span {
  display: block;
  color: rgba(255,255,255,.72);
  font-size: 11px;
  line-height: 1;
}
.market-card .stat strong {
  display: block;
  color: #fff;
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.08;
  overflow-wrap: break-word;
}

.page-intro {
  min-height: 140px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding-top: 18px;
}
.page-intro h1 {
  font-size: clamp(30px, 4vw, 52px);
}
.period-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  margin-top: 18px;
  background:
    linear-gradient(180deg, rgba(239, 243, 249, .82), rgba(237, 243, 250, .72));
  backdrop-filter: blur(18px);
  border-top: 1px solid rgba(255,255,255,.42);
  border-bottom: 1px solid rgba(203, 213, 225, .42);
  box-shadow: 0 14px 34px rgba(68, 82, 130, .06);
}
.period-bar .app-shell {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  overflow-x: auto;
  scrollbar-width: thin;
}
.period-bar .app-shell::-webkit-scrollbar,
.scroll-row::-webkit-scrollbar,
.tabs::-webkit-scrollbar {
  display: block;
  height: 8px;
}
.period-bar .app-shell,
.scroll-row,
.tabs {
  scrollbar-gutter: stable;
}
.pill,
.calc-choice,
.risk-choice,
.advanced-toggle {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 16px;
  color: var(--ink);
  background: rgba(255,255,255,.78);
  cursor: pointer;
  font-weight: 900;
  box-shadow: 0 8px 22px rgba(75, 82, 122, .06);
}
.date-range {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: var(--muted);
}
.date-range input,
input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 12px;
  color: var(--ink);
  background: rgba(255,255,255,.86);
  font-weight: 900;
}
.date-range input { width: 140px; }

.kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.kpi {
  min-height: 136px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 18px;
}
.kpi.signature {
  grid-column: span 2;
  color: #fff;
  text-decoration: none;
  background:
    linear-gradient(135deg, rgba(116,102,255,.96), rgba(24,33,105,.98)),
    radial-gradient(circle at 18% 100%, rgba(94,216,255,.38), transparent 38%);
  border-color: transparent;
}
.kpi.signature .label,
.kpi.signature .value,
.kpi.signature .sub { color: #fff; }
.kpi .value,
.home-metric strong {
  display: block;
  color: var(--ink);
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.05;
}
.kpi .sub {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.panel {
  padding: 20px;
}
.panel h3 {
  margin: 0 0 16px;
  color: var(--ink);
  font-size: 17px;
}
.chart-wrap {
  height: 282px;
  position: relative;
  padding: 10px 4px 0;
  border: 1px solid rgba(225,229,239,.74);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.68), rgba(247,249,254,.4)),
    radial-gradient(circle at 12% 18%, rgba(116,102,255,.08), transparent 34%);
}
.chart-wrap.tall { height: 342px; }
.table-wrap {
  overflow: auto;
  max-height: 460px;
  border: 1px solid rgba(225,229,239,.8);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.9), rgba(247,249,254,.72));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.82),
    0 18px 42px rgba(66, 76, 120, .08);
}
table {
  width: 100%;
  min-width: 700px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
th, td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(225,229,239,.82);
  text-align: right;
  white-space: nowrap;
}
th:first-child, td:first-child { text-align: left; }
th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(14px);
  font-size: 11px;
  text-transform: uppercase;
}
td {
  color: var(--body);
  font-weight: 800;
}
tbody tr:nth-child(even) td {
  background: rgba(79, 109, 245, .035);
}
tbody tr:hover td {
  background: rgba(116, 102, 255, .085);
}
tbody tr:last-child td {
  border-bottom: 0;
}
.pos { color: var(--accent-green); }
.neg { color: var(--accent-red); }
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  background: var(--surface-soft);
  color: var(--body);
}
.badge.buy { color: #007a4b; background: rgba(8, 178, 107, .12); }
.badge.sell { color: #b8203d; background: rgba(229, 69, 98, .12); }

.calculator-shell {
  width: min(1220px, calc(100% - 48px));
}
.calculator-card {
  padding: 30px;
}
.screen-heading {
  margin-bottom: 22px;
}
.screen-heading h1 {
  max-width: 920px;
  font-size: clamp(30px, 4vw, 48px);
}
.calc-block {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}
.calc-options,
.scroll-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.risk-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.risk-choice {
  min-height: 72px;
  border-radius: 18px;
  display: grid;
  align-content: center;
  gap: 3px;
  text-align: left;
}
.risk-choice span {
  color: inherit;
  opacity: .82;
  font-size: 12px;
}
.calc-custom {
  width: 118px;
  border-style: dashed;
}
.advanced-box {
  margin-top: 20px;
  padding: 0;
  border-radius: 22px;
}
.advanced-toggle {
  width: 100%;
  min-height: 60px;
  border: 0;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
}
.advanced-panel {
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0 18px 18px;
}
.advanced-panel.open { display: grid; }
.controls { grid-template-columns: repeat(4, minmax(0, 1fr)); }
label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.home-result-grid {
  grid-template-columns: 1.25fr repeat(4, minmax(0, 1fr));
  margin-top: 20px;
}
.home-metric {
  min-height: 118px;
  display: grid;
  align-content: space-between;
  gap: 14px;
  padding: 18px 19px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.94), rgba(248,250,255,.76));
  border-color: rgba(225,229,239,.72);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.9),
    0 18px 44px rgba(65, 73, 116, .1);
}
.home-metric.accent {
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(231, 255, 244, .96), rgba(255,255,255,.92)),
    radial-gradient(circle at 100% 0, rgba(8,178,107,.16), transparent 36%);
  border-color: rgba(8,178,107,.28);
}
.home-metric span {
  line-height: 1.25;
}
.home-metric.accent span { color: #267b59; }
.home-metric.accent strong { color: var(--accent-green); }
.home-metric strong {
  color: var(--accent-green);
  font-size: clamp(22px, 2vw, 28px);
  letter-spacing: 0;
}
.calc-note {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  border: 1px solid rgba(225,229,239,.86);
  border-radius: 22px;
  padding: 16px 18px;
  color: var(--ink);
  background: rgba(255,255,255,.64);
}
.btn.community-cta {
  width: min(320px, 100%);
  min-width: 250px;
  min-height: 52px;
  display: flex;
  margin: 18px auto 0;
  padding: 0 24px;
  border-radius: 18px;
  background: linear-gradient(135deg, #17204d, var(--accent-blue) 52%, var(--accent-violet));
  box-shadow: 0 18px 38px rgba(79,109,245,.25);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.tab {
  min-height: 132px;
  display: grid;
  align-content: start;
  gap: 7px;
  border: 1px solid rgba(225,229,239,.9);
  border-radius: var(--radius-md);
  padding: 18px;
  color: var(--body);
  background: rgba(255,255,255,.72);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.tab:hover { transform: translateY(-2px); }
.tab.active {
  border-color: rgba(116,102,255,.42);
  box-shadow: 0 0 0 4px rgba(116,102,255,.11), var(--shadow-soft);
}
.tab strong {
  color: var(--ink);
  font-size: 17px;
}
.tab span:last-child {
  color: var(--muted);
  font-size: 13px;
}
.muted-tab { opacity: .82; }

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 50;
  width: min(430px, calc(100% - 28px));
  min-height: 62px;
  transform: translateX(-50%);
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 7px;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 28px;
  background: rgba(255,255,255,.84);
  backdrop-filter: blur(22px);
  box-shadow: 0 18px 48px rgba(58, 68, 117, .18);
}
.bottom-nav a {
  min-height: 48px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
}
.bottom-nav a.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent-violet), var(--accent-blue));
}

@media (max-width: 1020px) {
  .app-shell,
  .calculator-shell { width: min(100% - 28px, 760px); }
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .top-actions {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .hero-panel,
  .home-grid,
  .grid-2,
  .grid-even,
  .risk-grid,
  .controls,
  .advanced-panel,
  .home-result-grid {
    grid-template-columns: 1fr;
  }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tabs {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }
  .tab {
    flex: 0 0 260px;
    scroll-snap-align: start;
  }
}

@media (max-width: 680px) {
  html,
  body {
    overscroll-behavior-y: none;
  }
  body {
    font-size: 14px;
    padding-bottom: 82px;
    background:
      radial-gradient(circle at 8% -4%, rgba(116, 102, 255, .22), transparent 42%),
      radial-gradient(circle at 100% 4%, rgba(94, 216, 255, .16), transparent 38%),
      linear-gradient(180deg, var(--canvas-top) 0%, var(--canvas-mid) 50%, var(--canvas-bottom) 100%);
    background-color: var(--canvas-bottom);
  }
  .app-shell,
  .calculator-shell { width: calc(100% - 22px); }
  .topbar {
    min-height: auto;
    padding-top: calc(14px + env(safe-area-inset-top, 0px));
    padding-bottom: 10px;
  }
  .top-actions { display: none; }
  .brand-mark { width: 50px; height: 50px; border-radius: 17px; }
  .brand-copy strong { font-size: 19px; }
  .page-stack { gap: 14px; padding-top: 8px; padding-bottom: 36px; }
  .hero-panel,
  .calculator-card,
  .panel,
  .market-card { border-radius: 24px; padding: 20px; }
  .hero-copy,
  .screen-heading,
  .page-intro > div,
  .card-headline,
  .market-card p {
    min-width: 0;
    max-width: 100%;
  }
  .hero-copy h1,
  .screen-heading h1,
  .page-intro h1 {
    max-width: 100%;
    font-size: clamp(26px, 7vw, 30px);
    line-height: 1.05;
    overflow-wrap: break-word;
    word-break: normal;
  }
  .hero-copy p,
  .screen-heading p,
  .page-intro p {
    overflow-wrap: break-word;
  }
  .page-intro {
    min-height: auto;
    align-items: flex-start;
    flex-direction: column;
  }
  .period-bar {
    margin-top: 6px;
    background: transparent;
    backdrop-filter: none;
    border-top: 0;
    border-bottom: 0;
    box-shadow: none;
  }
  .market-card { min-height: 300px; }
  .card-headline { display: grid; }
  .card-headline h2,
  .market-card h2 { font-size: 28px; }
  .round-action { width: fit-content; }
  .card-stats { grid-template-columns: 1fr; }
  .period-bar .app-shell {
    width: calc(100% - 22px);
    padding: 0 0 10px;
  }
  .date-range { flex: 0 0 auto; margin-left: 0; }
  .date-range input { width: 132px; }
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi.signature { grid-column: auto; }
  .chart-wrap,
  .chart-wrap.tall { height: 250px; }
  .table-wrap {
    margin-left: -10px;
    margin-right: -10px;
    border-radius: 18px;
    max-height: 390px;
  }
  table { min-width: 680px; font-size: 12px; }
  th, td { padding: 10px 12px; }
  .scroll-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .calc-choice { flex: 0 0 auto; }
  .bottom-nav {
    left: 11px;
    right: 11px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    width: auto;
    transform: none;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .bottom-nav a {
    min-width: 0;
    padding: 0 4px;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
  }
  .bottom-nav a span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

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