:root {
  color-scheme: dark;
  --bg: #0a0e15;
  --surface: #111722;
  --surface-2: #161d2b;
  --surface-3: #1d2638;
  --line: #222b3b;
  --line-strong: #2f3a4f;
  --text: #e8edf5;
  --muted: #98a3b8;
  --faint: #6c7890;
  --accent: #7c9cff;
  --accent-strong: #a3b8ff;
  --up: #ff5d6c;
  --down: #4f8fff;
  --buy: #2fc7a1;
  --risk: #f5a43a;
  --watch: #b394ff;
  --goal: #7c9cff;
  --neutral: #8c97ad;
  --ma50: #ffd166;
  --ma100: #c49bff;
  --ma200: #4fd1c5;
  --radius: 14px;
  --radius-sm: 9px;
  --gap: 16px;
  --font: "Segoe UI Variable Text", "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 15px/1.55 var(--font); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, dl, dd { margin: 0; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
h2 { font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
h3 { font-size: 13px; font-weight: 600; color: var(--muted); }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--muted); }
.sub { color: var(--muted); font-size: 13px; }
.hint { font-size: 12.5px; color: var(--faint); }
.footnote { color: var(--faint); font-size: 12.5px; margin-top: 12px; }

/* Top bar and market strip */
.topbar {
  position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px);
}
.bar { max-width: 1320px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.brand-mark { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), var(--buy)); }
.nav { display: flex; gap: 4px; }
.nav a { padding: 7px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; white-space: nowrap; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface-3); }
.sync { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.market { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.market i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.market.open i { background: var(--buy); box-shadow: 0 0 0 4px color-mix(in srgb, var(--buy) 22%, transparent); }
.sync-time { display: flex; flex-direction: column; align-items: flex-end; font-size: 12px; color: var(--muted); line-height: 1.35; white-space: nowrap; }
#countdown { color: var(--faint); }

.strip { max-width: 1320px; margin: 0 auto; padding: 16px 24px 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.index {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px;
  padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.index-name { font-size: 13px; color: var(--muted); }
.index-price { font-size: 19px; font-weight: 650; letter-spacing: -0.01em; }
.index-change { font-size: 13px; font-weight: 600; }
.index-error { font-size: 12px; color: var(--risk); }
.index .spark { grid-column: 2; grid-row: 1 / span 3; width: 120px; height: 40px; }
.spark-line { fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linejoin: round; }
.spark-base { stroke: var(--line-strong); stroke-dasharray: 3 3; }
.index.up .spark-line { stroke: var(--up); }
.index.down .spark-line { stroke: var(--down); }

.banner {
  width: calc(100% - 48px); max-width: 1272px; margin: 12px auto 0; padding: 10px 16px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--risk) 12%, var(--surface)); color: var(--risk); font-size: 14px;
}

/* Page layout */
.page { max-width: 1320px; margin: 0 auto; padding: 24px 24px 48px; }
section[data-page] { display: flex; flex-direction: column; gap: var(--gap); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head .sub { margin-top: 4px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head .sub { margin-top: 2px; }
.stack { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); }
.grid-main > .stack { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.grid-stock { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--gap); align-items: start; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.grid-income { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
.grid-settings { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }

/* KPI cards */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi {
  display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 18px 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.kpi-main { background: linear-gradient(140deg, #18233a, var(--surface) 70%); border-color: #2a3956; }
.kpi-label { font-size: 13px; color: var(--muted); }
.kpi strong { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; overflow-wrap: anywhere; }
.kpi-sub { font-size: 13px; color: var(--muted); min-height: 1.4em; }

/* Tables */
.table-wrap { overflow-x: auto; position: relative; } /* relative: keeps .sr-only cells (absolute) inside the scroll box */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--faint); padding: 0 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.holdings tbody tr { cursor: pointer; }
.holdings tbody tr:hover td, .holdings tbody tr:focus-visible td { background: var(--surface-2); }
.ticker { display: flex; flex-direction: column; line-height: 1.3; }
.ticker b { font-weight: 650; }
.ticker span { font-size: 12px; color: var(--faint); max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.cell-sub { display: block; font-size: 12px; }
.stale { color: var(--risk); }
.weight { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.weight-track { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.weight-fill { width: var(--w, 0%); height: 100%; border-radius: 3px; background: var(--accent); }
.weight span { width: 44px; text-align: right; font-size: 12.5px; color: var(--muted); }
.table td.empty { color: var(--faint); text-align: center; padding: 28px 0; }

/* Badges, tabs, buttons */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
  color: var(--tone); background: color-mix(in srgb, var(--tone) 15%, transparent);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tone-buy { --tone: var(--buy); }
.tone-risk { --tone: var(--risk); }
.tone-watch { --tone: var(--watch); }
.tone-goal { --tone: var(--goal); }
.tone-neutral { --tone: var(--neutral); }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tab {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600;
}
.tab:hover { color: var(--text); border-color: var(--line-strong); }
.tab[aria-current="page"] { color: var(--bg); background: var(--text); border-color: var(--text); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface-2);
  color: var(--text); font-size: 14px; font-weight: 600; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #0b1530; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { background: transparent; }
.icon-btn { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }

/* Overview side cards */
.stacked { display: flex; gap: 2px; height: 12px; margin-bottom: 14px; border-radius: 6px; overflow: hidden; background: var(--surface-3); }
.stacked span { width: var(--w); background: var(--c); }
.alloc-list, .signal-list { list-style: none; margin: 0; padding: 0; display: grid; }
.alloc-list { gap: 10px; }
.alloc-list li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 2px 10px; }
.alloc-list i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.alloc-list .sub { grid-column: 2 / 4; }
.group-index { --c: var(--accent); }
.group-income { --c: var(--buy); }
.group-leveraged { --c: var(--risk); }
.group-other { --c: var(--neutral); }
.signal-list { gap: 8px; }
.signal-list a {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px;
  border-radius: var(--radius-sm); background: var(--surface-2); text-decoration: none;
}
.signal-list a:hover { background: var(--surface-3); }

/* Stock page */
.quote-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.quote-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.quote-name { color: var(--muted); font-size: 14px; }
.quote-price { display: flex; align-items: baseline; gap: 10px; margin-top: 4px; }
.quote-price strong { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.quote-price span { font-size: 15px; font-weight: 600; }
.chart-controls { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.segmented { display: inline-flex; padding: 3px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); }
.segmented button { border: 0; border-radius: 7px; padding: 5px 11px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; }
.segmented button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); }
.toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.toggle {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 12.5px;
}
.toggle b { color: var(--text); font-weight: 600; }
.toggle i { width: 12px; height: 3px; border-radius: 2px; background: var(--c); }
.toggle[aria-pressed="false"] { opacity: 0.45; }
.ma50 { --c: var(--ma50); }
.ma100 { --c: var(--ma100); }
.ma200 { --c: var(--ma200); }
.chart-box { position: relative; height: 420px; }
.chart-box canvas { display: block; width: 100%; height: 100%; }
.chart-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 12.5px; color: var(--faint); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.facts dt { font-size: 12.5px; color: var(--muted); }
.facts dd { font-size: 16px; font-weight: 650; }
.decision-state { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.decision-state .badge { padding: 5px 12px; font-size: 14px; }
.decision-reason { margin: 10px 0 14px; }
.levels { display: grid; margin-bottom: 16px; }
.levels div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.levels div:last-child { border-bottom: 0; }
.levels dt { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.levels dt i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.levels dd { font-weight: 650; text-align: right; }
.lv-support { --c: var(--buy); }
.lv-entry { --c: var(--accent); }
.lv-stop { --c: var(--risk); }
.lv-target { --c: var(--watch); }
.callout { padding: 12px 14px; border-radius: var(--radius-sm); border-left: 3px solid var(--accent); background: var(--surface-2); font-size: 14px; }
.callout h3 { margin-bottom: 4px; }
.sizing { margin-top: 14px; }
.sizing summary { display: flex; justify-content: space-between; gap: 12px; cursor: pointer; color: var(--muted); font-size: 14px; }
.sizing p { margin-top: 8px; font-size: 14px; }

/* Forms and strategy cards */
.fields { display: grid; gap: 12px; margin-bottom: 16px; }
.fields-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fields-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: 13px; color: var(--muted); }
.field input, .field select, .editor input {
  width: 100%; height: 38px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--bg); color: var(--text); font-size: 14px;
}
.field input::placeholder, .editor input::placeholder { color: var(--faint); }
.field-inline { max-width: 240px; margin-bottom: 14px; }
.results div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.results dt { color: var(--muted); font-size: 14px; }
.results dd { font-weight: 650; text-align: right; }
.verdict { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 14px; }
.verdict:empty { display: none; }
.editor td { padding: 6px; }
.editor input { height: 36px; }
.ticker-input { max-width: 130px; text-transform: uppercase; }
.form-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.spacer { flex: 1; }
.form-error { min-height: 1.2em; margin-top: 8px; color: var(--risk); font-size: 13.5px; }
.body-text { margin-bottom: 14px; color: var(--muted); font-size: 14px; }
#feed-form .field { margin-bottom: 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }

/* Income chart */
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; align-items: end; height: 260px; }
.bar-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; min-width: 0; }
.bar-stack {
  display: flex; flex-direction: column-reverse; width: 100%; max-width: 38px; height: var(--h); min-height: 2px;
  border-radius: 6px 6px 2px 2px; overflow: hidden; background: var(--surface-3);
}
.bar-stack span { height: var(--h); background: var(--c); }
.bar-value { font-size: 11px; color: var(--muted); white-space: nowrap; }
.bar-label { font-size: 12px; color: var(--faint); }

/* Dialog and toast */
.dialog {
  width: min(560px, calc(100% - 32px)); padding: 22px; border: 1px solid var(--line-strong); border-radius: 16px;
  background: var(--surface); color: var(--text);
}
.dialog::backdrop { background: #000a; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.dialog-actions { display: flex; align-items: center; gap: 8px; margin-top: 18px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 20; transform: translateX(-50%); padding: 10px 16px;
  border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface-3);
  box-shadow: 0 10px 30px #0006; font-size: 14px;
}

/* Explore and offset pages */
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.toolbar .field { min-width: 150px; }
.toolbar .field-wide { min-width: 250px; }
.add-form { display: flex; gap: 8px; margin-left: auto; }
.add-form input {
  width: 170px; height: 36px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--bg); color: var(--text); font-size: 14px; text-transform: uppercase;
}
.add-form input::placeholder { color: var(--faint); text-transform: none; }
.explore th { line-height: 1.3; vertical-align: bottom; }
.explore td { font-size: 13.5px; }
.explore tr.is-ref td { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.analyst { font-size: 12.5px; color: var(--muted); white-space: normal; min-width: 150px; }
.pick { min-height: 30px; padding: 0 10px; font-size: 13px; }
.pick[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #0b1530; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.tag-cut {
  display: inline-block; margin-top: 2px; padding: 1px 7px; border-radius: 999px; font-size: 11.5px;
  color: var(--risk); background: color-mix(in srgb, var(--risk) 15%, transparent);
}
.muted-cell { color: var(--faint); }
.fields-5 { grid-template-columns: repeat(3, minmax(0, 1fr)) auto auto; align-items: end; }
.partner-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 4px 10px; border-radius: 999px; background: var(--surface-3); font-size: 13px; font-weight: 600; }
.offset-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--gap); align-items: start; }
.plan-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.plan-head h2 { font-size: 20px; }
.plan-price { text-align: right; font-size: 12.5px; color: var(--muted); }
.plan-price strong { display: block; font-size: 18px; color: var(--text); }
.plan-meta { margin: 8px 0 14px; font-size: 13px; color: var(--muted); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.steps li { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; font-size: 14px; }
.step-label { padding-top: 1px; font-size: 12px; font-weight: 700; color: var(--accent); }
.steps .sub { margin-top: 2px; }
.rare {
  margin-top: 6px; padding: 6px 10px; border-radius: 8px; font-size: 13px;
  color: var(--risk); background: color-mix(in srgb, var(--risk) 12%, transparent);
}
.plan-result { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; }
.callout.warn { border-left-color: var(--risk); }

/* Login and devices */
.login-body { display: grid; place-items: center; padding: 24px 16px; }
.login { width: 100%; max-width: 380px; }
.login-card { display: flex; flex-direction: column; gap: 14px; }
.login-card .brand { font-size: 18px; }
.login-card .btn { width: 100%; justify-content: center; }
.device-list { list-style: none; margin: 0; padding: 0; }
.device-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.device-list li:last-child { border-bottom: 0; }
.device-list .current { color: var(--buy); font-weight: 600; }

/* Responsive */
@media (max-width: 1100px) {
  .grid-main, .grid-stock, .grid-income, .grid-settings { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .bar { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 8px 16px; }
  .nav { order: 3; width: 100%; overflow-x: auto; }
  .sync-time { display: none; }
  .strip { display: grid; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(250px, 82%); overflow-x: auto; padding: 12px 16px 0; }
  .banner { width: calc(100% - 32px); }
  .page { padding: 18px 16px 40px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-main > .stack { grid-template-columns: minmax(0, 1fr); }
  .fields-3, .fields-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .add-form { width: 100%; margin-left: 0; }
  .add-form input { flex: 1; }
}
@media (max-width: 520px) {
  h1 { font-size: 22px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpis-3 { grid-template-columns: minmax(0, 1fr); }
  .kpi { padding: 14px; }
  .kpi strong { font-size: 20px; }
  .kpis-3 .kpi strong { font-size: 24px; }
  .card { padding: 16px; }
  #market-label { display: none; }
  .chart-box { height: 300px; }
  .chart-controls { align-items: flex-start; }
  .fields-2, .fields-3 { grid-template-columns: minmax(0, 1fr); }
  .bars { gap: 4px; }
  .bar-value { display: none; }
}
.session-tag { color: var(--watch); }
#market-short { display: none; }

/* Holdings as one compact card per stock on phones: ticker · price · day change / signal · P&L */
@media (max-width: 520px) {
  #market-short { display: inline; }
  .holdings thead { display: none; }
  .holdings, .holdings tbody { display: block; }
  .holdings tbody tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "ticker price change" "signal pnl pnl";
    align-items: start; column-gap: 12px; row-gap: 6px; padding: 12px 2px; border-bottom: 1px solid var(--line);
  }
  .holdings tbody tr:last-child { border-bottom: 0; }
  .holdings td { padding: 0; border: 0; white-space: normal; }
  .holdings tbody tr:hover td, .holdings tbody tr:focus-visible td { background: none; }
  .holdings tbody tr:focus-visible { background: var(--surface-2); }
  .holdings td:nth-child(1) { grid-area: ticker; min-width: 0; }
  .holdings td:nth-child(2) { grid-area: price; }
  .holdings td:nth-child(3) { grid-area: change; min-width: 56px; }
  .holdings td:nth-child(7) { grid-area: pnl; text-align: right; }
  .holdings td:nth-child(7) .cell-sub { display: inline; margin-left: 6px; }
  .holdings td:nth-child(9) { grid-area: signal; align-self: center; }
  .holdings td:nth-child(4), .holdings td:nth-child(5), .holdings td:nth-child(6), .holdings td:nth-child(8) { display: none; }
  .holdings .ticker span { max-width: 100%; white-space: nowrap; }
}

/* Home-screen app on iPhone: keep clear of the notch / Dynamic Island, rounded corners and home bar. */
.topbar { padding-top: env(safe-area-inset-top); }
.bar { padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
.strip { padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
.page {
  padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right));
  padding-bottom: calc(48px + env(safe-area-inset-bottom));
}
@media (max-width: 900px) {
  .bar, .strip, .page { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .page { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
}
.login-body { padding-top: max(24px, env(safe-area-inset-top)); padding-bottom: max(24px, env(safe-area-inset-bottom)); }
