/* ---------- theme tokens ---------- */
:root, [data-theme="light"] {
  --bg: #f3f5fa; --surface: #ffffff; --surface-2: #f0f2f8; --surface-3: #e7ebf4; --border: #e2e6ef;
  --text: #0e1426; --muted: #5d6680; --faint: #8a92a8;
  --accent: #f5b400; --accent-ink: #1b1400; --accent-text: #8f6400; --accent-soft: #fff4d1;
  --brand: #12307a; --brand-2: #1f4fb8; --brand-soft: #e8eefc;
  --pos: #0b9a63; --neg: #dc2c3b; --pos-soft: #e3f6ee; --neg-soft: #fde8ea; --warn: #b26a00; --warn-soft: #fff1d6;
  --hero: linear-gradient(135deg, #0f2a6e 0%, #1b46a8 60%, #2a62d6 100%); --hero-text: #ffffff;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .18);
  --chart-1: #1f4fb8; --chart-2: #f5b400; --chart-3: #0b9a63; --chart-4: #c2410c; --chart-5: #7c3aed; --chart-6: #0891b2;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0a0c11; --surface: #13161e; --surface-2: #1a1e28; --surface-3: #222736; --border: #252a37;
  --text: #eceef4; --muted: #949bb0; --faint: #6b7287;
  --accent: #ffc21a; --accent-ink: #1b1400; --accent-text: #ffc21a; --accent-soft: #2b2410;
  --brand: #4d7cf0; --brand-2: #6b93f5; --brand-soft: #1a2340;
  --pos: #2ccf7f; --neg: #ff5a68; --pos-soft: #10291d; --neg-soft: #33141a; --warn: #ffb547; --warn-soft: #2e2311;
  --hero: linear-gradient(135deg, #1b2030 0%, #232a3f 60%, #2b3452 100%); --hero-text: #ffffff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 16px 48px rgba(0, 0, 0, .55);
  --chart-1: #6b93f5; --chart-2: #ffc21a; --chart-3: #2ccf7f; --chart-4: #fb923c; --chart-5: #a78bfa; --chart-6: #22d3ee;
  color-scheme: dark;
}
[data-theme="navy"] {
  --bg: #061230; --surface: #0c1c44; --surface-2: #12265a; --surface-3: #183068; --border: #1d3571;
  --text: #e9eefc; --muted: #9eb0d8; --faint: #7286b4;
  --accent: #ffc21a; --accent-ink: #1b1400; --accent-text: #ffc21a; --accent-soft: #2a2a2a33;
  --brand: #6f9bff; --brand-2: #8fb2ff; --brand-soft: #16306e;
  --pos: #34d399; --neg: #ff6b7a; --pos-soft: #0e3a3a; --neg-soft: #3d1a37; --warn: #ffbf5a; --warn-soft: #33301f;
  --hero: linear-gradient(135deg, #13348a 0%, #1b49b8 55%, #2a63e0 100%); --hero-text: #ffffff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .25); --shadow-lg: 0 16px 48px rgba(0, 0, 0, .5);
  --chart-1: #8fb2ff; --chart-2: #ffc21a; --chart-3: #34d399; --chart-4: #fb923c; --chart-5: #c4b5fd; --chart-6: #67e8f9;
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.5 "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, "Nirmala UI", "Noto Sans Devanagari", "Noto Sans Kannada", "Noto Sans Telugu", "Mangal", "Tunga", "Gautami", sans-serif;
  -webkit-font-smoothing: antialiased; min-height: 100vh;
  transition: background-color .2s ease, color .2s ease;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 26px; } h2 { font-size: 20px; } h3 { font-size: 16px; }
p { margin: 0; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.pos { color: var(--pos); } .neg { color: var(--neg); }
.num { font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 12px; } .row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; } .stack.lg { gap: 20px; } .stack.sm { gap: 6px; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }
svg.i { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }

.wrap-page { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
@media (max-width: 640px) { .wrap-page { padding: 0 16px; } }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.topbar .wrap-page { display: flex; align-items: center; gap: 14px; height: 68px; }
.profile-btn { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); cursor: pointer; max-width: 260px; }
.profile-btn:hover { border-color: var(--brand-2); }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--hero); color: #fff; flex: none; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-edit { position: relative; flex: none; }
.avatar-edit .avatar.lg { width: 76px; height: 76px; font-size: 26px; }
.avatar-cam { position: absolute; right: -4px; bottom: -4px; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--surface);
  background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; cursor: pointer; padding: 0; }
.avatar-cam svg { width: 16px; height: 16px; }
.avatar-cam:hover { filter: brightness(1.08); }
.profile-btn .who { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.profile-btn .who b { font-size: 14px; }
/* Dashboard account buttons: round, with dotted rings orbiting around them */
/* overflow-x: clip: a spinning ring's (invisible) box grows while it rotates; don't let it widen the page */
.orbs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; padding: 16px 8px 6px; overflow-x: clip; max-width: 760px; margin: 0 auto; }
.orb { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--text); text-decoration: none; text-align: center; padding: 4px 2px; border-radius: 14px; }
.orb-disc { position: relative; width: 64px; height: 64px; flex: none; }
.orb-disc::before, .orb-disc::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.orb-disc::before { inset: -6px; border: 2px dotted #d4a843; animation: orbit 10s linear infinite; }
.orb-disc::after { inset: -11px; border: 2px dotted color-mix(in srgb, var(--brand-2) 70%, transparent); animation: orbit 16s linear infinite reverse; }
/* navy disc like the "A" in the AlphaAnalyst logo */
.orb-core { position: relative; width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(145deg, #1d4a9e, #0b2a5b); border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 6px 16px rgba(11, 42, 91, .28), inset 0 1px 0 rgba(255, 255, 255, .2); transition: transform .2s ease; }
.orb-ico { width: 28px; height: 28px; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.orb-ico .w { stroke: #fff; stroke-width: 1.7; }
.orb-ico .g { stroke: #e3b341; stroke-width: 2; }
.orb-ico .gf { fill: #e3b341; }
.orb-label { font-size: 13px; font-weight: 700; line-height: 1.3; max-width: 120px; }
.orb:hover .orb-core, .orb:focus-visible .orb-core { transform: scale(1.06); }
.orb:hover .orb-disc::before { animation-duration: 3s; }
.orb:hover .orb-disc::after { animation-duration: 5s; }
.orb:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
@keyframes orbit { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .orb-disc::before, .orb-disc::after { animation: none; } }
@media (max-width: 640px) {
  .orbs { gap: 4px; padding: 12px 8px 4px; }
  .orb { gap: 10px; }
  .orb-disc { width: 46px; height: 46px; }
  .orb-disc::before { inset: -5px; }
  .orb-disc::after { inset: -9px; border-width: 1.5px; }
  .orb-ico { width: 22px; height: 22px; }
  .orb-label { font-size: 11px; }
}
/* the account pages (#/holdings, #/returns, ...) */
.orb-core.sm { width: 40px; height: 40px; flex: none; box-shadow: none; }
.orb-core.sm .orb-ico { width: 22px; height: 22px; }
.page-head { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.page-switch { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
.page-switch .tab { text-decoration: none; white-space: nowrap; }
.member-chips { gap: 8px; align-items: center; }
.member-chips .chip { height: 34px; padding: 0 14px; cursor: pointer; }
/* Import: individual / family */
.import-mode { display: flex; align-items: flex-start; gap: 14px; text-align: left; cursor: pointer; font: inherit; color: var(--text); border: 2px solid var(--border); background: var(--surface); }
.import-mode:hover { border-color: var(--brand-2); }
.import-mode.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.import-mode .check { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; border: 2px solid var(--border); color: transparent; }
.import-mode.on .check { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.import-mode .check svg { width: 15px; height: 15px; }
.family-card .avatar { width: 36px; height: 36px; font-size: 14px; }
/* AlphaAnalyst brand: the logo mark sits on a white tile so its navy "A" stays visible on dark themes */
.brand { display: flex; align-items: center; gap: 10px; flex: none; color: var(--text); text-decoration: none; }
.brand img { width: 40px; height: 40px; border-radius: 11px; background: #fff; border: 1px solid var(--border); display: block; }
.brand-name { font-size: 19px; letter-spacing: -.02em; white-space: nowrap; }
.brand-name b { font-weight: 800; }
.brand-name .gold { color: var(--accent-text); }
.brand-logo { position: relative; z-index: 1; align-self: center; width: 240px; background: #fff; border-radius: 18px; padding: 8px 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.brand-logo img { display: block; width: 100%; height: auto; }
@media (max-width: 1100px) { .brand-name { display: none; } }
@media (max-width: 900px) { .brand-logo { width: 170px; padding: 6px 10px; border-radius: 14px; } }
@media (max-width: 480px) { .topbar .brand { display: none; } }
.brand-mark { font-weight: 800; letter-spacing: -.02em; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.brand-mark .dot { width: 26px; height: 26px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 14px; }

.search { position: relative; flex: 1; max-width: 560px; }
.search input { width: 100%; height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); padding: 0 14px 0 42px; outline: none; }
.search input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-2) 18%, transparent); }
.search > .i { position: absolute; left: 14px; top: 13px; color: var(--muted); }
.search .mic { position: absolute; right: 6px; top: 6px; width: 32px; height: 32px; border-radius: 9px; border: 0; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; cursor: pointer; }
.search .mic:hover { background: var(--accent); color: var(--accent-ink); }
.topbar .search input { padding-right: 46px; }
.voice-panel { position: fixed; right: 20px; bottom: 20px; width: 380px; max-width: calc(100vw - 32px); z-index: 75; padding: 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow-lg); animation: pop .18s ease; }
.voice-state { font-weight: 700; color: var(--accent-text); display: flex; align-items: center; gap: 10px; min-height: 20px; }
.voice-state.error { color: var(--neg); }
.voice-heard { font-size: 18px; font-weight: 700; }
.voice-reply { color: var(--muted); line-height: 1.6; max-height: 220px; overflow: auto; }
.pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--neg); animation: pulse 1s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(220, 44, 59, .6); } 100% { box-shadow: 0 0 0 12px rgba(220, 44, 59, 0); } }
@media (max-width: 640px) { .voice-panel { right: 16px; left: 16px; bottom: 16px; width: auto; } }
.search-pop { position: absolute; top: 50px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); max-height: 70vh; overflow: auto; padding: 8px; }
.search-pop h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 8px 10px 4px; }
.search-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.search-item:hover, .search-item.active { background: var(--surface-2); }
.search-item .ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-2); flex: none; }
.tip { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-left: 6px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 800; line-height: 1; cursor: pointer; vertical-align: middle; padding: 0; text-transform: none; letter-spacing: 0; }
.tip:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
h1 .tip { width: 22px; height: 22px; font-size: 13px; }
.quick-help .quick { height: 38px; padding: 0 14px; font-size: 13.5px; cursor: pointer; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.quick-help .quick:hover { border-color: var(--accent); background: var(--accent-soft); }
.help-pop p { color: var(--muted); line-height: 1.6; }
.help-item { border-bottom: 1px solid var(--border); }
.help-item:last-child { border-bottom: 0; }
.help-item > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 15px 18px; cursor: pointer; font-weight: 650; }
.help-item > summary::-webkit-details-marker { display: none; }
.help-item > summary:hover { background: var(--surface-2); }
.help-item > summary .chev { transition: transform .15s ease; color: var(--muted); }
.help-item[open] > summary .chev { transform: rotate(90deg); }
.help-body { padding: 0 18px 16px; display: flex; flex-direction: column; gap: 10px; color: var(--muted); line-height: 1.6; }
.help-q { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); font-weight: 600; font-size: 14px; }
.help-q:hover { border-color: var(--brand-2); }
button.help-q { width: 100%; text-align: left; color: var(--text); cursor: pointer; font: inherit; font-weight: 600; font-size: 14px; }
/* floating Help button + panel (every signed-in page) */
.help-fab { position: fixed; right: 20px; bottom: 20px; z-index: 70; display: inline-flex; align-items: center; gap: 8px; height: 50px; padding: 0 20px 0 16px;
  border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 800; font-size: 15px; cursor: pointer; box-shadow: var(--shadow-lg); transition: transform .15s ease; }
