/* 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: #0f766e;
  --accent-ink: #ffffff;
  --accent-soft: #e0f2ef;
  --pos: #15803d;
  --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: #2dd4bf; --accent-ink: #062b27; --accent-soft: #123532;
    --pos: #4ade80; --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 { font-size: 1.1rem; margin-bottom: 1rem; }
.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; }
.kpi.hero { background: var(--accent); border-color: var(--accent); color: 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: .78rem; 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: .75rem; 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: 11px; }
.chart .bv { font-size: 12px; 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; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; }
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-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; 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(2, 1fr); gap: .4rem .6rem; }
@media (min-width: 560px) { .fcfgrid { grid-template-columns: repeat(5, 1fr); } }
.fcfgrid .mini { font-size: .78rem; 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: .78rem; }

/* ---- 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: .75rem; 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; }
.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: .72rem; 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; }
.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: .75rem; 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: 190px; }
.gauge { width: 190px; max-width: 100%; height: auto; }
.gauge path { 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-num { font-size: 26px; 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: .7rem; 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: .78rem; margin-top: .3rem; opacity: .9; }
.lbl { font-size: .72rem; 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: .68rem; 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: .7rem; 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: .7rem; 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: .68rem; 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: .75rem; opacity: .8; }
.curbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0; }
.curbar .seg { display: inline-flex; 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 { width: 100%; } .curbar .seg button { flex: 1; padding: .55rem .3rem; }
}

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; }
