/* Portfolio Tracker — light/dark, mobile first. Colours are tokens so a rebrand is a few lines. */
:root {
  --bg: #f4f6f5;
  --card: #ffffff;
  --ink: #14211f;
  --muted: #5c6b68;
  --line: #e2e8e6;
  --accent: #5b50a0;
  --accent-ink: #ffffff;
  --accent-soft: #ece9f7;
  --gain: #0f766e;
  --pos: var(--gain); /* every gain (numbers, bars, chips) uses the same teal as the Realized P/L bars */
  --neg: #b91c1c;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --err-bg: #fee2e2;
  --cash: #94a3b8;
  --c7: #7c3aed; --c8: #ea580c; --c9: #0891b2;
  --c1: #0f766e; --c2: #6366f1; --c3: #d97706; --c4: #db2777; --c5: #0284c7; --c6: #84cc16;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1514; --card: #142120; --ink: #e8f0ee; --muted: #93a6a2; --line: #243533;
    --accent: #a99ce8; --accent-ink: #1c1740; --accent-soft: #2a2450;
    --gain: #2dd4bf;
    --pos: var(--gain); --neg: #f87171; --warn: #fbbf24; --warn-bg: #3b2f0b; --err-bg: #4a1d1d;
    --cash: #64748b;
    --c7: #a78bfa; --c8: #fb923c; --c9: #22d3ee;
    --c1: #2dd4bf; --c2: #818cf8; --c3: #fbbf24; --c4: #f472b6; --c5: #38bdf8; --c6: #a3e635;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; }
h1 { font-size: 1.7rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; color: var(--muted); font-weight: 600; }
h3.mt { margin-top: 1.25rem; }
p { margin: .4rem 0; }
a { color: var(--accent); }
.pos { color: var(--pos); } .neg { color: var(--neg); }
.sub { color: var(--muted); font-size: .84rem; }
.warn-text { color: var(--warn); } .ok-text { color: var(--pos); }
.center { text-align: center; margin-top: .75rem; }
.r { text-align: right; }
.mt { margin-top: 1rem; }
.empty { color: var(--muted); padding: 1rem; text-align: center; }
.loading { text-align: center; color: var(--muted); padding: 3rem 0; }

/* header */
.top { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem;
  padding: .6rem 16px; background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; letter-spacing: -.01em; color: var(--accent); }
.brand.big { margin-bottom: 1rem; }
.brand { display: flex; align-items: center; line-height: 0; }
.logo-full { height: 30px; width: auto; display: block; }
.brand.big .logo-full { height: 44px; }
.logo-d, .logo-mark { display: none; }
@media (prefers-color-scheme: dark) { .logo-l { display: none; } .logo-d { display: block; } }
.tabs { display: flex; gap: .25rem; flex: 1; overflow-x: auto; }
.tab { border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; padding: .45rem .8rem; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active { background: var(--accent-soft); color: var(--accent); }
.ctrl { display: flex; gap: .25rem; margin-left: auto; }
.icon { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 10px; min-width: 38px; height: 38px; font-size: 1rem; cursor: pointer; }
.icon:hover { border-color: var(--accent); }
.icon.lang { font-size: .8rem; font-weight: 700; }
.icon.sm { min-width: 32px; height: 32px; border-color: transparent; background: none; }
.langbar { display: flex; justify-content: flex-end; padding: 12px 16px 0; }

.page { max-width: 1120px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; }
.foot { max-width: 1120px; margin: 0 auto; padding: 8px 16px 32px; color: var(--muted); font-size: .8rem; }

/* banners */
.banner { padding: .6rem 16px; font-size: .9rem; }
.banner.demo { background: var(--accent-soft); color: var(--accent); text-align: center; }
.banner.err { background: var(--err-bg); color: var(--neg); }
.banner.warn { background: var(--warn-bg); color: var(--warn); border-radius: var(--radius); }
.banner.good { background: var(--accent-soft); color: var(--pos); border-radius: var(--radius); margin-top: .5rem; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card.inset { background: var(--bg); box-shadow: none; margin-top: 1rem; }
.grid2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.kpis { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .kpis { grid-template-columns: repeat(4, 1fr); } .kpis .kpi.hero { grid-column: 1 / -1; } }
.kpi .kl { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.kpi .kv { font-size: 1.45rem; font-weight: 700; letter-spacing: -.01em; margin: .15rem 0; overflow-wrap: anywhere; }
.kpi .ks { color: var(--muted); font-size: .8rem; }
.kpis .kpi { min-width: 0; }
.kpi .kv.mf { white-space: nowrap; overflow: hidden; }
.kpi .ks.exact { white-space: nowrap; overflow: hidden; margin-top: -.05rem; }
.kpi.hero { background: var(--hero, var(--accent)); border-color: var(--hero, var(--accent)); color: var(--hero-ink, var(--accent-ink)); grid-column: span 2; }
.kpi.hero .kl, .kpi.hero .ks { color: color-mix(in srgb, var(--accent-ink) 80%, transparent); }
.kpi.hero .kv { font-size: 2rem; }
@media (max-width: 559px) { .kpi.hero { grid-column: auto; } }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }

/* tables */
.scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; padding: .45rem .6rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th.r { text-align: right; }
.tbl td { padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl.compact td { padding: .35rem .4rem; }
.tbl td .sub { margin-top: -2px; }
.chip { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--accent-soft); color: var(--accent); }
.chip.sell, .chip.withdrawal, .chip.fee { background: var(--err-bg); color: var(--neg); }
.chip.dividend, .chip.deposit { background: var(--accent-soft); color: var(--pos); }
.rank { list-style: none; margin: 0; padding: 0; }
.rank li { display: flex; justify-content: space-between; gap: .5rem; padding: .4rem 0; border-bottom: 1px solid var(--line); }
.rank li:last-child { border: 0; }
.health { list-style: none; margin: 0; padding: 0; } .health li { padding: .25rem 0; }

/* charts */
.chart { width: 100%; height: auto; display: block; }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--accent); opacity: .1; }
.chart .dot { fill: var(--card); stroke: var(--accent); stroke-width: 2; }
.chart .tick, .chart .bl { fill: var(--muted); font-size: 13px; }
.chart .bv { font-size: 13px; font-weight: 600; fill: currentColor; }
.chart .pos-fill { fill: var(--pos); } .chart .neg-fill { fill: var(--neg); }
.chart.bars { max-width: 560px; margin: 0 auto; } /* never upscale: keeps the labels at their designed size */
.alloc { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.donut { width: 180px; height: 180px; flex: none; }
.legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 150px; }
.legend li { display: flex; align-items: center; gap: .5rem; padding: .15rem 0; font-size: .88rem; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend .lg-l { flex: 1; } .legend .lg-v { color: var(--muted); }
.spark { width: 80px; height: 22px; fill: none; stroke-width: 1.6; } .spark.pos { stroke: var(--pos); } .spark.neg { stroke: var(--neg); }

/* forms */
.form { display: grid; gap: 12px 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-top: .75rem; }
.form .wide, .helper, .form-actions { grid-column: 1 / -1; }
label { display: grid; gap: .25rem; font-size: .84rem; font-weight: 600; color: var(--muted); align-content: start; }
label.check { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-weight: 500; color: var(--ink); }
label.check .sub { flex-basis: 100%; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; flex: none; }
label.check, .form > label.check { min-width: 0; flex-direction: row; flex-wrap: wrap; align-items: center; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .55rem .7rem; width: 100%; min-height: 42px; }
input[type=checkbox] { width: 18px; min-height: 18px; accent-color: var(--accent); }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { resize: vertical; }
input[type=file] { border: 0; padding: .25rem 0; min-height: 0; font-size: .8rem; }
.helper { min-height: 1.4rem; color: var(--muted); font-size: .88rem; }
.form-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; } .filters select, .filters input { width: auto; min-height: 36px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: .4rem; }
.out { margin-top: .9rem; padding: .75rem; background: var(--accent-soft); border-radius: 10px; min-height: 2.6rem; }
.card > label { margin-top: .6rem; }

.btn { font: inherit; font-weight: 600; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 10px; padding: .55rem 1rem; min-height: 42px; cursor: pointer; }
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.small { min-height: 32px; padding: .25rem .7rem; font-size: .85rem; }
.btn.danger { background: var(--neg); border-color: var(--neg); color: #fff; }
.link { background: none; border: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; padding: 0; }
details.danger { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .75rem; }
details.danger summary { cursor: pointer; color: var(--neg); font-weight: 600; }
details.danger input { max-width: 180px; }

/* connect screen */
.connect { min-height: 82vh; display: grid; place-items: center; padding: 16px; }
.welcome { max-width: 620px; padding: 28px; }
.welcome .lead { color: var(--muted); font-size: 1.05rem; }
.welcome .actions { display: flex; gap: .75rem; flex-wrap: wrap; margin: 1.25rem 0 .5rem; }
.welcome .hint { color: var(--warn); font-size: .88rem; }
.points { margin: 1.25rem 0 0; padding-left: 1.1rem; color: var(--muted); font-size: .92rem; } .points li { margin: .3rem 0; }
.empty-state { text-align: center; padding: 40px 16px; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--ink); color: var(--bg);
  padding: .65rem 1rem; border-radius: 12px; max-width: min(92vw, 520px); font-size: .9rem; transition: .2s; z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--neg); color: #fff; }

@media (max-width: 640px) {
  .tabs { order: 3; flex-basis: 100%; overflow-x: auto; scrollbar-width: none; } /* six tabs do not fit a phone: swipe sideways */
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: 0 0 auto; padding: .45rem .7rem; font-size: .88rem; text-align: center; }
  h1 { font-size: 1.4rem; }
  .kpi .kv { font-size: 1.25rem; }
  .kpi.hero .kv { font-size: 1.7rem; }
  .welcome { padding: 20px; }
}
@media print { .top, .foot, .ctrl, .toast { display: none; } body { background: #fff; } }

/* ---- valuation page ---- */
.seg { display: flex; gap: 0; margin: .6rem 0; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg-btn { flex: 1; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; padding: .5rem .6rem; cursor: pointer; }
.seg-btn.active { background: var(--accent-soft); color: var(--accent); }
.tickerbar { display: flex; gap: .6rem; align-items: flex-end; }
.tickerbar label { flex: 1; }
.val-note.ok { color: var(--pos); } .val-note.err { color: var(--neg); }
.formula { font-size: .9rem; color: var(--muted); margin: 0 0 .5rem; overflow-wrap: anywhere; }
.form > label, .form .pair label, .form .trio label { display: flex; flex-direction: column; gap: .2rem; font-size: .88rem; margin-top: .4rem; min-width: 0; }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.fcfgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); gap: .6rem; }
.fcfgrid .mini { font-size: .8rem; display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.h3 { font-size: .95rem; margin: .2rem 0 .4rem; }
.adv { margin-top: .7rem; } .adv summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.tbl td.r, .tbl th.r { text-align: right; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; padding: .1rem .6rem; border-radius: 999px; font-weight: 700; font-size: .82rem; background: var(--accent-soft); color: var(--accent); }
.badge.buy, .badge.band-under, .badge.band-veryUnder { background: var(--accent-soft); color: var(--pos); }
.badge.watch, .badge.band-fair { background: var(--warn-bg); color: var(--warn); }
.badge.sell, .badge.band-over { background: var(--err-bg, #fee2e2); color: var(--neg); }
.vmsg { margin: 0; padding: .6rem .75rem; border-radius: 10px; background: var(--accent-soft); }
.vmsg.err { background: var(--err-bg, #fee2e2); color: var(--neg); }
.disc { margin-top: .8rem; font-size: .8rem; }

/* ---- transaction helper ---- */
.helper.on { background: var(--accent-soft); border-radius: 10px; padding: .6rem .75rem; color: var(--ink); }
.hgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .5rem .9rem; }
.hcell { display: flex; flex-direction: column; min-width: 0; }
.hcell .hl { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.hcell b { font-size: 1.02rem; overflow-wrap: anywhere; }
.helper p { margin: .4rem 0 0; }
.savebar { display: flex; gap: .5rem; margin-top: .8rem; }
.savebar input { flex: 1; min-width: 0; }
.savebar .btn { white-space: nowrap; }
.nowrap { white-space: nowrap; }

/* ---- transactions page: form + calculators side by side ---- */
.tx-top { align-items: start; }
.tx-top .seg { margin: .5rem 0; }
[hidden] { display: none !important; }
.calc-panel[hidden] { display: none; }

/* ---- analysis page ---- */
.chart .acc-fill { fill: var(--accent); }
.chart .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.chart .line.thin { stroke-width: 1.8; }
.chart .hit { fill: transparent; }
.chart .hit:hover { fill: var(--accent-soft); }
.chart .mk-buy { fill: var(--pos); stroke: var(--card); stroke-width: 1; }
.chart .mk-sell { fill: var(--neg); stroke: var(--card); stroke-width: 1; }
.chart.price, .chart.cols { max-width: 760px; }
.an-controls { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: .5rem 0 .8rem; }
.an-controls select { width: auto; min-width: 11rem; max-width: 100%; }
.seg.small { margin: 0; display: inline-flex; }
.seg.small .seg-btn { padding: .35rem .8rem; font-size: .85rem; }
.mstats { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin: .2rem 0 .6rem; }
.mstats div { display: flex; flex-direction: column; }
.mstats .hl { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.legend-mk { display: inline-flex; gap: 1rem; font-size: .8rem; color: var(--muted); margin-top: .3rem; }
.tbl td.name { font-weight: 600; }
.tagsel { min-width: 9rem; }
.tag-list { display: flex; flex-direction: column; margin-top: .4rem; }
.tag-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .6rem 0; border-top: 1px solid var(--line); }
.tag-id { display: flex; flex-direction: column; min-width: 0; }
.tag-id .name { overflow-wrap: anywhere; }
.tag-row .tagsel { width: auto; flex: 0 0 auto; max-width: 55%; }
/* the strategy menu always stays on the same line as the stock, even on a small phone */
.tag-row .tag-id { min-width: 0; flex: 1 1 auto; display: grid; }
.tag-row .tag-id .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag-row .tagsel { max-width: 46%; min-width: 0; }
.best { color: var(--pos); font-weight: 700; }

.seg-btn { white-space: nowrap; }

/* trade-confirmation import */
.imp-card, .imp-review { margin-bottom: 1rem; }
.imp-actions { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin: .5rem 0; }
.imp-pick { position: relative; cursor: pointer; }
.imp-file { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.imp-pick:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.imp-card[data-drop].drag { outline: 2px dashed var(--accent); }
.imp-doc { margin: .5rem 0 .75rem; }
.imp-checks { list-style: none; margin: .25rem 0 .4rem; padding: 0; font-size: .9rem; }
.imp-checks li { padding: .1rem 0; }
.imp-good { color: var(--pos); }
.imp-warn { color: var(--warn); }
.imp-bad { color: var(--neg); }
.imp-raw { white-space: pre-wrap; font-size: .8rem; max-height: 14rem; overflow: auto; background: var(--accent-soft); padding: .5rem; border-radius: var(--radius); }
.imp-tbl { min-width: 900px; }
.imp-strow td { border-top: 0; padding-top: 0; }
.imp-tbl input, .imp-tbl select { width: 100%; min-width: 4.5rem; font-size: .85rem; padding: .3rem .35rem; }
.imp-tbl input[type=checkbox] { width: auto; min-width: 0; }
.imp-tbl .imp-tk { min-width: 4rem; }
.imp-tbl .imp-st { font-size: .85rem; }
.imp-tbl select[data-conf=broker] { min-width: 8.5rem; }
.imp-off td:not(:first-child) { opacity: .5; }
.imp-foot { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin-top: .5rem; }

/* closed-trade statistics */
.st-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; background: var(--accent-soft); border-radius: var(--radius); padding: 1rem; }
.st-big { font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.st-lbl { color: var(--muted); font-size: .85rem; }
.st-left > div + div { margin-top: .8rem; padding-top: .8rem; border-top: 1px dashed var(--line); }
.st-gauge { text-align: center; min-width: 170px; }
.gauge { width: 170px; max-width: 100%; height: auto; }
.gauge path, .gauge circle { fill: none; stroke-width: 16; stroke-linecap: butt; }
.gauge .g-win { stroke: var(--pos); } .gauge .g-loss { stroke: var(--neg); } .gauge .g-none { stroke: var(--line); }
.gauge .g-sub { font-size: 13px; fill: var(--muted); }
.gauge .g-num { font-size: 34px; font-weight: 700; fill: currentColor; }
.st-wl { display: flex; justify-content: space-around; font-size: .9rem; }
.st-wl b { display: block; font-size: 1.2rem; }
.st-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin: .9rem 0; }
.st-tile { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem; }
.st-tile .v { font-weight: 600; font-size: 1.05rem; margin-top: .2rem; }
.st-tile .s { font-size: .85rem; margin-top: .15rem; }


/* ---- redesign: bell, add button, bottom bar, hero, who earned more, tabs ---- */
.bell { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.bell .badge { position: absolute; margin: 0; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--neg); color: #fff; font-size: .8rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.add-top { margin-left: .5rem; }
.bottom { display: none; }
.alerts { background: var(--warn-bg); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 6px; scroll-margin-top: 70px; }
.alerts-h { display: flex; align-items: center; gap: 8px; color: var(--warn); }
.alerts .banner { padding: .25rem 0; margin: 0; background: none; border-radius: 0; font-size: .88rem; }
.alerts .banner.warn { color: var(--ink); } .alerts .banner.good { color: var(--ink); }
.kpi.hero .split { display: flex; height: 10px; border-radius: 5px; overflow: hidden; margin-top: .7rem; background: color-mix(in srgb, var(--accent-ink) 30%, transparent); }
.split-cash { background: var(--cash); } .split-stocks { flex: 1; background: color-mix(in srgb, var(--accent-ink) 85%, transparent); }
.split-lbl { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: .8rem; margin-top: .3rem; opacity: .9; }
.lbl { font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: .5rem; }
.earned h2 { margin-bottom: .1rem; }
.earn-cols { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); margin-top: .8rem; }
.earn-list { display: grid; gap: 12px; }
.earn-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: .92rem; }
.meter { height: 10px; border-radius: 5px; background: var(--line); margin-top: 5px; overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 5px; }
.meter .bar-a { background: var(--accent); } .meter .bar-b { background: var(--c2); } .meter .neg { background: var(--neg); }
.pill { display: inline-block; background: var(--accent-soft); color: var(--accent); font-size: .8rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; vertical-align: middle; }
.more { margin: .8rem 0 0; text-align: right; }
.ptabs { display: flex; gap: 4px; overflow-x: auto; padding: 10px 12px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.ptabs.card { border-bottom: 1px solid var(--line); }
.tabbed { padding: 0; overflow: hidden; } .ppanel { padding: 16px; }
.ptab { border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; padding: .5rem .9rem; border-radius: 999px; cursor: pointer; white-space: nowrap; min-height: 40px; }
.ptab.on { background: var(--accent-soft); color: var(--accent); }
.dot-warn { background: var(--warn); color: #fff; border-radius: 9px; padding: 0 6px; font-size: .8rem; margin-left: 4px; }
.card.inset { box-shadow: none; margin-bottom: 12px; }
.hold-cards { display: none; }
.hold-card { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.hold-card .r { text-align: right; }
.link-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.alloc svg { max-width: 100%; height: auto; }

@media (max-width: 720px) {
  .tabs, .add-top { display: none; }
  .top { padding: .5rem 12px; } .brand { flex: 1; }
  .page { padding: 12px 12px 96px; }
  .foot { padding-bottom: 96px; }
  .bottom { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; justify-content: space-around; align-items: flex-end;
    background: var(--card); border-top: 1px solid var(--line); padding: 6px 4px calc(10px + env(safe-area-inset-bottom)); }
  .bn { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: none; color: var(--muted); font: inherit; font-size: .8rem; font-weight: 500; min-width: 56px; min-height: 44px; cursor: pointer; }
  .bn.on { color: var(--accent); font-weight: 700; }
  .fab { width: 56px; height: 56px; border-radius: 28px; border: 0; background: var(--accent); color: var(--accent-ink); margin-top: -26px; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 16px rgba(15,118,110,.4); cursor: pointer; }
  .hold-table { display: none; } .hold-cards { display: block; }
  .kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi.hero { grid-column: 1 / -1; }
  .kpi .kv { font-size: 1.15rem; }
}

/* ---- two currencies: rupiah and US dollar side by side, never added ---- */
.nw2 { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.nw2 .kpi.hero { grid-column: auto; }
.kpi.hero.usd { background: #3730a3; color: #fff; }
.kpi.hero.usd .kl, .kpi.hero.usd .ks { color: rgba(255,255,255,.88); }
.curtag { display: inline-block; font-size: .8rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); vertical-align: middle; }
.curtag.usd { background: #e3e7fb; color: #3730a3; }
.kpi.hero .curtag { background: rgba(255,255,255,.2); color: #fff; }
.est { font-size: .85rem; margin-top: .3rem; opacity: .95; }
.est span { font-size: .8rem; opacity: .8; }
.curbar { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; margin: 4px 0; }
.curbar .seg { display: inline-flex; flex: 1 1 auto; min-width: 0; background: var(--line); border: 0; border-radius: 12px; padding: 4px; gap: 2px; margin: 0; }
.curbar .seg button { border: 0; background: none; font: inherit; font-weight: 600; color: var(--muted); padding: .55rem 1rem; border-radius: 9px; cursor: pointer; min-height: 40px; }
.curbar .seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(16,32,29,.14); }
.nosum { margin: 2px 0 0; }
.kpis4 { grid-template-columns: repeat(4, 1fr); }
.curnote { font-size: .82rem; border-radius: 8px; padding: 6px 10px; background: var(--accent-soft); color: var(--accent); }
.curnote.usd { background: #eef0fb; color: #312e81; }
.xwarn { display: none; } .xwarn.on { display: block; }
.xbox { background: #fef3c7; border: 1.5px solid #d97706; border-radius: 12px; padding: 12px 14px; color: #1f2937; }
.xbox b { color: #92400e; } .xbox p { margin: .4rem 0 0; font-size: .9rem; line-height: 1.45; }
.xbtns { display: flex; gap: 8px; margin-top: .7rem; flex-wrap: wrap; }
.confirm-line { font-size: .88rem; color: var(--muted); text-align: center; margin: 0; } .confirm-line:empty { display: none; }
.form-actions .btn:disabled, .btn.primary:disabled { opacity: .5; cursor: not-allowed; }
.brk { display: grid; gap: 4px; margin: .6rem 0; }
.brk-row { display: flex; align-items: center; gap: 12px; padding: 8px 2px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brk-row b { min-width: 9rem; }
.brk-add { display: grid; grid-template-columns: 2fr 1fr auto; gap: 12px; align-items: end; margin: .8rem 0; }
@media (max-width: 720px) {
  .nw2 { grid-template-columns: 1fr; gap: 10px; }
  .kpis4 { grid-template-columns: repeat(2, 1fr); }
  .brk-add { grid-template-columns: 1fr; }
  .curbar .seg button { flex: 1; min-width: 0; padding: .55rem .2rem; font-size: .92rem; } .curbar .seg .curtag { padding-inline: .4rem; }
}

label .curtag { align-self: flex-start; margin-top: 4px; }

/* ---- free trial and lock ---- */
.banner.trial { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: #eef0fb; color: #312e81; }
.banner.trial.urgent { background: #fef3c7; color: #92400e; }
.trial-actions { display: flex; align-items: center; gap: 10px; }
.lock .welcome { text-align: center; }
.lockicon { font-size: 2.4rem; }
.lic-h { font-size: 1rem; margin: 1.2rem 0 .4rem; }
.lic-form { display: grid; gap: 10px; max-width: 340px; margin: 0 auto; text-align: left; }
.lic-form input { text-transform: uppercase; letter-spacing: .06em; }
#license-card .lic-form { margin: .6rem 0 0; max-width: 380px; }
.btn.big { padding: .8rem 1.6rem; font-size: 1.05rem; }
.lock .lead { margin: .8rem 0 1.2rem; }
.lock p { margin: 1rem 0; }
a.btn, a.btn:hover { text-decoration: none; display: inline-block; }
.banner.trial a.btn { color: #fff; }
.lock .hint { color: var(--muted); }

/* ---- email consent ---- */
.mkt-ask { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; background: #f0f9f7; border: 1px solid #cfe8e3; border-radius: var(--radius); padding: 12px 14px; margin: 10px 12px 0; text-align: left; }
.mkt-btns { display: flex; gap: 8px; }
.lock .mkt-ask { margin: 1rem 0; }
.lic-privacy { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: .8rem; }
.check { display: flex; align-items: center; gap: 8px; margin: .4rem 0; }

/* ---- phones and tablets: cards instead of wide tables, one comparison at a time ---- */
.perf-cards, .brk-bars, .hist-cards, .earn-seg { display: none; }
.ptabs { position: relative; }
.ptab-more { display: none; }
.ptabs.can-scroll:not(.at-end) .ptab-more { display: flex; position: sticky; right: 0; flex: none; align-self: stretch; width: 48px; margin-left: -48px; align-items: center; justify-content: flex-end;
  padding: 0 6px; border: 0; min-height: 40px; color: var(--accent); cursor: pointer; background: linear-gradient(90deg, transparent, var(--card) 60%); }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: .6rem 0 .2rem; padding-bottom: 2px; }
.fchip { flex: none; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.fchip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* history card list */
.hgrp { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 2px 6px; font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.hgrp .sub { text-transform: none; letter-spacing: 0; font-weight: 500; }
.hrow { border-bottom: 1px solid var(--line); }
.hrow summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 10px 2px; min-height: 64px; cursor: pointer; }
.hrow summary::-webkit-details-marker { display: none; }
.hic { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; background: var(--accent-soft); color: var(--accent); }
.hic.k-sell, .hic.k-withdrawal { background: var(--err-bg); color: var(--neg); }
.hic.k-fee { background: var(--warn-bg); color: var(--warn); }
.hic.k-dividend, .hic.k-deposit { background: var(--accent-soft); color: var(--pos); }
.hmid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.h1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.h2 { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hamt { text-align: right; flex: none; display: flex; flex-direction: column; gap: 1px; }
.hamt b { white-space: nowrap; }
.hact { padding: 0 2px 12px 52px; }
.hact .btn { min-height: 44px; }
.hrow[open] summary { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); border-radius: 10px; }

/* one card per broker or strategy */
.pcard { border: 1px solid var(--line); border-radius: 14px; margin-top: 10px; background: var(--card); }
.pcard.best { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: color-mix(in srgb, var(--accent-soft) 40%, var(--card)); }
.pcard summary { list-style: none; display: grid; gap: 8px; padding: 14px; cursor: pointer; }
.pcard summary::-webkit-details-marker { display: none; }
.pc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .95rem; }
.pc-badge { background: var(--accent); color: var(--accent-ink); font-size: .8rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pc-pl { font-size: 1.5rem; font-weight: 700; line-height: 1.15; }
.pc-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pc-pill { background: var(--bg); border-radius: 999px; padding: 4px 12px; font-size: .82rem; font-weight: 600; }
.pc-pill i { font-style: normal; font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.pc-meter { height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; display: block; }
.pc-meter > span { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.pc-meter > span.neg { background: var(--neg); }
.pc-toggle { text-align: center; color: var(--accent); font-weight: 600; font-size: .88rem; min-height: 28px; line-height: 28px; }
.pcard .t-open, .pcard[open] .t-closed { display: none; } .pcard[open] .t-open { display: inline; }
.pc-kv { padding: 0 14px 10px; }
.pc-kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.pc-kv > div:last-child { border-bottom: 0; }
.pc-kv span { color: var(--muted); }

/* cash against stocks, per broker */
.brk-bar { padding: 10px 0 12px; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.brk-bar:last-child { border-bottom: 0; }
.brk-split { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--line); }
.s-cash { background: var(--cash); } .s-stock { background: var(--accent); }

@media (max-width: 720px) {
  .perf-table, .brk-table, .hist-table { display: none; }
  .perf-cards, .brk-bars, .hist-cards { display: block; }
  .earn-seg { display: flex; margin: .8rem 0 0; padding: 4px; border: 0; border-radius: 12px; background: var(--line); gap: 2px; }
  .earn-seg .seg-btn { min-height: 40px; border-radius: 9px; font-size: .92rem; }
  .earn-seg .seg-btn.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(16,32,29,.14); }
  .earn-cols .lbl { display: none; }
  .earn-cols[data-by="broker"] > [data-col="strategy"], .earn-cols[data-by="strategy"] > [data-col="broker"] { display: none; }
  .ledger-note { display: none; }
}

/* ---- touch tablet held sideways: side rail, and the add form stays open on the right ---- */
.tab-ic { display: none; }
.add-panel { display: none; }
body.rail .top { position: fixed; left: 0; top: 0; bottom: 0; width: 88px; flex-direction: column; flex-wrap: nowrap; align-items: center; justify-content: flex-start; gap: 6px; padding: 14px 0; border-bottom: 0; border-right: 1px solid var(--line); overflow-y: auto; backdrop-filter: none; background: var(--card); }
body.rail .brand { margin-bottom: 10px; flex: none; }
body.rail .logo-full { display: none; }
body.rail .logo-mark { display: block; width: 40px; height: 40px; }
body.rail .tabs { flex: none; flex-direction: column; overflow: visible; gap: 6px; }
body.rail .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; width: 72px; height: 60px; padding: 0; border-radius: 14px; font-size: .8rem; font-weight: 500; }
body.rail .tab.active { font-weight: 700; }
body.rail .tab .tab-ic { display: flex; }
body.rail .ctrl { flex-direction: column; margin: auto 0 0; align-items: center; gap: 6px; }
body.rail .ctrl .icon { width: 56px; height: 48px; }
body.rail .add-top { display: none; }
body.rail .banner, body.rail .page, body.rail .foot { margin-left: 88px; max-width: none; }
body.rail.has-panel .banner, body.rail.has-panel .page, body.rail.has-panel .foot { margin-right: 340px; }
body.rail .page { padding: 16px 20px; }
body.rail .add-panel { display: block; position: fixed; right: 0; top: 0; bottom: 0; width: 340px; overflow-y: auto; background: var(--card); border-left: 1px solid var(--line); padding: 16px 18px; z-index: 5; }
body.rail .add-panel .card { border: 0; box-shadow: none; padding: 0; }
body.rail .add-panel .form { grid-template-columns: 1fr 1fr; gap: 8px 10px; }
body.rail .add-panel .form > label:nth-child(n+3) { grid-column: 1 / -1; }
.hmid .h2 { white-space: normal; overflow: visible; }
body.rail .kpis, body.rail .kpis4 { grid-template-columns: repeat(2, 1fr); }
body.rail.has-panel .earn-cols { grid-template-columns: 1fr; }
@media (max-width: 720px) { .ptabs { gap: 2px; padding: 8px 8px; } .ptab { padding: .5rem .5rem; font-size: .88rem; } }

/* ⓘ: long explanations live behind a small button */
.hd { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.hd > h2, .hd > h3 { margin: 0; }
.info-btn { flex: none; width: 21px; height: 21px; padding: 0; border-radius: 50%; border: 1.5px solid var(--muted); background: none; color: var(--muted); font: 600 11px/1 system-ui, sans-serif; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; position: relative; }
.info-btn::after { content: ''; position: absolute; inset: -12px; } /* 44px tap area */
.info-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.info-tip { background: var(--accent-soft); border-radius: 10px; padding: .7rem .85rem; margin: .6rem 0; font-size: .92rem; line-height: 1.5; }

/* a segmented control that is allowed to be swiped sideways (the market chart's ranges: 1D … since I started) */
.seg-scroll { max-width: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; scrollbar-width: none; overscroll-behavior-x: contain; }
.seg-scroll::-webkit-scrollbar { display: none; }
.seg-scroll .seg-btn { flex: none; scroll-snap-align: center; min-height: 40px; }
@media (max-width: 720px) {
  .an-controls .seg-scroll { display: flex; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); padding-right: 14px; }
  .an-controls .seg-scroll.at-end { -webkit-mask-image: none; mask-image: none; }
}
/* iOS Safari sizes a date field to its own idea of "wide" and pushes past the card; make it a normal block */
input[type="date"], input[type="time"], input[type="month"] { -webkit-appearance: none; appearance: none; display: block; width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; min-height: 44px; text-align: left; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; min-width: 0; }

/* sell-target alert rows */
.banner.tgt { display: grid; gap: .7rem; }
.tgt-row { display: grid; gap: .45rem; padding-top: .6rem; border-top: 1px solid rgba(0,0,0,.08); }
.tgt-btns { display: flex; flex-wrap: wrap; gap: .4rem; }
.tgt-btns .btn { min-height: 40px; padding: .4rem .8rem; font-size: .85rem; }
.tgt-off { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.tgt-more { display: grid; gap: .7rem; } .tgt-more > summary { cursor: pointer; font-weight: 600; min-height: 40px; display: flex; align-items: center; } .tgt-more[open] > summary { margin-bottom: .2rem; }

/* ---- Settings: "Email alerts" box (mail-*) ---- */
.mail-hd { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.mail-hd h2 { margin: 0; }
.mail-badge { font-size: .85rem; font-weight: 700; padding: .15rem .7rem; border-radius: 999px; background: var(--warn-bg); color: var(--warn); }
.mail-active .mail-badge { background: var(--accent-soft); color: var(--pos); }
.mail-lead { margin: .5rem 0 .2rem; }
.mail-steps { list-style: none; margin: .6rem 0; padding: 0; display: grid; gap: .45rem; }
.mail-steps li { display: flex; align-items: center; gap: .6rem; font-size: .95rem; }
.mail-n { flex: none; width: 1.7rem; height: 1.7rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; background: var(--accent-soft); color: var(--accent); }
.mail-steps li.done .mail-n { background: var(--accent); color: var(--accent-ink); }
.mail-warn { margin: .6rem 0; padding: .55rem .75rem; border-radius: 10px; background: var(--warn-bg); color: var(--warn); font-size: .9rem; }
.mail-err { margin: .6rem 0; padding: .55rem .75rem; border-radius: 10px; background: var(--err-bg); color: var(--neg); font-size: .9rem; }
.mail-go { font-size: 1rem; padding: .7rem 1.3rem; }
.mail-card .form-actions .btn { text-decoration: none; }
.check.mail-dim { opacity: .55; }

/* ---- Markets and your stocks: chart on the left, market cards on the right (mkt-*, mq-*) ---- */
.mkt-split { display: flex; flex-wrap: wrap; gap: 1rem 1.4rem; align-items: flex-start; }
.mkt-main { flex: 1 1 560px; min-width: 0; }
.mkt-side { flex: 1 1 300px; min-width: min(100%, 260px); max-width: 480px; }
.mq-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.mq-card { border: 1px solid var(--line); border-radius: 12px; padding: .55rem .75rem; background: var(--card); min-width: 0; }
.mq-name { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.mq-val { font-size: clamp(.95rem, 4.2vw, 1.15rem); font-weight: 700; margin-top: .1rem; white-space: nowrap; }
.mq-chg { font-size: .85rem; font-weight: 700; color: var(--muted); }
.mq-chg.pos { color: var(--pos); } .mq-chg.neg { color: var(--neg); } .mq-chg.warn { color: var(--warn); }
.mq-note { font-size: .8rem; color: var(--muted); }
.mq-time { font-size: .72rem; color: var(--muted); margin-top: .1rem; }
.mq-skel { min-height: 4.6rem; display: flex; align-items: center; justify-content: center; color: var(--muted); }
@media (max-width: 720px) { .mkt-side { max-width: none; flex-basis: 100%; } }

/* valuation forms: one tidy column; rows of two fields line their boxes up on the bottom edge */
.val-form { display: grid; gap: 14px; margin-top: .75rem; min-width: 0; }
.val-form > * { min-width: 0; margin: 0; }
.val-form label { display: flex; flex-direction: column; justify-content: flex-end; gap: .3rem; font-size: .84rem; margin: 0; min-width: 0; }
.val-form input, .val-form select { width: 100%; min-width: 0; }
.val-form .pair { grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; align-items: end; }
.val-form .trio { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 12px; align-items: end; margin-top: .6rem; }
.val-form .formula { margin: 0; padding: .65rem .8rem; background: var(--bg); border-radius: 10px; font-size: .86rem; line-height: 1.45; }
.val-form .h3 { margin: .2rem 0 -.2rem; }
.val-form .hint { margin: -.4rem 0 0; font-size: .8rem; line-height: 1.4; }
.val-form .fcfgrid .mini { font-size: .78rem; white-space: nowrap; }
.val-form .adv { margin: 0; padding-top: .2rem; }
.val-form .adv > .pair, .val-form .adv > .trio { margin-top: .75rem; }
.grid2 > *, .val-head { min-width: 0; }

/* settings: profile and alerts form in one tidy column */
.set-form { display: grid; gap: 14px; margin-top: .75rem; min-width: 0; }
.set-form > * { min-width: 0; margin: 0; }
.set-form label { display: flex; flex-direction: column; justify-content: flex-end; gap: .3rem; font-size: .84rem; min-width: 0; margin: 0; }
.set-form input:not([type=checkbox]), .set-form textarea, .set-form select { width: 100%; min-width: 0; }
.set-form .pair { margin: 0; gap: 12px; align-items: end; }
.set-form .trio { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: end; margin-top: .4rem; }
.set-form label.check { flex-direction: row; flex-wrap: nowrap; justify-content: flex-start; align-items: flex-start; gap: .65rem; font-size: .95rem; font-weight: 500; color: var(--ink); }
.set-form label.check input { margin: .2rem 0 0; flex: none; width: 1.15rem; height: 1.15rem; padding: 0; }
.set-form label.check .sub { display: block; margin-top: .15rem; font-weight: 400; }
.set-group { border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem 1rem; display: grid; gap: 12px; margin: 0; min-width: 0; }
.set-group legend { padding: 0 .4rem; font-weight: 700; font-size: .9rem; color: var(--ink); }
.set-group .hint { margin: 0; font-size: .8rem; }
.set-group .tgt-off { margin: 0; }

.kpi-link { cursor: pointer; }
.kpi-link:hover { border-color: var(--accent); }
.kpi-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#an-realized { scroll-margin-top: 84px; }

/* Realized P/L detail: month groups that open and close; wide screens show a table, phones two-line rows */
.rl-controls select { min-width: 8.5rem; }
.rl-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: .5rem; margin: .2rem 0 .8rem; }
.rl-tile { background: var(--bg); border-radius: 10px; padding: .5rem .7rem; display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.rl-tile b { font-size: 1rem; overflow-wrap: anywhere; }
.rl-listhead { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }
.rl-all { font-size: .85rem; color: var(--muted); }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; }
.rl-group { border-bottom: 1px solid var(--line); }
.rl-head { width: 100%; display: flex; align-items: center; gap: .5rem; background: var(--bg); border: 0; border-radius: 8px; padding: .55rem .7rem; margin-top: .45rem; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.rl-name { font-weight: 600; flex: 1; min-width: 0; }
.rl-n { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.rl-head b { white-space: nowrap; }
.rl-caret { display: inline-block; transition: transform .15s; color: var(--muted); }
.rl-group.open .rl-caret { transform: rotate(90deg); }
.rl-row { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "tk br pl" "date q pc" "avg avg px"; gap: .1rem .6rem; padding: .55rem .2rem; border-top: 1px solid var(--line); font-size: .85rem; }
.rl-row .c-tk { grid-area: tk; } .rl-row .c-br { grid-area: br; color: var(--muted); } .rl-row .c-pl { grid-area: pl; } .rl-row .c-date { grid-area: date; color: var(--muted); }
.rl-row .c-q { grid-area: q; text-align: left; color: var(--muted); } .rl-row .c-pc { grid-area: pc; } .rl-row .c-avg { grid-area: avg; text-align: left; color: var(--muted); } .rl-row .c-px { grid-area: px; color: var(--muted); }
.rl-row .r { text-align: right; } .rl-row span { white-space: nowrap; min-width: 0; }
.rl-cols { display: none; }
@media (min-width: 760px) {
  .rl-cols, .rl-row { display: grid; grid-template-columns: 6.5rem 4.5rem minmax(7rem, 1.4fr) 5.5rem 1fr 1fr 1.3fr 4.5rem; grid-template-areas: none; gap: 0 .7rem; align-items: center; }
  .rl-cols { padding: .5rem .2rem; border-bottom: 1px solid var(--line); margin-top: .4rem; }
  .rl-th { background: none; border: 0; font: inherit; font-size: .75rem; text-transform: uppercase; color: var(--muted); cursor: pointer; text-align: left; padding: 0; }
  .rl-th.r { text-align: right; } .rl-th.on { color: var(--accent); font-weight: 700; }
  .rl-row .c-tk, .rl-row .c-br, .rl-row .c-date, .rl-row .c-q, .rl-row .c-avg, .rl-row .c-px, .rl-row .c-pl, .rl-row .c-pc { grid-area: auto; }
  .rl-row .c-q, .rl-row .c-avg, .rl-row .c-px { color: inherit; text-align: right; }
  .rl-row .lab { display: none; }
}

/* Detail cards for Lifetime P/L, XIRR and Unrealized (Analysis page) */
.dc { --c-realized: #0f766e; --c-unrealized: #5fb3a5; --c-dividends: #b8ddd6; --c-fees: #e7a29a; padding: 1.25rem; }
.dc-eye { font-size: .72rem; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0; }
.dc-hero { font-size: clamp(1.45rem, 7vw, 1.9rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.15; margin: .4rem 0 .15rem; white-space: nowrap; }
.dc-unit { font-size: .95rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.dc-cap { font-size: .82rem; color: var(--muted); }
.dc-split { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.dc-pill { display: inline-block; font-size: .76rem; font-weight: 600; padding: .05rem .55rem; border-radius: 999px; background: var(--accent-soft); margin-left: .35rem; vertical-align: middle; }
.dc-sec { font-size: .72rem; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 1.2rem 0 .4rem; }
.dc-stack { display: flex; height: 10px; border-radius: 999px; overflow: hidden; gap: 2px; margin: .8rem 0 .2rem; }
.dc-stack i { display: block; height: 100%; } i.c-realized, .dc-dot.c-realized { background: var(--c-realized); } i.c-unrealized, .dc-dot.c-unrealized { background: var(--c-unrealized); } i.c-dividends, .dc-dot.c-dividends { background: var(--c-dividends); } i.c-fees, .dc-dot.c-fees { background: var(--c-fees); }
.dc-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dc-leg { border-bottom: 1px solid var(--line); } .dc-leg:last-of-type { border-bottom: 0; }
.dc-tog { width: 100%; display: flex; align-items: center; gap: .55rem; background: none; border: 0; padding: .6rem 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.dc-n { flex: 1; min-width: 0; } .dc-p { color: var(--muted); font-size: .8rem; min-width: 2.4rem; text-align: right; } .dc-v { font-weight: 600; text-align: right; white-space: nowrap; }
.dc-chev { color: var(--muted); width: .7rem; transition: transform .15s; flex: none; } .dc-chev.open { transform: rotate(90deg); }
.dc-sub { margin: 0 0 .5rem 1.6rem; font-size: .85rem; } .dc-sub > div { display: flex; justify-content: space-between; gap: .6rem; padding: .18rem 0; }
.dc-go { font-weight: 600; text-decoration: none; }
.dc-tbl { width: 100%; border-collapse: collapse; font-size: .82rem; } .dc-tbl th { font-weight: 600; color: var(--muted); font-size: .72rem; text-align: right; padding: 0 .2rem .4rem; } .dc-tbl td { text-align: right; padding: .5rem .2rem; border-top: 1px solid var(--line); white-space: nowrap; }
.dc-tbl th:first-child, .dc-tbl td:first-child { text-align: left; font-weight: 600; }
.dc-note { font-size: .76rem; color: var(--muted); margin: .6rem 0 0; }
.dc-two { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; margin-top: .9rem; } .dc-two .k { display: block; font-size: .76rem; color: var(--muted); } .dc-two b { display: block; font-size: 1.05rem; margin-top: .1rem; overflow-wrap: anywhere; }
.dc-why { background: var(--bg); border-radius: 12px; padding: .7rem .85rem; font-size: .84rem; line-height: 1.5; margin-top: .9rem; }
.dc-year { font-weight: 700; padding: .4rem 0; } .dc-year .dc-v { font-weight: 500; color: var(--muted); font-size: .8rem; }
.dc-tl { margin: .2rem 0 .6rem .4rem; padding-left: 1.1rem; border-left: 2px solid var(--line); } .dc-tl.now { border-left-color: var(--accent); margin-top: .8rem; }
.dc-ev { position: relative; padding: 0 0 .8rem; } .dc-ev::before { content: ""; position: absolute; left: -1.55rem; top: .3rem; width: 10px; height: 10px; border-radius: 50%; background: var(--card); border: 2px solid var(--accent); box-sizing: border-box; }
.dc-ev.out::before { background: var(--pos); border-color: var(--pos); } .dc-tl.now .dc-ev::before { background: var(--accent); }
.dc-d { font-size: .76rem; color: var(--muted); white-space: nowrap; } .dc-t { display: flex; justify-content: space-between; gap: .6rem; font-size: .9rem; font-weight: 600; } .dc-t b { white-space: nowrap; } .dc-s { font-size: .76rem; color: var(--muted); }
.dc-prog { height: 6px; border-radius: 999px; background: var(--line); margin: .8rem 0 .3rem; overflow: hidden; } .dc-prog i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.dc-controls { margin-top: .9rem; } .dc-controls select { min-width: 8rem; }
.dc-grp { margin-top: .3rem; } .dc-bro { background: var(--bg); border-radius: 8px; padding: .5rem .7rem; font-weight: 700; margin-top: .4rem; width: 100%; }
.dc-pos { border-bottom: 1px solid var(--line); }
.dc-posbtn { display: grid; grid-template-columns: .7rem 1fr auto; grid-template-areas: "chev n v" ". sub pct"; gap: .1rem .55rem; align-items: baseline; }
.dc-posbtn .dc-chev { grid-area: chev; } .dc-posbtn .dc-n { grid-area: n; } .dc-posbtn .dc-v { grid-area: v; } .dc-posbtn .dc-sub2 { grid-area: sub; font-size: .76rem; color: var(--muted); display: flex; align-items: center; gap: .45rem; } .dc-posbtn .dc-pct { grid-area: pct; font-size: .78rem; text-align: right; }
.dc-w { display: inline-block; width: 70px; height: 4px; border-radius: 99px; background: var(--line); } .dc-w i { display: block; height: 100%; border-radius: 99px; background: var(--c-unrealized, #5fb3a5); }
.dc-lots { background: var(--bg); border-radius: 12px; padding: .65rem .8rem; margin: 0 0 .6rem; font-size: .82rem; }
.dc-lot { display: grid; grid-template-columns: 7.2rem 1fr auto; gap: .4rem; padding: .22rem 0; } .dc-m { font-size: .76rem; color: var(--muted); margin-bottom: .3rem; } .dc-divline { border-top: 1px solid var(--line); padding-top: .4rem; margin: .4rem 0 0; }
.dc-ctr { display: grid; grid-template-columns: 4.5rem 1fr 3.4rem; gap: .5rem; align-items: center; font-size: .82rem; padding: .2rem 0; } .dc-bar { height: 6px; border-radius: 99px; background: var(--line); } .dc-bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); } .dc-bar i.neg { background: var(--neg); } .dc-ctr b { text-align: right; }
.dc .ks.exact { font-size: .8rem; color: var(--muted); margin-bottom: .2rem; }
.dc-bn { display: inline-block; max-width: 6.2rem; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.dc-tbl { font-size: .78rem; } .dc-tbl th, .dc-tbl td { padding-left: .15rem; padding-right: .15rem; }
.dc-bn { max-width: none; white-space: normal; overflow: visible; }
.dc-tbl td:first-child { white-space: normal; min-width: 5.5rem; }
.dc-two .k { display: flex; align-items: center; gap: .35rem; }
.dc-bar i, .dc-w i { background: var(--accent); } .dc-bar i.neg { background: var(--neg); }

/* ---- numbers that always fit: they shrink instead of wrapping or being cut off ---- */
.fitnum { display: block; min-width: 0; max-width: 100%; white-space: nowrap; overflow: hidden; font-variant-numeric: tabular-nums; }
.dc-v.fitnum, .dc-t .fitnum { flex: 0 1 auto; }
.dc-t > span:first-child { min-width: 0; }
.rl-tile { min-width: 0; }

/* ---- Holdings (phone cards), Stats, Watchlist: calmer, more elegant ---- */
.chip { display: inline-block; font-size: .78rem; font-weight: 600; padding: .08rem .55rem; border-radius: 999px; background: var(--bg); color: var(--muted); white-space: nowrap; }
.chip.pos { background: color-mix(in srgb, var(--pos) 12%, transparent); color: var(--pos); }
.chip.neg { background: color-mix(in srgb, var(--neg) 12%, transparent); color: var(--neg); }
.hold-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: .3rem; padding: .85rem .1rem; border-bottom: 1px solid var(--line); }
.hold-card:last-child { border-bottom: 0; }
.hc-top, .hc-mid, .hc-bot { display: flex; align-items: center; justify-content: space-between; gap: .7rem; min-width: 0; }
.hc-id { display: flex; flex-direction: column; min-width: 0; } .hc-id b { font-size: 1.02rem; letter-spacing: .01em; } .hc-id .sub { font-size: .78rem; }
.hc-val { flex: 0 1 auto; font-size: 1.05rem; text-align: right; }
.hc-px { flex: 1 1 0; font-size: .78rem; }
.hc-pl { display: flex; align-items: center; gap: .4rem; flex: 0 1 auto; min-width: 0; } .hc-plv { font-size: .9rem; font-weight: 600; }
.hc-bot { font-size: .76rem; } .hc-bot > .sub { flex: 1 1 auto; min-width: 0; } .hc-day { margin-left: auto; text-align: right; white-space: nowrap; }
.hc-top > :last-child, .hc-mid > :last-child, .hc-bot > :last-child { justify-self: end; text-align: right; }
.hc-w { flex: none; width: 64px; height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; } .hc-w i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.soft { background: var(--bg); border-radius: 14px; padding: .8rem 1rem; } .soft h3 { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 .3rem; }
.soft .rank li { border-bottom-color: color-mix(in srgb, var(--line) 70%, transparent); }
.hold-table .tbl th { font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.hold-table .tbl td { font-variant-numeric: tabular-nums; }
.brk-split { height: 8px; border-radius: 99px; gap: 2px; background: none; } .brk-split span { border-radius: 99px; }
.bb-sub { gap: .6rem; } .bb-sub .fitnum { flex: 0 1 auto; } .bb-sub .fitnum.r { text-align: right; } .dotk { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: .35rem; vertical-align: 1px; } .dotk.c { background: #94a3b8; } .dotk.s { background: var(--accent); }
.bb-nw { flex: 0 1 auto; text-align: right; }

.st-top { display: flex; align-items: center; justify-content: center; gap: 1.6rem; flex-wrap: wrap; background: none; padding: .4rem 0 .2rem; border-radius: 0; }
.st-gauge { min-width: 0; } .st-left { display: grid; gap: .9rem; } .st-left > div + div { margin: 0; padding: 0; border: 0; }
.st-lbl { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.st-big { font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; }
.st-wl { display: flex; justify-content: center; gap: .6rem; flex-wrap: wrap; margin: .5rem 0 1rem; } .st-wl .chip { font-size: .85rem; padding: .25rem .8rem; } .st-wl b { font-size: 1rem; }
.st-tiles { gap: .6rem; }
.st-tile { border: 0; background: var(--bg); border-radius: 14px; padding: .8rem .9rem; min-width: 0; }
.st-tile .v { font-size: 1.05rem; margin-top: .25rem; } .st-tile .s { font-size: .8rem; }

.wl { display: grid; }
.wl-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto auto; align-items: center; gap: .7rem; padding: .8rem .1rem; border-bottom: 1px solid var(--line); } .wl-row:last-child { border-bottom: 0; }
.wl-id { display: flex; flex-direction: column; min-width: 0; } .wl-id b { font-size: 1.02rem; } .wl-id .sub { font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-px { text-align: right; } .wl-row .chip { min-width: 4.4rem; text-align: center; }
.rank li { align-items: center; gap: .7rem; }
.rk-id { display: flex; flex-direction: column; min-width: 0; } .rk-id .sub { font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-v { display: flex; align-items: center; gap: .45rem; justify-content: flex-end; min-width: 0; flex: 0 1 auto; } .rk-pl { font-weight: 600; font-size: .92rem; }

/* ---- Market tab: soft quote cards and stat panels (the "You vs the market" block and the range buttons stay as they were) ---- */
.mq-card { border: 0; background: var(--bg); border-radius: 14px; padding: .75rem .85rem; display: flex; flex-direction: column; align-items: flex-start; gap: .15rem; }
.mq-name { font-size: .7rem; letter-spacing: .08em; font-weight: 600; }
.mq-val { margin: .15rem 0; max-width: 100%; }
.mq-chg { display: inline-block; font-size: .78rem; padding: .08rem .6rem; border-radius: 999px; background: var(--line); }
.mq-chg.pos { background: color-mix(in srgb, var(--pos) 12%, transparent); } .mq-chg.neg { background: color-mix(in srgb, var(--neg) 12%, transparent); } .mq-chg.warn { background: color-mix(in srgb, var(--warn) 14%, transparent); }
.mq-chg:empty { display: none; }
.mq-time { margin-top: .2rem; }
.mstats { display: flex; flex-wrap: nowrap; gap: .4rem; margin: .5rem 0 .7rem; }
.mstats > div { flex: 1 1 0; background: var(--bg); border-radius: 12px; padding: .5rem .55rem; min-width: 0; }
.mstats .hl { font-size: .66rem; letter-spacing: .06em; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: clip; display: block; }
.mstats > div > :last-child { font-weight: 700; font-size: .95rem; margin-top: .1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Health tab ---- */
.hl-ok { display: flex; align-items: center; gap: .9rem; padding: .3rem 0; } .hl-ok b { font-size: 1.02rem; }
.hl-ic { width: 34px; height: 34px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 700; background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.hl-ic.r { background: color-mix(in srgb, var(--neg) 14%, transparent); color: var(--neg); } .hl-ic.ok { width: 42px; height: 42px; font-size: 1.2rem; background: color-mix(in srgb, var(--pos) 14%, transparent); color: var(--pos); }
.hl-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.hl-tx { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.hl-fix { background: none; border: 0; font: inherit; font-weight: 600; font-size: .85rem; color: var(--accent); text-decoration: underline; cursor: pointer; padding: .4rem 0; min-height: 40px; }
.hl-card > .sub { margin: .7rem 0 0; }
.mstats > div > .fitnum { overflow: hidden; text-overflow: clip; }

/* crosshair + bubble on line charts (chart-hover.js) */
.chart[data-hv] { touch-action: pan-y; cursor: crosshair; }
.hv-line { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.hv-dot { fill: var(--accent); stroke: var(--card); stroke-width: 2; }
.hv-box { fill: var(--card); stroke: var(--line); stroke-width: 1; filter: drop-shadow(0 2px 6px rgba(16, 40, 36, .15)); }
.hv-t1 { font-size: 12px; fill: var(--muted); } .hv-t2 { font-size: 15px; font-weight: 700; fill: var(--ink, currentColor); } .hv-t3 { font-size: 12px; font-weight: 600; fill: var(--muted); }
.hv-t3.pos { fill: var(--pos); } .hv-t3.neg { fill: var(--neg); }

/* ---- holding detail sheet and share window ---- */
.hrow, .hold-card[role=button] { cursor: pointer; }
.hrow:hover td { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.hold-card[role=button]:active { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
body.sheet-open { overflow: hidden; }
.sheet-wrap { position: fixed; inset: 0; z-index: 40; background: rgba(10, 20, 18, .48); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: min(100%, 520px); max-height: 94vh; overflow-y: auto; background: var(--bg); border-radius: 24px 24px 0 0; padding: 8px 16px calc(18px + env(safe-area-inset-bottom)); animation: sheetUp .22s ease-out; }
@keyframes sheetUp { from { transform: translateY(40px); opacity: .6; } }
@media (min-width: 700px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 24px; } }
.sh-grab { width: 40px; height: 4px; border-radius: 9px; background: var(--line); margin: 4px auto 10px; }
.sh-head { display: flex; align-items: flex-start; gap: 8px; }
.sh-head h2 { font-size: 1.35rem; margin: 0; }
.sh-id { flex: 1; min-width: 0; display: grid; }
.sh-head > h2 { flex: 1; align-self: center; text-align: center; font-size: 1.1rem; }
.sh-x { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; }
.sh-x.on { color: var(--accent); border-color: var(--accent); }
.sh-hero { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; margin-top: 12px; }
.sh-big { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; margin: 2px 0 4px; }
.sh-pl { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .7rem; font-weight: 700; }
.sh-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.sh-grid > div { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; min-width: 0; }
.sh-grid small { display: block; color: var(--muted); font-size: .78rem; margin-bottom: 2px; }
.sh-grid b { font-size: 1rem; overflow-wrap: anywhere; }
.sh-grid .wide { grid-column: span 2; } .sh-grid .wide .hc-w { display: block; width: 100%; margin-top: 8px; }
.sh-btns { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; } .sh-btns .btn { flex: 1; min-width: 100px; padding: .7rem 1rem; border-radius: 14px; text-align: center; }
.sh-btns.two .buy { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.sh-btns.two .sell { color: var(--neg); border-color: var(--neg); }
.sh-sharebtn { width: 100%; margin-top: 8px; border-radius: 14px; background: var(--card); color: var(--accent); border-color: var(--accent); }
.sh-sharebtn.primary { background: var(--card); color: var(--accent); }
.sh-card { display: block; width: min(100%, 360px); aspect-ratio: 1; margin: 12px auto 4px; border-radius: 0; box-shadow: 0 8px 28px rgba(30, 20, 70, .22); }
.sh-tg { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; margin-top: 8px; font-weight: 600; }
.sh-tg small { display: block; font-weight: 400; color: var(--muted); font-size: .78rem; }
.sh-tg.off { opacity: .7; }
.swt, input.swt { -webkit-appearance: none; appearance: none; flex: none; width: 44px; min-width: 44px; height: 26px; min-height: 26px; padding: 0; border-radius: 99px; background: #cdd5d3; position: relative; cursor: pointer; transition: background .15s; border: 0; margin: 0; }
.swt::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .15s; }
.swt:checked { background: var(--accent); } .swt:checked::after { left: 21px; }
.swt:disabled { cursor: not-allowed; }
.sh-note { margin: 10px 2px 0; font-size: .8rem; }

.mail-snap { margin: .6rem 0; font-size: .86rem; } .mail-snap ul { margin: .25rem 0 0; padding-left: 1.1rem; } .mail-snap li.bad { color: var(--neg); font-weight: 600; }

/* Account page: list + detail */
.acc-top{display:flex;align-items:center;gap:12px}
.acc-av{width:44px;height:44px;border-radius:50%;background:var(--accent);color:#fff;display:grid;place-items:center;font-weight:700;font-size:18px;flex:none}
.acc-who{flex:1;min-width:0;display:flex;flex-direction:column}
.acc-who b,.acc-who .sub{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.acc-list{padding:4px 0}
.acc-row{display:flex;align-items:center;gap:12px;width:100%;padding:14px 16px;background:none;border:0;border-bottom:1px solid var(--line);color:inherit;font:inherit;text-align:left;cursor:pointer}
.acc-row:last-child{border-bottom:0}
.acc-row:hover{background:color-mix(in srgb,var(--accent) 6%,transparent)}
.acc-ic{width:36px;height:36px;border-radius:10px;background:color-mix(in srgb,var(--accent) 12%,transparent);color:var(--accent);display:grid;place-items:center;flex:none}
.acc-tx{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.acc-tx .sub{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.acc-bad{color:var(--neg)}
.acc-chev{color:var(--muted);font-size:22px}
.acc-bar{display:flex;align-items:center;gap:8px;margin-bottom:12px}
.acc-bar h1{font-size:18px;margin:0}
.acc-back{width:40px;height:40px;border-radius:50%;border:1px solid var(--line);background:var(--card);color:inherit;display:grid;place-items:center;cursor:pointer}
.acc-h{font-size:22px;margin:4px 0 12px}

/* Theme choices (Account > Theme): purple is the default */
html[data-accent=green] { --accent: #0f766e; --accent-ink: #fff; --accent-soft: #e0f2ef; }
@media (prefers-color-scheme: dark) {
  html[data-accent=green] { --accent: #2dd4bf; --accent-ink: #062b27; --accent-soft: #123532; }
}
.thm { display: grid; gap: 10px; margin-top: 10px }
.thm-opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); color: inherit; font: inherit; text-align: left; cursor: pointer }
.thm-opt.on { border-color: var(--accent) }
.thm-sw { display: flex; flex: none; width: 44px; height: 28px; border-radius: 8px; overflow: hidden }
.thm-sw i { flex: 1 }
.thm-tick { color: var(--accent); font-weight: 700; width: 18px; text-align: center }
.thm { grid-template-columns: minmax(0, 1fr) }
.thm-opt .acc-tx .sub { white-space: normal }
.ref-bar{height:8px;border-radius:99px;background:var(--line);overflow:hidden;margin:.6rem 0 .3rem}.ref-bar i{display:block;height:100%;background:var(--gain)}
.ref-link{display:flex;gap:8px;margin-top:10px}.ref-link input{flex:1;min-width:0}
.acc-detail > .card + .card { margin-top: 12px }

/* logo + tagline lockup */
.lockup { position: relative; display: inline-block; line-height: 0 }
.lk-tag { position: absolute; inset: 0; width: 100%; height: 100%; fill: var(--muted); pointer-events: none }
body.rail .lk-tag { display: none }
/* start screen */
.splash { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; background: var(--bg) }
.splash-lock .logo-full { height: 64px }
.imp-chips{margin:10px 0}.nchips{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0}
.nchip{border:1px solid var(--line);background:var(--card);color:inherit;border-radius:99px;padding:6px 12px;font:inherit;cursor:pointer}.nchip:hover{border-color:var(--accent)}

/* history: one-line filters, foldable years and months */
.tx-filters { display: flex; gap: 8px; margin: .6rem 0 .2rem; flex-wrap: nowrap }
.tx-filters select { flex: 0 1 42%; min-width: 0; width: auto; min-height: 40px }
.tx-filters input { flex: 1 1 0; min-width: 0; width: auto; min-height: 40px }
.tx-types { margin: .4rem 0 .2rem }
.tx-types .seg-scroll { display: flex }
.hyr { display: flex; align-items: center; gap: 8px; width: 100%; padding: 12px 2px 6px; border: 0; background: none; color: var(--ink); font: inherit; font-size: .95rem; text-align: left; cursor: pointer }
.hyr .sub { margin-left: auto; font-weight: 500 }
.hyr.hmo { padding-left: 14px; font-size: .85rem }
.hgrp.hmo { width: 100%; border: 0; background: none; font-family: inherit; cursor: pointer; padding-left: 14px; text-align: left }
.hgrp.hmo > span:first-child { display: inline-flex; align-items: center; gap: 6px }
.hchev { flex: none; color: var(--muted) }
.hyr-row td, .hmo-row td { padding: 0 !important; background: var(--bg) }

.go-row { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.go-row .chev, .kpi-link .hd .chev { color: var(--accent); display: inline-flex; flex: none; }
.go-row:hover .chev { transform: translateX(2px); }
.card.inset .hd { display: flex; align-items: center; gap: 6px; }
.card.inset .hd .chev { margin-left: auto; }

.rep .lbl-s { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted, #6b7b76); font-weight: 700; margin: 16px 0 8px; }
.rep-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.rep-chip { border: 1px solid var(--line, #d5dcd8); background: transparent; color: inherit; border-radius: 99px; padding: 8px 14px; font: inherit; font-size: 13px; cursor: pointer; }
.rep-chip.on { background: color-mix(in srgb, var(--accent) 14%, transparent); border-color: var(--accent); color: var(--accent); font-weight: 700; }
.rep-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.rep-dates label { display: grid; gap: 4px; font-size: 12px; color: var(--muted, #6b7b76); }
.rep-dates input { min-width: 0; }
.rep-opt { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line, #e1e6e3); cursor: pointer; }
.rep-opt input { margin-top: 3px; flex: none; width: 18px; height: 18px; accent-color: var(--accent); }
.rep-opt .sub { display: block; }
.rep-go { width: 100%; margin-top: 16px; }
.rep-busy { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 14px; }
.rep-done { display: grid; gap: 6px; margin-top: 14px; padding: 12px; border-radius: 12px; background: color-mix(in srgb, var(--gain, #0f766e) 10%, transparent); }
.rep-act { display: flex; gap: 8px; }
.rep-note { margin-top: 12px; }
.spin { width: 16px; height: 16px; border: 2px solid color-mix(in srgb, var(--accent) 25%, transparent); border-top-color: var(--accent); border-radius: 50%; animation: rspin .8s linear infinite; flex: none; }
@keyframes rspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.4s; } }

.card.inset.white { background: var(--card); }
.hv-t2.hv-m { font-size: 13px; font-weight: 600; }


/* Premium-only cards */
.premium-lock { border: 1px dashed var(--line, #cfc9e6); background: color-mix(in srgb, var(--accent, #3E3478) 5%, var(--card, #fff)); }
.premium-lock .hd { display: flex; align-items: center; gap: .6rem; justify-content: space-between; }
.plan-badge { font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: .15rem .55rem; border-radius: 999px; background: var(--accent, #3E3478); color: #fff; }

/* Account: Premium card, invite card, help rows, plan screen */
.premium-card{position:relative;overflow:hidden;display:grid;gap:6px;width:100%;text-align:left;padding:20px 18px 16px;margin:0 0 12px;border:0;border-radius:22px;background:linear-gradient(135deg,#1b1740 0%,#2d2670 55%,#0f766e 140%);color:#fff;font:inherit;cursor:pointer;box-shadow:0 8px 24px rgba(27,23,64,.28)}
.premium-card b{font-size:1.35rem;letter-spacing:-.02em;max-width:75%}
.pc-line{position:absolute;right:0;top:0;width:55%;height:70px;color:rgba(255,255,255,.28)}
.pc-eye{font-size:.7rem;font-weight:800;letter-spacing:.12em;color:#7ee7c7}
.pc-sub{font-size:.88rem;color:rgba(255,255,255,.78)}
.pc-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}.pc-chips i{font-style:normal;font-size:.76rem;font-weight:600;padding:3px 10px;border-radius:999px;background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.18)}
.pc-go{margin-top:8px;font-weight:700;color:#7ee7c7}
.premium-card.on{background:linear-gradient(135deg,#0f3d36,#0f766e)}
.invite-card{display:flex;align-items:center;gap:12px;width:100%;text-align:left;padding:14px 16px;margin:0 0 12px;border:1px dashed color-mix(in srgb,var(--accent) 45%,transparent);border-radius:16px;background:var(--card,#fff);color:inherit;font:inherit;cursor:pointer}
.invite-card .ic-tx{display:grid;gap:6px;flex:1}
.ic-dots{display:flex;gap:5px}.ic-dots i{width:100%;max-width:22px;height:8px;border-radius:99px;background:var(--line)}.ic-dots i.on{background:var(--gain)}
.ref-code{display:flex;align-items:center;gap:10px;margin-top:10px}.ref-code b{font-family:ui-monospace,monospace;font-size:1.25rem;letter-spacing:.12em}.ref-code .btn{margin-left:auto}
#ref-enter{margin-top:12px}#ref-enter input{text-transform:uppercase;letter-spacing:.12em}
.acc-group{padding:12px 16px 4px;font-size:.78rem;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:var(--muted)}
a.acc-row{text-decoration:none}
.plans-screen{display:grid;gap:12px}
.pl-hero{position:relative;overflow:hidden;padding:22px 20px 20px;border-radius:22px;color:#fff;background:linear-gradient(135deg,#1b1740 0%,#2d2670 55%,#0f766e 140%);box-shadow:0 8px 24px rgba(27,23,64,.25)}
.pl-hero h2{margin:6px 0 4px;font-size:1.5rem;letter-spacing:-.02em;color:#fff;max-width:80%}.pl-hero p{margin:0;color:rgba(255,255,255,.8);font-size:.92rem;max-width:34em}
.pl-status{display:inline-block;margin-top:12px;font-size:.78rem;font-weight:700;padding:4px 12px;border-radius:999px;background:rgba(126,231,199,.18);border:1px solid rgba(126,231,199,.4);color:#7ee7c7}
.pl-card{padding:16px 14px;margin:0}
.cmp-app{width:100%;border-collapse:separate;border-spacing:0}
.cmp-app th,.cmp-app td{padding:11px 8px;border-bottom:1px solid var(--line);text-align:center;font-size:.9rem}
.cmp-app tbody tr:last-child th,.cmp-app tbody tr:last-child td{border-bottom:0}
.cmp-app thead th{font-size:.7rem;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);font-weight:700}
.cmp-app thead .pcol{color:var(--accent)}
.cmp-app tbody th{text-align:left;font-weight:500}
.cmp-app .pcol{font-weight:700;color:var(--accent);background:color-mix(in srgb,var(--accent) 8%,transparent)}
.cmp-app thead .pcol{border-radius:12px 12px 0 0}.cmp-app tbody tr:last-child .pcol{border-radius:0 0 12px 12px}
.cmp-app .yes{color:#1f9d6b;font-weight:800}.cmp-app .no{color:var(--muted)}
.pk-h{margin:0 0 12px;font-size:.78rem;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.packs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.pack{position:relative;display:grid;justify-items:center;align-content:start;gap:2px;padding:20px 6px 12px;border:1.5px solid var(--line);border-radius:18px;cursor:pointer;background:var(--card,#fff);text-align:center;transition:border-color .15s,box-shadow .15s,transform .15s}
.pack.on{border-color:var(--accent);background:color-mix(in srgb,var(--accent) 7%,var(--card,#fff));box-shadow:0 6px 18px color-mix(in srgb,var(--accent) 22%,transparent)}
.pack input{position:absolute;opacity:0;inset:0;width:100%;height:100%;margin:0;cursor:pointer}
.pack:has(input:focus-visible){outline:2px solid var(--accent);outline-offset:2px}
.pk-n{font-size:2rem;font-weight:800;line-height:1;letter-spacing:-.03em}.pk-u{font-size:.72rem;text-transform:uppercase;letter-spacing:.08em;color:var(--muted)}
.pk-price{font-weight:800;font-size:.98rem;margin-top:8px}.pk-per{font-size:.72rem;color:var(--muted)}
.pk-badge{margin-top:8px;font-size:.7rem;font-weight:700;padding:2px 8px;border-radius:999px;background:color-mix(in srgb,var(--gain,#1f9d6b) 16%,transparent);color:var(--gain,#1f9d6b)}.pk-badge.ghost{visibility:hidden}
.pk-ribbon{position:absolute;top:-9px;left:50%;transform:translateX(-50%);white-space:nowrap;font-size:.66rem;font-weight:800;letter-spacing:.06em;text-transform:uppercase;padding:3px 10px;border-radius:999px;background:var(--accent);color:#fff}
.pk-once{margin:14px 0 0;text-align:center;font-size:.82rem;color:var(--muted)}
.pk-go{margin-top:12px}.pk-go .btn{width:100%}.pk-note,.pk-links{text-align:center;margin-top:10px}
.linkish{background:none;border:0;padding:0;font:inherit;color:var(--accent);font-weight:600;cursor:pointer;text-decoration:underline}.pk-key{text-align:center;margin:10px 0 0}
.nw2.n3,.nw2.n4,.nw2.n5{grid-template-columns:repeat(auto-fit,minmax(200px,1fr))}

/* ---- net worth carousel on a soft gradient stage, glass cards (same family as the Premium card) ---- */
.nw-stage{position:relative;overflow:hidden;border-radius:24px;padding:18px 0 12px;margin:0 0 10px;background:linear-gradient(135deg,#1b1740 0%,#2d2670 55%,#0f766e 140%);box-shadow:0 8px 24px rgba(27,23,64,.22)}
.nw-stage::before,.nw-stage::after{content:"";position:absolute;border-radius:50%;filter:blur(40px);pointer-events:none;opacity:.55}
.nw-stage::before{width:220px;height:220px;left:-60px;top:-70px;background:#7c5cff}
.nw-stage::after{width:240px;height:240px;right:-70px;bottom:-90px;background:#14b8a6}
.nw-car{position:relative;z-index:1;display:flex;gap:12px;overflow-x:auto;scroll-snap-type:x mandatory;padding:4px 16px 10px;scrollbar-width:none;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain}
.nw-car::-webkit-scrollbar{display:none}
.nw-slide{flex:0 0 min(330px,84%);scroll-snap-align:center;cursor:pointer;opacity:.8;transform:scale(.97);transition:opacity .25s,transform .25s}
.nw-slide.on{opacity:1;transform:none}
.nw-slide .kpi.hero,.nw-slide .kpi.hero.usd{height:100%;margin:0;background:linear-gradient(145deg,rgba(255,255,255,.2),rgba(255,255,255,.06));border:1px solid rgba(255,255,255,.3);color:#fff;border-radius:20px;-webkit-backdrop-filter:blur(18px) saturate(150%);backdrop-filter:blur(18px) saturate(150%);box-shadow:0 6px 20px rgba(8,6,30,.25),inset 0 1px 0 rgba(255,255,255,.25)}
.nw-slide .kpi.hero .kl,.nw-slide .kpi.hero .ks,.nw-slide .kpi.hero .split-lbl{color:rgba(255,255,255,.85)}
.nw-slide .kpi.hero .split{background:rgba(255,255,255,.2)}
.nw-slide .kpi.hero .split-cash{background:#7ee7c7}.nw-slide .kpi.hero .split-stocks{background:#fff}
.nw-tabs{position:relative;z-index:1;display:flex;justify-content:center;gap:6px;padding:0 12px}
.nw-tab{display:inline-flex;align-items:center;gap:5px;border:1px solid rgba(255,255,255,.25);background:rgba(255,255,255,.1);color:rgba(255,255,255,.85);font:inherit;font-size:.8rem;font-weight:700;letter-spacing:.04em;padding:5px 10px;border-radius:999px;cursor:pointer;min-height:32px;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}
.nw-tab .fl{font-size:.95rem;line-height:1}
.nw-tab.on{background:#fff;color:#1b1740;border-color:#fff}
@media (max-width:420px){.nw-tab{padding:5px 8px;gap:3px;font-size:.74rem}.nw-slide{flex-basis:86%}}
@media (prefers-reduced-motion:reduce){.nw-slide{transition:none}}

/* ---- the four number cards: soft glass tiles with a small icon, one tidy line each on a phone ---- */
.kpis .kpi.kc{position:relative;overflow:hidden;padding:14px 14px 12px;border-radius:20px;border:1px solid color-mix(in srgb,var(--kc,var(--accent)) 16%,var(--line));background:linear-gradient(155deg,var(--card) 35%,color-mix(in srgb,var(--kc,var(--accent)) 10%,var(--card)) 140%);box-shadow:0 10px 24px -16px color-mix(in srgb,var(--kc,var(--accent)) 60%,transparent),inset 0 1px 0 rgba(255,255,255,.5)}
.kpis .kpi.kc::after{content:"";position:absolute;right:-26px;top:-26px;width:84px;height:84px;border-radius:50%;background:radial-gradient(circle,color-mix(in srgb,var(--kc,var(--accent)) 22%,transparent),transparent 70%);pointer-events:none}
.kc-life{--kc:#0f9488}.kc-xirr{--kc:#6d5bd0}.kc-real{--kc:#2563eb}.kc-unreal{--kc:#d97706}
.kc .kl{display:flex;align-items:center;gap:8px;text-transform:none;letter-spacing:.01em;font-size:.78rem}
.kc .klt{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.kic{flex:0 0 auto;width:26px;height:26px;border-radius:9px;display:grid;place-items:center;color:var(--kc);background:color-mix(in srgb,var(--kc) 14%,transparent)}
.kc .kv{font-size:1.4rem;margin:.45rem 0 .2rem}
@media (max-width:560px){
  .kpis .kpi.kc{padding:12px 12px 10px;border-radius:18px}
  .kc .kv{font-size:1.2rem}
  .kc .k-more,.kc .ks.exact{display:none}
  .kc .ks{font-size:.74rem}
}
@media (prefers-color-scheme:dark){.kpis .kpi.kc{box-shadow:none;background:linear-gradient(155deg,var(--card) 35%,color-mix(in srgb,var(--kc,var(--accent)) 14%,var(--card)) 140%)}}
/* five currency pills always fit, even on a 320px phone */
.nw-tabs{padding:0 10px;gap:5px}
.nw-tab{flex:1 1 0;min-width:0;justify-content:center;padding:5px 4px}
@media (max-width:420px){.nw-tab{font-size:.7rem;gap:2px;padding:5px 2px}.nw-tab .fl{font-size:.85rem}}

.wl-add{display:flex;gap:8px;margin:0 0 12px}
.wl-add input{flex:1 1 auto;min-width:0;font:inherit;padding:.6rem .8rem;border:1px solid var(--line);border-radius:12px;background:var(--card);color:var(--ink);min-height:44px}
.wl-del{border:0;background:none;color:var(--muted);font-size:1.3rem;line-height:1;width:32px;height:32px;border-radius:50%;cursor:pointer;flex:0 0 auto}
.wl-del:hover{background:var(--accent-soft);color:var(--neg)}
@media (max-width:560px){.kc-xirr .k-more{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}}

/* ======== v40 "soft glass" look: quieter cards, floating bottom bar, merged profile + Premium card ======== */
@media (prefers-color-scheme: light){
  :root{--bg:#f3f2fa;--line:#e8e6f2;--radius:18px;--shadow:0 12px 26px -20px rgba(62,52,120,.45)}
}
.card{border-color:color-mix(in srgb,var(--line) 70%,transparent)}
.tbl th,.tbl td{border-color:color-mix(in srgb,var(--line) 60%,transparent)}
.acc-row{border-bottom-color:color-mix(in srgb,var(--line) 55%,transparent)}
.acc-list{border-radius:20px}
.acc-ic{border-radius:12px}
@media (max-width:720px){
  .bottom{left:10px!important;right:10px!important;bottom:calc(8px + env(safe-area-inset-bottom))!important;border:1px solid color-mix(in srgb,var(--line) 60%,transparent)!important;border-radius:22px;padding:6px 6px!important;background:color-mix(in srgb,var(--card) 84%,transparent)!important;-webkit-backdrop-filter:blur(14px) saturate(160%);backdrop-filter:blur(14px) saturate(160%);box-shadow:0 14px 30px -12px rgba(50,41,95,.45)}
  .page{padding-bottom:110px!important}
}
/* number cards: keep the exact amount (small) under a short one, and let the XIRR hint use two lines */
@media (max-width:560px){
  .kc .ks.exact{display:block}
  .kc-xirr .k-more{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:normal;overflow:hidden;text-overflow:clip}
}
/* profile + Premium in one dark card */
.acc-hero{position:relative;overflow:hidden;border-radius:24px;margin:0 0 12px;color:#fff;background:linear-gradient(135deg,#1b1740 0%,#2d2670 58%,#0f766e 150%);box-shadow:0 14px 30px -18px rgba(27,23,64,.7)}
.acc-hero.on{background:linear-gradient(135deg,#17133a 0%,#2d2670 50%,#0f6b62 130%)}
.acc-hero::before{content:"";position:absolute;right:-40px;top:-40px;width:170px;height:170px;border-radius:50%;background:radial-gradient(circle,rgba(245,196,81,.5),transparent 68%);pointer-events:none}
.ah-top{position:relative;display:flex;align-items:center;gap:10px;padding:16px 16px 12px}
.acc-hero .acc-av{background:linear-gradient(135deg,#fff,#d9d3f7);color:#2d2670}
.acc-hero .acc-who b{color:#fff}
.acc-hero .acc-who .sub{color:rgba(255,255,255,.72)}
.acc-hero .ah-top .btn{background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.28);color:#fff;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}
.acc-hero .premium-card.embed{border-radius:0;box-shadow:none;margin:0;background:rgba(255,255,255,.07);border-top:1px solid rgba(255,255,255,.16);padding:14px 16px 16px}
.acc-hero .premium-card.embed.on{background:rgba(255,255,255,.07)}
.acc-hero .premium-card.embed b{max-width:100%;font-size:1.25rem}
.acc-hero .pc-line{opacity:.7}
.pc-eye{display:inline-block;justify-self:start;padding:3px 10px;border-radius:999px;background:linear-gradient(90deg,#f5c451,#f59e0b);color:#3b2a00;font-size:.68rem}
@media (max-width:420px){.ah-top{flex-wrap:wrap}.ah-top .acc-who{flex:1 1 60%}}

.wl-add select{flex:0 0 auto;font:inherit;padding:.5rem .4rem;border:1px solid var(--line);border-radius:12px;background:var(--card);color:var(--ink);min-height:44px;max-width:92px}

.tickerbar .vt-mkt select{font:inherit;padding:.55rem .5rem;border:1px solid var(--line);border-radius:12px;background:var(--card);color:var(--ink);min-height:44px}
.em-mk{margin:.6rem 0}.em-chk{display:inline-flex;margin:0 .8rem .3rem 0}

/* v43: errors under the field, a darker red that passes contrast, and the in-app confirmation box */
:root { --neg-bg: #b91c1c; }
.toast.err { background: var(--neg-bg); color: #fff; }
.badge.neg, .bell .badge { background: var(--neg-bg); }
.form input[aria-invalid="true"], .form select[aria-invalid="true"] { border-color: var(--neg); box-shadow: 0 0 0 1px var(--neg); }
.ferr { display: block; margin-top: 4px; font-size: .84rem; font-weight: 600; color: var(--neg); }
.dlg-wrap { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(8, 10, 20, .55); }
.dlg { width: min(420px, 100%); background: var(--card, var(--bg)); color: var(--ink); border: 1px solid var(--line, rgba(128,128,128,.3)); border-radius: 16px; padding: 20px; box-shadow: 0 18px 50px rgba(0,0,0,.35); }
.dlg h3 { margin: 0 0 8px; }
.dlg-body p { margin: 0 0 8px; line-height: 1.45; }
.dlg-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.dlg-actions .btn { min-height: 44px; min-width: 96px; }
.btn.danger { background: var(--neg-bg); border-color: var(--neg-bg); color: #fff; }

/* v43: alerts are one calm line under the numbers; open it to act */
details.alerts { padding: 0; display: block; }
details.alerts > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 12px 14px; min-height: 44px; color: var(--warn); }
details.alerts > summary::-webkit-details-marker { display: none; }
.alerts-peek { color: var(--ink); opacity: .75; font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; width: 0; flex: 1 1 0; }
details.alerts { min-width: 0; max-width: 100%; }
details.alerts > summary b { white-space: nowrap; }
.alerts-chev { margin-left: auto; transition: transform .15s; }
details.alerts[open] .alerts-chev { transform: rotate(180deg); }
details.alerts[open] .alerts-peek { display: none; }
.alerts-body { padding: 0 14px 12px; display: grid; gap: 6px; }
.tgt-menu { position: relative; display: inline-block; }
.tgt-menu > summary { list-style: none; cursor: pointer; min-width: 44px; text-align: center; }
.tgt-menu > summary::-webkit-details-marker { display: none; }
.tgt-pop { display: grid; gap: .4rem; margin-top: .4rem; }

/* v43 accessibility pass: softer positive green, 44px touch targets, readable micro labels, contrast */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --gain: #5cc8ae; } }
:root[data-theme="dark"] { --gain: #5cc8ae; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.acc-av { color: var(--accent-ink, #fff); }
.acc-hero .acc-av { color: #2d2670; }
.mstats .hl { font-size: .72rem; }
.banner.demo .link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; }
.kc-main { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, transparent); }
button, select, input, textarea { font-family: inherit; }
@media (pointer: coarse), (max-width: 640px) {
  .icon { min-width: 44px; height: 44px; }
  .nw-tab, .curbar .seg button { min-height: 44px; }
  .seg-btn, .fchip, .ptab { min-height: 44px; }
}

.peek { margin: 14px 0 6px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.peek img { display: block; width: 100%; height: auto; }
.more-link { margin: 0 0 8px; text-align: center; font-size: .92rem; }
.more-link a { color: var(--accent); }

.banner.demo { padding: .2rem .8rem; font-size: .9rem; }

/* v43: valuation row stays tidy on a 320px phone: market and code side by side, the fill button on its own full-width row */
.tickerbar { display: grid; grid-template-columns: minmax(7.5rem, 9rem) minmax(0, 1fr); gap: .6rem; align-items: end; }
.tickerbar > label { min-width: 0; flex: none; }
.tickerbar > label input, .tickerbar > label select { width: 100%; min-width: 0; box-sizing: border-box; }
.tickerbar > .btn { grid-column: 1 / -1; min-height: 44px; white-space: normal; }

/* v43: sign-in preview is a swipeable strip, one phone screenshot per currency */
.peek { border: 0; border-radius: 0; margin: 14px -4px 6px; }
.peek-row { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 4px 8px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.peek-row::-webkit-scrollbar { display: none; }
.peek-slide { position: relative; flex: 0 0 58%; max-width: 230px; scroll-snap-align: start; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.peek-slide img { display: block; width: 100%; height: auto; }
.peek-cur { position: absolute; left: 8px; bottom: 8px; padding: 2px 9px; border-radius: 99px; background: rgba(15, 18, 30, .78); color: #fff; font-weight: 700; font-size: .78rem; }
.peek figcaption { text-align: center; font-size: .86rem; color: var(--muted, var(--ink)); opacity: .8; margin-top: 2px; }
.peek-slide { overflow: visible; border: 0; }
.peek-slide img { border-radius: 16px; border: 1px solid var(--line); }
.peek-cur { position: static; display: block; width: max-content; margin: 6px auto 0; background: var(--chip, rgba(128, 128, 160, .18)); color: var(--ink); }

/* v43: the net worth graph stretches to the card's height */
.card.fitcard { display: flex; flex-direction: column; }
.chart-fit { position: relative; flex: 1 1 auto; min-height: 220px; }
.chart-fit > svg.chart { position: absolute; inset: 0; width: 100%; height: 100%; }
.chart-fit > .empty { position: absolute; inset: 0; display: grid; place-items: center; }


.sh-sharerow { display: flex; gap: 8px; align-items: stretch; margin-top: 8px; }
.sh-sharerow .sh-sharebtn { margin-top: 0; }
.sh-sharerow .sh-sharebtn { flex: 1; min-width: 0; }
.icon.sh-trash, .brk-act .icon { width: 44px; height: 44px; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.icon.sh-trash, .brk-act .icon.danger { color: var(--neg); }
.brk-act { margin-left: auto; display: inline-flex; gap: 4px; }
.brk-row.editing { gap: 8px; }
.brk-input { flex: 1 1 8rem; min-width: 0; }

.fb { display: grid; gap: 8px; }
.fb label { display: block; font-weight: 600; margin-top: 6px; }
.fb label .req { display: inline; }
.fb .req { color: var(--neg); }
.fb-moods { display: flex; gap: 8px; flex-wrap: wrap; }
.fb-mood { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--card); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.fb-mood.on { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--card)); }
.fb textarea, .fb input { width: 100%; box-sizing: border-box; }

.tg-steps { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 14px; }
.tg-steps li { display: flex; gap: 12px; align-items: flex-start; }
.tg-steps li > div { flex: 1; min-width: 0; display: grid; gap: 8px; }
.tg-n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; }
.tg input { width: 100%; box-sizing: border-box; }
.tg-code { margin: 4px 0 0; font-size: 1.15rem; }
.tg-code b { padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 10%, var(--card)); user-select: all; word-break: break-all; display: inline-block; }
.tg-ok { color: var(--pos); font-weight: 600; }
.tg-help { margin-top: 12px; }
.tg-help pre { white-space: pre-wrap; word-break: break-word; font-size: .85rem; margin: 8px 0 0; }

.tg-auto { margin: 10px 0; padding: 12px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 8%, var(--card)); }
.tg-auto ol { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; }

/* Telegram instant saving */
.tg-instant { margin: 12px 0; padding: 12px 14px; border: 1px solid var(--line, #d9dee7); border-radius: 12px; background: var(--card-2, rgba(0,0,0,.03)); }
.tg-instant.on { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tg-instant .btn { margin: 6px 0; }
.tg-instant .sub { margin: 4px 0; }

.brk-margin { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted, #667); white-space: nowrap; }
.brk-margin input { width: auto; margin: 0; }

.margin-card { margin-top: 12px; }
.margin-card .mg-over td { color: var(--neg, #c0392b); }
.margin-card .mg-warn { color: var(--neg, #c0392b); font-weight: 600; margin: 8px 0 0; }
.margin-card .mg-set { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: .9rem; }
.margin-card .mg-set input { width: 5rem; }

/* locked Premium cards: a faded made-up picture, a veil, a lock */
.lockprev { border-style: solid; padding-bottom: 0; overflow: hidden; }
.lp-stage { position: relative; margin: .4rem -1rem 0; min-height: 210px; }
.lp-fake { position: absolute; inset: 0; padding: .6rem 1rem; opacity: .9; filter: saturate(.9); }
.lp-fake svg { width: 100%; height: 100%; }
.lp-veil { position: relative; z-index: 1; min-height: 210px; display: grid; place-content: center; justify-items: center; gap: .35rem; text-align: center; padding: 1.2rem 1.4rem;
  background: color-mix(in srgb, var(--card, #fff) 76%, transparent); backdrop-filter: blur(1px); }
.lp-key { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #2d2670, #0f766e); box-shadow: 0 6px 16px rgba(45, 38, 112, .3); }
.lp-t { margin: .3rem 0 0; font-weight: 700; max-width: 30em; }
.lp-s { margin: 0 0 .4rem; color: var(--muted); font-size: .88rem; max-width: 30em; }
.g100-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }
.g100-chips .chip { border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; padding: .25rem .7rem; }
.g100-chips .chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.demo-prem { font-size: .65rem; margin-left: .3rem; vertical-align: middle; }
.banner.good { background: color-mix(in srgb, var(--pos, #1f9d6b) 14%, transparent); color: var(--pos, #1f9d6b); border-radius: var(--radius); margin: .6rem 0; text-align: center; }