.help-fab:hover { transform: translateY(-2px); }
.help-fab.on { background: var(--text); color: var(--bg); }
.help-fab svg { width: 20px; height: 20px; }
body:has(main.bare) .help-fab, body:has(main.bare) .help-desk { display: none; }
.help-desk { position: fixed; right: 20px; bottom: 82px; z-index: 70; width: 400px; max-width: calc(100vw - 32px); max-height: min(640px, calc(100vh - 110px));
  padding: 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow-lg); animation: pop .18s ease; }
.help-desk-body { overflow: auto; display: flex; flex-direction: column; gap: 14px; min-height: 120px; padding-right: 2px; }
.help-desk-body h3 { font-size: 17px; }
.help-desk .quick-help .quick { height: 34px; padding: 0 12px; font-size: 13px; }
.help-desk [data-hback] { align-self: flex-start; background: none; border: 0; padding: 0; cursor: pointer; }
@media (max-width: 640px) {
  .help-fab { right: 14px; bottom: 14px; height: 46px; padding: 0 16px 0 14px; }
  .help-desk { right: 8px; left: 8px; width: auto; max-width: none; bottom: 70px; max-height: calc(100vh - 90px); }
}
.cal-bars { display: flex; gap: 10px; align-items: stretch; height: 170px; }
.cal-bars .cb { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.cal-bars .cb-track { flex: 1; width: 100%; max-width: 46px; display: flex; align-items: flex-end; background: var(--surface-2); border-radius: 8px; overflow: hidden; }
.cal-bars .cb-track i { display: block; width: 100%; border-radius: 8px 8px 0 0; }
.cal-bars .cb-track i.up { background: var(--pos); } .cal-bars .cb-track i.down { background: var(--neg); }
.wiz-steps { display: flex; gap: 6px; }
.wiz-step { flex: 1; display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; color: var(--faint); }
.wiz-step::before { content: ""; height: 4px; border-radius: 2px; background: var(--surface-3); }
.wiz-step .n { display: none; }
.wiz-step.on { color: var(--text); } .wiz-step.on::before { background: var(--accent); }
.wiz-step.done { color: var(--pos); } .wiz-step.done::before { background: var(--pos); }
@media (max-width: 480px) { .wiz-step .t { font-size: 10.5px; } }
.admin-btn { position: relative; height: 44px; padding: 0 14px; flex: none; }
.count-badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--neg); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
@media (max-width: 640px) { .admin-btn .hide-sm { display: none; } .admin-btn { padding: 0 12px; } }
.doc-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.doc-tile { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface-2); cursor: pointer; display: flex; flex-direction: column; }
.doc-tile img { width: 100%; height: 130px; object-fit: cover; display: block; background: #fff; }
.doc-tile .pdf { height: 130px; display: grid; place-items: center; font-weight: 800; color: var(--muted); }
.doc-tile .cap { padding: 8px 10px; font-size: 12px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.doc-tile.missing { cursor: default; opacity: .6; }
.doc-full { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto; border-radius: 10px; background: #fff; }
@media (max-width: 640px) { .doc-tiles { grid-template-columns: 1fr; } }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); display: grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn:hover { border-color: var(--brand-2); }
.menu { position: absolute; right: 0; top: 52px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 200px; z-index: 40; }
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 12px; white-space: nowrap; border: 0; background: none; border-radius: 10px; cursor: pointer; text-align: left; }
.menu button:hover { background: var(--surface-2); }
.menu button.on { color: var(--accent-text); font-weight: 600; }
.swatch { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--border); flex: none; }

@media (max-width: 720px) {
  .profile-btn { padding: 3px; } .profile-btn .who { display: none; }
  .topbar .wrap-page { gap: 8px; height: 62px; }
  #helpBtn { display: none; } /* the floating Help button covers it on small screens */
}
.topbar .search { min-width: 0; } /* let the search box shrink so the buttons stay on screen */
@media (max-width: 480px) {
  .topbar .wrap-page { gap: 6px; }
  .topbar .icon-btn, .topbar .admin-btn { width: 38px; height: 38px; padding: 0; justify-content: center; }
  .topbar .profile-btn .avatar { width: 34px; height: 34px; }
  .topbar .search input { height: 40px; padding-left: 36px; }
  .topbar .search > .i { left: 11px; top: 11px; }
  .topbar .search .mic { top: 4px; }
}

/* ---------- cards & sections ---------- */
main { padding: 22px 0 60px; }
.section { margin-top: 28px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); }
.card.pad { padding: 18px; } .card.pad-lg { padding: 24px; }
@media (max-width: 640px) { .card.pad-lg { padding: 18px; } }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 980px) { .g6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .g3, .g2 { grid-template-columns: 1fr; } .g6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.hero { background: var(--hero); color: var(--hero-text); border-radius: 20px; padding: 22px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 194, 26, .35), transparent 70%); pointer-events: none; }
.hero .muted { color: rgba(255, 255, 255, .72); }
.hero .big { font-size: 32px; font-weight: 800; letter-spacing: -.02em; }
.hero .pos { color: #6ff0ad; } .hero .neg { color: #ff9aa4; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 6px; padding: 5px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 1 0 auto; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; border-radius: 10px; border: 0; background: none; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); white-space: nowrap; }
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.on { background: var(--accent); color: var(--accent-ink); }
.tabs.sub { background: transparent; border: 0; padding: 0; gap: 8px; }
.tabs.sub .tab { flex: 0 0 auto; border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 8px 14px; }
.tabs.sub .tab.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.tab-panel { margin-top: 14px; }

/* ---------- buttons, inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; font-weight: 700; cursor: pointer; background: var(--accent); color: var(--accent-ink); white-space: nowrap; }
.btn:hover { filter: brightness(1.05); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn.secondary:hover { border-color: var(--brand-2); }
.btn.brand { background: var(--brand-2); color: #fff; }
.btn.ghost { background: transparent; color: var(--accent-text); padding: 0 8px; height: 36px; }
.btn.danger { background: var(--neg-soft); color: var(--neg); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }
.link { color: var(--accent-text); font-weight: 600; cursor: pointer; background: none; border: 0; padding: 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input { height: 46px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); padding: 0 14px; outline: none; width: 100%; }
textarea.input { height: auto; padding: 12px 14px; min-height: 120px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.input:focus { border-color: var(--brand-2); background: var(--surface); }
.input.upper { text-transform: uppercase; }
.hint { font-size: 12px; color: var(--faint); }
.err { color: var(--neg); font-size: 13px; min-height: 18px; }
.otp-input { height: 60px; text-align: center; font-size: 28px; font-weight: 800; letter-spacing: 14px; padding-left: 28px; font-variant-numeric: tabular-nums; }
.otp-input::placeholder { color: var(--faint); letter-spacing: 14px; }
.otp-boxes { display: flex; gap: 8px; }
.otp-boxes input { width: 48px; height: 56px; text-align: center; font-size: 22px; font-weight: 700; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); outline: none; }
.otp-boxes input:focus { border-color: var(--accent); background: var(--surface); }
@media (max-width: 380px) { .otp-boxes input { width: 42px; height: 50px; } }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.file-drop { border: 1.5px dashed var(--border); border-radius: 14px; padding: 16px; display: flex; align-items: center; gap: 12px; cursor: pointer; background: var(--surface-2); }
.file-drop:hover { border-color: var(--brand-2); }
.file-drop input { display: none; }
.file-drop img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.chip.pos { background: var(--pos-soft); color: var(--pos); } .chip.neg { background: var(--neg-soft); color: var(--neg); }
.chip.warn { background: var(--warn-soft); color: var(--warn); } .chip.brand { background: var(--brand-soft); color: var(--brand-2); }
.chip.accent { background: var(--accent); color: var(--accent-ink); }
.day-chips { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day-chips button { height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; font-weight: 600; }
.day-chips button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.toggle input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ---------- stats ---------- */
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .k { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat .v { font-size: 20px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stat .v.lg { font-size: 28px; }
.hero .stat .k { color: rgba(255, 255, 255, .7); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; }

/* ---------- fund rows ---------- */
.list { display: flex; flex-direction: column; }
.fund-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; }
.fund-row:last-child { border-bottom: 0; }
.fund-item { display: flex; align-items: center; border-bottom: 1px solid var(--border); }
.fund-item:last-child { border-bottom: 0; }
.fund-item:hover { background: var(--surface-2); }
.fund-item .fund-row { flex: 1; min-width: 0; border-bottom: 0; }
.fund-item .fund-row:hover { background: transparent; }
.list.card .fund-item:first-child { border-radius: 18px 18px 0 0; } .list.card .fund-item:last-child { border-radius: 0 0 18px 18px; }
.cart-btn { width: 38px; height: 38px; margin-right: 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--accent-text); display: grid; place-items: center; cursor: pointer; flex: none; }
.cart-btn:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
@media (max-width: 640px) { .cart-btn { margin-right: 10px; width: 34px; height: 34px; } }
.top-icon { position: relative; }
.fund-row:hover { background: var(--surface-2); }
.list.card .fund-row:first-child { border-radius: 18px 18px 0 0; } .list.card .fund-row:last-child { border-radius: 0 0 18px 18px; }
.amc { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; color: #fff; }
.fund-row .name { font-weight: 650; }
.fund-row .meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fund-row .right { text-align: right; flex: none; }
.fund-row .right .v { font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.fund-row .right .k { font-size: 11.5px; color: var(--faint); }
.stars { color: var(--accent); letter-spacing: 1px; font-size: 12px; }
.stars .off { color: var(--surface-3); }
.rank { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); font-size: 12px; font-weight: 800; color: var(--muted); flex: none; }
.rank.top { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 640px) { .fund-row { padding: 12px; gap: 10px; } .rank { display: none; } .fund-row .hide-sm { display: none; } }

.locked { position: relative; overflow: hidden; border-top: 1px solid var(--border); }
.locked .ghost-rows { filter: blur(5px); opacity: .6; pointer-events: none; user-select: none; }
.ghost-row { display: flex; gap: 14px; padding: 16px; align-items: center; }
.ghost-row .bar { height: 12px; border-radius: 6px; background: var(--surface-3); }
.locked .unlock { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 16px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 30%, transparent), color-mix(in srgb, var(--surface) 92%, transparent)); }
.lock-ico { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); }

/* ---------- tiles ---------- */
.tile { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); cursor: pointer; transition: transform .12s ease, border-color .12s ease; min-height: 118px; }
.tile:hover { transform: translateY(-2px); border-color: var(--brand-2); }
.tile .ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 20px; }
.tile h3 { font-size: 15px; }
.tile p { font-size: 12.5px; color: var(--muted); }
.ico.c1 { background: #e8eefc; color: #1f4fb8; } .ico.c2 { background: #fff2cc; color: #9a6b00; } .ico.c3 { background: #dff5ea; color: #0b8a59; }
.ico.c4 { background: #ffe7dc; color: #c2410c; } .ico.c5 { background: #efe6ff; color: #6d28d9; } .ico.c6 { background: #dcf3f7; color: #0e7490; }
[data-theme="dark"] .ico.c1, [data-theme="navy"] .ico.c1 { background: #1f2d55; color: #8fb2ff; }
[data-theme="dark"] .ico.c2, [data-theme="navy"] .ico.c2 { background: #3a2f10; color: #ffc21a; }
[data-theme="dark"] .ico.c3, [data-theme="navy"] .ico.c3 { background: #12352a; color: #34d399; }
[data-theme="dark"] .ico.c4, [data-theme="navy"] .ico.c4 { background: #3a2216; color: #fb923c; }
[data-theme="dark"] .ico.c5, [data-theme="navy"] .ico.c5 { background: #2a1f48; color: #c4b5fd; }
[data-theme="dark"] .ico.c6, [data-theme="navy"] .ico.c6 { background: #123540; color: #67e8f9; }

.cta { display: flex; align-items: center; gap: 18px; justify-content: space-between; }
.cta .btn { height: 52px; padding: 0 28px; font-size: 16px; border-radius: 14px; }
@media (max-width: 640px) { .cta { flex-direction: column; align-items: stretch; } }

.goal-tile { position: relative; overflow: hidden; }
.goal-tile .amt { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
table.t th { text-align: left; font-size: 12px; color: var(--faint); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.t td { padding: 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.t tr:last-child td { border-bottom: 0; }
table.t .r { text-align: right; }
table.t td.best { color: var(--pos); font-weight: 700; }
/* Market news → Research pack */
.pack-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 18px; align-items: start; }
.pack-nav { position: sticky; top: 84px; padding: 8px; max-height: calc(100vh - 100px); overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.pack-topic { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 10px; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; font-size: 13.5px; cursor: pointer; }
.pack-topic:hover { background: var(--surface-2); }
.pack-topic.on { background: var(--accent-soft); color: var(--accent-text); font-weight: 700; }
.pack-select { display: none; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--faint); vertical-align: middle; }
.dot.pos { background: var(--pos); } .dot.warn { background: var(--warn, #d97706); } .dot.muted { background: transparent; border: 1.5px solid var(--faint); }
.pack-table th { white-space: normal; min-width: 90px; max-width: 180px; vertical-align: bottom; line-height: 1.3; }
.pack-table td:first-child { white-space: normal; min-width: 140px; max-width: 320px; }
.pack-block h4 { font-size: 15px; }
@media (max-width: 900px) { .pack-layout { grid-template-columns: 1fr; } .pack-nav { display: none; } .pack-select { display: block; } }

/* ---------- misc ---------- */
.empty { text-align: center; padding: 36px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .ico { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); font-size: 24px; }
.banner { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; font-size: 13.5px; }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.info { background: var(--brand-soft); color: var(--brand-2); }
.banner.ok { background: var(--pos-soft); color: var(--pos); }
.banner.err { background: var(--neg-soft); color: var(--neg); }
.dev-otp { font-family: ui-monospace, Consolas, monospace; font-weight: 800; letter-spacing: 3px; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 10px; }
@keyframes sk { to { background-position: -200% 0; } }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.bar-h { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.bar-h > i { display: block; height: 100%; border-radius: 4px; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 18px; }
.kv .k { font-size: 12px; color: var(--muted); } .kv .v { font-weight: 700; font-variant-numeric: tabular-nums; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; margin-bottom: 14px; cursor: pointer; }
.back:hover { color: var(--text); }
.steps { display: flex; gap: 8px; }
.steps .s { flex: 1; height: 5px; border-radius: 3px; background: var(--surface-3); }
.steps .s.on { background: var(--accent); }
.kyc-step { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; cursor: pointer; background: var(--surface); }
.kyc-step.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.kyc-step .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-weight: 800; font-size: 13px; flex: none; }
.kyc-step.done .n { background: var(--pos); color: #fff; }
.detail-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.detail-row:last-child { border-bottom: 0; }
.detail-row .k { color: var(--muted); font-size: 14px; }
.detail-row .v { font-weight: 650; text-align: right; }
footer.site { border-top: 1px solid var(--border); padding: 22px 0 90px; /* room for the Help button */ color: var(--faint); font-size: 12px; line-height: 1.6; }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .tip { position: absolute; pointer-events: none; background: var(--text); color: var(--bg); font-size: 12px; padding: 6px 9px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, -110%); font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.donut-wrap { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.donut-wrap svg { width: 170px; height: 170px; flex: none; }

/* ---------- modal & toast ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(5, 8, 18, .55); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .15s ease; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; width: 100%; max-width: 480px; max-height: 92vh; overflow: auto; box-shadow: var(--shadow-lg); animation: pop .18s ease; }
.modal.wide { max-width: 720px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.modal-body { padding: 16px 20px 20px; }
@media (max-width: 640px) { .modal-back { align-items: flex-end; padding: 0; } .modal { border-radius: 20px 20px 0 0; max-height: 90vh; } }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { transform: translateY(10px); opacity: 0; } }
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); animation: pop .2s ease; max-width: 90vw; }
.toast.err { background: var(--neg); color: #fff; } .toast.ok { background: var(--pos); color: #fff; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-side { background: var(--hero); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 194, 26, .38), transparent 68%); }
.auth-side h1 { font-size: 40px; letter-spacing: -.03em; max-width: 460px; }
.auth-side .pts { display: grid; gap: 14px; margin-top: 28px; max-width: 420px; position: relative; z-index: 1; }
.auth-side .pt { display: flex; gap: 12px; align-items: flex-start; color: rgba(255, 255, 255, .86); }
.auth-side .pt .ico { width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, .14); display: grid; place-items: center; flex: none; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 420px; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-side { padding: 28px 20px; } .auth-side h1 { font-size: 28px; } .auth-side .pts, .auth-side .foot { display: none; } }
.g-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 600; }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .d { min-width: 0; }
.cal .dow { font-size: 11px; text-transform: uppercase; color: var(--faint); text-align: center; font-weight: 700; padding: 4px 0; }
.cal .d { min-height: 86px; border-radius: 12px; background: var(--surface-2); padding: 6px; font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.cal .d.out { opacity: .35; } .cal .d.today { outline: 2px solid var(--accent); }
.cal .d .dn { font-weight: 700; color: var(--muted); }
.cal .d .ev { background: var(--accent); color: var(--accent-ink); border-radius: 6px; padding: 2px 5px; font-weight: 700; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) { .cal .d { min-height: 54px; } .cal .d .ev { font-size: 0; height: 6px; padding: 0; } }
