*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --ink: #f6f5f1; --ink2: #ffffff; --ink3: #f1f0ea; --ink4: #ecebe5;
  --line: #e7e5de; --line2: #d9d7cf; --dim: #b3b1a9; --muted: #8f8d85;
  --sub: #5b5a55; --text: #34332f; --bright: #191918; --accent: #2a78d6;
  --red: #d03b3b; --green: #0a8a3c; --blue: #2a78d6; --purple: #7a4fd0; --teal: #1baf7a;
  --mono: "DM Mono", monospace; --serif: "Manrope", sans-serif; --sans: "Manrope", sans-serif;
  /* v0.9.13 - amber had no token; the freshness 'aging' state and the
     partial-failure toast both need one that is readable on either surface. */
  --amber-ink: #9a6b06; --amber-dot: #d9a520;
  /* v0.9.16 - FIFO lot-consumption strip on the sell estimator. */
  --lot-fill: rgba(217,165,32,.28); --lot-edge: #b98a12;
  --shadow-card: 0 1px 2px rgba(25,25,24,.04), 0 8px 24px -12px rgba(25,25,24,.10);
}

html, body { min-height: 100%; background: var(--ink); color: var(--text); font-family: var(--sans); font-size: 15px; }
body { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
a { color: var(--accent); text-decoration: none; text-underline-offset: 3px; transition: color .15s, text-decoration-color .15s; }
a:hover { color: var(--bright); text-decoration: underline; text-decoration-color: rgba(42,120,214, .65); }
a:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

img, svg { max-width: 100%; }
* { -webkit-tap-highlight-color: transparent; }
.position-item, .list-row, .nav-item, .snapshot-row, .news-row, .btn, .filter-tab, .t-tab { -webkit-tap-highlight-color: rgba(42,120,214,.15); }

.shell { display: grid; grid-template-rows: 52px 1fr; height: 100vh; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 28px; border-bottom: 1px solid var(--line); background: var(--ink); }
.wordmark { font-family: var(--serif); font-size: 19px; color: var(--bright); display: flex; align-items: center; gap: 9px; background: none; border: 0; cursor: pointer; }
.wordmark-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 9px var(--accent); }
.wordmark-logo { width: 30px; height: 30px; object-fit: contain; flex: 0 0 auto; display: block; }
.auth-wordmark .wordmark-logo { width: 36px; height: 36px; }

.mobile-menu-btn { display: none; width: 40px; height: 40px; background: transparent; border: 1px solid var(--line2); border-radius: 4px; cursor: pointer; padding: 0; flex-direction: column; align-items: center; justify-content: center; gap: 4px; flex: 0 0 auto; }
.mobile-menu-btn span { display: block; width: 18px; height: 1.5px; background: var(--text); border-radius: 1px; transition: transform .2s, opacity .2s; }
.mobile-menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.mobile-menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.mobile-menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

.topbar-center { display: flex; align-self: stretch; min-width: 0; }
.t-tab { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); background: none; border: none; padding: 0 16px; height: 52px; cursor: pointer; transition: color .18s; }
.t-tab:hover, .cell-link:hover, .wordmark:hover { color: var(--sub); }
.t-tab.active { color: var(--bright); }
.topbar-right { display: flex; align-items: center; gap: 12px; position: relative; }
.t-clock, .t-status { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .06em; white-space: nowrap; }
.t-status { display: flex; align-items: center; gap: 6px; }
.t-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.icon-btn { width: 30px; height: 30px; display: inline-grid; place-items: center; border: 1px solid var(--line2); border-radius: 3px; background: transparent; color: var(--muted); font-family: var(--mono); font-size: 10px; cursor: pointer; }
.icon-btn:hover { border-color: var(--dim); color: var(--accent); }
.file-btn input { display: none; }

.auth-overlay { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; background: rgba(25,25,24,.45); }
.auth-overlay[hidden] { display: none; }
.auth-panel { width: min(460px, 100%); border: 1px solid var(--line2); background: var(--ink2); border-radius: 4px; padding: 28px; box-shadow: 0 24px 70px -20px rgba(25,25,24,.25); }
.auth-wordmark { margin-bottom: 24px; cursor: default; }
.auth-panel h1 { font-family: var(--serif); font-size: 31px; line-height: 1.12; font-weight: 400; color: var(--bright); }
.auth-copy { color: var(--sub); line-height: 1.6; margin: 12px 0 22px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 13px; font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.auth-providers { display: flex; flex-direction: column; gap: 10px; }
.auth-providers[hidden], .auth-provider[hidden] { display: none; }   /* display above would otherwise beat the hidden attribute */
.auth-provider { width: 100%; justify-content: center; }
.auth-legal { margin: 14px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--muted); }
.auth-legal a { color: inherit; text-decoration: underline; }
.auth-providers #emailLinkForm { margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--line2); }
.auth-providers #emailLinkForm .modal-actions { justify-content: flex-start; }

.scroll { height: 100%; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
.view { display: none; min-height: calc(100vh - 52px); }
.view.active { display: block; }

.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 34px 36px 24px; border-bottom: 1px solid var(--line); }
.hero-eyebrow { font-family: var(--mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.hero-date, .section-title { font-family: var(--serif); font-size: 38px; font-weight: 400; color: var(--bright); line-height: 1.08; }
.hero-greeting { margin-top: 8px; color: var(--sub); max-width: 760px; line-height: 1.55; }
.hero-actions, .toolbar-row, .modal-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hero-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.metric { background: var(--ink); padding: 20px 24px; }
.metric-label, .sec-label, .cell-title, .modal label, .provider-box label { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.metric-value { font-family: var(--serif); font-size: 30px; color: var(--bright); margin-top: 6px; }
.metric-sub { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 5px; }
.up, .green { color: var(--green) !important; }
.dn, .red { color: var(--red) !important; }
.accent { color: var(--accent) !important; }

.overview-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: minmax(280px, auto);
  gap: 1px;
  background: var(--line);
  grid-template-areas:
    "portfolio portfolio movers movers allocation allocation"
    "heatmap heatmap heatmap heatmap heatmap heatmap"
    "today today news news history history";
}
.cell-portfolio  { grid-area: portfolio; }
.cell-movers     { grid-area: movers; }
.cell-allocation { grid-area: allocation; }
.cell-heatmap    { grid-area: heatmap; min-height: 300px; }
.cell-today      { grid-area: today; }
.cell-news       { grid-area: news; }
.cell-history    { grid-area: history; }
.cell, .detail-section { min-height: 330px; background: var(--ink); padding: 22px 24px; overflow: hidden; }
.cell-head, .panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.cell-title { color: var(--accent); display: flex; align-items: center; gap: 8px; }
.cell-title::before { content: ""; width: 3px; height: 13px; background: var(--accent); border-radius: 1px; }
.cell-link { font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: .08em; background: none; border: none; cursor: pointer; text-transform: uppercase; }

.split-layout { display: grid; min-height: calc(100vh - 52px); grid-template-columns: 340px 1fr; }
.three-col { grid-template-columns: 230px 1fr 330px; }
.tasks-layout { grid-template-columns: 1fr 330px; }
.portfolio-layout { grid-template-columns: 410px 1fr; }
.intel-layout { grid-template-columns: 260px 1fr; }
.history-layout { grid-template-columns: 330px 1fr; }
.profile-layout { grid-template-columns: 1fr 360px; }

.panel { border-right: 1px solid var(--line); background: var(--ink); min-width: 0; }
.compact-panel { min-height: calc(100vh - 52px); }
.panel-head { padding: 15px 20px 14px; border-bottom: 1px solid var(--line); margin-bottom: 0; }
.sec-badge { font-family: var(--mono); font-size: 10px; color: var(--dim); background: var(--ink3); border: 1px solid var(--line2); padding: 3px 8px; border-radius: 2px; }
.summary-card, .panel-stats { padding: 22px 20px; border-bottom: 1px solid var(--line); }
.summary-value { font-family: var(--serif); font-size: 34px; line-height: 1; color: var(--bright); }
.summary-row { display: flex; gap: 16px; margin-top: 14px; flex-wrap: wrap; }
.summary-stat { min-width: 86px; }
.summary-stat strong { display: block; font-family: var(--mono); font-size: 12px; font-weight: 400; }
.summary-stat span { display: block; margin-top: 4px; font-family: var(--mono); font-size: 9px; color: var(--dim); text-transform: uppercase; letter-spacing: .1em; }

.position-list, .list-scroll, .news-feed, .workspace-body { overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
.position-item, .list-row, .news-row, .activity-row, .lot-row, .snapshot-row, .nav-item { border-bottom: 1px solid var(--line); cursor: pointer; transition: background .15s, border-color .15s; }
.position-item { padding: 14px 20px; }
.position-item:hover, .position-item.active, .list-row:hover, .list-row.selected, .nav-item:hover, .nav-item.active, .snapshot-row:hover, .snapshot-row.active { background: var(--ink3); }
.position-item.active, .list-row.selected, .nav-item.active, .snapshot-row.active { border-left: 2px solid var(--accent); }
.row-top, .row-meta, .asset-title-row, .db-row, .lot-row, .activity-row, .snapshot-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.asset-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.ticker { font-family: var(--mono); font-size: 14px; color: var(--bright); font-weight: 500; }
.muted, .asset-name, .small { color: var(--muted); font-size: 12px; }
.pnl-row { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(25,25,24,.05); }
.mono { font-family: var(--mono); font-size: 12px; }
.alloc-track { height: 3px; background: var(--line2); overflow: hidden; border-radius: 2px; margin-top: 8px; }
.alloc-fill { height: 100%; border-radius: 2px; }

.workspace { display: flex; flex-direction: column; min-width: 0; min-height: calc(100vh - 52px); }
.workspace-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 26px 32px 22px; border-bottom: 1px solid var(--line); }
.asset-title { font-family: var(--serif); font-size: 34px; color: var(--bright); line-height: 1; }
.price-block { text-align: right; }
.price-block .summary-value { font-size: 31px; }

.kmetrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: 18px; }
.km { background: var(--ink2); padding: 13px 14px; }
.km-val { font-family: var(--mono); font-size: 13px; color: var(--text); }
.km-lbl { font-family: var(--mono); font-size: 9px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; margin-top: 5px; }

.chart-panel { border-bottom: 1px solid var(--line); min-height: 330px; }
.chart-toolbar, .list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 32px 0; }
.chart-control-group { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.range-tabs { display: flex; gap: 2px; }
.range-tab, .filter-tab { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: var(--muted); background: none; border: 0; padding: 6px 11px; cursor: pointer; border-radius: 2px; }
.range-tab.active, .filter-tab.active { color: var(--accent); background: rgba(42,120,214, .07); }
.chart-style-tabs { margin-left: auto; }
.chart-legend { display: flex; gap: 16px; font-family: var(--mono); font-size: 10px; color: var(--muted); align-items: center; flex-wrap: wrap; }
.dot { width: 6px; height: 6px; display: inline-block; border-radius: 50%; margin-right: 5px; }
.dot.green { background: var(--green); }
.dot.accent { background: var(--accent); }
.chart-stat { font-family: var(--mono); font-size: 10px; color: var(--text); letter-spacing: .06em; margin-left: 12px; padding-left: 12px; border-left: 1px solid var(--line2); }
.chart-stat.up { color: var(--green); }
.chart-stat.dn { color: var(--red); }
.chart-empty { font-family: var(--mono); font-size: 11px; fill: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.line-chart { width: calc(100% - 64px); min-height: 250px; margin: 12px 32px 18px; }
.chart-canvas { position: relative; width: calc(100% - 64px); height: 320px; margin: 14px 32px 18px; border: 1px solid var(--line); border-radius: 4px; background: linear-gradient(180deg, rgba(42,120,214,.02) 0%, rgba(255,255,255,0) 60%); overflow: hidden; }
.chart-canvas canvas { display: block; }
.chart-canvas .tv-lightweight-charts { border-radius: 4px; }
.chart-empty-msg { margin: 0 32px 18px; padding: 40px 16px; text-align: center; color: var(--muted); font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; border: 1px dashed var(--line2); border-radius: 4px; }

.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.detail-section { min-height: 270px; }
.lot-row, .activity-row { padding: 10px 0; font-family: var(--mono); font-size: 11px; }
.portfolio-health { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.health-card { background: var(--ink3); border: 1px solid var(--line2); border-radius: 3px; padding: 10px; }
.health-card strong { display: block; font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--bright); }
.health-card span { display: block; margin-top: 4px; font-family: var(--mono); font-size: 9px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.alloc-stack { display: flex; gap: 1px; height: 5px; border-radius: 3px; overflow: hidden; background: var(--line2); margin: 16px 0 10px; }
.alloc-piece { height: 100%; }
.connection-row { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 10px; }
.connection-row:last-child { border-bottom: none; }
.connection-row span:first-child { color: var(--sub); }
.connection-row span:last-child { color: var(--muted); text-align: right; }

.profile-form { padding: 28px 32px; max-width: 820px; }
.profile-form > label { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.profile-side { border-right: 0; border-left: 1px solid var(--line); }
.profile-account { padding: 8px 20px 22px; }
.profile-stat { padding: 14px 0; border-bottom: 1px solid var(--line); }
.profile-stat span { display: block; font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }
.profile-stat strong { display: block; margin-top: 6px; color: var(--text); font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }

.activity-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; text-align: right; }
.danger-link { color: var(--red); }
.nav-list { padding: 8px 0; }
.nav-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 18px; }
.nav-name { color: var(--sub); font-size: 13px; }
.nav-count { font-family: var(--mono); font-size: 10px; color: var(--dim); }

.list-toolbar { justify-content: flex-start; padding: 0; border-bottom: 1px solid var(--line); }
.list-toolbar .filter-tab { height: 44px; padding: 0 18px; border-radius: 0; border-bottom: 2px solid transparent; }
.list-toolbar .filter-tab.active { border-bottom-color: var(--accent); background: transparent; color: var(--bright); }
.list-toolbar .btn { margin-left: auto; margin-right: 18px; }

.list-row { display: flex; align-items: flex-start; gap: 12px; padding: 14px 20px; }
.check { width: 17px; height: 17px; border: 1px solid var(--line2); border-radius: 3px; flex: 0 0 auto; margin-top: 1px; }
.check.done { background: var(--green); border-color: var(--green); }
.check.done::after { content: ""; display: block; width: 8px; height: 4px; border-left: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(-45deg) translate(-1px, 4px); margin: auto; }

.tag { font-family: var(--mono); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; border-radius: 2px; padding: 2px 7px; border: 1px solid var(--line2); color: var(--sub); }
.tag.finance, .tag.etf, .tag.stock { color: var(--blue); background: rgba(42,120,214, .08); border-color: rgba(42,120,214, .22); }
.tag.crypto, .tag.health { color: var(--green); background: rgba(10,138,60, .08); border-color: rgba(10,138,60, .22); }
.tag.committed { color: var(--green); }
.tag.research { color: var(--accent); }
.tag.raw { color: var(--muted); }
.tag.business, .tag.tech { color: var(--purple); background: rgba(122,79,208, .08); border-color: rgba(122,79,208, .22); }

.detail-card { padding: 20px; }
.detail-card h2 { font-family: var(--serif); font-size: 22px; font-weight: 400; color: var(--bright); line-height: 1.25; margin-bottom: 12px; }
.detail-card p { color: var(--sub); line-height: 1.7; margin: 12px 0; }
.db-row { border-bottom: 1px solid var(--line); padding: 7px 0; font-family: var(--mono); font-size: 11px; }

.news-feed { padding: 0 0 24px; }
.news-row { display: grid; grid-template-columns: 44px 1fr auto; gap: 16px; padding: 18px 32px; }
.news-num { font-family: var(--mono); color: var(--dim); font-size: 11px; }
.news-title { color: var(--text); font-size: 16px; line-height: 1.45; }
.news-title a { color: var(--text); display: inline; }
.news-title a::after { content: " OPEN"; font-family: var(--mono); font-size: 9px; letter-spacing: .12em; color: var(--accent); margin-left: 8px; white-space: nowrap; }
.news-title a:hover { color: var(--bright); }
.news-meta { font-family: var(--mono); font-size: 10px; color: var(--muted); margin-top: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.news-source { display: inline-flex; align-items: center; gap: 5px; padding: 2px 7px; border-radius: 2px; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--line2); color: var(--sub); }
.news-source.theblock { color: #c2491a; border-color: rgba(194,73,26,.3); background: rgba(194,73,26,.06); }
.news-source.coindesk { color: #a5640a; border-color: rgba(165,100,10,.3); background: rgba(165,100,10,.06); }
.news-source.cointelegraph { color: #8a6d00; border-color: rgba(138,109,0,.3); background: rgba(138,109,0,.06); }
.news-source.yahoo { color: #7a4fa0; border-color: rgba(122,79,160,.3); background: rgba(122,79,160,.06); }
.news-source.alphavantage { color: var(--blue); border-color: rgba(42,120,214,.3); background: rgba(42,120,214,.06); }

.news-toolbar.list-toolbar { padding-left: 16px; }
.news-toolbar.list-toolbar .filter-tab { height: 40px; padding: 0 14px; }

.sentiment-pill { display: inline-block; padding: 2px 7px; border-radius: 999px; font-family: var(--mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; border: 1px solid var(--line2); }
.sentiment-pill.bullish, .sentiment-pill.somewhat-bullish { color: var(--green); border-color: rgba(10,138,60,.35); background: rgba(10,138,60,.08); }
.sentiment-pill.bearish, .sentiment-pill.somewhat-bearish { color: var(--red); border-color: rgba(208,59,59,.35); background: rgba(208,59,59,.08); }
.sentiment-pill.neutral { color: var(--muted); }

.provider-box { display: grid; grid-template-columns: 1fr auto; gap: 6px 8px; min-width: min(420px, 45vw); }
.provider-box label { grid-column: 1 / -1; }

.btn { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; padding: 8px 14px; border-radius: 2px; cursor: pointer; transition: all .15s; border: 1px solid; text-transform: uppercase; }
.btn-primary { color: var(--ink); background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: #000000; }
.btn-ghost { color: var(--muted); background: transparent; border-color: var(--line2); }
.btn-ghost:hover { color: var(--sub); border-color: var(--dim); }
.btn-danger { color: var(--red); border-color: rgba(208,59,59, .28); background: transparent; }
.full { width: 100%; justify-content: center; }

input, textarea, select { width: 100%; background: var(--ink3); border: 1px solid var(--line2); border-radius: 2px; color: var(--text); padding: 9px 10px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 78px; }

.modal-overlay { position: fixed; inset: 0; background: rgba(25,25,24,.45); z-index: 50; display: none; align-items: center; justify-content: center; padding: 24px; }
.modal-overlay.open { display: flex; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 48px); overflow: auto; background: var(--ink2); border: 1px solid var(--line2); border-radius: 4px; padding: 24px; box-shadow: 0 22px 70px -18px rgba(25,25,24,.25); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.modal-title { font-family: var(--serif); font-size: 24px; font-weight: 400; color: var(--bright); }
.modal-close { background: none; border: 0; color: var(--muted); font-size: 22px; cursor: pointer; }
.modal label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.form-grid .wide { grid-column: 1 / -1; }
.field-with-action { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: stretch; }
.field-with-action .btn { height: 100%; min-width: 92px; }
.modal-note { font-size: 12px; color: var(--muted); line-height: 1.5; border: 1px solid var(--line2); padding: 10px; margin: 4px 0 14px; }

.empty { padding: 22px 0; color: var(--muted); font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.snapshot-row { padding: 14px 18px; align-items: flex-start; }
.report { padding: 30px 34px; }
.report h1 { font-family: var(--serif); font-size: 34px; font-weight: 400; color: var(--bright); margin-bottom: 20px; }
.report-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); margin-bottom: 28px; }
.report-section { border-top: 1px solid var(--line); padding: 20px 0; }
.report-section h2 { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; color: var(--accent); text-transform: uppercase; margin-bottom: 12px; }

/* TABLET (≤1120px) */
@media (max-width: 1120px) {
  body { overflow: auto; }
  .shell { height: auto; min-height: 100vh; }
  .topbar { position: sticky; top: 0; z-index: 40; height: auto; padding: 12px 18px; padding-top: max(12px, env(safe-area-inset-top)); }
  .topbar-center { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
  .topbar-center::-webkit-scrollbar { display: none; }
  .t-tab { height: 38px; flex: 0 0 auto; padding: 0 12px; }
  .scroll { height: auto; overflow: visible; }
  .hero, .workspace-head { flex-direction: column; align-items: stretch; padding: 28px 20px 22px; }
  .hero-summary, .overview-grid, .detail-grid, .report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-grid { grid-template-areas: none; }
  .cell-portfolio, .cell-movers, .cell-allocation, .cell-heatmap, .cell-today, .cell-news, .cell-history { grid-area: auto; }
  .split-layout, .three-col, .tasks-layout, .portfolio-layout, .intel-layout, .history-layout, .profile-layout { grid-template-columns: 1fr; }
  .panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .profile-side { border-left: 0; }
  .workspace, .compact-panel { min-height: auto; }
  .workspace-body, .position-list, .list-scroll, .news-feed { overflow: visible; }
  .position-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portfolio-layout .position-list { border-top: 1px solid var(--line); }
  .chart-toolbar { align-items: flex-start; padding: 12px 20px 0; flex-wrap: wrap; }
  .chart-control-group { align-items: flex-start; gap: 10px; flex-wrap: wrap; }
  .chart-style-tabs { margin-left: 0; }
  .range-tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .range-tabs::-webkit-scrollbar { display: none; }
  .kmetrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .asset-actions { align-items: flex-start; }
  .price-block { text-align: left; }
  .news-row { grid-template-columns: 34px 1fr; }
  .news-row .tag { grid-column: 2; width: max-content; }
  .provider-box { min-width: 0; width: 100%; }
  .profile-form { padding: 24px 20px; max-width: none; }
  .chart-canvas { width: calc(100% - 40px); margin: 14px 20px 18px; height: 280px; }
  .chart-empty-msg { margin: 0 20px 18px; }
}

/* MOBILE (≤780px) — slide-out nav */
@media (max-width: 780px) {
  html, body { font-size: 14px; }
  body { -webkit-text-size-adjust: 100%; }
  .t-clock { display: none; }
  .topbar { gap: 8px; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); flex-wrap: nowrap; }
  .wordmark { font-size: 18px; flex: 1 1 auto; min-width: 0; }
  .wordmark-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .wordmark-logo { width: 28px; height: 28px; }
  .mobile-menu-btn { display: flex; }

  .topbar-center {
    position: fixed; top: 0; left: 0; right: 0; width: 100%;
    flex-direction: column; background: var(--ink2); border-bottom: 1px solid var(--line2);
    box-shadow: 0 12px 28px -10px rgba(25,25,24,.18);
    padding: max(60px, calc(env(safe-area-inset-top) + 56px)) 16px 16px;
    transform: translateY(-100%); transition: transform .25s ease;
    z-index: 35; overflow-y: auto; max-height: 100vh; align-items: stretch;
  }
  .topbar-center.open { transform: translateY(0); }
  .topbar-center::-webkit-scrollbar { display: none; }
  .topbar-center .t-tab { height: 48px; padding: 0 16px; text-align: left; justify-content: flex-start; border-bottom: 1px solid var(--line); border-radius: 0; width: 100%; font-size: 13px; }
  .topbar-center .t-tab.active { border-bottom-color: var(--accent); color: var(--accent); background: rgba(42,120,214,.04); }

  .topbar-right { gap: 6px; flex-shrink: 0; flex-wrap: nowrap; }
  .topbar-right .icon-btn { width: 36px; height: 36px; min-width: 36px; }
  .topbar-right .t-status { display: none; }

  .hero { padding: 22px 16px 18px; }
  .hero-date, .section-title { font-size: 28px; }
  .hero-greeting { font-size: 13px; }
  .hero-summary, .overview-grid, .detail-grid, .report-grid, .form-grid, .kmetrics { grid-template-columns: 1fr; }
  .cell, .detail-section { min-height: auto; padding: 18px 16px; }
  .metric { padding: 16px 18px; }
  .metric-value { font-size: 26px; }
  .summary-card, .panel-stats { padding: 18px 16px; }
  .panel-head { padding: 13px 16px; }
  .position-list { display: block; }
  .position-item, .list-row, .snapshot-row { padding: 14px 16px; min-height: 56px; }
  .position-item:hover, .list-row:hover { background: var(--ink2); }
  .row-top, .row-meta, .db-row, .lot-row, .activity-row, .snapshot-row { align-items: flex-start; }
  .row-meta { flex-wrap: wrap; gap: 6px; }
  .asset-title { font-size: 28px; }
  .asset-title-row { align-items: flex-start; }
  .asset-actions .toolbar-row, .hero-actions, .modal-actions, .toolbar-row { align-items: stretch; }
  .asset-actions .btn, .hero-actions .btn, .toolbar-row .btn, .modal-actions .btn { flex: 1 1 auto; min-height: 44px; }
  .chart-toolbar { flex-direction: column; padding: 12px 16px 0; gap: 10px; }
  .chart-control-group { width: 100%; flex-direction: column; align-items: stretch; gap: 8px; }
  .chart-style-tabs { margin-left: 0; }
  .chart-legend { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .chart-stat { margin-left: 0; padding-left: 0; border-left: 0; }
  .chart-canvas { width: calc(100% - 24px); height: 240px; margin: 12px 12px 16px; }
  .chart-empty-msg { margin: 0 12px 16px; padding: 28px 12px; }
  .line-chart { width: calc(100% - 24px); margin: 12px 12px 16px; }
  .btn { min-height: 40px; padding: 10px 14px; }
  .btn-primary, .btn-ghost, .btn-danger { min-height: 44px; }
  input, textarea, select { font-size: 16px; padding: 11px 12px; min-height: 44px; }
  textarea { min-height: 88px; }
  .provider-box { min-width: 0; grid-template-columns: 1fr; padding-top: 8px; }
  .news-toolbar.list-toolbar { padding-left: 4px; padding-right: 4px; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .news-toolbar.list-toolbar::-webkit-scrollbar { display: none; }
  .news-toolbar.list-toolbar .filter-tab { flex: 0 0 auto; padding: 0 14px; height: 42px; }
  .news-row { grid-template-columns: 1fr; gap: 8px; padding: 16px 14px; }
  .news-row .tag { grid-column: 1; }
  .news-num { order: -1; font-size: 10px; }
  .news-title { font-size: 15px; line-height: 1.4; }
  .news-title a::after { display: none; }
  .profile-form { padding: 20px 16px; max-width: none; }
  .profile-account { padding: 4px 16px 20px; }

  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal { width: 100%; max-width: none; max-height: 92vh; border-radius: 14px 14px 0 0; padding: 20px 16px; padding-bottom: max(20px, env(safe-area-inset-bottom)); animation: modal-slide-up .22s ease-out; }
  @keyframes modal-slide-up { from { transform: translateY(20px); opacity: .85; } to { transform: translateY(0); opacity: 1; } }
  .modal-head { margin-bottom: 14px; }
  .modal-title { font-size: 22px; }
  .modal-close { width: 36px; height: 36px; }
  .field-with-action { grid-template-columns: 1fr; }
  .field-with-action .btn { min-height: 44px; }

  .auth-overlay { padding: 16px; padding-top: max(16px, env(safe-area-inset-top)); }
  .auth-panel { padding: 24px 18px; }
  .auth-panel h1 { font-size: 26px; }
}

/* SMALL PHONES (≤380px) */
@media (max-width: 380px) {
  .topbar { padding-left: 10px; padding-right: 10px; }
  .wordmark { font-size: 16px; }
  .wordmark-logo { width: 24px; height: 24px; }
  .topbar-right .icon-btn { width: 34px; height: 34px; min-width: 34px; font-size: 9px; }
  .hero-date, .section-title { font-size: 24px; }
  .modal-title { font-size: 19px; }
  .chart-canvas { height: 220px; }
}

/* LANDSCAPE phone fixes */
@media (max-width: 920px) and (orientation: landscape) and (max-height: 500px) {
  .hero { padding: 16px 16px 12px; }
  .hero-date { font-size: 24px; }
  .chart-canvas { height: 200px; }
  .modal { max-height: 96vh; }
}

/* Touch device hover overrides */
@media (hover: none) {
  .position-item:hover, .list-row:hover, .nav-item:hover, .snapshot-row:hover { background: transparent; }
  .position-item.active, .list-row.selected, .nav-item.active, .snapshot-row.active { background: var(--ink3); }
  .btn:hover { transform: none; }
}

@supports (padding: env(safe-area-inset-bottom)) {
  .modal-overlay { padding-bottom: env(safe-area-inset-bottom); }
}

/* Sync conflict banner */
.conflict-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: linear-gradient(180deg, rgba(208,59,59,.18), rgba(208,59,59,.05));
  border-bottom: 1px solid rgba(208,59,59,.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: max(10px, env(safe-area-inset-top)) 20px 10px;
  animation: conflict-slide-down .25s ease-out;
}
@keyframes conflict-slide-down { from { transform: translateY(-100%); } to { transform: translateY(0); } }
.conflict-banner-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1280px; margin: 0 auto; flex-wrap: wrap; }
.conflict-banner-text { font-size: 13px; color: var(--text); line-height: 1.4; }
.conflict-banner-text strong { color: var(--red); margin-right: 6px; }
.conflict-banner-actions { display: flex; gap: 8px; flex-shrink: 0; }
.conflict-banner-actions .btn { min-height: 36px; padding: 6px 14px; }

@media (max-width: 780px) {
  .conflict-banner { padding: max(10px, env(safe-area-inset-top)) 14px 10px; }
  .conflict-banner-inner { flex-direction: column; align-items: stretch; }
  .conflict-banner-actions { justify-content: stretch; }
  .conflict-banner-actions .btn { flex: 1; }
}

/* Price alerts */
.alert-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 88;
  background: linear-gradient(180deg, rgba(42,120,214,.18), rgba(42,120,214,.03));
  border-bottom: 1px solid rgba(42,120,214,.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: max(10px, env(safe-area-inset-top)) 20px 10px;
  animation: conflict-slide-down .25s ease-out;
}
.alert-banner-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1280px; margin: 0 auto; flex-wrap: wrap; }
.alert-banner-text { font-size: 13px; color: var(--text); line-height: 1.4; }
.alert-banner-text strong { color: var(--accent); margin-right: 6px; }
.alert-banner-actions { display: flex; gap: 8px; flex-shrink: 0; }
.alert-banner-actions .btn { min-height: 36px; padding: 6px 14px; }

.alert-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  align-items: flex-start;
}
.alert-row.triggered { background: rgba(42,120,214,.04); }
.alert-row.paused { opacity: .55; }
.alert-symbol { font-family: var(--mono); color: var(--bright); font-size: 14px; font-weight: 500; letter-spacing: .04em; }
.alert-condition { font-family: var(--mono); font-size: 12px; color: var(--sub); margin-top: 4px; }
.alert-meta { font-family: var(--mono); font-size: 10px; color: var(--muted); margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; }
.alert-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start; }
.alert-actions .btn { padding: 4px 10px; font-size: 10px; min-height: 30px; }

.alert-status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  border: 1px solid var(--line2);
}
.alert-status-pill.active { color: var(--green); border-color: rgba(10,138,60,.4); background: rgba(10,138,60,.08); }
.alert-status-pill.triggered { color: var(--accent); border-color: rgba(42,120,214,.4); background: rgba(42,120,214,.08); }
.alert-status-pill.paused { color: var(--muted); }
.alert-status-pill.dismissed { color: var(--dim); }

.checkbox-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--sub);
  text-transform: none;
  letter-spacing: 0;
}
.checkbox-row input[type="checkbox"] {
  width: auto !important;
  min-height: 0 !important;
  margin: 0;
}

@media (max-width: 780px) {
  .alert-banner { padding: max(10px, env(safe-area-inset-top)) 14px 10px; }
  .alert-banner-inner { flex-direction: column; align-items: stretch; }
  .alert-banner-actions { justify-content: stretch; }
  .alert-banner-actions .btn { flex: 1; }
  .alert-row { grid-template-columns: 1fr; padding: 14px 16px; }
}

/* Push notifications panel */
.push-status { padding-top: 12px; border-top: 1px solid var(--line); margin-top: 14px; }
.push-status-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 11px; }
.push-status-row .mono { font-size: 11px; }


/* User chip + dropdown */
.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 36px;
  padding: 0 8px 0 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  transition: color .15s;
}
.user-chip:hover .user-chip-name { color: var(--bright); }
.user-chip[aria-expanded="true"] .user-chip-name { color: var(--accent); }
.user-chip-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #d4b487);
  color: var(--ink);
  display: inline-grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
}
.user-chip-name {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
  letter-spacing: .04em;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-chip-anon .user-chip-avatar { background: var(--ink3); color: var(--muted); }
.user-chip-anon .user-chip-name { color: var(--muted); }

.user-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: var(--ink2);
  border: 1px solid var(--line2);
  border-radius: 6px;
  box-shadow: 0 18px 44px -14px rgba(25,25,24,.20);
  padding: 6px;
  z-index: 60;
}
.user-menu[hidden] { display: none; }
.user-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  padding: 9px 12px;
  border-radius: 4px;
  cursor: pointer;
}
.user-menu-item:hover { background: var(--ink3); color: var(--bright); }
.user-menu-divider { height: 1px; background: var(--line); margin: 4px 0; }
.user-menu-danger { color: var(--red); }
.user-menu-danger:hover { background: rgba(208,59,59, .08); color: var(--red); }

@media (max-width: 780px) {
  .user-chip-name { display: none; }
  .user-chip { padding: 0 4px; gap: 0; }
  .user-menu { right: 12px; top: 56px; }
}

/* Priority tags (replacing category tags) */
.tag.priority-high { color: var(--accent); border-color: rgba(42,120,214, .35); background: rgba(42,120,214, .08); }
.tag.priority-medium { color: var(--sub); }
.tag.priority-low { color: var(--muted); }

/* Footer */
.app-footer {
  text-align: center;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .2em;
  color: var(--dim);
  text-transform: uppercase;
  padding: 18px 16px max(18px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
@media (max-width: 1120px) {
  .app-footer { padding: 14px 12px max(14px, env(safe-area-inset-bottom)); }
}


/* Icon-only buttons (refresh, etc.) */
.btn.icon-only {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  min-height: 0;
  border-radius: 4px;
}
.btn.icon-only svg { display: block; }
.btn-ghost.icon-only:hover { color: var(--accent); border-color: var(--dim); }
@media (max-width: 780px) {
  .btn.icon-only { width: 40px; height: 40px; flex: 0 0 auto !important; }
}


/* Overview Movers cell — compact horizontal bars */
.movers-grid { display: flex; flex-direction: column; gap: 8px; }
.mover-bar-row {
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  cursor: pointer;
  transition: background .12s;
  border-radius: 3px;
}
.mover-bar-row:hover { background: var(--ink2); }
.mover-ticker {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--bright);
  letter-spacing: .03em;
}
/* Divergent track — center line, fills grow outward to either side */
.mover-track {
  position: relative;
  height: 6px;
  background: var(--line2);
  border-radius: 999px;
}
.mover-track::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -2px;
  bottom: -2px;
  width: 1px;
  background: var(--dim);
}
.mover-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  transition: width .35s ease;
}
.mover-fill.up {
  left: 50%;
  background: linear-gradient(90deg, rgba(10,138,60,.45), var(--green));
}
.mover-fill.dn {
  right: 50%;
  background: linear-gradient(90deg, var(--red), rgba(208,59,59,.45));
}
.mover-pct {
  font-size: 11px;
  text-align: right;
}


/* Beta invitations panel */
.invite-form { padding: 4px 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.invite-form .form-grid { gap: 12px; }
.invitations-list { display: flex; flex-direction: column; }
.invitation-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.invitation-row:last-child { border-bottom: 0; }
.invitation-email {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--bright);
  letter-spacing: .02em;
}
.invitation-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
  font-size: 11px;
}
.invitation-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  border: 1px solid var(--line2);
}
.invitation-pill.pending { color: var(--accent); border-color: rgba(42,120,214,.35); background: rgba(42,120,214,.08); }
.invitation-pill.accepted { color: var(--green); border-color: rgba(10,138,60,.35); background: rgba(10,138,60,.08); }
.invitation-pill.expired { color: var(--muted); }
.invitation-pill.revoked { color: var(--red); border-color: rgba(208,59,59,.35); background: rgba(208,59,59,.08); }
.invitation-actions { display: flex; gap: 6px; flex-shrink: 0; }
.invitation-actions .btn { padding: 4px 10px; font-size: 10px; min-height: 30px; }
@media (max-width: 780px) {
  .invitation-row { flex-direction: column; align-items: flex-start; }
  .invitation-actions { width: 100%; justify-content: flex-end; }
}


/* Metric sparkline */
.metric { position: relative; }
.metric-spark {
  display: block;
  width: 100%;
  height: 22px;
  margin: 6px 0 4px;
  pointer-events: none;
}

/* Allocation cell layout */
.allocation-layout {
  display: flex;
  gap: 18px;
  align-items: center;
  min-height: 140px;
}
.allocation-donut-wrap {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.donut-svg { display: block; }
.donut-center {
  font-family: var(--mono);
  font-size: 13px;
  fill: var(--bright);
  font-weight: 500;
}
.donut-center-sub {
  font-family: var(--mono);
  font-size: 9px;
  fill: var(--muted);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.allocation-legend {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  min-width: 0;
}
.allocation-legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.allocation-swatch {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  flex-shrink: 0;
}
.allocation-label { color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.allocation-pct { color: var(--sub); font-size: 11px; }
.allocation-class-line {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: .04em;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--line);
}
.allocation-class-line strong {
  color: var(--accent);
  font-weight: 400;
  margin-right: 4px;
}

@media (max-width: 780px) {
  .allocation-layout { flex-direction: column; gap: 14px; }
  .allocation-legend { width: 100%; }
}


/* Overview performance chart */
.overview-perf {
  background: var(--ink);
  border-bottom: 1px solid var(--line);
  padding: 16px 24px 18px;
  position: relative;
}
.overview-perf-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 16px;
  flex-wrap: wrap;
}
.overview-perf-head .sec-label { display: inline-block; }
.overview-perf-summary {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text);
  letter-spacing: .04em;
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid var(--line2);
}
.overview-perf-summary.up { color: var(--green); }
.overview-perf-summary.dn { color: var(--red); }
.overview-perf-canvas {
  position: relative;
  width: 100%;
  height: 280px;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(42,120,214,.02) 0%, rgba(255,255,255,0) 60%);
  margin-bottom: 12px;
}
.overview-perf-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  border: 1px dashed var(--line2);
  border-radius: 4px;
}
@media (max-width: 780px) {
  .overview-perf { padding: 14px 16px 18px; }
  .overview-perf-canvas { height: 260px; margin-bottom: 14px; }
  .overview-perf-summary { margin-left: 0; padding-left: 0; border-left: 0; display: block; margin-top: 4px; }
}


/* Overview heatmap */
.heatmap-canvas {
  position: relative;
  width: 100%;
  height: 240px;
  background: var(--ink2);
  border-radius: 4px;
  overflow: hidden;
}
.heatmap-tile {
  position: absolute;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px 8px;
  cursor: pointer;
  border-radius: 2px;
  border: 1px solid rgba(25,25,24,.08);
  overflow: hidden;
  transition: transform .15s, border-color .15s;
}
.heatmap-tile:hover { border-color: rgba(25,25,24,.55); transform: scale(1.01); z-index: 2; }
.heatmap-tile .heatmap-ticker {
  font-family: var(--mono);
  font-weight: 500;
  color: var(--bright);
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.heatmap-tile .heatmap-pct {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text);
  opacity: 0.85;
  white-space: nowrap;
}
.heatmap-tile.size-sm { padding: 4px 6px; }
.heatmap-tile.size-sm .heatmap-ticker { font-size: 11px; }
.heatmap-tile.size-sm .heatmap-pct { font-size: 9px; }
.heatmap-tile.size-md .heatmap-ticker { font-size: 13px; }
.heatmap-tile.size-md .heatmap-pct { font-size: 11px; }
.heatmap-tile.size-lg .heatmap-ticker { font-size: 16px; }
.heatmap-tile.size-lg .heatmap-pct { font-size: 12px; }
.heatmap-caption {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: .04em;
  margin-top: 10px;
  text-align: right;
}
.heatmap-legend-swatch {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: -1px;
}
.heatmap-legend-swatch.up { background: rgba(10,138,60,0.7); }
.heatmap-legend-swatch.dn { background: rgba(208,59,59,0.7); }
.heatmap-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

@media (max-width: 780px) {
  .heatmap-canvas { height: 200px; }
}


/* Benchmark toggles on the performance chart */
.overview-perf-controls {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}
.benchmark-tabs .range-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.benchmark-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  opacity: 0.55;
  transition: opacity .15s;
}
.benchmark-tabs .range-tab.active .benchmark-dot { opacity: 1; }
.overview-perf-summary-row {
  display: flex;
  gap: 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .04em;
  flex-wrap: wrap;
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid var(--line2);
}
.perf-stat { color: var(--muted); }
.perf-stat strong { color: var(--text); font-weight: 400; }
.perf-stat.up strong { color: var(--green); }
.perf-stat.dn strong { color: var(--red); }
@media (max-width: 780px) {
  .overview-perf-controls { width: 100%; gap: 10px; }
  .overview-perf-summary-row { margin-left: 0; padding-left: 0; border-left: 0; }
  /* Range tabs are 5 buttons - give them their own row below benchmarks + export. */
  .overview-perf-controls .benchmark-tabs { order: 1; }
  .overview-perf-controls .overview-perf-export { order: 2; margin-left: auto; }
  .overview-perf-controls .range-tabs:not(.benchmark-tabs) {
    order: 3;
    flex-basis: 100%;
    max-width: 100%;
    justify-content: flex-start;
  }
}


/* Sparkline hover tooltip */
.metric { cursor: default; }
.metric-spark { cursor: crosshair; }
.spark-tooltip {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  background: rgba(17,17,20,.96);
  border: 1px solid var(--line2);
  border-radius: 4px;
  padding: 6px 9px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--bright);
  line-height: 1.4;
  white-space: nowrap;
  transform: translate(-50%, -110%);
  opacity: 0;
  transition: opacity .12s;
  box-shadow: 0 6px 16px rgba(25,25,24,.18);
}
.spark-tooltip.visible { opacity: 1; }
.spark-tooltip .spark-tooltip-date { color: var(--muted); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 2px; }
.spark-tooltip .spark-tooltip-value { color: var(--bright); font-size: 11px; }
.spark-hover-marker {
  fill: var(--accent);
  stroke: var(--ink);
  stroke-width: 1;
}

/* Donut transitions */
.donut-svg circle { transition: stroke-dasharray .55s cubic-bezier(.4,.0,.2,1), stroke-dashoffset .55s cubic-bezier(.4,.0,.2,1); }

/* Performance chart export button */
.overview-perf-export { color: var(--muted); }
.overview-perf-export:hover { color: var(--accent); border-color: var(--dim); }

/* Heatmap mobile fallback — when canvas is narrow, prefer a vertical list of horizontal bars */
@media (max-width: 780px) {
  .heatmap-canvas.heatmap-list { height: auto; padding: 8px; display: flex; flex-direction: column; gap: 4px; background: transparent; }
  .heatmap-canvas.heatmap-list .heatmap-tile {
    position: relative;
    left: 0; top: 0;
    width: 100% !important;
    height: 32px !important;
    display: grid;
    grid-template-columns: 60px 1fr 60px;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    background: transparent !important;
    border: 0;
  }
  .heatmap-canvas.heatmap-list .heatmap-tile:hover { transform: none; }
  .heatmap-canvas.heatmap-list .heatmap-tile .heatmap-bar-track {
    position: relative;
    height: 6px;
    background: var(--line2);
    border-radius: 999px;
    overflow: hidden;
  }
  .heatmap-canvas.heatmap-list .heatmap-tile .heatmap-bar-fill {
    position: absolute;
    top: 0; bottom: 0; left: 0;
    border-radius: 999px;
  }
}

/* Portfolio tab — value-first section header. The big mono number replaces
   the implicit "Portfolio" title; eyebrow above carries the section identity,
   sub-line below shows day + total P&L in one scan. Lives at the top of
   #portfolioView, above the split-layout. */
.portfolio-head { padding: 18px 24px 16px; border-bottom: 1px solid var(--line); }
.portfolio-head .hero-eyebrow { margin: 0 0 6px; }
.portfolio-head-value { font-family: var(--mono); font-size: 36px; font-weight: 500; letter-spacing: -0.01em; color: var(--bright); line-height: 1.05; margin: 0 0 8px; }
.portfolio-head-sub { font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; color: var(--sub); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.portfolio-head-sub .sep { color: var(--dim); }
@media (max-width: 780px) {
  .portfolio-head { padding: 14px 16px 12px; }
  .portfolio-head-value { font-size: 30px; }
  .portfolio-head-sub { font-size: 10.5px; }
}

/* =========================================================================
 * News redesign (v0.4 mockup) — hero card, trending strip, coverage map,
 * sentiment color bars, save/read state, mark-all-read footer.
 * ========================================================================= */
.news-hero { padding: 0 18px; }
.news-hero-card {
  background: var(--ink2);
  border: 0.5px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 14px 16px 12px;
  margin: 6px 0 14px;
  cursor: pointer;
  transition: background 0.15s;
}
.news-hero-card:hover { background: var(--ink3); }
.news-hero-card.pos { border-left-color: var(--green); }
.news-hero-card.neg { border-left-color: var(--red); }
.news-hero-card.read { opacity: 0.6; }
.news-hero-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.news-hero-card.pos .news-hero-tag { color: var(--green); }
.news-hero-card.neg .news-hero-tag { color: var(--red); }
.news-hero-headline {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  color: var(--bright);
  line-height: 1.3;
  margin: 0 0 10px;
  letter-spacing: -0.005em;
}
.news-hero-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.news-hero-foot .sep { color: var(--dim); }
.news-hero-foot .grow { flex: 1; }

.news-trending {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 0 18px;
  margin: 0 0 12px;
}
.news-trending .trend-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 4px;
}
.news-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  background: var(--ink3);
  color: var(--sub);
  border: 0.5px solid transparent;
  cursor: pointer;
  user-select: none;
  transition: all 0.12s;
}
.news-pill:hover { color: var(--bright); background: var(--ink4); }
.news-pill.active {
  background: rgba(42,120,214, 0.14);
  color: var(--accent);
  border-color: rgba(42,120,214, 0.3);
}
.news-pill-dot { width: 5px; height: 5px; border-radius: 50%; }
.news-pill-ct { font-size: 10px; color: var(--dim); margin-left: 2px; }
.news-pill.active .news-pill-ct { color: var(--accent); }

.coverage-map { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; }
.coverage-row {
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  border: 0.5px solid transparent;
  transition: all 0.12s;
}
.coverage-row:hover { background: var(--ink3); border-color: var(--line); }
.coverage-row.active {
  background: rgba(42,120,214, 0.08);
  border-color: rgba(42,120,214, 0.22);
}
.coverage-top { display: flex; justify-content: space-between; align-items: baseline; }
.coverage-sym {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--bright);
  letter-spacing: 0.04em;
}
.coverage-chg { font-family: var(--mono); font-size: 10.5px; }
.coverage-mid {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
  letter-spacing: 0.04em;
}
.coverage-bar {
  display: flex;
  height: 3px;
  margin-top: 5px;
  border-radius: 1px;
  overflow: hidden;
  background: var(--ink);
}
.coverage-bar > span { display: block; height: 100%; }
.coverage-bar .pos { background: var(--green); }
.coverage-bar .neu { background: var(--muted); }
.coverage-bar .neg { background: var(--red); }

.filter-tab .filter-ct {
  margin-left: 5px;
  color: var(--dim);
  font-size: 10px;
}
.filter-tab.active .filter-ct { color: var(--accent); }

.news-feed { display: flex; flex-direction: column; }
.news-item {
  display: grid;
  grid-template-columns: 3px 1fr;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 0.5px solid var(--line);
  cursor: pointer;
  transition: opacity 0.15s, background 0.12s;
}
.news-item:hover { background: var(--ink2); }
.news-item.read { opacity: 0.5; }
.news-sent-bar { width: 3px; align-self: stretch; border-radius: 1px; margin-top: 2px; }
.news-sent-bar.pos { background: var(--green); }
.news-sent-bar.neu { background: var(--muted); }
.news-sent-bar.neg { background: var(--red); }
.news-content { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.news-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.news-tk {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--accent);
}
.news-tk.mkt { color: var(--muted); }
.news-meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
  flex: 1;
  min-width: 0;
}
.news-meta .sep { color: var(--dim); margin: 0 6px; }
.news-sent-label.pos { color: var(--green); }
.news-sent-label.neg { color: var(--red); }
.news-sent-label.neu { color: var(--muted); }
.news-actions { display: inline-flex; gap: 2px; margin-left: auto; }
.news-act {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 3px;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
}
.news-act:hover { color: var(--accent); background: var(--ink3); }
.news-act.saved { color: var(--accent); }
.news-headline {
  font-size: 13.5px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.4;
  margin: 0;
}

.news-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-top: 0.5px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.news-footer button {
  background: transparent;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  color: var(--accent);
  cursor: pointer;
}
.news-footer button:hover { color: var(--bright); }
.news-foot-num { color: var(--text); }

@media (max-width: 780px) {
  .news-hero { padding: 0 12px; }
  .news-hero-card { padding: 12px 14px; margin: 4px 0 12px; }
  .news-hero-headline { font-size: 16px; }
  .news-trending { padding: 0 12px 4px; overflow-x: auto; flex-wrap: nowrap; }
  .news-trending::-webkit-scrollbar { height: 4px; }
  .news-trending::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 2px; }
  .news-item { padding: 10px 12px; }
  .news-footer { padding: 10px 12px; }
}

/* =========================================================================
 * Shared section redesign (Tasks / Alerts / History / Overview)
 * Hero card + sub-line + item color bars + footer.
 * Same visual idioms as the News redesign so the system reads as one app.
 * ========================================================================= */
.section-sub { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 0.04em; margin: 6px 0 0; }
.section-hero { padding: 0 18px; }
.section-hero-card {
  background: var(--ink2);
  border: 0.5px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 14px 16px 12px;
  margin: 6px 0 14px;
  cursor: pointer;
  transition: background 0.15s;
}
.section-hero-card:hover { background: var(--ink3); }
.section-hero-card.up, .section-hero-card.pos { border-left-color: var(--green); }
.section-hero-card.dn, .section-hero-card.neg { border-left-color: var(--red); }
.section-hero-card.warn { border-left-color: #b97f0a; }
.section-hero-card.neu { border-left-color: var(--accent); }
.section-hero-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.section-hero-card.up .section-hero-tag, .section-hero-card.pos .section-hero-tag { color: var(--green); }
.section-hero-card.dn .section-hero-tag, .section-hero-card.neg .section-hero-tag { color: var(--red); }
.section-hero-card.warn .section-hero-tag { color: #b97f0a; }
.section-hero-headline {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  color: var(--bright);
  line-height: 1.3;
  margin: 0 0 6px;
  letter-spacing: -0.005em;
}
.section-hero-headline-mono { font-family: var(--mono); letter-spacing: 0.005em; }
.section-hero-lede {
  font-size: 12.5px;
  color: var(--sub);
  margin: 0 0 8px;
  line-height: 1.5;
}
.section-hero-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
  flex-wrap: wrap;
}
.section-hero-foot .sep { color: var(--dim); }
.section-hero-foot .grow { flex: 1; }

/* Item bar (priority / status / P&L direction stripe on the left of list rows) */
.item-bar-row { position: relative; padding-left: 14px !important; }
.item-bar {
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 1px;
}
.item-bar.bar-hi { background: var(--red); }
.item-bar.bar-md { background: #b97f0a; }
.item-bar.bar-lo { background: var(--muted); }
.item-bar.bar-up, .item-bar.bar-pos { background: var(--green); }
.item-bar.bar-dn, .item-bar.bar-neg { background: var(--red); }
.item-bar.bar-neu { background: var(--muted); }

/* Compact row inner layout (used by Alerts + History rows) */
.item-content { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.item-top { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.item-tk {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--accent);
  min-width: 38px;
}
.item-name { font-size: 12.5px; color: var(--text); flex: 1; min-width: 0; }
.item-price { font-family: var(--mono); font-size: 12px; color: var(--bright); font-weight: 500; }
.item-sub {
  display: flex;
  gap: 6px;
  align-items: center;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
  flex-wrap: wrap;
}
.item-sub .sep { color: var(--dim); margin: 0; }
.item-title { font-size: 13px; color: var(--text); line-height: 1.4; }

/* Task row — checkbox sits between the bar and the content. */
.task-row { display: grid !important; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; }
.task-row.done .item-title { text-decoration: line-through; color: var(--dim); }
.task-row.done { opacity: 0.7; }

/* Section footer — running counts + one action, same idiom as news-footer. */
.section-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-top: 0.5px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.section-footer button {
  background: transparent; border: none; padding: 0;
  font-family: inherit; font-size: inherit; letter-spacing: inherit;
  color: var(--accent); cursor: pointer;
}
.section-footer button:hover { color: var(--bright); }

/* History — section-level header above the split-layout */
.history-head { padding: 18px 24px 8px; border-bottom: 1px solid var(--line); }
.history-head .hero-eyebrow { margin: 0; }
.history-head .section-title { margin: 4px 0 0; }

@media (max-width: 780px) {
  .section-hero { padding: 0 12px; }
  .section-hero-card { padding: 12px 14px; margin: 4px 0 12px; }
  .section-hero-headline { font-size: 16px; }
  .section-footer { padding: 10px 12px; }
  .history-head { padding: 14px 16px 8px; }
}

/* =========================================================================
 * Mobile layout order fix (v0.4.6)
 * News + Alerts share .intel-layout, whose DOM order is sidebar-then-workspace.
 * On desktop that's correct (left rail). On mobile the grid collapses to one
 * column in source order, which stacked the coverage map / alert filters ABOVE
 * the page title + hero — contradicting the mobile mockups, where the hero
 * leads. Reorder so the workspace comes first; the secondary sidebar follows.
 * Also render the coverage map as the compact horizontal-scroll strip the
 * mockup showed, instead of a tall vertical list at the bottom.
 * ========================================================================= */
/* Inline coverage strip is hidden on desktop (the left sidebar shows it there). */
.coverage-inline { display: none; }

@media (max-width: 780px) {
  /* News + Alerts (.intel-layout): lead with the workspace, not the sidebar. */
  .intel-layout > .workspace { order: -1; }
  /* News: surface coverage inline (right after the trending pills) instead of
     the desktop sidebar, so it sits near the top rather than below the feed.
     Hide the sidebar's coverage list + its header; the Refresh Intel button
     stays in the sidebar (which now collapses below the feed). */
  #intelView .compact-panel .coverage-map,
  #intelView .compact-panel .panel-head { display: none; }
  .coverage-inline { display: flex; }
  /* Compact horizontal-scroll card strip (applies to the inline coverage). */
  .intel-layout .coverage-map {
    flex-direction: row;
    overflow-x: auto;
    gap: 8px;
    padding: 10px 12px 12px;
    margin: 0 -2px;
    -webkit-overflow-scrolling: touch;
  }
  .intel-layout .coverage-map::-webkit-scrollbar { height: 4px; }
  .intel-layout .coverage-map::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 2px; }
  .intel-layout .coverage-row { flex: 0 0 auto; min-width: 152px; }
}

/* =========================================================================
 * Home view (v0.5.0) — replaces Overview as the primary dashboard.
 * Big mono portfolio value leads, performance chart below, holdings rail on
 * the right (stacks below on mobile), spotlight card, and a 3-panel below-fold
 * strip for today's tasks / latest news / alerts. Removes the redundant
 * Movers / Allocation / Heatmap cards — the holdings rail covers allocation
 * visually, and the spotlight surfaces the biggest mover explicitly.
 * ========================================================================= */
.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; }

.home-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 24px 32px 6px; }
.home-head .hero-eyebrow { margin: 0 0 6px; }
.home-head .hero-greeting { font-size: 13px; color: var(--sub); margin: 0; max-width: 560px; }

.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; padding: 14px 32px 18px; align-items: start; }
.home-main { min-width: 0; }
.home-value {
  font-family: var(--mono);
  font-size: 42px;
  font-weight: 500;
  color: var(--bright);
  letter-spacing: -0.01em;
  line-height: 1.05;
  margin: 0 0 8px;
}
.home-day { display: flex; align-items: baseline; gap: 8px; font-family: var(--mono); font-size: 14px; margin: 0 0 4px; }
.home-day .arr { font-size: 11px; }
.home-day .sub { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 0.04em; margin-left: auto; }
.home-total { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 0.04em; margin: 2px 0 20px; }
.home-spotlight { padding: 0; margin: 16px 0 0; }
.home-perf { padding: 0; }
.home-perf .overview-perf-head { padding: 0 0 10px; }
.home-perf .overview-perf-canvas { width: 100%; margin: 8px 0 0; }
.home-perf .overview-perf-empty { margin: 0; }

.home-rail { background: var(--ink2); border: 1px solid var(--line); border-radius: 4px; padding: 0; align-self: start; }
.home-rail .rail-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 14px 16px 10px; border-bottom: 1px solid var(--line);
}
.home-rail .rail-head .sec-label { color: var(--sub); }
.rail-count { font-family: var(--mono); font-size: 10px; color: var(--dim); letter-spacing: 0.04em; }
.rail-list { display: flex; flex-direction: column; }
.rail-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 60px auto; gap: 10px;
  align-items: center; padding: 11px 16px;
  border-bottom: 0.5px solid rgba(25,25,24,.06);
  cursor: pointer; transition: background 0.12s;
}
.rail-row:last-child { border-bottom: none; }
.rail-row:hover { background: rgba(25,25,24,.03); }
.rail-row-left { min-width: 0; }
.rail-tk { font-family: var(--serif); font-size: 15px; font-weight: 500; color: var(--bright); letter-spacing: -0.005em; line-height: 1.15; }
.rail-sub { font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: 0.04em; margin-top: 2px; }
.rail-spark { display: block; height: 22px; width: 60px; }
.rail-right { text-align: right; font-family: var(--mono); }
.rail-val { font-size: 12.5px; color: var(--bright); font-weight: 500; line-height: 1.15; }
.rail-pct { font-size: 10.5px; margin-top: 2px; }
.rail-add {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 12px 16px 14px; padding: 10px;
  border: 0.5px dashed rgba(42,120,214,0.3); border-radius: 3px;
  color: var(--accent); font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  cursor: pointer; background: transparent;
}
.rail-add:hover { background: rgba(42,120,214,0.04); }

.home-below { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; padding: 8px 32px 32px; }
.below-panel { background: var(--ink2); border: 1px solid var(--line); border-radius: 4px; padding: 14px 16px; min-height: 140px; }
.below-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.below-row {
  display: grid; grid-template-columns: 3px minmax(0, 1fr) auto; gap: 10px;
  padding: 8px 0; border-bottom: 0.5px solid rgba(25,25,24,.06);
  align-items: start; cursor: pointer;
}
.below-row:last-child { border-bottom: none; }
.below-bar { width: 3px; align-self: stretch; border-radius: 1px; min-height: 18px; }
.below-bar.bar-hi { background: var(--red); }
.below-bar.bar-md { background: #b97f0a; }
.below-bar.bar-lo { background: var(--muted); }
.below-bar.bar-pos { background: var(--green); }
.below-bar.bar-neg { background: var(--red); }
.below-bar.bar-neu { background: var(--muted); }
.below-title { font-size: 12.5px; color: var(--text); line-height: 1.4; }
.below-meta { font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: 0.04em; margin-top: 3px; }
.below-tag { font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; color: var(--muted); white-space: nowrap; }

@media (max-width: 1120px) {
  .home-below { grid-template-columns: 1fr 1fr; }
  .home-below .below-panel:last-child { grid-column: 1 / -1; }
}

@media (max-width: 980px) {
  .home-grid { grid-template-columns: 1fr; }
  .home-rail { margin-top: 8px; }
}

@media (max-width: 780px) {
  .home-head { padding: 18px 16px 4px; }
  .home-grid { padding: 8px 16px 16px; gap: 16px; }
  .home-value { font-size: 34px; }
  .home-below { grid-template-columns: 1fr; padding: 8px 16px 18px; }
  .home-below .below-panel:last-child { grid-column: auto; }
}

/* =========================================================================
 * Position page (v0.5.1) — replaces the old portfolioView split-pane layout.
 * Reached by tapping a holding on Home. Single-column flow: header (Back +
 * eyebrow + name + big price + day change) -> chart -> 6-cell stats grid ->
 * Lots / Tax / Activity detail sections side-by-side -> Edit/Add trade
 * actions. The Portfolio tab is removed from the top nav; this view is now
 * purely a drilldown destination from Home.
 * ========================================================================= */
.position-header { padding: 22px 32px 14px; border-bottom: 1px solid var(--line); }
.position-back {
  background: transparent; border: 0; color: var(--accent); padding: 0;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em;
  cursor: pointer; margin-bottom: 12px;
}
.position-back:hover { color: var(--bright); }
.position-eyebrow { margin: 0 0 6px; }
.position-title-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.position-title-block { min-width: 0; }
.position-title {
  font-family: var(--serif); font-size: 32px; font-weight: 500;
  color: var(--bright); letter-spacing: -0.01em; line-height: 1.1; margin: 0;
}
.position-name { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 0.04em; margin: 4px 0 0; }
.position-price-block { text-align: right; }
.position-price { font-family: var(--mono); font-size: 32px; font-weight: 500; color: var(--bright); letter-spacing: -0.005em; line-height: 1; }
.position-day { font-family: var(--mono); font-size: 13px; margin-top: 6px; }
.position-day .arr { font-size: 11px; margin-right: 2px; }

.position-body { padding: 16px 32px 24px; }
.position-chart { padding: 0; }

.pos-stats-grid {
  display: grid; grid-template-columns: repeat(6, 1fr);
  margin: 18px 0 16px;
  border: 1px solid var(--line); border-radius: 4px;
}
.pos-stat-cell {
  padding: 12px 14px;
  border-right: 0.5px solid rgba(25,25,24,.06);
}
.pos-stat-cell:last-child { border-right: none; }
.pos-stat-lab { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.12em; color: var(--dim); text-transform: uppercase; }
.pos-stat-val { font-family: var(--mono); font-size: 14px; color: var(--bright); font-weight: 500; margin-top: 4px; }

.position-detail-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px;
  margin-top: 16px;
}

.position-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--line);
}
.position-actions .btn { min-width: 140px; }

@media (max-width: 1120px) {
  .pos-stats-grid { grid-template-columns: repeat(3, 1fr); }
  .pos-stat-cell:nth-child(3) { border-right: none; }
  .pos-stat-cell:nth-child(-n+3) { border-bottom: 0.5px solid rgba(25,25,24,.06); }
  .position-detail-grid { grid-template-columns: 1fr 1fr; }
  .position-detail-grid .detail-section:last-child { grid-column: 1 / -1; }
}

@media (max-width: 780px) {
  .position-header { padding: 18px 16px 14px; }
  .position-title-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .position-title { font-size: 26px; }
  .position-price-block { text-align: left; }
  .position-price { font-size: 28px; }
  .position-body { padding: 12px 16px 18px; }
  .pos-stats-grid { grid-template-columns: 1fr 1fr; }
  .pos-stat-cell:nth-child(2n) { border-right: none; }
  .pos-stat-cell { border-bottom: 0.5px solid rgba(25,25,24,.06); }
  .pos-stat-cell:nth-last-child(-n+2) { border-bottom: none; }
  .position-detail-grid { grid-template-columns: 1fr; }
  .position-detail-grid .detail-section:last-child { grid-column: auto; }
  .position-actions { flex-direction: column; }
  .position-actions .btn { width: 100%; }
}

/* =========================================================================
 * More tab (v0.5.2) — consolidates History, Profile, Invitations, push
 * notifications, export, app info, and sign-out into a single secondary
 * destination so the four primary tabs (Home/Tasks/News/Alerts) stay focused.
 * Each row routes to an existing view or fires an existing handler.
 * ========================================================================= */
.more-head { padding: 26px 32px 14px; border-bottom: 1px solid var(--line); }
.more-head .hero-eyebrow { margin: 0 0 6px; }
.more-head .section-title { margin: 4px 0 6px; }
.more-head .section-sub { margin: 0; max-width: 560px; }

.more-list { padding: 18px 32px 36px; max-width: 720px; }

.more-item {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  padding: 14px 4px;
  background: transparent;
  border: 0;
  border-bottom: 0.5px solid var(--line);
  cursor: pointer;
  font: inherit; color: inherit;
  text-align: left;
  transition: background 0.12s;
}
.more-item:hover { background: rgba(25,25,24,.025); }
.more-item:last-child { border-bottom: none; }
.mi-left { display: flex; align-items: center; gap: 14px; }
.mi-icon {
  width: 36px; height: 36px; border-radius: 6px;
  background: var(--ink3); border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--sub);
  flex-shrink: 0;
}
.mi-icon-danger { color: var(--red); }
.mi-text { display: flex; flex-direction: column; }
.mi-name { font-family: var(--serif); font-size: 15px; color: var(--bright); line-height: 1.25; letter-spacing: -0.005em; }
.mi-name-danger { color: var(--red); }
.mi-sub { font-family: var(--mono); font-size: 10.5px; color: var(--muted); letter-spacing: 0.04em; margin-top: 2px; }
.mi-right { color: var(--dim); flex-shrink: 0; }

@media (max-width: 780px) {
  .more-head { padding: 18px 16px 12px; }
  .more-list { padding: 14px 16px 24px; }
}

/* =========================================================================
 * Bottom-tab nav (v0.5.3) — primary mobile navigation.
 * Visible only at <=780px. The top topbar-center drawer is hidden on mobile
 * (replaced by these thumb-reachable tabs). Home/Tasks/News/Alerts/More.
 * ========================================================================= */
.bottom-tabs {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  /* the bar is 60px of icons and labels PLUS the home-indicator strip. It was a flat 62px with the strip taken out of that, so on an
     iPhone opened from the home screen (about 34px of strip) only 22px was left and the icons were squeezed out, leaving bare labels. */
  height: calc(60px + env(safe-area-inset-bottom, 0px));
  padding: 0 4px env(safe-area-inset-bottom, 0px) 4px;   /* the tabs fill the 60px above the strip, so they sit centred in it */
  background: var(--ink);
  border-top: 1px solid var(--line2);
  z-index: 30;
}
.bt-tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  background: transparent; border: 0;
  color: var(--dim);
  cursor: pointer;
  padding: 4px 0;
  transition: color .12s;
}
/* never let the bar squeeze the icon or the label away: in a tall strip WebKit (iPhone) shrinks a flex child to nothing, which left bare labels */
.bt-tab svg { display: block; flex: none; width: 20px; height: 20px; }
.bt-tab span { flex: none; }
.bt-tab span {
  font-family: var(--mono); font-size: 9px;
  letter-spacing: .08em; text-transform: uppercase;
}
.bt-tab.active { color: var(--accent); }
.bt-tab:hover { color: var(--sub); }

@media (max-width: 780px) {
  .bottom-tabs { display: flex; }
  /* Hide the old slide-down drawer + hamburger on mobile — bottom tabs replace them. */
  .mobile-menu-btn { display: none !important; }
  .topbar-center { display: none !important; }
  /* Leave room at the bottom so content does not hide behind the tab bar. */
  main.scroll { padding-bottom: calc(62px + max(0px, env(safe-area-inset-bottom))); }
}

/* =========================================================================
 * Daylight Bento re-skin (v0.6.0) — Concept 2 design system.
 * Layered on top of the original rules: light surfaces, Manrope/DM Mono,
 * rounded cards with soft shadows, pill controls, blue accent.
 * ========================================================================= */

body { font-weight: 500; }
strong, b { font-weight: 700; }

/* Topbar — floating pill nav */
.shell { grid-template-rows: auto 1fr; }
.topbar { height: auto; padding: 10px 28px; background: color-mix(in srgb, var(--ink) 88%, transparent); backdrop-filter: blur(12px); }
.wordmark { font-weight: 800; font-size: 17px; letter-spacing: -0.01em; }
.wordmark-dot { box-shadow: none; }
.topbar-center { align-items: center; align-self: center; gap: 2px; background: var(--ink4); border-radius: 999px; padding: 4px; }
.t-tab { font-family: var(--sans); font-size: 13px; font-weight: 700; letter-spacing: 0; text-transform: none; height: auto; padding: 7px 16px; border-radius: 999px; }
.t-tab.active { background: var(--ink2); color: var(--bright); box-shadow: 0 1px 2px rgba(25,25,24,.06), 0 4px 12px -6px rgba(25,25,24,.14); }
.user-chip { border-radius: 999px; }

/* Typography — Manrope displays */
.hero-date, .section-title, .metric-value, .summary-value, .asset-title, .auth-panel h1,
.modal-title, .detail-card h2, .report h1, .position-title { font-weight: 800; letter-spacing: -0.02em; }
.home-value { font-family: var(--sans); font-weight: 800; letter-spacing: -0.025em; font-size: 46px; }
.rail-tk, .mi-name { font-family: var(--sans); font-weight: 800; }
.cell-title { color: var(--sub); }
.hero-eyebrow { letter-spacing: .16em; }

/* Buttons & inputs */
.btn { font-family: var(--sans); font-size: 13px; font-weight: 800; letter-spacing: 0; text-transform: none; border-radius: 999px; padding: 9px 17px; }
.btn-primary { color: #fff; background: var(--bright); border-color: var(--bright); }
.btn-primary:hover { background: #000; border-color: #000; }
.btn-ghost { background: var(--ink2); box-shadow: var(--shadow-card); }
.icon-btn { border-radius: 10px; }
input, textarea, select { border-radius: 12px; background: #fdfdfb; }
.check { border-radius: 6px; }
.check.done::after { border-left-color: #fff; border-bottom-color: #fff; }

/* Pills for range/filter tabs */
.range-tabs { background: var(--ink3); border-radius: 999px; padding: 3px; gap: 0; }
.range-tab { border-radius: 999px; padding: 5px 11px; }
.range-tab.active { background: var(--bright); color: #fff; }
.filter-tab { border-radius: 999px; }
.list-toolbar { padding: 8px 18px; gap: 6px; }
.list-toolbar .filter-tab { height: 34px; padding: 0 15px; border-radius: 999px; border-bottom: 0; }
.list-toolbar .filter-tab.active { background: var(--bright); color: #fff; border-bottom: 0; }
.filter-tab.active { color: #fff; background: var(--bright); }

/* Chips, tags, badges */
.tag, .sec-badge, .news-source, .rail-count { border-radius: 999px; }
.mi-icon, .health-card { border-radius: 12px; }

/* Card-ification of grid cells */
.overview-grid, .hero-summary, .detail-grid, .report-grid, .kmetrics { gap: 14px; background: transparent; border: 0; }
.overview-grid { padding: 18px 28px 8px; }
.hero-summary { padding: 16px 28px 4px; border-bottom: 0; }
.cell, .detail-section, .metric, .km {
  background: var(--ink2); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-card);
}
.metric { padding: 18px 20px; }
.detail-section { padding: 20px 22px; }
.pos-stats-grid { border-radius: 16px; background: var(--ink2); box-shadow: var(--shadow-card); overflow: hidden; }
.home-rail, .below-panel { border-radius: 18px; box-shadow: var(--shadow-card); background: var(--ink2); }
.rail-add { border-radius: 12px; }
.chart-canvas { border-radius: 16px; background: var(--ink2); }
.chart-canvas .tv-lightweight-charts { border-radius: 16px; }
.chart-empty-msg { border-radius: 14px; }
.modal { border-radius: 20px; }
.modal-overlay { backdrop-filter: blur(3px); }
.modal-note { border-radius: 12px; }
.auth-panel { border-radius: 22px; box-shadow: 0 24px 70px -20px rgba(25,25,24,.25); }
.auth-overlay { backdrop-filter: blur(4px); }
.summary-card { border-bottom-color: var(--line); }
.panel { background: transparent; }
.bottom-tabs { background: color-mix(in srgb, var(--ink2) 92%, transparent); backdrop-filter: blur(12px); }
.bt-tab.active { color: var(--accent); }
.heatmap-tile { border-radius: 6px; }
.section-hero, .news-hero { border-radius: 16px; }

/* Overview perf chart — live pulsing dot (Concept 3 carry-over) */
.overview-perf-canvas { position: relative; }
.live-dot { position: absolute; width: 0; height: 0; z-index: 3; pointer-events: none; }
.live-dot-core { position: absolute; left: -4.5px; top: -4.5px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid var(--ink2); box-sizing: content-box; }
.live-dot-pulse { position: absolute; left: -4.5px; top: -4.5px; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--accent); animation: livePulse 1.8s ease-out infinite; }
@keyframes livePulse { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(3.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .live-dot-pulse { animation: none; opacity: 0; } }

/* ===== v0.6.1 feature layer: insight card, streak, alert meters, history insights, dividends ===== */

/* Home insight card (allocation drift) */
.home-insight { padding: 0; margin: 14px 0 0; }
.insight-card { background: linear-gradient(150deg, #fdf6e8, #fbefdc); border: 1px solid #f0dfc0; border-radius: 16px; padding: 16px 18px; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.insight-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-card); }
.insight-tag { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #9a7a33; }
.insight-msg { font-size: 13.5px; font-weight: 600; color: var(--bright); line-height: 1.55; margin-top: 8px; }
.insight-msg b { color: #8a5b00; }
.insight-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.insight-foot .grow { flex: 1; }

/* Snapshot streak chip */
.streak-chip { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 10px; color: var(--accent); background: rgba(42,120,214,.08); border-radius: 999px; padding: 2px 9px; letter-spacing: .04em; }

/* Alert distance-to-trigger meter */
.alert-meter { display: flex; align-items: center; gap: 12px; margin-top: 9px; max-width: 480px; }
.alert-meter-track { flex: 1; height: 7px; border-radius: 999px; background: var(--ink3); overflow: hidden; }
.alert-meter-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #9ec5f4, var(--accent)); transition: width .4s cubic-bezier(.2,.8,.2,1); }
.alert-meter.hot .alert-meter-fill { background: linear-gradient(90deg, #f3cf8e, #b97f0a); }
.alert-meter.past .alert-meter-fill { background: var(--red); }
.alert-meter-note { font-family: var(--mono); font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.alert-meter.hot .alert-meter-note b { color: #b97f0a; }

/* Holdings rail: est. dividend income */
.rail-income { display: flex; justify-content: space-between; align-items: baseline; padding: 11px 16px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); font-weight: 600; }
.rail-income b { font-family: var(--mono); font-weight: 500; color: var(--green); font-size: 12px; }

/* History insights strip: heatmap + monthly recap */
.history-insights { display: grid; grid-template-columns: 1.5fr 1fr; gap: 14px; padding: 4px 32px 16px; }
.insight-panel { background: var(--ink2); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-card); padding: 16px 18px; }
.heatmap-hint { font-family: var(--mono); font-size: 10px; color: var(--dim); }
.pl-heatmap { display: grid; grid-template-columns: repeat(18, 1fr); gap: 4px; margin-top: 10px; }
.pl-cell { aspect-ratio: 1; border-radius: 5px; cursor: pointer; transition: transform .12s; min-width: 0; }
.pl-cell:hover { transform: scale(1.2); outline: 2px solid var(--bright); z-index: 2; }
.pl-heatmap-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.pl-heatmap-months { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: var(--muted); }
.pl-heatmap-legend { display: flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 10px; color: var(--muted); }
.pl-heatmap-legend i { width: 11px; height: 11px; border-radius: 4px; display: inline-block; }
.recap-title { font-size: 17px; font-weight: 800; letter-spacing: -.01em; color: var(--bright); margin: 6px 0 4px; }
.recap-row { display: flex; justify-content: space-between; align-items: baseline; padding: 7px 0; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--sub); font-weight: 600; }
.recap-row:first-of-type { border-top: 0; }
.recap-row b { font-family: var(--mono); font-weight: 500; font-size: 12px; color: var(--bright); }
.recap-row b.up { color: var(--green); } .recap-row b.dn { color: var(--red); }

@media (max-width: 1120px) { .history-insights { grid-template-columns: 1fr; padding: 4px 20px 14px; } .pl-heatmap { grid-template-columns: repeat(14, 1fr); } }
@media (max-width: 780px) { .history-insights { padding: 4px 16px 12px; } .pl-heatmap { grid-template-columns: repeat(10, 1fr); } .alert-meter-note { white-space: normal; } }

/* Fix: .alert-row's legacy 3-col grid vs .item-bar-row markup (bar is absolute,
   so content was landing in the 56px column). */
.alert-row.item-bar-row { grid-template-columns: minmax(0, 1fr) auto; }

/* =========================================================================
 * v0.7.0 BENTO ARCHITECTURE — mockup-exact presentation layer.
 * DOM emitted by bento.js into the rebuilt index.html. Legacy component
 * styles above remain for modals, auth, forms, banners, bottom tabs.
 * ========================================================================= */

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 36px; }
@media (max-width: 780px) { .wrap { padding: 0 16px; } }

/* Topbar as mockup header */
.topbar.bento-top { border-bottom: 0; background: var(--ink); backdrop-filter: none; padding: 22px 0 18px; }
.topbar.bento-top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; width: 100%; }
.brand { display: flex; align-items: center; gap: 11px; background: none; border: 0; cursor: pointer; text-align: left; }
.brand .mark { width: 34px; height: 34px; border-radius: 11px; background: var(--bright); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 15px; font-family: var(--sans); }
.brand .bt { font-weight: 800; font-size: 16px; letter-spacing: -.01em; color: var(--bright); line-height: 1.2; }
.brand .bt small { display: block; font-weight: 600; font-size: 11.5px; color: var(--muted); letter-spacing: 0; }
.seg { display: flex; background: #ecebe5; border-radius: 99px; padding: 4px; }
.seg .t-tab { font-family: var(--sans); font-size: 13px; font-weight: 700; color: var(--sub); padding: 8px 18px; border-radius: 99px; height: auto; letter-spacing: 0; text-transform: none; transition: all .2s; }
.seg .t-tab.active { background: var(--ink2); color: var(--bright); box-shadow: var(--shadow-card); }
.hdr-right { display: flex; align-items: center; gap: 12px; }
.search-pill { display: flex; align-items: center; gap: 8px; background: var(--ink2); border: 1px solid var(--line); border-radius: 99px; padding: 9px 16px; font-size: 13px; color: var(--muted); box-shadow: var(--shadow-card); cursor: default; white-space: nowrap; }
.kbd { font-family: var(--mono); font-size: 10.5px; background: var(--ink3); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; color: var(--sub); }
.user-chip { display: flex; align-items: center; gap: 0; background: none; border: 0; cursor: pointer; padding: 0; }
.user-chip-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #2a78d6, #7db1ea); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; font-family: var(--sans); }
.user-chip-name { display: none; }

/* Page scaffolding */
.greet { padding: 6px 0 22px; }
.greet h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--bright); }
.greet p { font-size: 13.5px; color: var(--muted); margin-top: 4px; font-weight: 500; }
.greet p b { font-weight: 800; }
.page-h { padding: 4px 0 20px; display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 14px; }
.page-h h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--bright); }
.page-h p { font-size: 13.5px; color: var(--muted); margin-top: 4px; font-weight: 500; }
.btn.pri { border: 0; font-family: var(--sans); font-weight: 800; font-size: 13px; border-radius: 99px; padding: 10px 18px; cursor: pointer; background: var(--bright); color: #fff; }
.btn.pri:hover { background: #000; }
.btn.gh { border: 1px solid var(--line); font-family: var(--sans); font-weight: 800; font-size: 13px; border-radius: 99px; padding: 10px 18px; cursor: pointer; background: var(--ink2); color: var(--bright); box-shadow: var(--shadow-card); }

/* Bento grid + tiles */
.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; padding-bottom: 56px; }
.tile { background: var(--ink2); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-card); padding: 22px; position: relative; transition: transform .2s, box-shadow .2s; min-width: 0; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(25,25,24,.05), 0 16px 36px -14px rgba(25,25,24,.14); }
.t-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; gap: 10px; }
.t-label { font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--muted); text-transform: uppercase; font-family: var(--sans); }
.t-more { font-size: 12.5px; font-weight: 700; color: var(--accent); text-decoration: none; background: none; border: 0; cursor: pointer; font-family: var(--sans); white-space: nowrap; }
.badge2 { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 800; padding: 4px 11px; border-radius: 99px; }
.badge2.up { color: var(--green); background: #e5f3ea; }
.badge2.dn { color: var(--red); background: #fdeeee; }
.ranges { display: flex; background: var(--ink3); border-radius: 99px; padding: 3px; width: max-content; }
.ranges button, .ranges .range-tab { border: 0; background: none; font-family: var(--mono); font-size: 11px; color: var(--muted); padding: 5px 11px; border-radius: 99px; cursor: pointer; letter-spacing: 0; }
.ranges button.active, .ranges .range-tab.active { background: var(--bright); color: #fff; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-family: var(--mono); font-size: 10.5px; border: 1px solid var(--line); background: none; color: var(--muted); border-radius: 99px; padding: 5px 12px; cursor: pointer; }
.chip.on, .chip.active { background: #eaf1fb; border-color: #c4d9f3; color: var(--accent); }
.tip2 { position: absolute; pointer-events: none; background: var(--bright); color: #fff; border-radius: 10px; padding: 8px 12px; font-size: 12px; opacity: 0; transition: opacity .15s; z-index: 4; white-space: nowrap; box-shadow: 0 8px 20px rgba(0,0,0,.25); }
.tip2 .d { font-family: var(--mono); font-size: 10px; opacity: .65; letter-spacing: .08em; }
.tip2 .v { font-weight: 800; font-size: 14px; margin-top: 2px; }

/* HOME tiles */
.worth { grid-column: span 8; }
.worth .val, .perf .val { font-size: 44px; font-weight: 800; letter-spacing: -.03em; margin-top: 8px; color: var(--bright); }
.worth .val small { font-size: 22px; color: var(--muted); font-weight: 700; }
.worth .sub, .perf .sub { display: flex; gap: 10px; align-items: center; margin-top: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.vs { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.worth .ranges { position: absolute; top: 22px; right: 22px; }
.worth .chart-wrap { position: relative; margin: 4px 0 0; }
.worth .overview-perf-empty { border: 1px dashed var(--line2); border-radius: 14px; padding: 34px 16px; text-align: center; color: var(--muted); font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.bench-row { display: flex; gap: 6px; margin-top: 10px; }

.alloc { grid-column: span 4; display: flex; flex-direction: column; }
.donut-box { display: flex; align-items: center; gap: 18px; flex: 1; margin-top: 6px; }
.donut-hold { position: relative; width: 150px; height: 150px; flex: none; }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.donut-center .n { font-size: 19px; font-weight: 800; color: var(--bright); }
.donut-center .l { font-size: 10.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.dlegend { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.dl-row { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; }
.dl-row .sw { width: 10px; height: 10px; border-radius: 4px; flex: none; }
.dl-row .nm { color: var(--bright); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-row .pc { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--sub); min-width: 46px; text-align: right; }
.dl-row .dv { font-family: var(--mono); font-size: 12px; color: var(--bright); min-width: 76px; text-align: right; font-variant-numeric: tabular-nums; }
.dl-row[data-select-asset] { cursor: pointer; }
.dlegend { gap: 0; }
.dlegend .dl-row { padding: 8px 0; border-bottom: 1px solid var(--line); }
.dlegend .dl-row:last-child { border-bottom: 0; }
.alloc-mode { font: inherit; font-size: 12px; font-weight: 700; color: var(--bright); background: var(--ink2); border: 1px solid var(--line); border-radius: 99px; padding: 5px 26px 5px 12px; height: auto; width: auto; cursor: pointer; }
.alloc-rebal { align-self: flex-start; margin-top: 10px; padding: 0; }

.movers { grid-column: span 4; }
.mv-row { display: grid; grid-template-columns: 52px 1fr 64px; align-items: center; gap: 10px; margin-top: 13px; }
.mv-t { font-size: 13px; font-weight: 800; color: var(--bright); }
.mv-bar { height: 16px; border-radius: 5px; position: relative; background: var(--ink3); overflow: hidden; }
.mv-fill { position: absolute; top: 0; bottom: 0; border-radius: 0 5px 5px 0; }
.mv-mid { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--line2); }
.mv-v { font-family: var(--mono); font-size: 12px; text-align: right; }
.mv-v.up { color: var(--green); } .mv-v.down { color: var(--red); }

.taskt { grid-column: span 4; }
.ring-row { display: flex; align-items: center; gap: 14px; margin: 8px 0 4px; }
.ring-txt .n { font-size: 17px; font-weight: 800; color: var(--bright); }
.ring-txt .l { font-size: 12px; color: var(--muted); font-weight: 600; }
.tkh { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-top: 1px solid var(--line); }
.tkh:first-of-type { border-top: 0; }
.tkh .cb { width: 17px; height: 17px; border-radius: 6px; border: 1.5px solid var(--line2); cursor: pointer; flex: none; display: grid; place-items: center; color: transparent; font-size: 10px; transition: all .2s; background: none; padding: 0; }
.tkh.done .cb { background: var(--green); border-color: var(--green); color: #fff; }
.tkh .tx { font-size: 13px; font-weight: 600; flex: 1; color: var(--bright); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tkh.done .tx { color: var(--muted); text-decoration: line-through; }
.tkh .due { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.tkh .due.hot { color: var(--red); }

.fgt { grid-column: span 4; }
.al { display: flex; gap: 11px; align-items: flex-start; padding: 11px 2px; border-top: 1px solid var(--line); }
.al:first-of-type { border-top: 0; }
.al .ic { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-size: 13px; flex: none; }
.al .ic.trig { background: #fdeeee; color: var(--red); }
.al .ic.arm { background: #fdf3e2; color: #b97f0a; }
.al .tx { font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--bright); }
.al .tx b { font-weight: 800; }
.al .tm { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-top: 2px; }

.newst { grid-column: span 8; }
.news-cards { display: flex; gap: 14px; overflow-x: auto; margin-top: 12px; padding-bottom: 4px; scrollbar-width: none; }
.news-card2 { flex: 0 0 240px; border: 1px solid var(--line); border-radius: 16px; padding: 15px; text-decoration: none; transition: border-color .2s, background .2s; background: #fdfdfb; cursor: pointer; }
.news-card2:hover { border-color: var(--line2); background: #faf9f5; }
.news-card2 .src { font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; display: flex; justify-content: space-between; gap: 8px; }
.news-card2 .src .tk2 { color: var(--accent); font-weight: 500; }
.news-card2 .hl { font-size: 13px; font-weight: 700; color: var(--bright); line-height: 1.45; margin-top: 8px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.news-card2 .ago { font-size: 11px; color: var(--muted); margin-top: 9px; font-weight: 600; }

.streak { grid-column: span 4; background: linear-gradient(150deg, #1c2f4e 0%, #132038 55%, #0f1a2e 100%); border: 0; color: #fff; }
.streak .t-label { color: #9db4d8; }
.streak .n { font-size: 38px; font-weight: 800; margin-top: 10px; }
.streak .l { font-size: 13px; color: #b9c9e4; font-weight: 600; margin-top: 2px; }
.dots { display: flex; gap: 6px; margin-top: 16px; }
.dot7 { width: 24px; height: 24px; border-radius: 8px; background: rgba(255,255,255,.10); display: grid; place-items: center; font-size: 10px; color: #8ea6cc; font-weight: 700; }
.dot7.on { background: #3987e5; color: #fff; }

/* PORTFOLIO page */
.perf { grid-column: span 8; }
.perf .val { font-size: 36px; margin-top: 6px; }
.perf-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.perf-right { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.chart-legend2 { display: flex; gap: 16px; font-size: 12px; color: var(--sub); font-weight: 600; margin-top: 2px; }
.chart-legend2 i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; margin-right: 6px; vertical-align: middle; }
.alloc2 { grid-column: span 4; }
.tophold { grid-column: span 4; display: flex; flex-direction: column; }
.d-row2 { margin-top: 12px; }
.d-top2 { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 700; color: var(--bright); }
.d-top2 .pc { font-family: var(--mono); color: var(--sub); font-weight: 500; }
.d-bar2 { height: 8px; border-radius: 99px; background: var(--ink3); margin-top: 6px; position: relative; }
.d-fill2 { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 99px; }
.d-tgt2 { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--bright); border-radius: 2px; }
.d-note2 { font-size: 11px; color: var(--muted); margin-top: 5px; font-weight: 600; }
.d-note2 b.over { color: #b97f0a; } .d-note2 b.ok { color: var(--green); }
.holdings { grid-column: span 12; padding: 10px 6px 6px; }
.holdings .t-head { padding: 8px 14px 2px; }
.tile table { width: 100%; border-collapse: collapse; }
.tile th { font-size: 10.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; text-align: right; padding: 10px 14px; border-bottom: 1px solid var(--line); font-family: var(--sans); }
.tile th:first-child { text-align: left; }
.tile td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: right; font-family: var(--mono); font-size: 13px; color: var(--bright); }
.tile tr:last-child td { border-bottom: 0; }
.tile tbody tr { cursor: pointer; transition: background .15s; }
.tile tbody tr:hover { background: #faf9f5; }
.tile td.asset { text-align: left; font-family: var(--sans); }
.a-cell { display: flex; align-items: center; gap: 11px; }
.a-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 10px; color: #fff; flex: none; font-family: var(--sans); }
.a-nm .t { font-size: 13.5px; font-weight: 800; color: var(--bright); }
.a-nm .s { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.tile td .up { color: var(--green); } .tile td .down { color: var(--red); }
.w-cell { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.w-bar { width: 64px; height: 6px; border-radius: 99px; background: var(--ink3); position: relative; overflow: visible; }
.w-fill { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 99px; background: var(--accent); }
.w-t { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--bright); }
.income { grid-column: span 4; }
.income .total { font-size: 26px; font-weight: 800; margin: 6px 0 10px; color: var(--bright); }
.income .total small { font-size: 13px; color: var(--muted); font-weight: 700; }
.div-row { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-top: 1px solid var(--line); }
.div-row:first-of-type { border-top: 0; }
.div-ic { width: 30px; height: 30px; border-radius: 9px; background: #e5f3ea; color: var(--green); display: grid; place-items: center; font-size: 13px; font-weight: 800; flex: none; }
.div-t { font-size: 13px; font-weight: 700; flex: 1; color: var(--bright); }
.div-t small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.div-v { font-family: var(--mono); font-size: 12.5px; color: var(--green); }
.insight2 { grid-column: span 4; background: linear-gradient(150deg, #fdf6e8, #fbefdc); border-color: #f0dfc0; }
.insight2 .t-label { color: #9a7a33; }
.insight2 .msg { font-size: 14px; font-weight: 700; line-height: 1.5; margin-top: 10px; color: var(--bright); }
.insight2 .msg b { color: #8a5b00; }
.insight2 .fix { margin-top: 14px; display: flex; gap: 8px; }
.insight2 .fix .btn.pri, .insight2 .fix .btn.gh { font-size: 12px; padding: 8px 15px; }
.rebal { grid-column: span 4; }
.rb-row { display: grid; grid-template-columns: 46px 1fr 90px; gap: 10px; align-items: center; padding: 9px 2px; border-top: 1px solid var(--line); }
.rb-row:first-of-type { border-top: 0; }
.rb-t { font-weight: 800; font-size: 13px; color: var(--bright); }
.rb-a { font-size: 12px; font-weight: 700; }
.rb-a.buy { color: var(--green); } .rb-a.sell { color: var(--red); }
.rb-v { font-family: var(--mono); font-size: 12.5px; text-align: right; color: var(--sub); }
.rebal-note { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 12px; }
.rebal-note b { color: var(--bright); }

/* POSITION page */
.back { font-size: 13px; font-weight: 700; color: var(--muted); text-decoration: none; display: inline-flex; gap: 6px; align-items: center; margin-bottom: 14px; background: none; border: 0; cursor: pointer; font-family: var(--sans); }
.back:hover { color: var(--bright); }
.pos-h { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding-bottom: 20px; }
.ph-l { display: flex; gap: 16px; align-items: center; }
.ph-ic { width: 56px; height: 56px; border-radius: 16px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 15px; box-shadow: var(--shadow-card); font-family: var(--sans); }
.ph-t h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--bright); }
.ph-t p { font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.live { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10px; color: var(--green); background: #e5f3ea; border-radius: 99px; padding: 3px 10px; letter-spacing: .08em; vertical-align: middle; }
.live i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: liveblink 1.6s infinite; }
@keyframes liveblink { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
.ph-r { text-align: right; }
.ph-r .p { font-size: 34px; font-weight: 800; letter-spacing: -.02em; color: var(--bright); }
.ph-r .d { font-size: 13.5px; font-weight: 800; margin-top: 2px; }
.ph-r .d.up { color: var(--green); } .ph-r .d.dn { color: var(--red); }
.ph-r .pv-line { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; min-height: 1.2em; }
.ph-r .pv-line b { font-weight: 800; color: var(--bright); }
.ph-r .pv-line .up { color: var(--green); } .ph-r .pv-line .dn { color: var(--red); }
.chart-tile { grid-column: span 12; padding-bottom: 12px; }
.chart-tile .chart-canvas { width: 100%; margin: 10px 0 0; height: 300px; border: 0; background: transparent; }
.chart-tile .chart-empty-msg { margin: 10px 0 0; }
.chart-tile .t-head { flex-wrap: wrap; gap: 10px; }
.ct-left { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stats2 { grid-column: span 12; display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; }
.stat2 { background: var(--ink2); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-card); padding: 16px 18px; min-width: 0; }
.stat2 .l { font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat2 .v { font-size: 21px; font-weight: 800; margin-top: 6px; color: var(--bright); }
.stat2 .s { font-size: 11.5px; font-weight: 600; color: var(--muted); margin-top: 2px; }
.stat2 .v.up { color: var(--green); } .stat2 .v.dn { color: var(--red); }
.lots { grid-column: span 12; }
.lots td:first-child { text-align: left; font-family: var(--sans); font-weight: 700; font-size: 12.5px; }
.lots th, .lots td { padding: 10px 10px; font-size: 12.5px; }
.lt { font-family: var(--mono); font-size: 9.5px; padding: 2px 8px; border-radius: 99px; letter-spacing: .05em; }
.lt.long { background: #e5f3ea; color: var(--green); } .lt.short { background: #fdf3e2; color: #b97f0a; }
.act { grid-column: span 3; }
.ac-row { display: flex; gap: 11px; align-items: flex-start; padding: 10px 2px; border-top: 1px solid var(--line); }
.ac-row:first-of-type { border-top: 0; }
.ac-ic { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-size: 12px; font-weight: 800; flex: none; }
.ac-ic.buy { background: #e5f3ea; color: var(--green); } .ac-ic.sell { background: #fdeeee; color: var(--red); }
.ac-ic.alrt { background: #fdf3e2; color: #b97f0a; } .ac-ic.div2 { background: #eaf1fb; color: var(--accent); }
.ac-t { font-size: 12.5px; font-weight: 700; line-height: 1.4; color: var(--bright); }
.ac-m { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.taxt { grid-column: span 12; }
.taxt .est { font-size: 24px; font-weight: 800; margin: 8px 0 2px; color: var(--bright); }
.taxt .es { font-size: 12px; color: var(--muted); font-weight: 600; }
.meter2 { height: 10px; border-radius: 99px; background: var(--ink3); margin-top: 14px; position: relative; overflow: hidden; }
.meter2 .m1 { position: absolute; top: 0; bottom: 0; left: 0; background: var(--green); }
.meter2 .m2 { position: absolute; top: 0; bottom: 0; background: #b97f0a; }
.mlegend { display: flex; gap: 14px; margin-top: 10px; font-size: 11.5px; font-weight: 700; color: var(--sub); flex-wrap: wrap; }
.mlegend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 5px; }
.tax-tip { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 12px; }
.tax-tip b { color: var(--bright); } .tax-tip b.gain { color: var(--green); }
.newsline { grid-column: span 4; }
.nl-row { display: flex; gap: 14px; overflow-x: auto; margin-top: 10px; scrollbar-width: none; }
.nl-card { flex: 0 0 250px; border: 1px solid var(--line); border-radius: 14px; padding: 13px; background: #fdfdfb; text-decoration: none; cursor: pointer; }
.nl-card .s2 { font-family: var(--mono); font-size: 9px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.nl-card .h { font-size: 12.5px; font-weight: 700; color: var(--bright); line-height: 1.45; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nl-card .a { font-size: 10.5px; color: var(--muted); margin-top: 7px; font-weight: 600; }
.pos-actions2 { grid-column: span 12; display: flex; justify-content: flex-end; gap: 10px; }

/* TASKS page */
.qadd { display: flex; align-items: center; gap: 12px; background: var(--ink2); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-card); padding: 6px 8px 6px 18px; margin-bottom: 20px; }
.qadd .plus { color: var(--accent); font-size: 19px; font-weight: 800; }
.qadd input { flex: 1; border: 0; outline: 0; font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--bright); background: none; padding: 10px 0; width: auto; }
.qadd input::placeholder { color: var(--muted); font-weight: 500; }
.qadd .hint { font-family: var(--mono); font-size: 10.5px; color: var(--muted); background: var(--ink3); border-radius: 8px; padding: 5px 10px; white-space: nowrap; }
.qadd .btn.pri { border-radius: 12px; }
.tcol { grid-column: span 4; display: flex; flex-direction: column; gap: 10px; min-height: 340px; align-content: start; }
.cnt { font-family: var(--mono); font-size: 11px; background: var(--ink3); color: var(--sub); border-radius: 99px; padding: 2px 9px; }
.tk2 { border: 1px solid var(--line); border-radius: 14px; padding: 13px 15px; background: #fdfdfb; cursor: pointer; transition: all .15s; }
.tk2:hover { border-color: var(--line2); transform: translateY(-1px); box-shadow: var(--shadow-card); }
.tk2-top { display: flex; align-items: flex-start; gap: 10px; }
.tk2 .cb { width: 17px; height: 17px; border-radius: 6px; border: 1.5px solid var(--line2); cursor: pointer; flex: none; margin-top: 1px; display: grid; place-items: center; color: transparent; font-size: 10px; transition: all .2s; background: none; padding: 0; }
.tk2.done .cb { background: var(--green); border-color: var(--green); color: #fff; }
.tk2 .tx { font-size: 13.5px; font-weight: 700; line-height: 1.45; flex: 1; color: var(--bright); }
.tk2.done .tx { color: var(--muted); text-decoration: line-through; }
.tk2-meta { display: flex; gap: 8px; align-items: center; margin-top: 9px; flex-wrap: wrap; }
.pri2 { font-family: var(--mono); font-size: 9px; letter-spacing: .08em; padding: 2.5px 8px; border-radius: 99px; text-transform: uppercase; font-weight: 500; }
.pri2.high { color: var(--red); background: #fdeeee; }
.pri2.med { color: #b97f0a; background: #fdf3e2; }
.pri2.low { color: var(--sub); background: var(--ink3); }
.tk-tick { font-family: var(--mono); font-size: 10px; color: var(--accent); background: #eaf1fb; border-radius: 99px; padding: 2.5px 8px; }
.due2 { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-left: auto; }
.due2.hot { color: var(--red); }
.tside { grid-column: span 12; display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; }
.focus { grid-column: span 4; background: linear-gradient(150deg, #1c2f4e, #132038); border: 0; color: #fff; }
.focus .t-label { color: #9db4d8; }
.focus .big { font-size: 17px; font-weight: 800; line-height: 1.5; margin-top: 10px; }
.focus .why { font-size: 12.5px; color: #b9c9e4; font-weight: 600; margin-top: 8px; line-height: 1.5; }
.focus .go { margin-top: 16px; display: inline-block; background: #3987e5; color: #fff; font-weight: 800; font-size: 12.5px; border-radius: 99px; padding: 9px 16px; border: 0; cursor: pointer; font-family: var(--sans); }
.ttrend { grid-column: span 4; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 110px; margin-top: 16px; padding: 0 4px; }
.bgrp { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; }
.bgrp .bar2 { width: 100%; max-width: 24px; border-radius: 5px 5px 0 0; background: var(--teal); min-height: 2px; }
.bgrp .bar2.today { background: var(--accent); }
.bgrp .d { font-family: var(--mono); font-size: 9.5px; color: var(--muted); }
.bgrp .n { font-family: var(--mono); font-size: 10px; color: var(--sub); }
.tlink { grid-column: span 4; }
.lk-row { display: flex; gap: 11px; align-items: flex-start; padding: 11px 2px; border-top: 1px solid var(--line); }
.lk-row:first-of-type { border-top: 0; }
.lk-ic { width: 28px; height: 28px; border-radius: 9px; background: #eaf1fb; color: var(--accent); display: grid; place-items: center; font-size: 12px; font-weight: 800; flex: none; }
.lk-t { font-size: 12.5px; font-weight: 700; line-height: 1.45; color: var(--bright); }
.lk-m { font-size: 11px; color: var(--muted); font-weight: 600; margin-top: 2px; }

/* NEWS page */
.filters2 { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.fc { font-family: var(--sans); font-weight: 700; font-size: 12.5px; color: var(--sub); background: var(--ink2); border: 1px solid var(--line); border-radius: 99px; padding: 8px 16px; cursor: pointer; box-shadow: var(--shadow-card); transition: all .2s; }
.fc.on, .fc.active { background: var(--bright); color: #fff; border-color: var(--bright); }
.fc .n { font-family: var(--mono); font-size: 10px; opacity: .6; margin-left: 5px; }
.tick2 { font-family: var(--mono); font-size: 10.5px; color: var(--accent); background: #eaf1fb; border-radius: 99px; padding: 3px 10px; }
.sent2 { font-family: var(--mono); font-size: 10px; border-radius: 99px; padding: 3px 10px; letter-spacing: .05em; text-transform: uppercase; }
.sent2.pos, .sent2.bullish, .sent2.somewhat-bullish { color: var(--green); background: #e5f3ea; }
.sent2.neg, .sent2.bearish, .sent2.somewhat-bearish { color: var(--red); background: #fdeeee; }
.sent2.neu, .sent2.neutral { color: var(--sub); background: var(--ink3); }
.ago2 { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-left: auto; }
.cover { grid-column: span 4; }
.cv-row { display: grid; grid-template-columns: 52px 1fr 30px; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.cv-row:first-of-type { border-top: 0; }
.cv-t { font-weight: 800; font-size: 13px; color: var(--bright); }
.cv-bar { height: 8px; border-radius: 99px; background: var(--ink3); overflow: hidden; }
.cv-fill { height: 100%; border-radius: 99px; background: var(--accent); }
.cv-n { font-family: var(--mono); font-size: 11px; color: var(--sub); text-align: right; }
.digest { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.digest .d-t { font-size: 13px; font-weight: 800; color: var(--bright); }
.digest p { font-size: 12px; color: var(--sub); font-weight: 600; line-height: 1.55; margin-top: 6px; }
.digest .go { color: var(--accent); font-weight: 800; font-size: 12.5px; text-decoration: none; background: none; border: 0; cursor: pointer; padding: 0; font-family: var(--sans); }
.feed { grid-column: span 8; padding: 8px 6px; }
.feed .t-head { padding: 8px 16px 2px; }
.n-row2 { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 15px 16px; border-radius: 14px; cursor: pointer; transition: background .15s; border-bottom: 1px solid var(--line); }
.n-row2:last-child { border-bottom: 0; }
.n-row2:hover { background: #faf9f5; }
.n-src { font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.n-h { font-size: 14.5px; font-weight: 700; line-height: 1.45; margin-top: 6px; color: var(--bright); }
.n-row2.read .n-h { color: var(--muted); font-weight: 600; }
.n-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; justify-content: space-between; }
.save2 { width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line); background: none; cursor: pointer; color: var(--muted); font-size: 13px; transition: all .2s; }
.save2.on { background: #fdf3e2; border-color: #f0dfc0; color: #b97f0a; }
.unread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.ntrend { grid-column: span 4; }
.tr-row { display: flex; align-items: center; gap: 11px; padding: 10px 0; border-top: 1px solid var(--line); }
.tr-row:first-of-type { border-top: 0; }
.tr-rank { font-family: var(--mono); font-size: 11px; color: var(--muted); width: 16px; }
.tr-t { font-weight: 800; font-size: 13px; flex: 1; color: var(--bright); }
.tr-t small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.tr-n { font-family: var(--mono); font-size: 11px; color: var(--sub); }
.tr-s { font-size: 10px; font-weight: 800; padding: 3px 9px; border-radius: 99px; }
.tr-s.pos { color: var(--green); background: #e5f3ea; } .tr-s.neg { color: var(--red); background: #fdeeee; } .tr-s.neu { color: var(--sub); background: var(--ink3); }

/* ALERTS page */
.alist { grid-column: span 8; display: flex; flex-direction: column; gap: 14px; }
.al-card { background: var(--ink2); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-card); padding: 18px 20px; }
.al-card.trig { border-color: #f3c8c8; background: linear-gradient(150deg, #fff, #fdf6f6); }
.al-card.pausedc { opacity: .7; }
.al-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.al-ic2 { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 15px; flex: none; }
.al-ic2.trig { background: #fdeeee; color: var(--red); }
.al-ic2.arm { background: #fdf3e2; color: #b97f0a; }
.al-ic2.paused { background: var(--ink3); color: var(--muted); }
.al-t2 { font-size: 14.5px; font-weight: 800; flex: 1; color: var(--bright); min-width: 200px; }
.al-t2 small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.status2 { font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; padding: 4px 11px; border-radius: 99px; text-transform: uppercase; }
.status2.trig { color: var(--red); background: #fdeeee; }
.status2.arm { color: #b97f0a; background: #fdf3e2; }
.status2.paused { color: var(--muted); background: var(--ink3); }
.switch { width: 38px; height: 22px; border-radius: 99px; background: #e0ded6; position: relative; cursor: pointer; transition: background .2s; flex: none; border: 0; padding: 0; }
.switch:after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: left .2s; }
.switch.on { background: var(--green); }
.switch.on:after { left: 19px; }
.dist { margin-top: 14px; }
.d-lab { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.d-track { height: 8px; border-radius: 99px; background: var(--ink3); margin-top: 6px; position: relative; }
.d-fillx { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 99px; background: linear-gradient(90deg, #9ec5f4, #2a78d6); }
.d-now { position: absolute; top: -4px; width: 2.5px; height: 16px; background: var(--bright); border-radius: 2px; }
.d-notex { font-size: 11.5px; font-weight: 700; color: var(--sub); margin-top: 8px; }
.d-notex b { color: var(--bright); }
.al-foot { display: flex; gap: 14px; margin-top: 12px; font-size: 12px; font-weight: 700; flex-wrap: wrap; }
.al-foot button, .al-foot a { color: var(--accent); text-decoration: none; background: none; border: 0; cursor: pointer; font-weight: 700; font-size: 12px; padding: 0; font-family: var(--sans); }
.al-foot .mutedlink { color: var(--muted); }
.arail { grid-column: span 4; display: flex; flex-direction: column; gap: 18px; }
.qform label { display: block; font-size: 11.5px; font-weight: 800; color: var(--sub); text-transform: uppercase; letter-spacing: .03em; margin: 13px 0 6px; }
.qform input { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; font-family: var(--sans); font-size: 13.5px; font-weight: 600; color: var(--bright); background: #fdfdfb; outline: none; }
.qform input:focus { border-color: var(--accent); }
.cond { display: flex; gap: 8px; }
.cond button { flex: 1; border: 1px solid var(--line); background: #fdfdfb; border-radius: 12px; padding: 10px 6px; font-family: var(--sans); font-weight: 700; font-size: 12px; color: var(--sub); cursor: pointer; }
.cond button.on { border-color: var(--accent); background: #eaf1fb; color: var(--accent); }
.qform .btn.pri { width: 100%; margin-top: 16px; }
.qform .tipnote { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 10px; }
.pusht { background: linear-gradient(150deg, #1c2f4e, #132038); border: 0; color: #fff; }
.pusht .t-label { color: #9db4d8; }
.pusht #pushStatus { color: #b9c9e4; font-size: 12px; font-weight: 600; margin-top: 8px; line-height: 1.5; }
.pusht #pushStatus .btn, .pusht #pushStatus button { margin-top: 10px; }
.histt .h-row { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--sub); }
.histt .h-row:first-of-type { border-top: 0; }
.histt .h-row b { color: var(--bright); }
.histt .tm { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-left: auto; }

/* HISTORY page */
.heat { grid-column: span 8; }
.hm { display: grid; grid-template-columns: repeat(18, 1fr); gap: 5px; margin-top: 6px; }
.hmcell { aspect-ratio: 1; border-radius: 6px; cursor: pointer; position: relative; transition: transform .15s; }
.hmcell:hover { transform: scale(1.18); z-index: 2; outline: 2px solid var(--bright); }
.hmcell.sel { outline: 2.5px solid var(--bright); }
.hm-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; flex-wrap: wrap; gap: 8px; }
.hm-leg { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); font-weight: 600; }
.hm-leg i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.hm-months { font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: .1em; display: flex; gap: 64px; }
.recap2 { grid-column: span 4; background: linear-gradient(150deg, #1c2f4e, #132038); border: 0; color: #fff; }
.recap2 .t-label { color: #9db4d8; }
.recap2 h3 { font-size: 19px; font-weight: 800; margin-top: 8px; }
.recap2 .rrow { display: flex; justify-content: space-between; padding: 9px 0; border-top: 1px solid rgba(255,255,255,.09); font-size: 13px; font-weight: 600; color: #c9d6ea; }
.recap2 .rrow:first-of-type { border-top: 0; margin-top: 10px; }
.recap2 .rrow b { color: #fff; font-family: var(--mono); font-weight: 500; }
.recap2 .rrow b.up { color: #34d399; } .recap2 .rrow b.dn { color: #f0a0a0; }
.dayt { grid-column: span 7; }
.dayt .dh { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.dayt h3 { font-size: 17px; font-weight: 800; color: var(--bright); }
.dayt .cap { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.dstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 14px; }
.ds { background: #faf9f5; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.ds .l { font-size: 10px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ds .v { font-size: 16px; font-weight: 800; margin-top: 4px; color: var(--bright); }
.ds .v.up { color: var(--green); } .ds .v.dn { color: var(--red); }
.dreport { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.dreport .r-t { font-size: 12.5px; font-weight: 800; color: var(--sub); text-transform: uppercase; letter-spacing: .03em; }
.dreport p { font-size: 13.5px; color: var(--sub); font-weight: 500; line-height: 1.65; margin-top: 8px; }
.snaps { grid-column: span 5; }
.sn { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 11px 4px; border-top: 1px solid var(--line); cursor: pointer; border-radius: 10px; }
.sn:hover { background: #faf9f5; }
.sn:first-of-type { border-top: 0; }
.sn.selrow { background: #f4f8fd; }
.sn .d { font-size: 13px; font-weight: 700; color: var(--bright); }
.sn .d small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.sn .v { font-family: var(--mono); font-size: 12.5px; color: var(--bright); }
.sn .pl { font-family: var(--mono); font-size: 12px; text-align: right; }
.sn .pl.up { color: var(--green); } .sn .pl.down { color: var(--red); }
.htip2 { position: fixed; pointer-events: none; background: var(--bright); color: #fff; border-radius: 10px; padding: 8px 12px; font-size: 12px; opacity: 0; transition: opacity .1s; z-index: 10; white-space: nowrap; }
.htip2 .d { font-family: var(--mono); font-size: 10px; opacity: .65; }
.htip2 .v { font-weight: 800; margin-top: 2px; }

/* Responsive collapse */
@media (max-width: 1000px) {
  .drove, .tophold, .worth, .alloc, .movers, .taskt, .fgt, .watch, .upcoming, .newst, .streak, .perf, .alloc2, .holdings,
  .income, .insight2, .rebal, .lots, .act, .taxt, .newsline, .tcol, .focus, .ttrend, .tlink,
  .nbrief, .cover, .feed, .ntrend, .alist, .arail, .heat, .recap2, .dayt, .snaps { grid-column: span 12; }
  .worth .ranges { position: relative; top: auto; right: auto; margin-top: 10px; }   /* relative keeps the sliding pill anchored; top/right off, or the base rule's offsets shift the tabs onto the number */
  .stats2 { grid-template-columns: repeat(2, 1fr); }
  .hm { grid-template-columns: repeat(12, 1fr); }
  .seg { display: none; }
}
/* 0.11.0 between 1001px and ~1180px the brand, tabs, search and avatar did not fit (the avatar and its Pro badge spilled past
   the edge and the page scrolled sideways). The brand and tabs keep their size; the search box gives way instead. */
@media (min-width: 1001px) {
  .topbar.bento-top .brand, .topbar.bento-top .seg { flex: none; }
  .brand .bt small { white-space: nowrap; }
  .topbar.bento-top .hdr-right { min-width: 0; }
  .topbar.bento-top .search-box { min-width: 150px; }
}
@media (min-width: 1001px) and (max-width: 1180px) {
  .wrap { padding: 0 24px; }
  .topbar.bento-top .wrap { gap: 14px; }
  .seg .t-tab { padding: 8px 13px; }
  .search-box { width: 190px; }
  .search-box.open, .search-box:focus-within { width: 250px; }
}

/* v0.7.0 fix: alert/conflict banners flow above the header instead of overlaying it */
.alert-banner, .conflict-banner { position: relative !important; top: auto !important; left: auto !important; right: auto !important; z-index: 5; }

/* =========================================================================
 * v0.7.1 — user-menu anchor fix, black logo, command palette, DARK MODE
 * ========================================================================= */

.hdr-right { position: relative; }
.user-menu { border-radius: 14px; }
.brand-logo { width: 34px; height: 34px; object-fit: contain; display: block; filter: brightness(0); }

/* Command palette */
.cmdk-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(25,25,24,.35); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 12vh 20px 20px; }
.cmdk-overlay[hidden] { display: none; }
.cmdk { width: min(560px, 100%); background: var(--ink2); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 24px 70px -20px rgba(25,25,24,.35); overflow: hidden; }
.cmdk input { width: 100%; border: 0; outline: 0; background: none; font-family: var(--sans); font-size: 15px; font-weight: 600; color: var(--bright); padding: 17px 20px; border-bottom: 1px solid var(--line); }
.cmdk input::placeholder { color: var(--muted); font-weight: 500; }
.cmdk-results { max-height: 46vh; overflow: auto; padding: 8px; }
.cmdk-group { font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 10px 12px 4px; }
.cmdk-item { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; background: none; border: 0; border-radius: 12px; padding: 10px 12px; cursor: pointer; font-family: var(--sans); }
.cmdk-item.on, .cmdk-item:hover { background: var(--ink3); }
.cmdk-item .ci { width: 28px; height: 28px; border-radius: 9px; background: var(--ink3); display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--sub); flex: none; }
.cmdk-item.on .ci { background: var(--ink4); }
.cmdk-item .ct { font-size: 13.5px; font-weight: 700; color: var(--bright); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-item .cs { font-size: 11.5px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.cmdk-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); font-weight: 600; }
.cmdk-empty { padding: 22px; text-align: center; color: var(--muted); font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }

/* ---------- DARK MODE ---------- */
html[data-theme="dark"] {
  --ink: #0f0f11; --ink2: #17171b; --ink3: #1f1f25; --ink4: #26262d;
  --line: #26262d; --line2: #33333c; --dim: #4a4a55; --muted: #8b8b98;
  --sub: #a9a9b7; --text: #d8d8e0; --bright: #f3f3f7;
  --accent: #3987e5; --red: #e05252; --green: #2fb371; --blue: #3987e5; --purple: #9085e9; --teal: #1baf7a;
  --amber-ink: #e0aa3a; --amber-dot: #e0aa3a;
  --lot-fill: rgba(224,170,58,.26); --lot-edge: #e0aa3a;
  --shadow-card: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px -12px rgba(0,0,0,.55);
}
html[data-theme="dark"] body { background: var(--ink); color: var(--text); }
html[data-theme="dark"] .brand-logo { filter: brightness(0) invert(1); }
html[data-theme="dark"] .brand .mark { background: #f3f3f7; color: #0f0f11; }
html[data-theme="dark"] .seg { background: #1c1c22; }
html[data-theme="dark"] .kbd, html[data-theme="dark"] .cnt, html[data-theme="dark"] .qadd .hint { background: var(--ink3); border-color: var(--line2); color: var(--sub); }
html[data-theme="dark"] .btn.pri, html[data-theme="dark"] .qadd .btn.pri { background: #f3f3f7; color: #0f0f11; }
html[data-theme="dark"] .btn.pri:hover { background: #ffffff; }
html[data-theme="dark"] .ranges button.active, html[data-theme="dark"] .ranges .range-tab.active,
html[data-theme="dark"] .fc.on, html[data-theme="dark"] .fc.active { background: #f3f3f7; color: #0f0f11; border-color: #f3f3f7; }
html[data-theme="dark"] .btn-primary { background: #f3f3f7; color: #0f0f11; border-color: #f3f3f7; }
html[data-theme="dark"] .tk2, html[data-theme="dark"] .news-card2, html[data-theme="dark"] .nl-card,
html[data-theme="dark"] .cond button, html[data-theme="dark"] .qform input { background: #1c1c22; }
html[data-theme="dark"] .news-card2:hover, html[data-theme="dark"] .tile tbody tr:hover,
html[data-theme="dark"] .n-row2:hover, html[data-theme="dark"] .sn:hover { background: #22222a; }
html[data-theme="dark"] .ds { background: #1c1c22; }
html[data-theme="dark"] .sn.selrow { background: rgba(57,135,229,.12); }
html[data-theme="dark"] input, html[data-theme="dark"] textarea, html[data-theme="dark"] select { background: var(--ink3); color: var(--text); border-color: var(--line2); }
/* tinted chips */
html[data-theme="dark"] .badge2.up, html[data-theme="dark"] .lt.long, html[data-theme="dark"] .div-ic,
html[data-theme="dark"] .ac-ic.buy, html[data-theme="dark"] .sent2.pos, html[data-theme="dark"] .sent2.bullish,
html[data-theme="dark"] .sent2.somewhat-bullish, html[data-theme="dark"] .tr-s.pos, html[data-theme="dark"] .live { background: rgba(47,179,113,.16); }
html[data-theme="dark"] .badge2.dn, html[data-theme="dark"] .al .ic.trig, html[data-theme="dark"] .al-ic2.trig,
html[data-theme="dark"] .status2.trig, html[data-theme="dark"] .sent2.neg, html[data-theme="dark"] .sent2.bearish,
html[data-theme="dark"] .sent2.somewhat-bearish, html[data-theme="dark"] .tr-s.neg, html[data-theme="dark"] .ac-ic.sell { background: rgba(224,82,82,.16); }
html[data-theme="dark"] .al .ic.arm, html[data-theme="dark"] .al-ic2.arm, html[data-theme="dark"] .status2.arm,
html[data-theme="dark"] .lt.short, html[data-theme="dark"] .pri2.med, html[data-theme="dark"] .ac-ic.alrt,
html[data-theme="dark"] .save2.on { background: rgba(217,149,15,.16); border-color: rgba(217,149,15,.3); color: #dfa940; }
html[data-theme="dark"] .pri2.high { background: rgba(224,82,82,.16); }
html[data-theme="dark"] .tk-tick, html[data-theme="dark"] .tick2, html[data-theme="dark"] .ac-ic.div2,
html[data-theme="dark"] .lk-ic, html[data-theme="dark"] .chip.on, html[data-theme="dark"] .chip.active { background: rgba(57,135,229,.16); border-color: rgba(57,135,229,.35); }
/* insight + triggered cards */
html[data-theme="dark"] .insight2 { background: linear-gradient(150deg, #262013, #1f1a0f); border-color: #4a3c1c; }
html[data-theme="dark"] .insight2 .t-label { color: #c9a35a; }
html[data-theme="dark"] .insight2 .msg b { color: #e5b567; }
html[data-theme="dark"] .al-card.trig { background: linear-gradient(150deg, #1b1b20, #261618); border-color: #5c2e2e; }
/* tooltips */
html[data-theme="dark"] .tip2, html[data-theme="dark"] .htip2 { background: #26262d; }
/* switches / meters */
html[data-theme="dark"] .switch { background: #33333c; }
html[data-theme="dark"] .mv-bar, html[data-theme="dark"] .d-track, html[data-theme="dark"] .d-bar2,
html[data-theme="dark"] .cv-bar, html[data-theme="dark"] .w-bar, html[data-theme="dark"] .meter2 { background: #26262d; }
/* legacy surfaces (modals, auth, banners already var-driven) */
html[data-theme="dark"] .modal, html[data-theme="dark"] .auth-panel { background: var(--ink2); }
html[data-theme="dark"] .chart-canvas { background: transparent; }
html[data-theme="dark"] .overview-perf-empty, html[data-theme="dark"] .chart-empty-msg { border-color: var(--line2); }

/* ============ v0.7.5 — scrub + delta toggle layer ============ */
/* Delta badges toggle $ / % display on tap (Robinhood-style). */
#homeSubRow .badge2, #perfSub .badge2, #positionDay { cursor: pointer; user-select: none; -webkit-user-select: none; }
/* Perf chart owns touch gestures so a finger drag scrubs instead of scrolling. */
#perfWrap { touch-action: none; }

/* v0.7.6 — charts are fixed-viewport now; stop drag-scrubbing from selecting page text. */
#portfolioChart, #overviewPerfChart, #perfWrap { -webkit-user-select: none; user-select: none; }

/* ============ v0.7.7 — asset logos ============ */
/* Real logo covers the colored letter tile; if it 404s the tile shows through. */
.a-ic, .ph-ic, .ci { position: relative; overflow: hidden; }
.a-logo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; background: #fff; }

/* =========================================================================
 * v0.7.8 — Profile page on the bento system + hybrid mobile layout
 * ========================================================================= */

/* ---- Profile (all sizes) ---- */
.profile-bento { align-items: start; }
.profile-main { grid-column: span 8; }
.profile-side2 { grid-column: span 4; }
.profile-form label, #invitationsPanel .invite-form label {
  display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .13em;
  text-transform: uppercase; color: var(--muted); font-weight: 500;
}
.profile-form input, .profile-form select, .profile-form textarea,
#invitationsPanel .invite-form input {
  width: 100%; margin-top: 7px; background: var(--ink); border: 1px solid var(--line);
  border-radius: 12px; padding: 11px 13px; font-family: var(--sans); font-size: 14px;
  font-weight: 600; color: var(--bright); outline: none; box-sizing: border-box;
}
.profile-form input:focus, .profile-form select:focus, .profile-form textarea:focus,
#invitationsPanel .invite-form input:focus { border-color: var(--accent); }
.profile-form input[readonly] { color: var(--muted); }
.profile-form .form-grid, #invitationsPanel .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.profile-form .form-grid .wide, #invitationsPanel .form-grid .wide { grid-column: 1 / -1; }
.profile-form > label { display: block; margin-top: 14px; }
.profile-form .modal-note { margin-top: 14px; font-size: 12px; color: var(--muted); background: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; }
.profile-form .modal-actions { margin-top: 16px; display: flex; gap: 10px; align-items: center; }
.profile-side2 .profile-stat { padding: 12px 0; border-bottom: 1px solid var(--line); }
.profile-side2 .profile-stat:last-child { border-bottom: 0; }
.profile-side2 .profile-stat strong { font-weight: 700; margin-top: 4px; }
#invitationsPanel .cell-head { margin-top: 30px; display: flex; justify-content: space-between; align-items: center; }
#invitationsPanel .cell-title { font-family: var(--sans); font-size: 15px; font-weight: 800; letter-spacing: 0; text-transform: none; color: var(--bright); }
#invitationsPanel .sec-badge { border-radius: 99px; font-size: 10px; padding: 4px 10px; background: var(--ink); border: 1px solid var(--line); color: var(--muted); }
#invitationsPanel .invite-form { border: 0; padding: 0 0 6px; margin: 12px 0 4px; }
#invitationsPanel .modal-actions { margin-top: 12px; display: flex; gap: 12px; align-items: center; }
.invitation-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.invitation-row:last-child { border-bottom: 0; }
.invitation-email { font-weight: 800; font-size: 13.5px; color: var(--bright); }
.invitation-meta { display: flex; gap: 8px; align-items: center; font-size: 11px; color: var(--muted); margin-top: 3px; flex-wrap: wrap; }
.invitation-pill { font-family: var(--mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 99px; }
.invitation-pill.pending { background: #fdf3dd; color: #b97f0a; }
.invitation-pill.accepted { background: #e5f3ea; color: var(--green); }
.invitation-pill.expired, .invitation-pill.revoked { background: #f0efe9; color: var(--muted); }
.invitation-actions { display: flex; gap: 8px; flex: none; }
html[data-theme="dark"] .invitation-pill.pending { background: #37301d; color: #e0b45c; }
html[data-theme="dark"] .invitation-pill.accepted { background: #1d3226; color: #56c288; }
html[data-theme="dark"] .invitation-pill.expired, html[data-theme="dark"] .invitation-pill.revoked { background: #26262d; color: #8f8d85; }

/* ---- Hybrid mobile layout (approved mockup: Robinhood top, bento below) ---- */
@media (max-width: 780px) {
  /* Header: compact — logo, stretchy search, avatar */
  .topbar.bento-top { padding: 10px 0; }
  .topbar.bento-top .wrap { gap: 10px; }
  .brand .bt small { display: none; }
  .brand .bt { font-size: 15px; }
  .brand-logo { width: 28px; height: 28px; }
  .hdr-right { flex: 1; display: flex; gap: 10px; align-items: center; min-width: 0; }
  .search-pill { flex: 1; min-width: 0; justify-content: flex-start; padding: 8px 14px; }
  .search-pill .kbd { display: none; }
  .user-chip-name { display: none; }

  /* Bottom tabs — bento look */
  .bottom-tabs { height: calc(60px + env(safe-area-inset-bottom, 0px)); background: color-mix(in srgb, var(--ink2) 96%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
  .bt-tab { color: #b5b3ab; }
  .bt-tab span { font-family: var(--sans); text-transform: none; font-size: 9.5px; font-weight: 800; letter-spacing: 0; }
  .bt-tab.active { color: var(--bright); }

  /* Home: hero-first, edge-to-edge axis-less chart, underline range pills */
  .greet { display: none; }
  #homeView .bento { display: flex; flex-direction: column; gap: 14px; }
  #homeView .tile.worth { order: 0; } #homeView .alloc { order: 1; }
  #homeView .taskt { order: 2; } #homeView .fgt { order: 3; }
  #homeView .newst { order: 4; } #homeView .movers { order: 5; } #homeView .streak { order: 6; }
  .tile.worth { background: none; border: 0; box-shadow: none; padding: 0; border-radius: 0; display: flex; flex-direction: column; }
  .tile.worth .t-head { order: 0; margin-bottom: 0; }
  .tile.worth .val { order: 1; font-size: 36px; }
  .tile.worth .sub { order: 2; }
  .tile.worth .chart-wrap { order: 3; margin: 8px -16px 0; }
  .tile.worth .ranges { order: 4; position: relative; top: auto; right: auto; display: flex; margin: 0 -16px; padding: 0 8px; border-bottom: 1px solid var(--line); background: none; border-radius: 0; }
  .tile.worth .bench-row { order: 5; margin-top: 12px; }
  .tile.worth .ranges .range-tab, #chartRangeTabs .range-tab, #perfRanges button {
    flex: 1; background: none !important; color: var(--muted); border-radius: 0;
    padding: 10px 0 12px; position: relative; border: 0; box-shadow: none;
  }
  .tile.worth .ranges .range-tab.active, #chartRangeTabs .range-tab.active, #perfRanges .active {
    color: var(--bright); background: none !important;
  }
  .tile.worth .ranges .range-tab.active::after, #chartRangeTabs .range-tab.active::after, #perfRanges .active::after {
    content: ""; position: absolute; left: 26%; right: 26%; bottom: 0; height: 3px; border-radius: 3px; background: var(--bright);
  }

  /* Portfolio: perf chart stretches, underline pills */
  .tile.perf { padding: 16px 16px 10px; }
  .perf-top { flex-direction: column; align-items: stretch; gap: 6px; }
  .perf-right { display: flex; flex-direction: column; gap: 6px; }
  #perfRanges { display: flex; margin: 0 -16px; padding: 0 8px; border-bottom: 1px solid var(--line); background: none; border-radius: 0; }
  #perfWrap { margin: 6px -16px 0; }

  /* Holdings table -> Robinhood rows: logo/name | spark | price + pill */
  .holdings { padding: 6px 14px 8px; }
  .holdings thead { display: none; }
  .holdings tr { display: grid; grid-template-columns: minmax(0,1fr) 58px auto; grid-template-areas: "a s p" "a s t"; align-items: center; column-gap: 10px; row-gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .holdings tbody tr:last-child { border-bottom: 0; }
  .holdings td { padding: 0; border: 0; }
  .holdings td.asset { grid-area: a; min-width: 0; }
  /* Column map (v0.7.10): 1 asset · 2 units · 3 price · 4 today · 5 trend · 6 value · 7 weight · 8 P&L */
  .holdings td:nth-child(3) { grid-area: p; text-align: right; font-family: var(--mono); font-size: 13.5px; }
  .holdings td:nth-child(4) { grid-area: t; text-align: right; }
  .holdings td:nth-child(5) { grid-area: s; }
  .holdings td:nth-child(2), .holdings td:nth-child(6), .holdings td:nth-child(7), .holdings td:nth-child(8) { display: none; }
  .holdings td:nth-child(4) .up, .holdings td:nth-child(4) .down {
    display: inline-block; min-width: 62px; text-align: center; font-family: var(--mono);
    font-size: 11.5px; padding: 3px 8px; border-radius: 8px; color: #fff !important;
  }
  .holdings td:nth-child(4) .up { background: var(--green); }
  .holdings td:nth-child(4) .down { background: var(--red); }

  /* Position: stacked hero, flat edge-to-edge chart, sticky CTA */
  .pos-h { flex-direction: column; align-items: stretch; gap: 4px; }
  .ph-rg { flex-direction: column; align-items: flex-start !important; gap: 4px !important; }
  .ph-r .p { font-size: 34px; }
  .ph-cta { position: fixed; left: 16px; right: 16px; bottom: calc(74px + env(safe-area-inset-bottom)); z-index: 29; display: flex !important; gap: 10px; }
  .ph-cta .btn { flex: 1; padding: 14px 0; border-radius: 99px; font-size: 15px; text-align: center; justify-content: center; box-shadow: 0 8px 24px rgba(25,25,24,.28); }
  .ph-cta .btn.gh { background: var(--ink2); }
  #positionView .wrap { padding-bottom: 84px; }
  .tile.chart-tile { background: none; border: 0; box-shadow: none; border-radius: 0; padding: 0; display: flex; flex-direction: column; }
  .chart-tile .t-head { order: 2; display: flex; flex-direction: column-reverse; gap: 10px; margin: 0; }
  .chart-tile .chart-canvas { order: 1; margin: 0 -16px; }
  #chartRangeTabs { display: flex; width: 100%; margin: 0 -16px; padding: 0 8px; border-bottom: 1px solid var(--line); background: none; border-radius: 0; box-sizing: content-box; }
  .chart-tile .ct-left { display: flex; gap: 8px; justify-content: center; }
  .stats2 { grid-template-columns: repeat(2, 1fr); }

  /* Profile mobile */
  .profile-bento { display: flex; flex-direction: column; }
}

/* v0.7.8 fixes — mobile range rows stretch full-width; chart canvas loses its
   border/tint so the edge-to-edge look is seamless. */
@media (max-width: 780px) {
  .tile.worth .ranges, #chartRangeTabs, #perfRanges { width: auto; }
  .tile.worth .ranges .range-tab, #chartRangeTabs .range-tab, #perfRanges button { flex: 1 1 0 !important; text-align: center; }
  .overview-perf-canvas { border: 0; border-radius: 0; background: none; margin-bottom: 0; }
  .chart-canvas { border: 0 !important; border-radius: 0 !important; background: none !important; }
}

/* v0.7.8 fixes round 2 — mobile position hero left-aligned; range rows stretch
   inside centered flex parents. */
@media (max-width: 780px) {
  .ph-r { text-align: left; }
  .ph-r .d { justify-content: flex-start; }
  .chart-tile .t-head { align-items: stretch; }
  .perf-right { width: 100%; align-items: stretch; }
}

/* v0.7.8 fixes round 3 — wide tables scroll inside their card instead of
   stretching the mobile layout viewport (which pushed the fixed bottom bars
   off-screen); body overflow backstop. */
@media (max-width: 780px) {
  html, body { overflow-x: hidden; }
  .tile.lots, .tile.act { overflow-x: auto; }
  .tile.lots table { min-width: 500px; }
}

/* =========================================================================
 * v0.7.9 — mobile overflow fix, holdings price/value toggle + sorting,
 * More view typography
 * ========================================================================= */

/* More view — body copy in the theme's sans, not mono */
.more-head .section-sub { font-family: var(--sans); font-size: 13.5px; letter-spacing: 0; font-weight: 500; color: var(--muted); }
.mi-sub { font-family: var(--sans); font-size: 12px; letter-spacing: 0; }

/* Sortable holdings headers (desktop) */
.holdings th[data-sort] { cursor: pointer; user-select: none; }
.holdings th[data-sort]:hover { color: var(--bright); }
.holdings th.sorted { color: var(--bright); }
.holdings th.sorted::after { content: " ▼"; font-size: 8px; color: var(--accent); }
.holdings th.sorted.asc::after { content: " ▲"; }
.hold-tools { display: none; }

@media (max-width: 780px) {
  /* Overflow fix: a chart canvas's intrinsic width could ratchet flex/grid
     tiles wider than the viewport (min-width:auto), shoving every card past
     the right edge. Clamp tiles and canvases; clip the wrap as a backstop. */
  .view .wrap { overflow-x: clip; }
  .bento .tile { min-width: 0; max-width: 100%; }
  #homeView .bento > .tile { width: 100%; box-sizing: border-box; }
  .overview-perf-canvas, .chart-canvas { max-width: 100%; min-width: 0; overflow: hidden; }
  .chart-wrap { min-width: 0; }
  .tile.worth .sub { flex-wrap: wrap; }

  /* Holdings tools row: Price/Value toggle + sort */
  .hold-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 2px 2px 10px; flex-wrap: wrap; }
  .hv-toggle { display: flex; background: var(--ink3); border-radius: 99px; padding: 3px; }
  .hv-toggle .chip { border: 0; background: none; font-family: var(--mono); font-size: 11px; padding: 5px 13px; border-radius: 99px; color: var(--muted); cursor: pointer; }
  .hv-toggle .chip.on { background: var(--bright); color: #fff; border-color: transparent; }
  .hold-sort { display: flex; gap: 6px; align-items: center; }
  #holdSortSel { font-family: var(--mono); font-size: 11px; background: var(--ink2); border: 1px solid var(--line); border-radius: 99px; padding: 6px 10px; color: var(--bright); outline: none; }
  #holdSortDir { border: 1px solid var(--line); background: var(--ink2); border-radius: 99px; padding: 5px 12px; font-size: 12px; color: var(--bright); cursor: pointer; }

  /* Value mode: right column shows market value + total P&L pill */
  .holdings.hv-value td:nth-child(3), .holdings.hv-value td:nth-child(4) { display: none; }
  .holdings.hv-value td:nth-child(6) { display: block; grid-area: p; text-align: right; font-family: var(--mono); font-size: 13.5px; }
  .holdings.hv-value td:nth-child(8) { display: block; grid-area: t; text-align: right; }
  .holdings.hv-value td:nth-child(8) .up, .holdings.hv-value td:nth-child(8) .down {
    display: inline-block; min-width: 62px; text-align: center; font-family: var(--mono);
    font-size: 11.5px; padding: 3px 8px; border-radius: 8px; color: #fff !important;
  }
  .holdings.hv-value td:nth-child(8) .up { background: var(--green); }
  .holdings.hv-value td:nth-child(8) .down { background: var(--red); }
  .holdings.hv-value td:nth-child(8) span:last-child { display: none; }
}

/* =========================================================================
 * v0.7.10 — Units column (desktop). The quantity moves out of the muted
 * asset sub-line into its own scannable column for broker reconciliation;
 * mobile keeps the sub-line and hides the column (see the ≤780px block).
 * Deliberately NOT sortable: units aren't comparable across assets.
 * ========================================================================= */
.td-units { white-space: nowrap; }
.td-units small { font-family: var(--sans); font-size: 10px; font-weight: 700; color: var(--muted); margin-left: 3px; }
.th-units, .td-units { width: 1%; }
.a-nm .s-qty { display: none; }          /* desktop: shown in the Units column instead */
@media (max-width: 780px) {
  .a-nm .s-qty { display: inline; }      /* mobile: keep it inline under the ticker */
}

/* =========================================================================
 * v0.7.11 — REAL fix for the mobile "widgets extend past the right edge" bug.
 *
 * `.shell` is a CSS grid and `main.scroll` is a grid item. Grid/flex items
 * default to `min-width: auto`, which refuses to shrink below the content's
 * max-content width — so the scroller laid itself out at 1240px (Home, the
 * .wrap max-width) or 669px (Tasks) inside a 390px track, pushing every card
 * past the screen. v0.7.9's `overflow-x: clip` only hid the resulting
 * scrollbar; the cards were still too wide and simply got cut off.
 *
 * min-width:0 lets the item shrink to its track. Applied at every viewport,
 * not just mobile — a narrow desktop window hit the same bug.
 * ========================================================================= */
.shell { min-width: 0; }
.shell > main.scroll, .shell > .topbar { min-width: 0; }
main.scroll > .view, .view > .wrap { min-width: 0; }

/* v0.7.11 — Tasks quick-add: the mono hint chip is `white-space: nowrap` and
   304px wide, which forced the flex row (and so the card) past a phone screen.
   Hide it on mobile — the placeholder already explains the syntax — and let
   the row's input shrink. */
@media (max-width: 780px) {
  .qadd { flex-wrap: wrap; padding: 6px 8px 6px 14px; }
  .qadd .hint { display: none; }
  .qadd input { min-width: 0; }
}

/* v0.7.11 — Tasks columns carry a 340px min-height so the three desktop
   columns align; on a phone they stack, so empty columns became large blank
   cards. Let them size to content. */
@media (max-width: 780px) {
  .tcol { min-height: 0; }
}

/* =========================================================================
 * v0.8.0 — Activity ledger (master view + position mount)
 * ========================================================================= */
.act-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi-a { background: var(--ink2); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; box-shadow: var(--shadow-card); min-width: 0; }
.kpi-a .l { font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.kpi-a .v { font-size: 23px; font-weight: 800; margin-top: 6px; letter-spacing: -.01em; color: var(--bright); }
.kpi-a .v.up { color: var(--green); } .kpi-a .v.dn { color: var(--red); }
.kpi-a .v small { font-size: 14px; color: var(--muted); font-weight: 700; }
.kpi-a .s { font-size: 11.5px; color: var(--muted); margin-top: 3px; font-weight: 700; }
.act-tile { grid-column: span 8; }
/* The ledger table needs ~950px. In the Activity TAB the ledger is the only tile in its grid, so a
 * 2/3-width card (span 8) clipped the table on windows under ~1500px and left the right third of
 * the row empty. Full width there, plus a scroll container as a safety net for widths between the
 * stacked mobile layout and the point where the table fits. Scoped: on the position page the same
 * .act-tile class correctly sits at span 8 beside the news tile. */
#activityView .act-tile { grid-column: span 12; }
#activityTableWrap { overflow-x: auto; }
/* Same safety net for the position page's per-holding ledger (#activityList): it sits in a span-8 tile beside the news tile,
 * and between the stacked mobile layout and ~1500px the table is wider than the tile. Scroll inside the card instead of spilling out. */
/* ROOT CAUSE of the position page ledger being clipped on tablets and phones: the responsive rule that makes tiles
 * full width (max-width: 1000px) lists .act but not .act-tile, and the later `.act-tile { span 8 }` above beat it, so the
 * ledger stayed at two thirds of the screen. Below 1000px every Activity tile is full width. */
@media (max-width: 1000px) { .act-tile, #activityView .act-tile { grid-column: span 12; } }
#activityList { overflow-x: auto; max-width: 100%; }

.act-filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.act-filters .sel { font-family: var(--mono); font-size: 11px; background: var(--ink2); border: 1px solid var(--line); border-radius: 99px; padding: 7px 11px; color: var(--bright); outline: none; }
.act-date { font-family: var(--mono) !important; font-size: 12.5px !important; white-space: nowrap; }
.act-warn { font-family: var(--sans); font-size: 10.5px; color: var(--amber, #b97f0a); font-weight: 700; margin-top: 4px; white-space: normal; }
.lot-box { padding: 4px 0 6px; }
.lot-h { font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.lot-line { display: flex; gap: 14px; align-items: center; justify-content: flex-end; padding: 7px 0; border-bottom: 1px dashed var(--line); font-family: var(--mono); font-size: 12px; color: var(--bright); flex-wrap: wrap; }
.lot-line:last-child { border-bottom: 0; }
.lot-line .d { color: var(--muted); font-size: 11px; margin-right: auto; }
.term { font-family: var(--mono); font-size: 9.5px; letter-spacing: .08em; padding: 3px 8px; border-radius: 6px; text-transform: uppercase; }
.term.long { background: #e5f3ea; color: var(--green); }
.term.short { background: #fdf3dd; color: #b97f0a; }
.term.split { background: #eef0f4; color: #5b6270; }
.term.na { color: #c9c7bf; }
.tax-disc { background: #fdf6e8; border: 1px solid #f0dfc0; border-radius: 14px; padding: 12px 14px; font-size: 12px; color: #7a5c12; font-weight: 600; margin-top: 14px; }
html[data-theme="dark"] .act-pill.buy, html[data-theme="dark"] .term.long { background: #1d3226; color: #56c288; }
html[data-theme="dark"] .act-pill.sell { background: #33211f; color: #e08585; }
html[data-theme="dark"] .term.short { background: #37301d; color: #e0b45c; }
html[data-theme="dark"] .term.split { background: #26262d; color: #a8adb8; }
html[data-theme="dark"] .lot-row td { background: #1b1b20; }
html[data-theme="dark"] .tax-disc { background: #2a2417; border-color: #443a22; color: #d8bd7e; }

/* Mobile: the ledger becomes stacked cards (a 10-column table cannot work at 390px) */
@media (max-width: 780px) {
  .act-kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-a { padding: 13px 15px; border-radius: 16px; }
  .kpi-a .v { font-size: 19px; }
  .act-filters { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; scrollbar-width: none; }
  .act-filters .chips { flex: none; }
  .act-filters .sel { flex: none; }
  /* Card layout keyed on CELL CLASSES, not nth-child: the master mount has an
     Asset column and the position mount does not, so positional rules collide. */
  .lot-line { justify-content: flex-start; font-size: 11.5px; gap: 8px; }
  .lot-line .d { margin-right: 0; width: 100%; }
}

/* v0.8.0 fix — the expanded FIFO-lot row must span the whole table on desktop
   (observed computing as display:block, collapsing it to one column width),
   and the ledger filter selects must not inherit the global `select{width:100%}`. */
.act-filters .sel { width: auto; flex: 0 0 auto; min-width: 0; }
.act-filters .chips { display: flex; gap: 6px; }
@media (max-width: 780px) {
}

/* =========================================================================
 * v0.9.2 — 1H range everywhere + per-asset change period on holdings
 * ========================================================================= */

/* Seven pills instead of six. `.ranges` is width:max-content, so on a phone the
   row would push the tile wider than the viewport (the v0.7.11 bug class).
   Let it shrink and scroll instead of overflowing. */
.ranges { max-width: 100%; }
@media (max-width: 780px) {
  .ranges { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .ranges::-webkit-scrollbar { display: none; }
  .ranges button, .ranges .range-tab { padding: 5px 9px; flex: 0 0 auto; }
}

/* Change column: dollar move + percent for the ONE period selected top-right.
   Not .up/.down — those carry a blanket green/red pill rule on this cell at
   ≤780px (v0.7.9) and the cell is now two figures, not one pill. */
.td-chg { white-space: nowrap; }
.td-chg .chg-amt { font-family: var(--mono); }
.td-chg .chg-amt.pos { color: var(--green); }
.td-chg .chg-amt.neg { color: var(--red); }
.td-chg .chg-pct { color: var(--muted); font-size: 11px; }
.td-chg .chg-wait { color: var(--muted); }
.holdings th[data-sort="day"] { white-space: nowrap; }
/* The period badge on the header: Change and Total P&L are both dollars now,
   so the window the Change figure covers has to be readable without looking up
   at the dropdown. */
.holdings th .th-per {
  font-family: var(--mono); font-size: 9px; letter-spacing: .1em; color: var(--muted);
  background: var(--ink3); border-radius: 99px; padding: 2px 6px; margin-left: 5px;
}

/* Bulk period control sits with the mobile holdings tools */
.hold-period { display: flex; align-items: center; }
#holdPeriodAll {
  width: auto; font-family: var(--mono); font-size: 11px; background: var(--ink2);
  border: 1px solid var(--line); border-radius: 99px; padding: 6px 10px;
  color: var(--bright); outline: none;
}

@media (max-width: 780px) {
  /* Column 4 sits in grid-area `t`. It stacks: coloured dollar move over the
     muted percent. A pill would have to widen for six-figure numbers and that
     squeezes long asset names onto four lines. */
  .holdings td:nth-child(4) {
    display: flex; flex-direction: column; align-items: flex-end;
    gap: 0; line-height: 1.3;
  }
  .holdings.hv-value td:nth-child(4) { display: none; }
  .td-chg .chg-amt { font-size: 13.5px; font-weight: 700; }
  .td-chg .chg-pct { font-size: 11.5px; }
}

/* Desktop keeps its clickable sort headers, but the "set every row" period
   control is worth surfacing there too — otherwise a 20-row table means 20
   individual pickers to compare the same window. */
@media (min-width: 781px) {
  .hold-tools { display: flex; justify-content: flex-end; align-items: center; margin-top: -2px; padding: 0 2px 8px; }
  .hold-tools .hv-toggle, .hold-tools .hold-sort { display: none; }
  #holdPeriodAll { font-size: 10.5px; padding: 5px 9px; }
}

/* =========================================================================
 * v0.9.4 — edit / delete a single ledger entry
 * ========================================================================= */


/* popover */

/* The filter strip shared the tile head with the "Transaction Ledger" label,
   leaving it 206px wide to hold 560px of controls — "Newest first" started
   315px off-screen, reachable only by swiping a narrow band most people would
   never think to swipe. Give it its own row AND let it wrap: 560px of controls
   does not fit one 358px line however it is sliced, so wrapping is the fix and
   the horizontal scroller has to go with it. */
@media (max-width: 780px) {
  .act-tile .t-head { flex-wrap: wrap; row-gap: 10px; }
  .act-tile .t-head .act-filters {
    flex-basis: 100%; width: 100%;
    flex-wrap: wrap; overflow-x: visible; row-gap: 8px; padding-bottom: 0;
  }
  /* Slightly tighter so the wrapped rows stay compact. */
  .act-tile .act-filters .sel { font-size: 10.5px; padding: 7px 9px; }
}

/* =========================================================================
 * v0.9.6 — failure states that are actually visible
 * ========================================================================= */
.sync-pill {
  position: fixed; right: 16px; bottom: 16px; z-index: 60;
  display: flex; align-items: center; gap: 9px; max-width: min(92vw, 440px);
  padding: 9px 12px 9px 11px; border-radius: 99px;
  background: var(--ink2); border: 1px solid var(--line2); color: var(--bright);
  box-shadow: 0 10px 30px rgba(0,0,0,.18); font-size: 12.5px; line-height: 1.3;
}
.sync-pill .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; background: var(--muted); }
.sync-pill.warn .dot { background: #e0a53a; }
.sync-pill.bad  .dot { background: var(--red); }
.sync-pill .retry {
  border: 1px solid var(--line2); background: none; color: var(--bright); border-radius: 99px;
  padding: 4px 10px; font: inherit; font-size: 11.5px; cursor: pointer; margin-left: 2px;
}
@media (max-width: 780px) { .sync-pill { left: 12px; right: 12px; bottom: calc(74px + env(safe-area-inset-bottom)); max-width: none; } }

.boot-error {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px;
  background: rgba(25,25,24,.55); backdrop-filter: blur(4px);
}
.boot-error-card {
  width: min(480px, 100%); background: var(--ink2); border: 1px solid var(--line2); border-radius: 18px; padding: 26px 26px 22px;
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
}
.boot-error-card .be-eyebrow { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.boot-error-card h2 { margin: 8px 0 8px; font-size: 22px; }
.boot-error-card p { margin: 0 0 18px; color: var(--muted); line-height: 1.5; }
.be-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* =========================================================================
 * v0.9.7 — first run: one card, one button; empty chrome hidden until there
 * is something to show. Zero reads neutral.
 * ========================================================================= */
.badge2.flat { color: var(--muted); background: var(--ink3); }
.ph-r .d.flat, .d.flat { color: var(--muted); }

.first-run-card { grid-column: 1 / -1; padding: 30px 30px 26px; }
.first-run-card .fr-eyebrow { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.first-run-card h2 { margin: 8px 0 8px; font-size: 28px; letter-spacing: -.01em; }
.first-run-card > p { margin: 0 0 18px; max-width: 62ch; color: var(--muted); font-size: 15px; line-height: 1.55; }
.fr-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 22px; }
.fr-actions .btn.pri { padding: 12px 20px; font-size: 15px; }
.fr-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; border-top: 1px solid var(--line); padding-top: 18px; }
.fr-steps > div { display: flex; gap: 10px; align-items: flex-start; }
.fr-steps .n { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; background: var(--bright); color: var(--ink2); font-family: var(--mono); font-size: 11px; display: grid; place-items: center; margin-top: 1px; }
.fr-steps b { display: block; font-size: 13.5px; margin-bottom: 2px; }
.fr-steps span:not(.n) { font-size: 12.5px; color: var(--muted); line-height: 1.45; }

/* Home: hide everything that is empty by definition on a fresh account */
#homeView.first-run .tile.worth, #homeView.first-run .tile.alloc, #homeView.first-run .tile.movers,
#homeView.first-run .tile.taskt, #homeView.first-run .tile.fgt, #homeView.first-run .tile.newst,
#homeView.first-run .tile.streak { display: none; }
/* Portfolio */
#portfolioView.first-run .tile.perf, #portfolioView.first-run .tile.alloc2, #portfolioView.first-run .tile.holdings,
#portfolioView.first-run .tile.income, #portfolioView.first-run .tile.rebal, #portfolioView.first-run #portInsight { display: none; }
/* Position: no chart toolbar, no lots/ledger/tax/news for a symbol that does not exist */
#positionView.first-run .tile.chart-tile, #positionView.first-run .pos-kpis, #positionView.first-run .pos-cols, #positionView.first-run .tile.lots,
#positionView.first-run .tile.act, #positionView.first-run .tile.taxt, #positionView.first-run .tile.newsline,
#positionView.first-run .ph-cta, #positionView.first-run #positionEditBtn { display: none; }

@media (max-width: 780px) {
  .first-run-card { padding: 22px 18px 20px; }
  .first-run-card h2 { font-size: 24px; }
  .fr-actions .btn { width: 100%; justify-content: center; }
  .fr-steps { grid-template-columns: 1fr; }
}

/* =========================================================================
 * v0.9.8 — trust fixes
 * ========================================================================= */
/* Position page: v0.9.8 paired the lots tile with the tax tile on one row
   (span 8 + span 4) because Activity had gone full-width and left six empty
   columns beside lots.
   REMOVED in v0.9.16. The dead space is now solved differently - Activity is
   span 8 with Intel as a span-4 sidebar - and lots and the sell estimator each
   own a full row. The canonical declarations are with the other tile spans
   (search "grid-column: span" near .lots / .taxt above); these duplicates sat
   1000 lines further down and silently won the cascade. */

/* Mobile lots table: 539 px on a 390 px screen, Gain and Term clipped with no
   scroll affordance. Drop Value (it is qty × price, shown above the table) and
   let the remaining five columns fit. */
@media (max-width: 780px) {
  .tile.lots table { min-width: 0; width: 100%; }
  .lots .lot-val { display: none; }
  .lots th, .lots td { padding: 9px 6px; font-size: 11.5px; }
  .lots td:first-child { font-size: 11.5px; white-space: nowrap; }
}

/* v0.9.9 — build version at the foot of the avatar menu */
.user-menu-version {
  margin-top: 4px; padding: 8px 12px 4px; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; color: var(--muted); user-select: all;
}
.user-menu-version.mismatch { color: var(--red); }


/* ===========================================================================
   v0.9.12 - Home hero sub-row, and the tappable contribution marker.
   =========================================================================== */

/* Two tiers, not four facts in one grey run-on. The badge is what people came
   for, so it gets a line to itself; everything lifetime drops a size and a
   shade below it. */
#homeSubRow { flex-direction: column; align-items: flex-start; gap: 4px; }
#homeSubRow .sub-primary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#homeSubRow .sub-word { font-size: 12.5px; color: var(--muted); font-weight: 600; }
#homeSubRow .sub-secondary { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
#homeSubRow .sub-secondary .vs { font-size: 11.5px; opacity: .82; }

/* Separators are generated, never typed. The old line concatenated its parts
   by hand and shipped "past month+$17,637" when one of them forgot its " · ". */
#homeSubRow .sub-secondary .vs + .vs::before { content: "\00b7"; margin-right: 6px; opacity: .55; }

/* Contribution marker popover. Dark in both themes, like the chart tooltip it
   sits beside - it is an overlay on the chart, not part of the page surface. */
.ov-marker-pop {
  position: absolute;
  transform: translate(-50%, -118%);
  z-index: 12;
  padding: 8px 10px;
  background: rgba(17, 17, 20, .94);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 10px;
  color: #f5f5f2;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .04em;
  line-height: 1.45;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .28);
}
.ov-marker-pop-date { color: #8f8d85; }
.ov-marker-pop-amt { font-weight: 700; margin-top: 1px; }
.ov-marker-pop-amt.up { color: #4ade80; }
.ov-marker-pop-amt.dn { color: #f87171; }
.ov-marker-pop-note { color: #8f8d85; margin-top: 3px; font-size: 10px; letter-spacing: .02em; }

/* ---- Home chart, hero v2 (chart-hero-ui.js): scrub card, high/low, worst dip, events rail, highlights ---- */
/* the scrub card and the rail popover are glass: they sit on the chart and show it through */
.overview-perf-tooltip, .ov-rail-pop {
  background: rgba(255, 255, 255, .84);
  -webkit-backdrop-filter: blur(12px) saturate(1.2); backdrop-filter: blur(12px) saturate(1.2);
  border: 1px solid rgba(25, 25, 24, .08);
  border-radius: 14px;
  color: var(--bright);
  box-shadow: 0 10px 30px -10px rgba(25, 25, 24, .28);
}
html[data-theme="dark"] .overview-perf-tooltip, html[data-theme="dark"] .ov-rail-pop {
  background: rgba(30, 30, 28, .78); border-color: rgba(255, 255, 255, .10); color: #f5f5f2; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .6);
}
.ovt-date { color: var(--muted); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; }
.ovt-chg { margin-top: 3px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ovt-chg small { font-size: 10.5px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.ovt-chg.up { color: var(--green); } .ovt-chg.dn { color: var(--red); }
.ovt-ev { display: flex; align-items: center; gap: 7px; margin-top: 4px; font-size: 11.5px; line-height: 1.3; }
.ovt-ev i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.ovt-ev.in i { background: var(--green); } .ovt-ev.out i { background: var(--red); } .ovt-ev.alert i { background: #b97f0a; }
html[data-theme="dark"] .ovt-ev.alert i { background: #e8b64a; }
.ovt-ev.more { color: var(--muted); } .ovt-ev.more i { display: none; }
.ovt-vs { margin-top: 2px; font-size: 11.5px; font-variant-numeric: tabular-nums; } .ovt-vs.up { color: var(--green); } .ovt-vs.dn { color: var(--red); }
.ovt-ev.div i { background: #2a78d6; border-radius: 2px; } html[data-theme="dark"] .ovt-ev.div i { background: #5aa0f0; }
.ovt-note { margin-top: 5px; font-size: 10px; letter-spacing: .02em; color: var(--muted); }

.ov-layer { position: absolute; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
.ov-hl {
  position: absolute; z-index: 2; padding: 3px 7px; border-radius: 7px; white-space: nowrap;
  font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .02em; font-variant-numeric: tabular-nums;
  background: var(--ink2); border: 1px solid var(--line2); box-shadow: 0 2px 8px rgba(25, 25, 24, .10);
  animation: ov-pop .4s cubic-bezier(.2, .8, .2, 1) .35s both;
}
.ov-hl.hi { color: var(--green); } .ov-hl.lo { color: var(--red); }
.ov-dip {
  position: absolute; border-radius: 8px;
  background: color-mix(in srgb, var(--red) 8%, transparent);
  border-left: 1px dashed color-mix(in srgb, var(--red) 45%, transparent);
  border-right: 1px dashed color-mix(in srgb, var(--red) 45%, transparent);
  animation: ov-fade .6s ease-out .3s both;
}
.ov-dip-tag {
  position: absolute; top: 4px; left: 6px; padding: 2px 6px; border-radius: 6px; white-space: nowrap;
  font-family: var(--mono); font-size: 10.5px; font-weight: 700; color: var(--red);
  background: color-mix(in srgb, var(--ink2) 85%, transparent);
}
.ov-dip-tag.flip { left: auto; right: calc(100% + 4px); }
.ov-dip-tag.flip-r { left: calc(100% + 4px); }
@keyframes ov-pop { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: scale(1); } }
@keyframes ov-fade { from { opacity: 0; } to { opacity: 1; } }

.ov-rail { position: relative; height: 24px; margin-top: 2px; }
.ov-rail::before { content: ""; position: absolute; left: 0; right: 0; top: 12px; height: 1px; background: var(--line); }
.ov-rail-dot { position: absolute; top: 4px; width: 16px; height: 16px; margin-left: -8px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.ov-rail-dot::before {
  content: ""; position: absolute; left: 4px; top: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 2px var(--ink2); transition: transform .18s cubic-bezier(.2, .8, .2, 1), box-shadow .18s;
  animation: ov-pop .4s cubic-bezier(.2, .8, .2, 1) .35s both;
}
.ov-rail-dot.out::before { background: var(--red); }
.ov-rail-dot.alert::before { background: #b97f0a; }
.ov-rail-dot.div::before { background: #2a78d6; border-radius: 2px; transform: rotate(45deg) scale(.85); }
html[data-theme="dark"] .ov-rail-dot.div::before { background: #5aa0f0; }
html[data-theme="dark"] .ov-rail-dot.alert::before { background: #e8b64a; }
.ov-rail-dot:hover::before, .ov-rail-dot.open::before, .ov-rail-dot.scrub::before { transform: scale(1.5); box-shadow: 0 0 0 2px var(--ink2), 0 0 0 4px rgba(25, 25, 24, .14); }
.ov-rail-dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ov-rail-pop { position: absolute; bottom: calc(100% + 4px); z-index: 20; min-width: 150px; padding: 9px 11px; font-family: var(--mono); font-size: 11px; letter-spacing: .02em; line-height: 1.4; white-space: nowrap; pointer-events: none; }

.perf-ov { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
.perf-ov .ov-hl, .perf-ov .ov-dip { position: absolute; }
.perf-ev { position: absolute; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 50%; background: var(--green); border: 2px solid var(--ink2); box-sizing: border-box; pointer-events: auto; cursor: default; animation: ov-pop .4s cubic-bezier(.2, .8, .2, 1) .35s both; }
.perf-ev.out { background: var(--red); } .perf-ev.alert { background: #b97f0a; } .perf-ev.div { background: #2a78d6; border-radius: 3px; }
html[data-theme="dark"] .perf-ev.alert { background: #e8b64a; } html[data-theme="dark"] .perf-ev.div { background: #5aa0f0; }
.perf-extras { margin-top: 4px; }
/* Levels (the draggable alert line), Pro (volume, averages, position size) and zoom, on the asset chart (chart-extras-ui.js) */
.lv-layer { position: absolute; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
.lv-line { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid #b97f0a; opacity: .8; transform: translateY(-1px); }
html[data-theme="dark"] .lv-line { border-top-color: #e8b64a; }
.lv-tag {
  position: absolute; right: 8px; transform: translateY(-50%); pointer-events: auto; cursor: ns-resize; touch-action: none;
  padding: 3px 9px; border-radius: 8px; border: 1.5px solid #b97f0a; background: #fbf3de; color: #8a640a;
  font-family: var(--mono); font-size: 11.5px; font-weight: 700; white-space: nowrap; box-shadow: 0 2px 8px rgba(25, 25, 24, .14);
}
html[data-theme="dark"] .lv-tag { background: #2e2a1d; color: #e8b64a; border-color: #e8b64a; }
.lv-tag:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lv-ring { position: absolute; width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; border-radius: 50%; border: 2.5px solid #b97f0a; background: var(--ink2); box-sizing: border-box; animation: ov-pop .3s cubic-bezier(.2, .8, .2, 1) both; }
html[data-theme="dark"] .lv-ring { border-color: #e8b64a; }
.lv-card { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 12px; padding: 14px 16px; border: 1px solid #ecd9a8; border-radius: 16px; background: color-mix(in srgb, #b97f0a 7%, var(--ink2)); }
.lv-price { font-family: var(--mono); font-size: 22px; font-weight: 500; color: var(--bright); letter-spacing: -.02em; }
.lv-price small { margin-left: 10px; font-size: 12.5px; font-weight: 700; } .lv-price small.up { color: var(--green); } .lv-price small.dn { color: var(--red); }
.lv-say { margin-top: 4px; font-size: 13.5px; font-weight: 700; color: var(--bright); }
.lv-sub, .lv-fired { margin-top: 4px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.lv-sub b { color: var(--bright); } .lv-sub b.up { color: var(--green); } .lv-sub b.dn { color: var(--red); }
.lv-fired { color: #8a640a; font-weight: 600; } html[data-theme="dark"] .lv-fired { color: #e8b64a; }
.lv-acts { display: flex; gap: 8px; flex: none; }
.ovt-ohlc { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 4px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ovt-ohlc .up { color: var(--green); } .ovt-ohlc .dn { color: var(--red); }
.nav-strip { position: relative; height: 34px; margin: 4px 32px 6px; border-radius: 10px; background: var(--ink3); overflow: hidden; touch-action: none; cursor: pointer; user-select: none; }
.nav-spark { position: absolute; inset: 2px 0; width: 100%; height: calc(100% - 4px); }
.nav-spark path { fill: none; stroke: var(--muted); stroke-width: 1.4; vector-effect: non-scaling-stroke; opacity: .8; }
.nav-win { position: absolute; top: 0; bottom: 0; border: 1.5px solid var(--accent); border-radius: 8px; background: color-mix(in srgb, var(--accent) 12%, transparent); cursor: grab; }
.nav-strip.is-full .nav-win { background: transparent; border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.nav-h { position: absolute; top: 0; bottom: 0; width: 14px; cursor: ew-resize; }
.nav-h.l { left: -3px; } .nav-h.r { right: -3px; }
.nav-h::after { content: ""; position: absolute; top: 9px; bottom: 9px; left: 5px; width: 3px; border-radius: 2px; background: var(--accent); }
@media (max-width: 780px) { .nav-strip { margin: 4px 12px 6px; } .lv-card { padding: 12px; } .lv-acts { width: 100%; } .lv-acts .btn { flex: 1; } }
.ov-gap { position: absolute; inset: 0; pointer-events: none; }
.ov-compare { margin: 8px 0 0; display: flex; flex-direction: column; gap: 4px; }
.ovc-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.ovc-row i { flex: none; width: 14px; height: 0; border-top: 2.5px solid; }
.ovc-row b.up { color: var(--green); } .ovc-row b.dn { color: var(--red); }
.replay-chip { margin-left: auto; }
.ov-extras { margin-top: 2px; }
.pos-rail { margin: 0 32px; } .pos-extras { margin: 0 32px 14px; }
@media (max-width: 780px) { .pos-rail { margin: 0 12px; } .pos-extras { margin: 0 12px 14px; } }
.ov-show { margin-top: 12px; flex-wrap: wrap; }
.ov-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.ovs-cell { min-width: 0; }
.ovs-cell span { display: block; font-size: 11px; font-weight: 700; color: var(--muted); }
.ovs-cell b { display: block; margin-top: 2px; font-size: 14px; font-weight: 800; color: var(--bright); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ovs-cell b.up { color: var(--green); } .ovs-cell b.dn { color: var(--red); }
.ovs-cell em { display: block; margin-top: 1px; font-style: normal; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) { .ov-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; } }
@media (max-width: 780px) { .tile.worth .ov-extras { order: 7; } }
@media (prefers-reduced-motion: reduce) { .ov-hl, .ov-dip, .ov-rail-dot::before { animation: none; } }


/* ===========================================================================
   v0.9.13 - refresh control, freshness readout, and the toast the app never had.
   =========================================================================== */

/* --- the control, identical on Home and Portfolio ------------------------ */
.head-tools { display: inline-flex; align-items: center; gap: 9px; margin-left: auto; }
.perf-top .t-label { display: flex; align-items: center; gap: 9px; }
.perf-top .t-label > span:first-child { flex: none; }

.btn.rf { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; font-size: 12px; line-height: 1; }
.btn.rf .rf-ico { display: inline-block; font-size: 13px; line-height: 1; }
.btn.rf[disabled] { cursor: default; opacity: .72; }
.btn.rf.working .rf-ico { animation: rf-spin .75s linear infinite; }
@keyframes rf-spin { to { transform: rotate(360deg); } }
.btn.rf.done { border-color: var(--green); color: var(--green); }
.btn.rf.fail { border-color: var(--red); color: var(--red); }
/* Motion is decoration here - the disabled state and the label already carry
   the meaning, so honour the OS setting and drop the spin. */
@media (prefers-reduced-motion: reduce) {
  .btn.rf.working .rf-ico { animation: none; }
}

/* --- freshness ----------------------------------------------------------- */
.freshness { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono);
  font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
.freshness-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex: none; }
.freshness.live .freshness-dot { animation: fresh-pulse 2.4s ease-in-out infinite; }
.freshness.aging { color: var(--amber-ink); } .freshness.aging .freshness-dot { background: var(--amber-dot); }
.freshness.stale { color: var(--red); }  .freshness.stale .freshness-dot { background: var(--red); }
.freshness.closed, .freshness.idle { color: var(--muted); }
.freshness.closed .freshness-dot, .freshness.idle .freshness-dot { background: var(--muted); }
@keyframes fresh-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .freshness.live .freshness-dot { animation: none; } }

/* On a narrow screen the label is the first thing to go: the coloured dot
   still carries the state, and the button needs the room more than the words
   "Updated 12m ago" do. The full text stays in the title attribute. */
@media (max-width: 560px) {
  .freshness { gap: 0; }
  .freshness > span:last-child { display: none; }
  .btn.rf .rf-label { display: none; }
  .btn.rf { padding: 7px 9px; }
}

/* --- toast --------------------------------------------------------------- */
.toast-host {
  position: fixed; z-index: 200; display: flex; flex-direction: column; gap: 8px;
  right: 18px; bottom: 18px; max-width: min(400px, calc(100vw - 36px));
  pointer-events: none;
}
/* Mobile: full width along the bottom, and lifted clear of the tab bar and the
   iOS home indicator. env() is a no-op where it is not supported. */
@media (max-width: 700px) {
  .toast-host {
    right: 12px; left: 12px; max-width: none;
    bottom: calc(74px + env(safe-area-inset-bottom, 0px));
  }
}
.toast {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 13px; border-radius: 12px;
  background: var(--ink2); border: 1px solid var(--line2);
  color: var(--text); font-size: 12.5px; line-height: 1.45;
  box-shadow: var(--shadow-card), 0 10px 30px rgba(0, 0, 0, .16);
  opacity: 0; transform: translateY(8px); transition: opacity .22s ease, transform .22s ease;
}
.toast.in { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; transform: none; } }
.toast-ic { flex: none; font-size: 13px; line-height: 1.35; font-weight: 700; }
.toast b { font-weight: 700; }
.toast-sub { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.toast.good { border-color: var(--green); } .toast.good .toast-ic { color: var(--green); }
.toast.warn { border-color: var(--amber-dot); } .toast.warn .toast-ic { color: var(--amber-ink); }
.toast.bad  { border-color: var(--red); }   .toast.bad  .toast-ic { color: var(--red); }


/* ===========================================================================
   v0.9.13.2 - stop the Portfolio header reflowing when the chart is hovered.
   ===========================================================================
   .perf-top is a wrapping flex row. Its left column had no flex basis and no
   min-width, so its width was whatever its widest child happened to be - and
   that child is #perfSub, whose text CHANGES on hover. With "vs SPY" on, the
   resting row carries a ~55-character benchmark note; scrubbing replaced it
   with a date. The column narrowed, .perf-right stopped needing to wrap, and
   the range tabs jumped from under the value up to the top-right - taking the
   header height, and therefore the chart's vertical position, with them. At the
   chart's top edge that becomes a mouseenter/mouseleave oscillation.

   bento.js now keeps the row's content stable (perfSubHtml). This is the second
   half: make the wrap decision independent of content width altogether, so the
   bug cannot return through some future edit to the sub-row text.

   - left column: flex 1 1 0 + min-width 0  -> takes the leftover space and is
     allowed to shrink, rather than dictating the row's width. min-width:0 is
     the load-bearing part; without it a flex item refuses to shrink below its
     content and wraps instead.
   - right column: flex none -> always its natural width, never pushed down by
     whatever the left column is currently saying.                             */
.perf-top > :first-child { flex: 1 1 0; min-width: 0; }
.perf-top .perf-right { flex: 0 0 auto; }

/* The sub-row must also not change HEIGHT between resting and scrubbing, or the
   chart still moves - just vertically instead of horizontally. Reserving one
   line does that without pinning a pixel height to a particular font. */
#perfSub { min-height: 1.65em; }

/* v0.9.13.3 - the last 17 pixels.
   ---------------------------------------------------------------------------
   Measured on the deployed 0.9.13.2 build, sweeping the .tile.perf width from
   1400px down to 320px: heights matched at every width EXCEPT 560px and 400px,
   where the row was one line taller at rest than while scrubbing.

   Cause: the two states carry the same benchmark note now, but the BADGE text
   still differs in length - "▲ +$10,470 (6.94%) past 3 months" against
   "▼ −$17,048 (11.45%) JUN 7". At narrow widths the longer one wrapped inside
   the badge and the shorter one did not, so the row gained a line on
   mouse-leave and the chart moved under the cursor again. Smaller than the
   original jump, and invisible on a wide desktop, which is exactly why it
   needed measuring rather than eyeballing.

   nowrap makes the badge exactly one line whatever it says. Verified over the
   same sweep afterwards: every width matches, and the badge's scrollWidth never
   exceeds its clientWidth - zero overflow even at 320px, the narrowest phone. */
.badge2 { white-space: nowrap; }
#homeSubRow .sub-secondary { min-height: 1.45em; }

/* The Portfolio hero now uses heroNumberHtml() like Home, so it emits a <small>
   for the cents. Only `.worth .val small` was styled, so without this the cents
   would render at the full 36px instead of small and muted - the numbers would
   match while looking different, which is half the problem. */
.perf .val small { font-size: 19px; color: var(--muted); font-weight: 700; }

/* Proportional digits are not the same width, so a value ticking from $111,111
   to $888,888 physically resizes the hero while you scrub - which nudges
   everything laid out beside it. .val is Manrope, not the mono face, so this is
   real. tabular-nums makes every digit one width and the jitter disappears. */
.worth .val, .perf .val, .ph-r .p, .ph-r .d, .badge2, .freshness, #perfSub .vs {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* Same class of bug as .perf-top, in the position header: .ph-rg wraps, and
   #positionPrice drives .ph-r's width while the scrub rewrites it. Pinning the
   CTA group's basis stops a digit-count change from wrapping the buttons. */
.ph-rg .ph-cta { flex: 0 0 auto; }
.ph-rg .ph-r { flex: 0 1 auto; }

@media (max-width: 780px) {
  /* 780px, matching the existing rule that flips .perf-top to a column. Once it
     stacks, the left column must stop claiming leftover space on a zero basis or
     the stacked layout can collapse to nothing. */
  .perf-top > :first-child { flex: 1 1 auto; }
}


/* ===========================================================================
   v0.9.16 - asset view: Activity + Intel side by side, live sell estimator,
   compact intel list. Spans above are desktop-only; the existing
   @media (max-width:1000px) rule already collapses all of these to span 12,
   so the mobile stack needs no new span rules - only the component styles
   below, which are written fluid rather than fixed-width.
   =========================================================================== */

/* ---- Intel, compact list (replaces the horizontal .nl-row card scroller) -- */
.nl-list { display: flex; flex-direction: column; margin-top: 6px; }
.nl-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 9px 2px; border-bottom: 1px solid var(--line);
  cursor: pointer; text-decoration: none;
}
.nl-item:last-child { border-bottom: 0; }
.nl-item:hover .nl-t { color: var(--accent); }
/* Sentiment rail. classify_sentiment() has always returned this and the
   position view threw it away - it costs one element to show. */
.nl-s { width: 3px; align-self: stretch; border-radius: 2px; background: var(--line2); flex: none; }
.nl-s.pos { background: var(--green); }
.nl-s.neg { background: var(--red); }
.nl-t {
  flex: 1; min-width: 0; font-size: 12.5px; font-weight: 600; line-height: 1.35; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.nl-a { font-family: var(--mono); font-size: 10px; font-weight: 600; color: var(--muted); white-space: nowrap; padding-top: 2px; }

/* ---- Live sell estimator -------------------------------------------------- */
.sell-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sell-qty { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--muted); }
.taxt .est { font-size: 26px; font-weight: 800; margin: 6px 0 2px; color: var(--bright); font-variant-numeric: tabular-nums; }
.taxt .es { font-size: 12.5px; color: var(--muted); font-weight: 600; }

.sell-range {
  -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 3px;
  background: var(--line2); outline: none; margin: 16px 0 4px; cursor: pointer;
}
.sell-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--bright); border: 3px solid var(--ink2); box-shadow: 0 0 0 1px var(--line2); cursor: pointer;
}
.sell-range::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%; background: var(--bright);
  border: 3px solid var(--ink2); box-shadow: 0 0 0 1px var(--line2); cursor: pointer;
}
.sell-range:focus-visible { box-shadow: 0 0 0 3px rgba(57,135,229,.35); }

.sell-presets { display: flex; gap: 7px; flex-wrap: wrap; margin: 10px 0 2px; }
.sell-presets .chip { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .04em; }

.sell-lots-label { font-family: var(--mono); font-size: 9.5px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); margin-top: 16px; }
.sell-strip { display: flex; gap: 3px; height: 26px; margin: 7px 0 6px; border-radius: 7px; overflow: hidden; }
/* v0.9.17 - proportional, but with a floor.
   A real position had 267 of 337 units in one lot, so pure `flex: qty` gave that
   lot ~80% of the strip and squeezed five others into unreadable slivers - which
   defeats the point, since the strip exists to show WHICH lots a sale consumes.
   A min-width keeps every lot legible while the flex basis still communicates
   relative size. It does compress the largest lot slightly; that is the trade,
   and it is the right way round - the big lot is still obviously the big one. */
.sell-seg { position: relative; background: var(--ink3); border: 1px solid var(--line2); border-radius: 5px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  min-width: 46px; }
.sell-seg .fill { position: absolute; inset: 0 auto 0 0; background: var(--lot-fill); border-right: 1px solid var(--lot-edge); }
.sell-seg span { position: relative; z-index: 1; font-family: var(--mono); font-size: 9.5px; font-weight: 700;
  color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
.sell-lotnote { font-size: 11.5px; color: var(--muted); font-weight: 600; }

.sell-cells { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 14px; }
@media (min-width: 620px) { .sell-cells { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.sell-cell { background: var(--ink3); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.sell-cell .k { font-family: var(--mono); font-size: 9.5px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); }
.sell-cell .v { font-family: var(--mono); font-size: 16px; font-weight: 800; color: var(--bright);
  margin-top: 5px; font-variant-numeric: tabular-nums; }
.sell-cell .v.up { color: var(--green); } .sell-cell .v.dn { color: var(--red); }

.sell-settings { margin-top: 12px; font-size: 12px; color: var(--muted); }
.sell-settings summary { cursor: pointer; color: var(--accent); font-weight: 700; font-size: 12px; }
.sell-settings input { width: 68px; background: var(--ink3); border: 1px solid var(--line2); color: var(--text);
  border-radius: 8px; padding: 6px 8px; font-family: var(--mono); font-size: 12px; font-weight: 600; margin: 0 4px; }
.sell-disc { font-size: 11px; color: var(--muted); margin-top: 12px; line-height: 1.5; opacity: .85; }

/* Touch targets on a phone: the thumb and the presets both grow. */
@media (max-width: 700px) {
  .sell-range { height: 6px; margin: 18px 0 6px; }
  .sell-range::-webkit-slider-thumb { width: 26px; height: 26px; }
  .sell-range::-moz-range-thumb { width: 26px; height: 26px; }
  .sell-presets .chip { padding: 9px 13px; font-size: 12px; }
  .sell-strip { height: 30px; }
}

/* =========================================================================
 * Feature switches (lib/features.js). Elements tagged data-feature="x" are hidden while
 * that feature is off; <html> carries a .no-x class. Presentation only - no data is removed.
 * ========================================================================= */
html.no-tasks [data-feature="tasks"],
html.no-history [data-feature="history"] { display: none !important; }

/* Rebalance the 12-column Home grid when tiles disappear, so no row is left half empty:
 * without the Tasks tile, Allocation + Fear & greed share a row (6 + 6); without the Snapshot
 * streak tile, the Intel tile takes the full width. */
html.no-tasks #homeView .alloc,
html.no-tasks #homeView .watch,
html.no-tasks #homeView .upcoming,
html.no-tasks #homeView .fgt { grid-column: span 6; }
html.no-history #homeView .newst { grid-column: span 12; }

/* =========================================================================
 * Theme toggle (header). One control, two inline icons: the moon is shown in light mode
 * ("go dark") and the sun in dark mode ("go light"). Switching is pure CSS on <html data-theme>.
 * ========================================================================= */
.theme-toggle { width: 36px; height: 36px; flex: 0 0 36px; display: inline-grid; place-items: center; padding: 0; border-radius: 50%; background: var(--ink2); border: 1px solid var(--line); color: var(--muted); box-shadow: var(--shadow-card); cursor: pointer; transition: color .15s, border-color .15s, transform .15s; }
.theme-toggle:hover { color: var(--accent); border-color: var(--line2); }
.theme-toggle:active { transform: scale(.94); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle .i-sun { display: none; }
html[data-theme="dark"] .theme-toggle .i-sun { display: block; }
html[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (max-width: 780px) {
  .theme-toggle { width: 34px; height: 34px; flex-basis: 34px; }
}
@media (prefers-reduced-motion: reduce) { .theme-toggle { transition: none; } }

/* =========================================================================
 * Live prices (live.js). The hero numbers tint briefly when a price moves, and the freshness pill
 * reads "Live" while quotes are streaming in.
 * ========================================================================= */
#homeValue[data-flash="up"], #positionPrice[data-flash="up"] { animation: num-flash-up .9s ease-out; }
#homeValue[data-flash="down"], #positionPrice[data-flash="down"] { animation: num-flash-down .9s ease-out; }
@keyframes num-flash-up { 0% { color: var(--green); } 100% { color: inherit; } }
@keyframes num-flash-down { 0% { color: var(--red); } 100% { color: inherit; } }
.freshness.live.streaming { color: var(--green); font-weight: 700; }
.freshness.live.streaming .freshness-dot { animation: live-dot-ping 1.6s ease-out infinite; }
@keyframes live-dot-ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 55%, transparent); } 100% { box-shadow: 0 0 0 7px transparent; } }
@media (prefers-reduced-motion: reduce) {
  #homeValue[data-flash], #positionPrice[data-flash] { animation: none; }
  .freshness.live.streaming .freshness-dot { animation: none; }
}

/* The Live tag beside "NET WORTH": auto right-margin keeps it next to the label while the header
 * tools stay pushed to the far right. [hidden] is restated because .freshness sets display. */
.live-tag { margin: 0 auto 0 10px; }
.live-tag[hidden] { display: none; }

/* =========================================================================
 * Live search dropdown (search-ui.js) and asset preview page (asset-preview.js)
 * ========================================================================= */
.search-box { position: relative; display: flex; align-items: center; gap: 8px; width: 250px; background: var(--ink2); border: 1px solid var(--line); border-radius: 99px; padding: 0 12px; height: 36px; box-shadow: var(--shadow-card); transition: width .2s ease, border-color .15s, box-shadow .15s; }
.search-box.open, .search-box:focus-within { width: 340px; border-color: var(--bright); }
.sb-ic { flex: none; color: var(--muted); }
.search-box .sb-input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; box-shadow: none; border-radius: 0; padding: 0; height: 100%; font: inherit; font-size: 13px; color: var(--bright); }
.search-box .sb-input::placeholder { color: var(--muted); }
.sb-clear { flex: none; border: 0; background: var(--ink3); color: var(--sub); width: 18px; height: 18px; border-radius: 50%; line-height: 16px; font-size: 14px; padding: 0; cursor: pointer; }
.sb-clear:hover { color: var(--bright); }
.search-box.open .sb-kbd { display: none; }
.search-drop { position: absolute; top: calc(100% + 8px); right: 0; width: max(100%, 420px); max-height: min(70vh, 560px); overflow-y: auto; overscroll-behavior: contain; background: var(--ink2); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 18px 50px rgba(0,0,0,.18); padding: 6px; z-index: 60; animation: sr-in .12s ease-out; }
@keyframes sr-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.sr-title { display: flex; align-items: center; gap: 8px; padding: 10px 12px 4px; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sr-title > span:first-child { flex: 1; }
.sr-clear { border: 0; background: none; color: var(--sub); font: inherit; font-size: 11px; font-weight: 700; text-transform: none; letter-spacing: 0; cursor: pointer; text-decoration: underline; padding: 0; }
.sr-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 12px; cursor: pointer; min-width: 0; }
.sr-row[aria-selected="true"] { background: var(--ink3); }
.sr-ic { position: relative; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--ink3); color: var(--sub); display: grid; place-items: center; font-size: 11px; font-weight: 800; overflow: hidden; }
.sr-ic .a-logo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }
.sr-glyph { font-size: 14px; }
.sr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sr-sym { font-weight: 800; font-size: 13.5px; color: var(--bright); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-name { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-row mark { background: none; color: inherit; font-weight: 900; text-decoration: underline; text-decoration-color: var(--green); text-underline-offset: 3px; }
.sr-tag { flex: none; font-size: 11px; color: var(--muted); text-align: right; max-width: 130px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-held { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 99px; background: var(--ink3); color: var(--sub); font-weight: 700; font-size: 10px; }
.sr-q { flex: none; display: flex; flex-direction: column; align-items: flex-end; min-width: 0; font-size: 12px; font-variant-numeric: tabular-nums; }
.sr-q:empty { display: none; }
.sr-px { font-weight: 700; color: var(--bright); }
.sr-ch { font-size: 11px; font-weight: 700; color: var(--muted); }
.sr-ch.up, .pv-change.up { color: var(--green); }
.sr-ch.dn, .pv-change.dn { color: var(--red); }
.sr-note { padding: 14px 12px; font-size: 12.5px; color: var(--muted); }
.sr-err { color: var(--red); }
.sr-skel-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; }
.sr-skel-row i { width: 32px; height: 32px; border-radius: 50%; background: var(--ink3); }
.sr-skel-row b { flex: 1; height: 12px; border-radius: 6px; background: var(--ink3); }
.sr-skel-row i, .sr-skel-row b { animation: sr-pulse 1.2s ease-in-out infinite; }
@keyframes sr-pulse { 50% { opacity: .45; } }
.sr-spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--sub); animation: sr-rot .7s linear infinite; display: inline-block; }
@keyframes sr-rot { to { transform: rotate(360deg); } }

/* preview page */
.pv-head { display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; padding: 2px 0 18px; }
.pv-id { flex: 1; min-width: 200px; }
.pv-id h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--bright); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pv-id p { font-size: 14px; color: var(--muted); margin-top: 3px; font-weight: 500; }
.pv-id .pv-tag { font-size: 12px; }
.pv-held { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--ink3); color: var(--sub); letter-spacing: 0; }
.pv-px { text-align: right; }
.pv-price { font-size: 34px; font-weight: 800; letter-spacing: -.02em; color: var(--bright); font-variant-numeric: tabular-nums; }
.pv-price small { font-size: .6em; opacity: .6; }
.pv-change { font-size: 13.5px; font-weight: 700; color: var(--muted); min-height: 1.3em; font-variant-numeric: tabular-nums; }
.btn.ghost { border: 1px solid var(--line); background: var(--ink2); color: var(--bright); font-weight: 800; font-size: 13px; border-radius: 99px; padding: 10px 18px; cursor: pointer; font-family: var(--sans); }
.pv-chart-tile { margin-bottom: 16px; }
.pv-ranges { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.pv-ranges button { border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 6px 12px; border-radius: 99px; cursor: pointer; }
.pv-ranges button.on { background: var(--bright); color: var(--ink2); }
.pv-chart-wrap { position: relative; height: 340px; }
.pv-chart { position: absolute; inset: 0; }
.pv-chart-state { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 13px; background: var(--ink2); }
.pv-chart-state[hidden] { display: none; }
.pv-cols { display: grid; grid-template-columns: 1fr 1.4fr; gap: 16px; }
.pv-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; margin-top: 8px; }
.pv-stat { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.pv-stat span { color: var(--muted); }
.pv-stat b { color: var(--bright); text-transform: capitalize; }
.pv-news { display: flex; flex-direction: column; margin-top: 6px; }
.pv-news-item { display: flex; flex-direction: column; gap: 3px; padding: 10px 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.pv-news-item:hover .pv-news-t { text-decoration: underline; }
.pv-news-t { font-size: 13.5px; font-weight: 700; color: var(--bright); }
.pv-news-m, .pv-muted { font-size: 12px; color: var(--muted); }
.pv-muted { padding: 10px 0; }
html[data-theme="dark"] .search-drop { box-shadow: 0 18px 50px rgba(0,0,0,.55); }
html[data-theme="dark"] .pv-ranges button.on { color: #0f0f11; }
@media (max-width: 780px) {
  .search-box, .search-box.open, .search-box:focus-within { flex: 1; width: auto; min-width: 0; }
  .search-box .sb-kbd { display: none; }
  .search-box.open { position: fixed; left: 8px; right: 8px; top: 8px; height: 40px; width: auto; z-index: 61; }
  .search-drop { position: fixed; left: 8px; right: 8px; top: 56px; width: auto; max-height: calc(100vh - 72px); max-height: calc(100dvh - 72px); }
  .sr-tag { max-width: 90px; }
  .pv-cols { grid-template-columns: 1fr; }
  .pv-px { text-align: left; width: 100%; }
  .pv-chart-wrap { height: 260px; }
  #previewView .wrap { padding-bottom: 84px; }
}
@media (prefers-reduced-motion: reduce) { .search-drop, .sr-spin, .sr-skel-row i, .sr-skel-row b { animation: none; } }
#pvPrice[data-flash="up"] { animation: num-flash-up .9s ease-out; }
#pvPrice[data-flash="down"] { animation: num-flash-down .9s ease-out; }
@media (prefers-reduced-motion: reduce) { #pvPrice[data-flash] { animation: none; } }

/* =========================================================================
 * Home: Market mood (two slim fear & greed meters) and the header alert bell (home-widgets.js)
 * ========================================================================= */
.fgt { grid-column: span 4; }
.fg-body { display: flex; flex-direction: column; }
.fg-row { display: grid; grid-template-columns: 54px minmax(0, 1fr) 96px; gap: 12px; align-items: center; padding: 9px 0; font-size: 13px; }
.fg-k { font-weight: 700; color: var(--bright); }
.fg-meter { position: relative; height: 7px; border-radius: 7px; background: linear-gradient(90deg, #e24b4a 0%, #ef9f27 25%, #b4b2a9 50%, #97c459 75%, #3b8f1d 100%); }
.fg-meter i { position: absolute; top: -4px; width: 4px; height: 15px; margin-left: -2px; border-radius: 2px; background: var(--bright); box-shadow: 0 0 0 2px var(--ink2); transition: left .8s cubic-bezier(.2,.8,.2,1); }
.fg-load .fg-meter { opacity: .35; }
.fg-v { text-align: right; white-space: nowrap; }
.fg-v b { font-size: 16px; font-weight: 800; color: var(--bright); font-variant-numeric: tabular-nums; }
.fg-v em { font-style: normal; font-size: 11.5px; font-weight: 800; }
.fg-err { grid-template-columns: 54px minmax(0, 1fr) auto; }
.fg-msg { font-size: 12px; color: var(--muted); }
.fg-retry { border: 0; background: none; font: inherit; font-size: 12px; font-weight: 700; color: var(--accent); cursor: pointer; text-decoration: underline; padding: 0; }
.fg-info { margin-top: 6px; font-size: 12px; color: var(--muted); }
.fg-info summary { cursor: pointer; font-weight: 700; color: var(--sub); list-style: none; }
.fg-info summary::-webkit-details-marker { display: none; }
.fg-info summary::before { content: "\24d8  "; }
.fg-info p { margin: 8px 0 4px; line-height: 1.5; }
.fg-d { margin-top: 12px; }
.fg-dh { font-weight: 800; color: var(--bright); }
.fg-dh small { font-weight: 500; color: var(--muted); margin-left: 6px; }
.fg-comp { display: grid; grid-template-columns: 1fr 30px; gap: 2px 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.fg-comp:last-of-type { border-bottom: 0; }
.fg-comp span { color: var(--bright); font-weight: 700; display: flex; flex-direction: column; }
.fg-comp small { color: var(--muted); font-weight: 500; font-size: 11px; }
.fg-comp b { text-align: right; color: var(--bright); font-variant-numeric: tabular-nums; }
.fg-comp em { grid-column: 1 / -1; height: 4px; background: var(--ink3); border-radius: 4px; overflow: hidden; }
.fg-comp em u { display: block; height: 100%; background: var(--sub); border-radius: 4px; }
.fg-src { margin-top: 6px; font-size: 11px; color: var(--muted); }
.fg-src a { color: var(--accent); text-decoration: none; font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .fg-meter i { transition: none; } }

.alert-bell { position: relative; width: 36px; height: 36px; flex: 0 0 36px; display: inline-grid; place-items: center; padding: 0; border-radius: 50%; background: var(--ink2); border: 1px solid var(--line); color: var(--muted); box-shadow: var(--shadow-card); cursor: pointer; transition: color .15s, border-color .15s; }
.alert-bell:hover { color: var(--bright); border-color: var(--bright); }
.alert-bell:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bell-badge { position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; font-size: 10px; font-weight: 800; line-height: 17px; text-align: center; color: #fff; background: var(--muted); box-sizing: border-box; border: 2px solid var(--ink2); line-height: 13px; }
.bell-badge[hidden] { display: none; }
.bell-badge.hot { background: var(--red); }
.bell-badge.warm { background: #d98a1c; }
@media (max-width: 780px) { .alert-bell { width: 34px; height: 34px; flex-basis: 34px; } }

/* Home polish: total inside the donut hole must fit; movers rows spread down the taller tile */
.donut-hold .donut-center .n { font-size: 15px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.donut-hold .donut-center .l { font-size: 9px; }
.donut-center > div { max-width: 84px; }
.movers { display: flex; flex-direction: column; }
.movers #homeMovers { flex: 1; display: flex; flex-direction: column; justify-content: space-evenly; }
.movers #homeMovers .mv-row { margin-top: 0; }
@media (max-width: 780px) {
  .alloc .donut-box { flex-direction: column; align-items: stretch; gap: 14px; }
  .alloc .donut-hold { align-self: center; }
  .alloc .alloc-rebal { margin-top: 6px; }
}

/* Stats block (asset preview): label above value, 3 columns for stocks and 2 for crypto */
.pv-cols { grid-template-columns: 1.35fr 1fr; }
.pv-stats { display: grid; gap: 22px 18px; margin-top: 14px; }
.pv-stats.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pv-stats.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pv-stats .pv-stat { display: flex; flex-direction: column; justify-content: flex-start; gap: 4px; padding: 0; border-bottom: 0; font-size: 12.5px; min-width: 0; }
.pv-stats .pv-stat span { color: var(--muted); font-weight: 600; }
.pv-stats .pv-stat b { font-size: 17px; font-weight: 700; color: var(--bright); text-transform: none; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pv-stats.is-loading .pv-stat b { opacity: .35; }
.pv-stats-src { margin-top: 16px; font-size: 11px; color: var(--muted); min-height: 1.2em; }
@media (max-width: 780px) { .pv-cols { grid-template-columns: 1fr; } .pv-stats.cols-3 { gap: 18px 12px; } .pv-stats .pv-stat b { font-size: 15px; } }

/* Attribution for the chart library (its license requires a visible credit now that the logo is off the charts) */
.app-credit { padding: 28px 16px 96px; text-align: center; font-size: 11.5px; color: var(--muted); }
.app-credit a { color: var(--sub); text-decoration: underline; }

/* Position page Stats tile: full width, so let the columns flow instead of fixing 2 or 3 */
.pstats { grid-column: span 12; }
.pstats[hidden] { display: none; }
.pstats .pv-stats.cols-3, .pstats .pv-stats.cols-2 { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
#positionView.first-run .tile.pstats { display: none; }

/* =========================================================================
 * Guided "Add to portfolio" flow (add-flow-ui.js)
 * ========================================================================= */
.add-modal { width: min(520px, 100%); }
.add-steps { list-style: none; display: flex; gap: 6px; margin: 0 0 16px; padding: 0; }
.add-steps li { flex: 1; font-size: 12px; font-weight: 700; color: var(--muted); border-top: 2px solid var(--line); padding-top: 6px; }
.add-steps li.on { color: var(--bright); border-color: var(--bright); }
.add-steps li.done { color: var(--sub); border-color: var(--sub); }
.add-segs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.add-seg { display: inline-flex; background: var(--ink3); border-radius: 99px; padding: 3px; flex-wrap: wrap; }
.add-seg button { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 700; padding: 6px 14px; border-radius: 99px; color: var(--muted); cursor: pointer; }
.add-seg button.on { background: var(--bright); color: var(--ink2); }
.add-lb { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin: 14px 0 5px; }
.add-in { width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; color: var(--bright); background: var(--ink2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.add-in:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.add-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.add-row > div { min-width: 0; }
.add-hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; min-height: 1.3em; }
.add-link { border: 0; background: none; padding: 0; font: inherit; font-size: 12px; font-weight: 700; color: var(--accent); cursor: pointer; text-decoration: underline; }
.add-res { border: 1px solid var(--line); border-radius: 12px; margin-top: 6px; max-height: 260px; overflow-y: auto; background: var(--ink2); }
.add-res[hidden] { display: none; }
.add-rt { padding: 8px 12px 3px; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.add-ri { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; font-size: 13px; cursor: pointer; border-radius: 8px; margin: 0 4px; }
.add-ri[aria-selected="true"], .add-ri:hover { background: var(--ink3); }
.add-ri b { color: var(--bright); }
.add-ri small, .add-sub { color: var(--muted); font-size: 12px; }
.add-tagc { white-space: nowrap; }
.add-note { padding: 10px 12px; font-size: 12.5px; color: var(--muted); }
.add-note.err { color: var(--red); }
.add-sel { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--ink3); border-radius: 14px; padding: 12px 14px; margin-top: 10px; }
.add-sel-t { font-weight: 800; color: var(--bright); font-size: 15px; }
.add-sel-t small { font-weight: 500; }
.add-sel-r { text-align: right; }
.add-px { font-size: 20px; font-weight: 800; color: var(--bright); font-variant-numeric: tabular-nums; }
.add-live { font-size: 11px; font-weight: 700; color: var(--green); }
.add-chip { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--ink2); color: var(--sub); white-space: nowrap; }
.add-more { margin-top: 12px; font-size: 13px; }
.add-more summary { cursor: pointer; font-weight: 700; color: var(--sub); }
.add-tg { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; font-size: 13px; font-weight: 700; color: var(--bright); }
.add-tg small { font-weight: 500; color: var(--muted); margin-left: 6px; }
.add-sw { position: relative; width: 38px; height: 22px; flex: none; border: 0; border-radius: 99px; background: var(--line2, #c9c7c0); cursor: pointer; padding: 0; transition: background .15s; }
.add-sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.add-sw.on { background: var(--green); }
.add-sw.on::after { left: 19px; }
.add-sw:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.add-tot, .add-rv { background: var(--ink3); border-radius: 14px; padding: 12px 14px; margin-top: 14px; font-size: 13px; }
.add-tot:empty { display: none; }
.add-tot > div, .add-rv > div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.add-tot span, .add-rv span { color: var(--muted); }
.add-tot b, .add-rv b { color: var(--bright); font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.add-warn { font-size: 12.5px; color: #b26a00; margin-top: 8px; }
.add-warn:empty { display: none; }
.add-warn.bad { color: var(--red); }
.add-fine { font-size: 12px; color: var(--muted); margin: 10px 0 0; line-height: 1.5; }
.add-msg { font-size: 12.5px; color: var(--red); margin-top: 10px; }
.add-msg[hidden] { display: none; }
.add-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; }
html[data-theme="dark"] .add-warn { color: #e0a24a; }
html[data-theme="dark"] .add-seg button.on { color: #0f0f11; }
@media (max-width: 520px) { .add-row { grid-template-columns: 1fr; gap: 0; } .add-modal { padding: 18px; } }
@media (prefers-reduced-motion: reduce) { .add-sw, .add-sw::after { transition: none; } }
.add-actions { position: sticky; bottom: -24px; background: var(--ink2); padding: 14px 0 0; margin-bottom: -6px; z-index: 1; }
@media (max-width: 520px) { .add-actions { bottom: -18px; } }

/* Anchor the add flow to the top of the screen: its height changes with every step and with the search results, and
 * a vertically centred modal would slide its controls around under the pointer. */
#addModal { align-items: flex-start; padding-top: min(9vh, 72px); }
#addModal .add-modal { max-height: calc(100vh - min(9vh, 72px) - 24px); }

/* =========================================================================
 * Today's movers (movers-ui.js): headline, gainers and losers by dollar impact, sparklines
 * ========================================================================= */
.movers #homeMovers { display: block; flex: none; justify-content: initial; }
.mv2-seg { display: inline-flex; background: var(--ink3); border-radius: 99px; padding: 2px; }
.mv2-seg button { border: 0; background: none; font: inherit; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 99px; color: var(--muted); cursor: pointer; }
.mv2-seg button.on { background: var(--bright); color: var(--ink2); }
.mv2-hero { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.mv2-net { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.mv2-netp { font-size: 13px; font-weight: 700; }
.mv2-net.up, .mv2-netp.up, .mv2-sub .up { color: var(--green); }
.mv2-net.dn, .mv2-netp.dn, .mv2-sub .dn { color: var(--red); }
.mv2-net.flat, .mv2-netp.flat { color: var(--muted); }
.mv2-sub { font-size: 12px; color: var(--sub); margin-top: 2px; }
.mv2-sub b { font-weight: 700; color: var(--bright); }
.mv2-sec { display: flex; justify-content: space-between; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; color: var(--muted); padding: 14px 0 2px; }
.mv2-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) 56px 66px; gap: 10px; align-items: center; padding: 7px 4px 5px; margin: 0 -4px; font-size: 13px; cursor: pointer; border-radius: 10px; }
.mv2-row:hover, .mv2-row:focus-visible { background: var(--ink3); outline: none; }
.mv2-ic { position: relative; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 800; color: #fff; overflow: hidden; }
.mv2-ic .a-logo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }
.mv2-id { min-width: 0; }
.mv2-sym { font-weight: 800; color: var(--bright); display: flex; align-items: center; gap: 6px; }
.mv2-tag { font-size: 9.5px; font-weight: 700; padding: 1px 6px; border-radius: 99px; background: var(--ink3); color: var(--sub); letter-spacing: .03em; }
.mv2-nm { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv2-spark path { stroke: var(--muted); }
.mv2-spark.up path { stroke: var(--green); }
.mv2-spark.dn path { stroke: var(--red); }
.mv2-val { display: flex; flex-direction: column; align-items: stretch; }
.mv2-pill { text-align: center; padding: 3px 0; border-radius: 99px; font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; background: var(--ink3); color: var(--muted); }
.mv2-pill.up { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
.mv2-pill.dn { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.mv2-alt { text-align: right; font-size: 10.5px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.mv2-bar { grid-column: 2 / 5; height: 3px; background: var(--ink3); border-radius: 3px; position: relative; margin-top: -1px; }
.mv2-bar i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 3px; background: var(--muted); }
.mv2-bar i.up { background: var(--green); }
.mv2-bar i.dn { background: var(--red); }
.mv2-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; font-size: 11.5px; color: var(--muted); }
.mv2-more { border: 0; background: none; padding: 0; margin-top: 8px; font: inherit; font-size: 12px; font-weight: 700; color: var(--accent); cursor: pointer; }

/* Home greeting row: text on the left, the Add button on the right */
.greet { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.greet-text { min-width: 0; }
.greet-note { font-weight: 500; color: var(--muted); }
.add-btn { flex: none; border: 0; border-radius: 99px; background: var(--bright); color: var(--ink2); font: inherit; font-size: 13px; font-weight: 800; padding: 9px 18px; cursor: pointer; margin-bottom: 4px; }
.add-btn:hover { opacity: .88; }
.add-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#homeView.first-run .add-btn { display: none; }
@media (max-width: 520px) { .greet-note { display: none; } .add-btn { padding: 8px 14px; } }

/* Net worth stat row (renderHomeStats) and a clearer benchmark label */
.worth-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.ws-cell { min-width: 0; text-align: left; background: none; border: 0; padding: 0; font: inherit; color: inherit; }
.ws-cell span { display: block; font-size: 11px; font-weight: 700; color: var(--muted); }
.ws-cell b { display: block; margin-top: 2px; font-size: 15px; font-weight: 800; color: var(--bright); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-cell b em { font-style: normal; font-size: 11.5px; font-weight: 700; opacity: .8; }
.ws-cell b.up { color: var(--green); } .ws-cell b.dn { color: var(--red); }
.ws-btn { cursor: pointer; border-radius: 8px; }
.ws-btn:hover b { text-decoration: underline; }
.ws-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.bench-lbl { font-size: 11px; font-weight: 700; color: var(--muted); align-self: center; margin-right: 2px; }
@media (max-width: 640px) { .worth-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; } }
@media (max-width: 780px) { .tile.worth .worth-stats { order: 5; margin-top: 12px; } .tile.worth .bench-row { order: 6; } }

/* Allocation: drift against the target weights */
.dl-row .dr { min-width: 74px; text-align: right; font-size: 11.5px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dl-row .dr.ok { color: var(--muted); }
.dl-row .dr.over { color: #b26a00; }
.dl-row .dr.under { color: var(--accent); }
.dl-row .dr.none { color: var(--muted); font-weight: 500; }
html[data-theme="dark"] .dl-row .dr.over { color: #e0a24a; }
.dl-hint { font-size: 11.5px; color: var(--muted); margin-top: 10px; line-height: 1.45; }

/* The Allocation tile lays itself out by its OWN width (the window width says nothing about a half-width tile):
 * donut beside the legend when there is room, stacked above it when there is not, and no dollar column when even that is tight. */
.alloc { container: alloc / inline-size; }
@container alloc (max-width: 500px) {
  .alloc .donut-box { flex-direction: column; align-items: stretch; gap: 14px; }
  .alloc .donut-hold { align-self: center; }
}
@container alloc (max-width: 340px) { .alloc .dl-row .dv { display: none; } }

/* =========================================================================
 * Home: Watchlist (watchlist-ui.js)
 * ========================================================================= */
.watch { grid-column: span 4; }
.wl-count { font-weight: 700; color: var(--muted); margin-left: 4px; }
.wl-search { margin: 4px 0 8px; position: relative; }
.wl-search[hidden] { display: none; }
.wl-search .add-res { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; box-shadow: 0 12px 30px rgba(0,0,0,.14); }
.wl-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) 50px 78px 22px; gap: 10px; align-items: center; padding: 8px 4px; margin: 0 -4px; border-radius: 10px; font-size: 13px; cursor: pointer; }
.wl-row + .wl-row { border-top: 1px solid var(--line); border-top-left-radius: 0; border-top-right-radius: 0; }
.wl-row:hover, .wl-row:focus-visible { background: var(--ink3); outline: none; }
.wl-id { min-width: 0; }
.wl-sym { font-weight: 800; color: var(--bright); }
.wl-nm { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-px { text-align: right; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.wl-px b { font-weight: 800; color: var(--bright); }
.wl-px span { font-size: 11px; font-weight: 700; color: var(--muted); }
.wl-px .up { color: var(--green); } .wl-px .dn { color: var(--red); }
.wl-x { border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; padding: 0; opacity: 0; border-radius: 50%; width: 22px; height: 22px; }
.wl-row:hover .wl-x, .wl-row:focus-within .wl-x, .wl-x:focus-visible { opacity: 1; }
.wl-x:hover { color: var(--red); background: var(--ink3); }
@media (hover: none) { .wl-x { opacity: .55; } }
.wl-empty { text-align: center; padding: 22px 8px 14px; color: var(--muted); font-size: 12.5px; }
.wl-empty b { display: block; color: var(--bright); font-size: 14px; margin-bottom: 4px; }
.wl-empty p { margin: 0 0 12px; }
.wl-big { border: 0; border-radius: 99px; background: var(--bright); color: var(--ink2); font: inherit; font-size: 13px; font-weight: 800; padding: 8px 16px; cursor: pointer; }
html[data-theme="dark"] .wl-search .add-res { box-shadow: 0 12px 30px rgba(0,0,0,.5); }
@media (max-width: 1000px) { .watch { grid-column: span 12; } }
@media (max-width: 780px) { #homeView .watch { order: 2; } }
#homeView.first-run .tile.watch { display: none; }

/* =========================================================================
 * Home: Upcoming earnings and dividends (events-ui.js)
 * ========================================================================= */
.upcoming { grid-column: span 4; }
.up-row { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: center; padding: 9px 4px; margin: 0 -4px; border-radius: 10px; cursor: pointer; }
.up-row + .up-row { border-top: 1px solid var(--line); border-top-left-radius: 0; border-top-right-radius: 0; }
.up-row:hover, .up-row:focus-visible { background: var(--ink3); outline: none; }
.up-dt { text-align: center; background: var(--ink3); border-radius: 10px; padding: 5px 0; line-height: 1.1; }
.up-dt b { display: block; font-size: 16px; font-weight: 800; color: var(--bright); font-variant-numeric: tabular-nums; }
.up-dt span { font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.up-t { font-size: 13px; font-weight: 800; color: var(--bright); }
.up-t em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--muted); margin-left: 4px; }
.up-d { font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.up-empty { padding: 18px 4px 10px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.up-load { opacity: .7; }
.up-retry, .up-more { border: 0; background: none; padding: 0; font: inherit; font-size: 12px; font-weight: 700; color: var(--accent); cursor: pointer; text-decoration: underline; }
.up-more { display: block; margin-top: 8px; text-decoration: none; }
.up-foot { margin-top: 12px; font-size: 11px; color: var(--muted); }
@media (max-width: 1000px) { .upcoming { grid-column: span 12; } }
@media (max-width: 780px) { #homeView .upcoming { order: 4; } }
#homeView.first-run .tile.upcoming { display: none; }

/* =========================================================================
 * Portfolio: KPI strip and benchmark legend (renderPortfolioKpis / renderPerfLegend)
 * ========================================================================= */
.pf-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { display: flex; flex-direction: column; gap: 3px; min-width: 0; text-align: left; background: var(--ink2); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow-card); font: inherit; color: inherit; }
.kpi-l { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; color: var(--muted); }
.kpi-v { font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: var(--bright); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-d { font-size: 11.5px; font-weight: 600; color: var(--sub); font-variant-numeric: tabular-nums; }
.kpi .up, .kpi-v.up, .kpi-d.up { color: var(--green); } .kpi .dn, .kpi-v.dn, .kpi-d.dn { color: var(--red); }
.kpi-v.flat, .kpi-d.flat { color: var(--muted); }
.kpi-btn { cursor: pointer; }
.kpi-btn:hover { border-color: var(--bright); }
.kpi-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chart-legend2 { flex-wrap: wrap; align-items: center; }
.chart-legend2 .lg-r { font-variant-numeric: tabular-nums; }
.chart-legend2 .lg-r.up { color: var(--green); } .chart-legend2 .lg-r.dn { color: var(--red); }
.chart-legend2 .lg-quiet { color: var(--muted); }
.chart-legend2 .lg-chip { margin-left: auto; font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 99px; background: var(--ink3); color: var(--bright); }
@media (max-width: 1000px) { .pf-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .pf-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .pf-kpis .kpi:first-child { grid-column: 1 / -1; } .kpi { padding: 12px 14px; } .kpi-v { font-size: 20px; } }
#portfolioView.first-run .pf-kpis { display: none; }


/* Portfolio: Top holdings card */
.th-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) 84px auto; align-items: center; gap: 10px; width: 100%; padding: 10px 4px; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; cursor: pointer; font: inherit; color: inherit; }
.th-row:last-of-type { border-bottom: 0; }
.th-row:hover { background: var(--ink2); }
.th-dot { width: 10px; height: 10px; border-radius: 50%; }
.th-id { display: flex; flex-direction: column; min-width: 0; }
.th-id b { font-size: 13px; color: var(--bright); }
.th-id small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-w { display: flex; align-items: center; gap: 6px; }
.th-bar { flex: 1; height: 6px; border-radius: 99px; background: var(--ink3); overflow: hidden; }
.th-bar i { display: block; height: 100%; border-radius: 99px; }
.th-w em { font-style: normal; font-family: var(--mono); font-size: 11.5px; color: var(--sub); min-width: 28px; text-align: right; }
.th-pill { font-family: var(--mono); font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: var(--ink3); color: var(--sub); }
.th-pill.up { background: rgba(31, 158, 99, .12); color: var(--green); }
.th-pill.dn { background: rgba(214, 69, 65, .12); color: var(--red); }
.th-more { font-size: 11.5px; color: var(--muted); padding: 8px 4px 2px; }



/* Portfolio: What drove your return */
.drove { grid-column: span 8; }
.drove-total { font-size: 12px; color: var(--muted); }
.drove-total b.up { color: var(--green); } .drove-total b.dn { color: var(--red); }
.dv-row { display: grid; grid-template-columns: minmax(110px, 180px) 1fr auto; align-items: center; gap: 12px; width: 100%; padding: 9px 4px; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; font: inherit; color: inherit; cursor: pointer; }
.dv-row:hover { background: var(--ink2); }
.dv-id { display: flex; flex-direction: column; min-width: 0; }
.dv-id b { font-size: 13px; color: var(--bright); }
.dv-id small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dv-bar { height: 8px; border-radius: 99px; background: var(--ink3); overflow: hidden; }
.dv-bar i { display: block; height: 100%; border-radius: 99px; }
.dv-bar i.up { background: var(--green); } .dv-bar i.dn { background: var(--red); }
.dv-usd { font-family: var(--mono); font-size: 12.5px; font-weight: 700; min-width: 74px; text-align: right; }
.dv-usd.up { color: var(--green); } .dv-usd.dn { color: var(--red); }


/* Position page: KPI strip, two columns, and the phone action bar */
.pos-kpis { margin: 4px 0 18px; }
.kpi-d.warn { color: #b97f0a; }
.pos-cols { grid-column: span 12; display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 18px; align-items: start; }
.pos-main, .pos-side { display: grid; gap: 18px; min-width: 0; align-content: start; }
.pos-cols .tile { grid-column: auto; }
.pos-cols .act-tile .act-filters { flex-wrap: wrap; }
.pill-note { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-right: auto; margin-left: 10px; }
.lr-main { min-width: 0; } .lr-end { text-align: right; flex: none; }
.lr-end b.up { color: var(--green); } .lr-end b.dn { color: var(--red); }
.pt-line { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; }
.pt-line b { font-size: 22px; color: var(--bright); } .pt-line span { font-size: 12px; color: var(--muted); }
.pt-bar { height: 8px; border-radius: 99px; background: var(--ink3); position: relative; margin-top: 8px; }
.pt-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--accent); }
.pt-bar i.over { background: #c98a12; } .pt-bar i.on { background: var(--green); }
.pt-tgt { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--bright); border-radius: 2px; }
.pt-note { font-size: 12.5px; color: var(--sub); margin: 10px 0 8px; line-height: 1.45; }
.pt-note b { color: var(--bright); }
.pt-actions { display: flex; gap: 8px; }
.pt-income { font-size: 12px; color: var(--muted); margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.pt-income b { color: var(--bright); }
.pa-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.pa-row:first-child { border-top: 0; }
.pa-t { min-width: 0; flex: 1; } .pa-t b { display: block; font-size: 13px; color: var(--bright); } .pa-t small { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.pa-bar { height: 6px; border-radius: 99px; background: var(--ink3); margin-top: 6px; overflow: hidden; } .pa-bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.pill-s { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--ink3); color: var(--sub); flex: none; }
.pill-s.bl { background: rgba(42, 120, 214, .12); color: var(--accent); } .pill-s.am { background: rgba(185, 127, 10, .14); color: #b97f0a; }
@media (max-width: 1000px) {
  .pos-cols { display: flex; flex-direction: column; align-items: stretch; gap: 18px; }
  .pos-main, .pos-side { display: contents; }
  .pos-cols #posTargetTile { order: 1; } .pos-cols #posAlertsTile { order: 2; } .pos-cols .pos-lots { order: 3; }
  .pos-cols #posStatsTile { order: 4; } .pos-cols .act-tile { order: 5; } .pos-cols .newsline { order: 6; } .pos-cols .taxt { order: 7; }
}
@media (max-width: 640px) {
  .pos-kpis .kpi:first-child { grid-column: 1 / -1; }
}

/* Activity: KPI strip, ledger as a month-grouped list, side tiles */
.act-k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }
.act-cols { grid-column: span 12; display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 18px; align-items: start; }
.act-side { display: grid; gap: 18px; min-width: 0; align-content: start; }
#activityView .act-cols .act-tile { grid-column: auto; min-width: 0; }
.act-search { min-width: 150px; }
.al-mh { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 14px 4px 4px; }
.al-mh:first-child { padding-top: 4px; }
.al-row { border-top: 1px solid var(--line); }
.al-mh + .al-row { border-top: 0; }
.al-head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 4px; background: none; border: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; border-radius: 10px; }
.al-head:hover { background: var(--ink); }
.al-icw { flex: none; display: inline-flex; }
.al-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 12px; color: #fff; }
.al-ic.cash { background: #e0a021; }
.al-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.al-main b { font-size: 13.5px; color: var(--bright); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.al-main small { font-size: 11.5px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.al-end { flex: none; text-align: right; display: flex; flex-direction: column; }
.al-end b { font-size: 13.5px; color: var(--bright); } .al-end b.up, .al-end small.up { color: var(--green); } .al-end b.dn, .al-end small.dn { color: var(--red); }
.al-end small { font-size: 11.5px; font-weight: 700; }
.al-detail { padding: 2px 4px 14px 48px; }
.al-cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px 14px; }
.al-cell span { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.al-cell b { font-size: 13px; color: var(--bright); font-family: var(--mono); font-weight: 600; } .al-cell b .up { color: var(--green); } .al-cell b .dn { color: var(--red); }
.al-actions { display: flex; gap: 8px; margin-top: 12px; }
.al-actions button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 99px; border: 1px solid var(--line); background: var(--ink2); font: inherit; font-size: 12.5px; font-weight: 700; color: var(--bright); cursor: pointer; }
.al-actions button svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.al-actions button.danger { color: var(--red); }
.ay-bars { display: flex; align-items: flex-end; gap: 16px; padding: 4px 8px 0; min-height: 130px; }
.ay-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; text-align: center; }
.ay-col i { display: block; width: 100%; max-width: 64px; border-radius: 8px 8px 0 0; background: var(--muted); }
.ay-col i.up { background: var(--green); } .ay-col i.dn { background: var(--red); }
.ay-col small { font-size: 11px; color: var(--muted); font-weight: 700; } .ay-col b { font-size: 12px; font-family: var(--mono); color: var(--bright); } .ay-col b.up { color: var(--green); } .ay-col b.dn { color: var(--red); }
.an-row { padding: 9px 0; border-top: 1px solid var(--line); } .an-row:first-child { border-top: 0; }
.an-row b { display: block; font-size: 13px; color: var(--bright); } .an-row small { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.an-disc { font-size: 11px; color: var(--muted); margin-top: 8px; }
@media (max-width: 1000px) {
  .act-cols { display: flex; flex-direction: column; align-items: stretch; }
  .act-k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .al-detail { padding-left: 4px; }
  .act-search { flex: 1 1 100%; width: 100%; }
  .act-k4 .kpi:first-child { grid-column: auto; }
}

.lot-row2 { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 2px; border-top: 1px solid var(--line); }
.lot-row2:first-child { border-top: 0; }
.lot-row2 b { display: block; font-size: 13.5px; color: var(--bright); }
.lot-row2 small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.al-cell .term { display: inline-block; }


/* News: your brief, day groups, "you hold" lines */
.nbrief { grid-column: span 8; background: linear-gradient(150deg, #1c2f4e 0%, #132038 60%, #0f1a2e 100%); border: 0; color: #fff; display: flex; flex-direction: column; gap: 10px; }
.nb-tag { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #8fb8ff; }
.nb-lead { margin: 0; font-size: 16px; line-height: 1.5; color: #fff; } .nb-lead b { color: #fff; }
.nb-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.nb-list li { font-size: 13.5px; color: #dbe6f7; } .nb-list li b { color: #fff; } .nb-list li span { color: #8fa5c6; margin: 0 4px; }
.nb-go { align-self: flex-start; background: #fff; color: #111; border-color: #fff; }
.nb-note { font-size: 11px; color: #8fa5c6; }
.n-day { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 14px 16px 4px; }
.n-day:first-child { padding-top: 4px; }
.n-sum { font-size: 12.5px; color: var(--sub); font-weight: 500; margin-top: 5px; line-height: 1.5; }
.n-impact { margin-top: 7px; font-size: 12px; color: var(--sub); background: var(--ink3); border-radius: 9px; padding: 5px 10px; display: inline-block; }
.n-impact b { color: var(--bright); } .n-impact b.up { color: var(--green); } .n-impact b.dn { color: var(--red); }
.n-gaps:empty { display: none; }
.n-gaps { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.n-gap { font-size: 12px; color: #b97f0a; font-weight: 600; line-height: 1.5; } .n-gap b { color: var(--bright); }
@media (max-width: 1000px) { .nbrief { grid-column: span 12; } }


/* Alerts: KPI strip, needs-attention, suggestions */
.al-cards { display: flex; flex-direction: column; gap: 14px; }
.al-attn { border-color: #e6c977; background: #fffdf5; }
html[data-theme="dark"] .al-attn { background: #2a2416; border-color: #5a4a1f; }
.al-warn { color: #b97f0a; }
.kpi-v.warn { color: #b97f0a; }
.an-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.an-item:first-of-type { border-top: 0; }
.an-t { min-width: 0; flex: 1 1 220px; } .an-t b { display: block; font-size: 14px; color: var(--bright); } .an-t small { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.an-btns { display: flex; gap: 8px; }
.sg-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.sg-row:first-of-type { border-top: 0; }
.sg-t { min-width: 0; } .sg-t b { display: block; font-size: 13.5px; color: var(--bright); } .sg-t small { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.al-attn[hidden], .al-suggest[hidden] { display: none; }
@media (max-width: 640px) { .an-btns { width: 100%; } .an-btns .btn { flex: 1; justify-content: center; min-height: 44px; } }


/* =========================================================================
 * Guided "Edit position" (edit-flow-ui.js)
 * ========================================================================= */
#editModal { align-items: flex-start; padding-top: min(9vh, 72px); }
.ef-modal { max-height: calc(100vh - min(9vh, 72px) - 24px); overflow-y: auto; }
.ef-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.ef-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-weight: 800; font-size: 11px; color: #fff; flex: none; background: var(--accent); }
.ef-ht { min-width: 0; flex: 1; } .ef-ht .modal-title { margin: 0; } .ef-ht small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ef-sum { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.ef-pill { border-radius: 99px; background: var(--ink3); padding: 4px 10px; font-size: 12px; font-weight: 700; color: var(--sub); white-space: nowrap; } .ef-pill b { color: var(--bright); }
.ef-q { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; } .ef-q2 { margin-top: 14px; }
.ef-opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; margin-bottom: 8px; background: var(--ink2); font: inherit; color: inherit; cursor: pointer; }
.ef-opt:hover { border-color: var(--bright); } .ef-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ef-oi { width: 34px; height: 34px; border-radius: 10px; background: var(--ink3); display: grid; place-items: center; font-size: 16px; flex: none; }
.ef-ot { flex: 1; min-width: 0; } .ef-ot b { display: block; font-size: 14px; color: var(--bright); } .ef-ot small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ef-go { color: var(--muted); font-size: 20px; }
.ef-danger { text-align: center; margin-top: 14px; } .ef-del { color: var(--red); text-decoration: none; }
.ef-back { border: 0; background: none; padding: 0; margin-bottom: 10px; font: inherit; font-size: 13px; font-weight: 700; color: var(--accent); cursor: pointer; }
.ef-big { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; } .ef-big > span:last-child { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.ef-bigv { display: inline-flex; align-items: baseline; gap: 2px; } .ef-bigv em { font-style: normal; font-size: 24px; font-weight: 800; color: var(--muted); }
.ef-num { width: 4.2ch; min-width: 0; font: inherit; font-size: 36px; font-weight: 800; letter-spacing: -.02em; color: var(--bright); background: none; border: 0; border-bottom: 2px solid var(--line); padding: 0; -moz-appearance: textfield; }
.ef-num::-webkit-outer-spin-button, .ef-num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ef-num:focus { outline: none; border-color: var(--accent); }
.ef-track { position: relative; margin: 16px 0 6px; height: 28px; }
.ef-range { width: 100%; height: 28px; margin: 0; background: none; accent-color: var(--accent); cursor: pointer; }
.ef-now { position: absolute; top: 2px; bottom: 2px; width: 2px; background: var(--bright); opacity: .7; border-radius: 2px; pointer-events: none; z-index: 1; }
.ef-scale { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; font-weight: 700; }
.ef-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.ef-chip { border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--sub); background: var(--ink2); cursor: pointer; }
.ef-chip.on { background: var(--bright); color: var(--ink2); border-color: var(--bright); }
.ef-prev { background: var(--ink3); border-radius: 14px; padding: 12px 14px; font-size: 13px; color: var(--sub); margin-top: 10px; line-height: 1.5; } .ef-prev b { color: var(--bright); }
.ef-am { color: #b97f0a; font-weight: 700; }
.ef-note { border: 1px dashed #b97f0a; border-radius: 12px; padding: 8px 12px; font-size: 12px; color: #b97f0a; margin-top: 10px; } .ef-note[hidden] { display: none; }
.ef-seg { margin: 4px 0 8px; } .ef-sub { font-size: 13px; color: var(--sub); margin: 8px 0 12px; line-height: 1.5; } .ef-sub b { color: var(--bright); } .ef-warnp { color: var(--red); }
.ef-sw { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.ef-swb { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; padding: 0; cursor: pointer; position: relative; overflow: hidden; }
.ef-swb.on { outline: 3px solid var(--accent); outline-offset: 2px; }
.ef-swc { background: conic-gradient(#e33, #ee3, #3e3, #3ee, #33e, #e3e, #e33); } .ef-swc input { opacity: 0; position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.ef-lock { font-size: 12px; color: var(--muted); margin: 14px 0 0; line-height: 1.5; }
.ef-foot { position: sticky; bottom: -24px; display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 14px 0 0; border-top: 1px solid var(--line); background: var(--ink2); z-index: 1; flex-wrap: wrap; }
.ef-n { flex: 1; min-width: 110px; color: var(--muted); font-size: 12.5px; }
.ef-foot .btn[disabled] { opacity: .45; cursor: not-allowed; }
@media (max-width: 520px) { .ef-foot { bottom: -18px; } .ef-modal { padding: 18px; } }
html[data-theme="dark"] .ef-range { color-scheme: dark; }


/* Polish: the News brief is as tall as its text (not stretched to the Coverage card), and the Activity ledger's filters
 * sit on their own row under the title instead of wrapping beside it at in-between widths. */
.nbrief { align-self: start; }
#activityView .act-cols .act-tile .t-head { flex-direction: column; align-items: stretch; gap: 10px; }
#activityView .act-cols .act-tile .t-head .act-filters { width: 100%; }

/* =========================================================================
 * Phone layout fixes (mobile review, v0.9.57). Kept at the end of the file on purpose: several base rules above are
 * declared after the responsive blocks, and a later rule of equal weight wins, which is how these bugs happened.
 * ========================================================================= */
@media (max-width: 1000px) {
  /* "What drove your return" kept its desktop 8-of-12 width on phones: its base rule sits after the collapse above */
  .drove { grid-column: span 12; }
}
.dv-row { grid-template-columns: minmax(96px, 180px) minmax(0, 1fr) auto; }

/* one Live indicator per card: when the Live tag beside the title shows, the older freshness dot on the right stays hidden */
.t-head:has(.live-tag:not([hidden])) .head-tools [data-freshness] { display: none; }

/* suggested alerts: .btn sets no background, so the button fell back to the browser's light grey under light text */
.sg-row .btn { background: var(--bright); color: var(--ink2); border-color: var(--bright); border-radius: 99px; flex: none; }

/* the sell estimator's slider picked up the phone rule that gives every input a 44px box */
.sell-range { min-height: 0; height: 4px; padding: 0; border: 0; box-shadow: none; background: var(--line2); }
/* News → Latest: the list has only 6px side padding (each story row brings its own), so the empty message sat on the edge */
.feed > .empty { padding-inline: 16px; }
/* a chart built at one width and shown after the screen turned (rotation) must not spill past its card */
.pv-chart { overflow: hidden; }

@media (max-width: 640px) {
  /* chip and range rows: one line that scrolls sideways, instead of one chip wrapping alone onto a second line */
  .filters2, .pv-ranges, #holdFilters {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px;
  }
  .filters2::-webkit-scrollbar, .pv-ranges::-webkit-scrollbar, #holdFilters::-webkit-scrollbar { display: none; }
  .filters2 > *, .pv-ranges > *, #holdFilters > * { flex: none; }
  /* Holdings: the filter chips get their own row under the title instead of squeezing beside it */
  .holdings > .t-head { flex-wrap: wrap; row-gap: 10px; }
  .holdings > .t-head #holdFilters { order: 3; width: 100%; }

  /* Activity: the ledger filters wrap (see the 780px block above); the search takes a whole line so its placeholder fits,
     and the type chips scroll sideways inside their line instead of running past the card on a 320px phone */
  .act-tile .t-head .act-filters .act-search { flex: 1 1 100%; width: 100%; }
  .act-tile .t-head .act-filters #actTypeChips { flex: 0 1 auto; max-width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .act-tile .t-head .act-filters #actTypeChips::-webkit-scrollbar { display: none; }
  .act-tile .t-head .act-filters #actTypeChips > * { flex: none; }

}
@media (max-width: 560px) {
  /* the Live tag is short enough to keep its word on a phone; the two bare dots it replaces meant nothing */
  .live-tag.freshness { gap: 6px; }
  .live-tag.freshness > span:last-child { display: inline; }
}

/* =========================================================================
 * Profile v2 (v0.9.58): hero with live numbers, goal, plan, settings rows that open sheets; the avatar with its plan ring
 * (Pro purple, founding member gold, Free none) is shared by the header, the account menu and Profile. Drawn by profile-ui.js.
 * ========================================================================= */
.pf-grid { align-items: start; }
.pf-hero { grid-column: span 12; }
.pf-goal { grid-column: span 7; }
.pf-plan { grid-column: span 5; }
.pf-grid:has(#pfPlan[hidden]) .pf-goal { grid-column: span 12; }
.pf-group { grid-column: span 4; }
.pf-grid:has(#pfNotify[hidden]) .pf-group { grid-column: span 6; }
@media (max-width: 1000px) {
  .pf-goal, .pf-plan { grid-column: span 6; }
  .pf-group, .pf-grid:has(#pfNotify[hidden]) .pf-group { grid-column: span 6; }
  #pfAccount { grid-column: span 12; }
}

/* avatar */
.pf-av { --av: #185FA5; position: relative; display: inline-grid; place-items: center; border-radius: 50%; background: var(--av); color: #fff; flex: none; font-family: var(--sans); font-weight: 800; letter-spacing: 0; line-height: 1; }
.pf-av-photo { background: var(--ink3); }
.pf-photo { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.pf-av-sm { width: 34px; height: 34px; font-size: 13px; }
.pf-av-md { width: 40px; height: 40px; font-size: 14px; }
.pf-av-lg { width: 68px; height: 68px; font-size: 24px; }
.pf-av-sm .pf-av-icon { width: 17px; height: 17px; }
.pf-av-md .pf-av-icon { width: 20px; height: 20px; }
.pf-av-lg .pf-av-icon { width: 32px; height: 32px; }
.pf-ring-pro { box-shadow: 0 0 0 2px var(--ink2), 0 0 0 4px #7F77DD; }
.pf-ring-plus { box-shadow: 0 0 0 2px var(--ink2), 0 0 0 4px #378ADD; }
.pf-ring-founding { box-shadow: 0 0 0 2px var(--ink2), 0 0 0 4px #EF9F27; }
.pf-av-lg.pf-ring-pro { box-shadow: 0 0 0 3px var(--ink2), 0 0 0 6px #7F77DD; }
.pf-av-lg.pf-ring-plus { box-shadow: 0 0 0 3px var(--ink2), 0 0 0 6px #378ADD; }
.pf-av-lg.pf-ring-founding { box-shadow: 0 0 0 3px var(--ink2), 0 0 0 6px #EF9F27; }
.pf-pip { position: absolute; right: -6px; bottom: -4px; font-size: 8.5px; font-weight: 800; line-height: 1; padding: 2px 4px; border-radius: 6px; border: 1.5px solid var(--ink2); letter-spacing: .02em; }
.pf-pip-pro { background: #534AB7; color: #fff; }
.pf-pip-plus { background: #185FA5; color: #fff; }
.pf-pip-founding { background: #FAC775; color: #633806; padding: 2px 3px; }
.pf-pip-founding svg { display: block; fill: currentColor; }
.pf-av-lg .pf-pip { font-size: 10.5px; right: -5px; bottom: -2px; padding: 3px 6px; border-width: 2px; }
.pf-av-lg .pf-pip-founding { padding: 3px 4px; }
.pf-av-lg .pf-pip-founding svg { width: 14px; height: 14px; }
.user-chip-avatar.has-pf { width: auto; height: auto; background: none; border-radius: 0; display: inline-flex; }

/* account menu head */
.user-menu-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--line); min-width: 250px; }
.user-menu-head[hidden] { display: none; }
.umh-id { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.umh-id b { font-size: 13.5px; font-weight: 800; color: var(--bright); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.umh-id small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* hero */
.pf-hero-top { display: flex; align-items: center; gap: 18px; }
.pf-av-btn { background: none; border: 0; padding: 6px; margin: -6px; cursor: pointer; border-radius: 50%; }
.pf-hero-id { min-width: 0; flex: 1; }
.pf-name { font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: var(--bright); overflow-wrap: anywhere; }
.pf-sub { font-size: 13px; color: var(--muted); margin-top: 2px; font-weight: 600; }
.pf-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pf-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--ink3); color: var(--sub); white-space: nowrap; }
.pf-chip svg { width: 11px; height: 11px; fill: currentColor; }
.pf-chip-founding { background: #FAEEDA; color: #633806; }
.pf-chip-pro { background: #EEEDFE; color: #3C3489; }
.pf-chip-plus { background: #E6F1FB; color: #0C447C; }
.pf-edit { align-self: flex-start; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line2); background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; flex: none; }
.pf-edit:hover { color: var(--bright); border-color: var(--dim); }
.pf-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.pf-stat { background: var(--ink3); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.pf-stat b { display: block; font-size: 18px; font-weight: 800; color: var(--bright); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-stat b.up { color: var(--green); }
.pf-stat b.dn { color: var(--red); }
.pf-stat span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1000px) { .pf-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* goal and plan */
.pf-goal-title { font-size: 20px; font-weight: 800; color: var(--bright); margin: 4px 0 12px; letter-spacing: -.01em; }
.pf-bar { height: 10px; border-radius: 99px; background: var(--ink3); overflow: hidden; }
.pf-bar span { display: block; height: 100%; border-radius: 99px; background: #7F77DD; transition: width .4s; }
.pf-goal-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 8px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.pf-goal-foot b { color: var(--bright); font-size: 14px; }
.pf-goal-empty p { font-size: 13.5px; color: var(--muted); margin: 6px 0 14px; }
.pf-link { background: none; border: 0; color: var(--accent); font-weight: 700; font-size: 13px; cursor: pointer; padding: 0; font-family: var(--sans); text-align: left; }
.pf-link.danger { color: var(--red); }
.pf-plan-name { font-size: 20px; font-weight: 800; color: var(--bright); margin-top: 4px; letter-spacing: -.01em; }
.pf-plan-copy { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.pf-plan .t-head svg { fill: currentColor; }
.pf-plan-founding { background: #FAEEDA; border-color: #FAC775; }
.pf-plan-founding .t-label, .pf-plan-founding .t-head svg, .pf-plan-founding .pf-plan-copy { color: #854F0B; }
.pf-plan-founding .pf-plan-name { color: #633806; }
.pf-plan-pro { background: #EEEDFE; border-color: #CECBF6; }
.pf-plan-pro .t-label, .pf-plan-pro .pf-plan-copy { color: #534AB7; }
.pf-plan-pro .pf-plan-name { color: #26215C; }

/* settings rows */
.pf-rows { display: flex; flex-direction: column; margin-top: 2px; }
.pf-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 11px 0; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; font-family: var(--sans); font-size: 14px; color: var(--text); }
.pf-rows > .pf-row:first-child { border-top: 0; }
button.pf-row { cursor: pointer; }
button.pf-row:hover .pf-row-label { color: var(--bright); }
button.pf-row:disabled { cursor: progress; }
.pf-lead { color: var(--muted); flex: none; }
.pf-row-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pf-row-label { font-weight: 700; }
.pf-row-sub { font-size: 12px; color: var(--muted); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-row-value { font-size: 13px; color: var(--muted); font-weight: 600; text-align: right; max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-chev { color: var(--dim); flex: none; }
.pf-row.danger, .pf-row.danger .pf-lead { color: var(--red); }
.pf-muted { color: var(--muted); }
.pf-switch { width: 42px; height: 26px; border-radius: 99px; background: var(--line2); position: relative; flex: none; transition: background .15s; }
.pf-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.pf-switch.on { background: var(--green); }
.pf-switch.on::after { transform: translateX(16px); }
.pf-version { font-family: var(--mono); font-size: 11px; color: var(--dim); margin-top: 10px; }

/* sheets: a dialog on wide screens, a bottom sheet on phones */
.pf-sheet-back { position: fixed; inset: 0; z-index: 60; background: rgba(25,25,24,.45); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 24px; }
.pf-sheet-back[hidden] { display: none; }
.pf-sheet { width: min(460px, 100%); max-height: calc(100vh - 48px); overflow: auto; background: var(--ink2); border-radius: 22px; padding: 20px 22px 22px; box-shadow: 0 22px 70px -18px rgba(0,0,0,.35); }
.pf-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.pf-sheet-head h2 { font-size: 19px; font-weight: 800; color: var(--bright); letter-spacing: -.01em; }
.pf-x { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--ink3); color: var(--sub); display: grid; place-items: center; cursor: pointer; flex: none; }
.pf-sheet-body { display: flex; flex-direction: column; gap: 14px; }
.pf-sheet-copy { font-size: 13.5px; color: var(--sub); line-height: 1.5; }
.pf-sheet-note { font-size: 12.5px; color: var(--muted); margin-top: -6px; }
.pf-field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); font-family: var(--sans); }
.pf-input { font-family: var(--sans); font-size: 16px; font-weight: 500; color: var(--text); background: var(--ink3); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; width: 100%; min-height: 46px; }
.pf-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea.pf-input { resize: vertical; min-height: 150px; line-height: 1.5; }
.pf-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.pf-seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; background: var(--ink3); padding: 4px; border-radius: 12px; }
.pf-seg button { display: flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: none; border-radius: 9px; padding: 9px 6px; font-family: var(--sans); font-size: 13px; font-weight: 700; color: var(--sub); cursor: pointer; }
.pf-seg button.on { background: var(--ink2); color: var(--bright); box-shadow: var(--shadow-card); }
.pf-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-swatch { width: 32px; height: 32px; border-radius: 50%; background: var(--av); border: 0; cursor: pointer; padding: 0; }
.pf-swatch.on { box-shadow: 0 0 0 2px var(--ink2), 0 0 0 4px var(--bright); }
.pf-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 8px; }
.pf-iconpick { height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--ink2); color: var(--sub); display: grid; place-items: center; cursor: pointer; padding: 0; }
.pf-iconpick.on { border-color: var(--bright); color: var(--bright); box-shadow: inset 0 0 0 1px var(--bright); }
.pf-preview { display: flex; justify-content: center; padding: 8px 0 4px; }
.pf-choices { display: flex; flex-direction: column; gap: 8px; }
.pf-choice { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--ink2); padding: 12px 14px; text-align: left; cursor: pointer; font-family: var(--sans); color: var(--bright); }
.pf-choice b { display: block; font-size: 14.5px; font-weight: 800; color: var(--bright); }
.pf-choice small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; font-weight: 500; }
.pf-choice.on { border-color: var(--bright); box-shadow: inset 0 0 0 1px var(--bright); }
.pf-sheet-msg { font-size: 13px; color: var(--green); margin-top: 12px; font-weight: 600; }
.pf-sheet-msg:empty { display: none; }
.pf-sheet-msg.bad { color: var(--red); }
.pf-sheet-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.pf-sheet-foot:empty { display: none; }
.pf-sheet-actions { display: flex; justify-content: flex-end; }
.btn.pf-danger-btn { background: var(--red); border-color: var(--red); color: #fff; }
body.pf-sheet-open { overflow: hidden; }

@media (max-width: 640px) {
  .pf-grid { display: flex; flex-direction: column; gap: 14px; }
  .pf-grid > .tile { width: 100%; }
  .pf-hero-top { gap: 14px; }
  .pf-name { font-size: 19px; }
  .pf-av-lg { width: 60px; height: 60px; font-size: 21px; }
  .pf-stats { gap: 8px; margin-top: 16px; }
  .pf-stat { padding: 10px 11px; border-radius: 12px; }
  .pf-stat b { font-size: 16px; }
  .pf-sheet-back { align-items: flex-end; padding: 0; }
  .pf-sheet { width: 100%; max-height: 90vh; max-height: 90dvh; border-radius: 22px 22px 0 0; padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
  .pf-sheet-foot .btn, .pf-sheet-actions .btn { flex: 1; }
  .pf-sheet-actions .btn { width: 100%; }
}

html[data-theme="dark"] .pf-chip-founding { background: #633806; color: #FAC775; }
html[data-theme="dark"] .pf-chip-pro { background: #3C3489; color: #CECBF6; }
html[data-theme="dark"] .pf-chip-plus { background: #0C447C; color: #B5D4F4; }
html[data-theme="dark"] .pf-plan-founding { background: #412402; border-color: #854F0B; }
html[data-theme="dark"] .pf-plan-founding .t-label, html[data-theme="dark"] .pf-plan-founding .t-head svg, html[data-theme="dark"] .pf-plan-founding .pf-plan-copy { color: #FAC775; }
html[data-theme="dark"] .pf-plan-founding .pf-plan-name { color: #FAEEDA; }
html[data-theme="dark"] .pf-plan-pro { background: #26215C; border-color: #3C3489; }
html[data-theme="dark"] .pf-plan-pro .t-label, html[data-theme="dark"] .pf-plan-pro .pf-plan-copy { color: #AFA9EC; }
html[data-theme="dark"] .pf-plan-pro .pf-plan-name { color: #EEEDFE; }
html[data-theme="dark"] .pf-sheet-back { background: rgba(0,0,0,.6); }

/* =========================================================================
 * Admin page (v0.9.58, admin-ui.js). Reuses the Profile sheet, chips and stat tiles.
 * ========================================================================= */
.adm-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.adm-kpis .pf-stat { background: var(--ink2); border: 1px solid var(--line); box-shadow: var(--shadow-card); }
.adm-bar-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.adm-tabs { max-width: 460px; flex: 1; }
.adm-error { color: var(--red); font-size: 13.5px; font-weight: 600; margin: 0 0 12px; }
.adm-body { padding: 8px 18px 14px; }
.adm-empty { color: var(--muted); font-size: 13.5px; padding: 18px 0; }
.adm-note { color: var(--muted); font-size: 12.5px; margin: 2px 0 8px; }
.adm-list { display: flex; flex-direction: column; }
.adm-head, .adm-person { display: grid; grid-template-columns: 40px minmax(0, 1.7fr) minmax(0, .7fr) minmax(0, .8fr) repeat(3, minmax(0, .5fr)) minmax(0, .9fr) 16px; gap: 12px; align-items: center; }
.adm-head { padding: 10px 0; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; border-bottom: 1px solid var(--line); }
.adm-person { width: 100%; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer; font-family: var(--sans); color: var(--text); font-size: 13.5px; }
.adm-person:last-child, .adm-invite:last-child, .adm-audit:last-child { border-bottom: 0; }
.adm-person:hover .adm-who b { color: var(--accent); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.adm-av { --av: #185FA5; width: 36px; height: 36px; border-radius: 50%; background: var(--av); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.adm-who { display: flex; flex-direction: column; min-width: 0; }
.adm-who b { font-size: 14px; font-weight: 800; color: var(--bright); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-who b small { font-weight: 600; color: var(--muted); }
.adm-who small { font-size: 12px; color: var(--muted); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-cell { color: var(--sub); font-weight: 600; }
.adm-chev { color: var(--dim); }
.pf-chip.adm-susp { background: #FCEBEB; color: #791F1F; }
.pf-chip.adm-joined { background: #EAF3DE; color: #27500A; }
.pf-chip.adm-pending { background: #FAEEDA; color: #633806; }
.adm-invite, .adm-audit { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.adm-invite .adm-who, .adm-audit .adm-who { flex: 1; }
.adm-audit .adm-who b { white-space: normal; font-weight: 700; }
.adm-actions { display: flex; gap: 14px; }
.adm-health { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 10px 0 4px; }
.adm-card { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; min-width: 0; }
.adm-card h3 { font-size: 13px; font-weight: 800; color: var(--bright); margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.adm-wide { grid-column: 1 / -1; }
.adm-job { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; }
.adm-job .adm-who small { white-space: normal; }
.adm-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex: none; background: var(--dim); }
.adm-dot.good { background: var(--green); } .adm-dot.bad { background: var(--red); } .adm-dot.late { background: var(--amber-dot); }
.adm-err { color: var(--red) !important; }
.adm-mailbar { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--sub); }
.adm-mailbar b { color: var(--bright); }
.adm-mini { margin-top: 8px; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.adm-fb { padding: 10px 0; border-bottom: 1px solid var(--line); }
.adm-fb:last-child { border-bottom: 0; }
.adm-fb p { margin: 0 0 4px; font-size: 14px; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.adm-fb.new p { color: var(--bright); font-weight: 600; }
.adm-fb small { font-size: 12px; color: var(--muted); margin-right: 10px; }
.adm-errrow { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.adm-errrow:last-child { border-bottom: 0; }
.adm-errrow code { font-family: var(--mono); font-size: 12px; color: var(--red); overflow-wrap: anywhere; }
.adm-errrow small { font-size: 11.5px; color: var(--muted); }
.adm-bar { display: grid; grid-template-columns: 90px 1fr 36px; align-items: center; gap: 10px; font-size: 12.5px; color: var(--sub); padding: 4px 0; }
.adm-bar i { display: block; height: 8px; border-radius: 99px; background: #7F77DD; }
.adm-bar b { text-align: right; color: var(--bright); font-variant-numeric: tabular-nums; }
.adm-sheet-id { display: flex; align-items: center; gap: 12px; padding: 4px 0 10px; }
.adm-sheet-id .adm-who small { white-space: normal; }
.adm-sheet-plan { display: flex; gap: 6px; padding-bottom: 6px; }
.adm-danger { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.adm-danger .btn { align-self: flex-start; }
html[data-theme="dark"] .pf-chip.adm-susp { background: #791F1F; color: #F7C1C1; }
html[data-theme="dark"] .pf-chip.adm-joined { background: #27500A; color: #C0DD97; }
html[data-theme="dark"] .pf-chip.adm-pending { background: #633806; color: #FAC775; }
@media (max-width: 900px) {
  .adm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adm-health { grid-template-columns: minmax(0, 1fr); }
  .adm-head { display: none; }
  .adm-person { grid-template-columns: 40px minmax(0, 1fr) auto 16px; }
  .adm-person .adm-cell:not(.adm-plan) { display: none; }
}
@media (max-width: 640px) {
  #adminView .page-h .btn { width: 100%; }
  .adm-bar-top { flex-direction: column; align-items: stretch; }
  .adm-tabs { max-width: none; }
  .adm-body { padding: 4px 14px 10px; }
  .adm-danger .btn { align-self: stretch; }
}

/* in a sheet there is room to say the whole thing */
.pf-sheet .pf-row-sub { white-space: normal; }

/* email sign-in, step 2: the code from the email */
.auth-providers #emailCodeForm { margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--line2); }
.auth-providers #emailCodeForm[hidden] { display: none; }
.auth-code-intro { margin: 0 0 12px; font-size: 13px; line-height: 1.5; color: var(--sub); }
#emailCodeForm input[name="code"] { font-family: var(--mono); font-size: 20px; letter-spacing: .25em; text-align: center; }
#emailCodeForm .modal-actions { justify-content: flex-start; gap: 10px; flex-wrap: wrap; }

/* Alerts (Phase 2): snooze and repeat controls on each card */
.al-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 0; }
.al-sel { font-family: var(--sans); font-size: 12.5px; font-weight: 600; color: var(--sub); background: var(--ink3); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; max-width: 100%; }
.al-sel:hover { color: var(--bright); border-color: var(--dim); }
.al-snoozed { font-size: 12.5px; font-weight: 600; color: var(--amber-ink); background: var(--ink3); border-radius: 999px; padding: 6px 12px; }
.al-link { background: none; border: 0; padding: 0 4px; font-family: var(--sans); font-size: 12.5px; font-weight: 700; color: var(--accent); cursor: pointer; }
.alert-symbol-row[hidden], .alert-repeat-row[hidden], .alert-baseline-row[hidden] { display: none; }
#alertForm select optgroup[hidden], #alertForm select option[hidden] { display: none; }
.al-opts .al-sel { width: auto; flex: 0 1 auto; }


/* =========================================================================
 * CSV import (csv-import-ui.js)
 * ========================================================================= */
#importModal { align-items: flex-start; padding-top: min(9vh, 72px); }
.ci-modal { width: min(620px, 100%); }
.ci-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 30px 16px; border: 2px dashed var(--line); border-radius: 18px; background: var(--ink2); cursor: pointer; text-align: center; }
.ci-drop b { color: var(--bright); font-size: 15px; } .ci-drop span { color: var(--muted); font-size: 12.5px; }
.ci-drop:hover, .ci-drop.over, .ci-drop:focus-visible { border-color: var(--accent); outline: none; }
.ci-hint { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin: 12px 0; }
.ci-paste { margin: 8px 0 4px; } .ci-paste summary, .ci-cols summary, .ci-skip summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--accent); }
.ci-paste textarea { width: 100%; box-sizing: border-box; margin: 8px 0; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--ink2); color: var(--bright); font: 12px/1.4 ui-monospace, Menlo, Consolas, monospace; resize: vertical; }
.ci-past { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 8px; background: var(--ink2); }
.ci-pt { flex: 1; min-width: 0; } .ci-pt b { display: block; font-size: 13.5px; color: var(--bright); } .ci-pt small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-src { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; } .ci-src b { font-size: 16px; color: var(--bright); } .ci-src small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-warn { border: 1px solid #b97f0a; border-radius: 12px; padding: 10px 12px; font-size: 12.5px; line-height: 1.5; color: #b97f0a; margin: 10px 0; } .ci-warn b { color: inherit; }
.ci-err { border: 1px solid var(--red); border-radius: 12px; padding: 10px 12px; font-size: 13px; color: var(--red); margin: 10px 0; line-height: 1.5; }
.ci-new { font-size: 12.5px; color: var(--sub); line-height: 1.5; margin: 10px 0; } .ci-new b { color: var(--bright); }
.ci-tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; margin: 10px 0; }
.ci-tbl table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ci-tbl th { text-align: left; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ci-tbl td { padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; color: var(--sub); text-transform: capitalize; } .ci-tbl td b { color: var(--bright); text-transform: none; } .ci-tbl td small { color: var(--muted); text-transform: none; }
.ci-tbl tr:last-child td { border-bottom: 0; } .ci-tbl .r { text-align: right; } .ci-dup td { opacity: .5; }
.ci-more { display: block; padding: 8px 10px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); }
.ci-opts { display: grid; gap: 8px; margin: 12px 0; }
.ci-modal label.ci-chk { display: flex; flex-direction: row; align-items: center; gap: 8px; font: 600 13px/1.4 inherit; font-family: inherit; text-transform: none; letter-spacing: 0; color: var(--sub); cursor: pointer; } .ci-modal .ci-chk input { width: 18px; height: 18px; flex: none; margin: 0; padding: 0; accent-color: var(--accent); } .ci-chk span { flex: 1; text-align: left; }
.ci-skip, .ci-cols { margin: 10px 0; } .ci-skip ul { margin: 8px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--sub); line-height: 1.6; } .ci-skip li b { color: var(--bright); }
.ci-maps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; margin-top: 10px; }
.ci-modal label.ci-map { display: grid; gap: 4px; font-family: inherit; font-size: 12px; font-weight: 700; text-transform: none; letter-spacing: 0; color: var(--muted); } .ci-map .sel { width: 100%; }
@media (max-width: 520px) { .ci-maps { grid-template-columns: 1fr; } .ci-modal { padding: 18px; } .ci-past { flex-wrap: wrap; } }


/* =========================================================================
 * Several portfolios (portfolios-ui.js)
 * ========================================================================= */
.scope-bar { display: flex; align-items: center; gap: 10px; padding-top: 14px; padding-bottom: 0; }
.scope-bar[hidden] { display: none; }
.scope-bar label { font-size: 12px; font-weight: 700; color: var(--muted); }
.scope-bar .sel { min-width: 0; max-width: 260px; font-weight: 700; }
#portfoliosModal { align-items: flex-start; padding-top: min(9vh, 72px); }
.pfm-modal { width: min(560px, 100%); }
.pfm-copy { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin: 0 0 12px; }
.pfm-list { display: grid; gap: 8px; margin-bottom: 14px; }
.pfm-row { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--ink2); flex-wrap: wrap; }
.pfm-t { flex: 1; min-width: 150px; } .pfm-t b { color: var(--bright); font-size: 14px; } .pfm-t small { display: block; color: var(--muted); font-size: 12px; }
.pfm-tag { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.pfm-acts { display: flex; gap: 6px; flex-wrap: wrap; } .pfm-del { color: var(--red); }
.pfm-edit { display: flex; gap: 8px; width: 100%; align-items: center; flex-wrap: wrap; }
.pfm-in { flex: 1; min-width: 140px; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--ink2); color: var(--bright); font: inherit; font-size: 14px; }
.pfm-in:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.pfm-confirm { margin: -4px 0 0; padding: 12px 14px; border: 1px dashed var(--red); border-radius: 14px; font-size: 13px; color: var(--sub); } .pfm-confirm p { margin: 0 0 8px; }
.pfm-modal label.pfm-radio { display: flex; flex-direction: row; align-items: center; gap: 8px; margin: 6px 0; font-family: inherit; font-size: 13px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--sub); cursor: pointer; }
.pfm-modal .pfm-radio input { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--accent); }
.pfm-row-acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; flex-wrap: wrap; }
.pfm-add-row { display: flex; gap: 8px; }
.add-pf { margin-bottom: 4px; } .add-pf .add-in { width: 100%; }
.ci-modal label.ci-pf { display: grid; gap: 4px; margin: 10px 0 0; font-family: inherit; font-size: 12px; font-weight: 700; text-transform: none; letter-spacing: 0; color: var(--muted); } .ci-pf .sel { width: 100%; }

/* Install app (pwa-ui.js) */
.install-steps { margin: 4px 0 12px; padding-left: 20px; font-size: 14px; line-height: 1.6; color: var(--sub); } .install-steps li { margin-bottom: 8px; } .install-steps b { color: var(--bright); }


/* =========================================================================
 * Guided alert flow (alert-flow-ui.js) - same shell as Add to portfolio
 * ========================================================================= */
#alertFlowModal { align-items: flex-start; padding-top: min(8vh, 64px); }
.af-modal { width: min(560px, 100%); max-height: calc(100vh - min(8vh, 64px) - 24px); overflow-y: auto; }
.af-kicker { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.af-modal .modal-head { align-items: flex-start; }
.af-step { display: block; }
.af-list { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow: auto; margin-top: 10px; padding: 2px; }
.af-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 14px; border-radius: 16px; background: var(--ink2); border: 1.5px solid var(--line); cursor: pointer; font: inherit; color: inherit; transition: border-color var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-press); }
.af-row:hover, .af-row.kb { border-color: var(--bright); }
.af-row:active { transform: scale(.985); }
.af-row.on { border-color: var(--bright); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bright) 10%, transparent); }
.af-badge { width: 38px; height: 38px; border-radius: 50%; background: var(--bright); color: var(--ink2); display: grid; place-items: center; font-weight: 800; font-size: 10.5px; flex: none; letter-spacing: -.01em; }
.af-rt { flex: 1; min-width: 0; } .af-rt b { display: block; color: var(--bright); font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .af-rt b small { font-weight: 600; font-size: 12px; color: var(--muted); } .af-rt > small { display: block; font-size: 12.5px; color: var(--sub); margin-top: 1px; }
.af-rp { text-align: right; flex: none; } .af-rp b { display: block; font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--bright); }
.af-mv { display: block; font-family: var(--mono); font-size: 11.5px; } .af-mv.up { color: var(--green); } .af-mv.dn { color: var(--red); }
.af-tick { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line2); display: grid; place-items: center; font-size: 12px; color: transparent; flex: none; transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast), transform var(--dur-base) var(--ease-spring); }
.af-row.on .af-tick { background: var(--bright); border-color: var(--bright); color: var(--ink2); transform: scale(1.08); }
.af-subject { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--sub); margin-bottom: 12px; } .af-subject .af-badge { width: 30px; height: 30px; font-size: 9px; } .af-subject b { color: var(--bright); } .af-subject .add-link { margin-left: auto; }
.af-cards { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.af-card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 9px 14px; border-radius: 14px; background: var(--ink2); border: 1.5px solid var(--line); cursor: pointer; font: inherit; color: inherit; transition: border-color var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-press); }
.af-card:hover { border-color: var(--bright); } .af-card:active { transform: scale(.985); }
.af-card.on { border-color: var(--bright); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bright) 10%, transparent); }
.af-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--ink3); color: var(--sub); transition: background var(--dur-fast), color var(--dur-fast); }
.af-card.on .af-ic { background: var(--bright); color: var(--ink2); }
.af-ct { flex: 1; } .af-ct b { display: block; font-size: 14px; color: var(--bright); } .af-ct small { display: block; font-size: 12.5px; color: var(--sub); margin-top: 1px; }
.af-meter { background: var(--ink); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px 12px; }
.af-meter-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.af-num { display: flex; align-items: baseline; gap: 6px; font-family: var(--mono); color: var(--muted); font-size: 18px; margin-bottom: 4px; }
.af-num input { width: 100%; border: 0; border-bottom: 2px solid var(--line2); border-radius: 0; background: transparent; font-family: var(--mono); font-size: 32px; font-weight: 500; color: var(--bright); padding: 2px 0; outline: none; -moz-appearance: textfield; }
.af-num input::-webkit-outer-spin-button, .af-num input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.af-num input:focus { border-color: var(--accent); }
.af-hint { font-size: 13px; font-weight: 700; min-height: 19px; margin-bottom: 8px; color: var(--sub); } .af-hint.up { color: var(--green); } .af-hint.down { color: var(--red); }
.af-ladder { position: relative; height: 62px; margin: 6px 6px 2px; }
.af-track { position: absolute; left: 0; right: 0; top: 30px; height: 6px; border-radius: 99px; background: var(--line); }
.af-seg-fill { position: absolute; top: 30px; height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, white)); }
.af-seg-fill.band { background: color-mix(in srgb, var(--green) 30%, transparent); }
.af-now { position: absolute; top: 15px; width: 2px; height: 36px; margin-left: -1px; background: var(--bright); border-radius: 2px; }
.af-mk { position: absolute; top: 25px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--ink2); border: 3px solid var(--accent); box-shadow: 0 1px 4px rgba(25,25,24,.25); }
.af-mk.band { border-color: var(--green); }
.af-tag { position: absolute; white-space: nowrap; font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; }
.af-tag-now { top: 0; color: var(--bright); } .af-tag-alert { top: 48px; color: var(--accent); font-weight: 500; }
.af-now, .af-mk, .af-seg-fill, .af-tag { transition: left var(--dur-base) var(--ease-settle), width var(--dur-base) var(--ease-settle), transform var(--dur-base) var(--ease-settle); }
.af-range { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; margin: 0; cursor: pointer; padding: 0; border: 0; }
.af-range::-webkit-slider-runnable-track { height: 4px; border-radius: 99px; background: var(--line); }
.af-range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--ink2); border: 2px solid var(--bright); margin-top: -9px; box-shadow: 0 2px 6px rgba(25,25,24,.2); transition: transform var(--dur-press); }
.af-range:active::-webkit-slider-thumb { transform: scale(1.14); }
.af-range::-moz-range-track { height: 4px; border-radius: 99px; background: var(--line); }
.af-range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--ink2); border: 2px solid var(--bright); }
.af-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.af-chip { font-family: var(--sans); font-weight: 700; font-size: 12.5px; padding: 6px 12px; color: var(--sub); background: var(--ink2); border: 1px solid var(--line2); border-radius: 99px; cursor: pointer; }
.af-chip.on { background: var(--bright); color: var(--ink2); border-color: var(--bright); }
.af-warn { margin-top: 10px; border: 1px solid var(--amber-dot); background: color-mix(in srgb, var(--amber-dot) 12%, transparent); color: var(--amber-ink); border-radius: 12px; padding: 9px 12px; font-size: 13px; line-height: 1.45; }
.af-warn[hidden] { display: none; }
.af-sentence { margin-top: 12px; font-size: 15px; line-height: 1.5; color: var(--bright); font-weight: 700; padding: 0 2px; }
.af-sentence-card { background: var(--ink); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin: 0 0 14px; font-size: 14.5px; }
.af-backtest { margin-top: 6px; font-size: 12.5px; color: var(--sub); min-height: 18px; padding: 0 2px; }
.af-seg { display: inline-flex; position: relative; background: var(--ink3); border-radius: 99px; padding: 4px; }
.af-seg button { position: relative; z-index: 1; border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 700; padding: 5px 14px; border-radius: 99px; color: var(--sub); cursor: pointer; transition: color var(--dur-fast); }
.af-seg button.active { color: var(--bright); }
.af-seg-wide { display: flex; } .af-seg-wide button { flex: 1; padding: 8px 6px; font-size: 13px; }
.af-chans { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.af-chan { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 14px; padding: 11px 14px; background: var(--ink2); } .af-chan > div { flex: 1; } .af-chan b { display: block; font-size: 14px; color: var(--bright); } .af-chan small { display: block; font-size: 12.5px; color: var(--sub); margin-top: 1px; }
.af-sub { font-size: 12.5px; color: var(--sub); margin-top: 8px; line-height: 1.5; }
.af-sum { display: flex; flex-direction: column; gap: 8px; }
.af-sumrow { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 11px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--ink2); font: inherit; color: inherit; cursor: pointer; transition: border-color var(--dur-fast), transform var(--dur-press); }
.af-sumrow:hover { border-color: var(--bright); } .af-sumrow:active { transform: scale(.985); } .af-sumrow.static { cursor: default; } .af-sumrow.static:hover { border-color: var(--line); } .af-sumrow.static:active { transform: none; }
.af-sumn { width: 26px; height: 26px; border-radius: 50%; background: var(--ink3); color: var(--sub); display: grid; place-items: center; font-weight: 800; font-size: 12px; flex: none; }
.af-sumt { flex: 1; } .af-sumt small { display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); } .af-sumt b { display: block; color: var(--bright); font-size: 14px; margin-top: 2px; }
.af-sumgo { font-size: 12.5px; font-weight: 700; color: var(--accent); }
.af-done { text-align: center; padding: 18px 8px 6px; } .af-check { width: 84px; height: 84px; margin: 0 auto 12px; color: var(--green); }
.af-ring { stroke-dasharray: 151; animation: mo-ring-draw 500ms var(--ease-settle) 50ms both; }
.af-checkmark { stroke-dasharray: 34; animation: mo-tick-draw 320ms var(--ease-settle) 400ms both; }
.af-done-s { font-size: 15px; line-height: 1.5; color: var(--bright); font-weight: 700; max-width: 380px; margin: 0 auto; }
.af-foot { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.af-foot-note { flex: 1; font-size: 12.5px; color: var(--muted); min-height: 18px; }
#afNext.is-busy { opacity: .7; pointer-events: none; } #afNext[disabled] { opacity: .5; cursor: not-allowed; }
.mo-fwd { animation: mo-in-fwd 320ms var(--ease-settle) both; } .mo-back { animation: mo-in-back 320ms var(--ease-settle) both; }
@media (max-width: 520px) { .af-modal { padding: 18px; } .af-num input { font-size: 28px; } }

/* an action on a toast (Undo): the toast host ignores the pointer, the button does not */
.toast-act { pointer-events: auto; margin-left: 6px; align-self: center; border: 0; background: none; padding: 4px 8px; border-radius: 8px; font: inherit; font-size: 12.5px; font-weight: 800; color: var(--accent); cursor: pointer; }
.toast-act:hover { background: var(--ink3); } .toast-act:disabled { opacity: .5; }
.toast:has(.toast-act) { pointer-events: auto; }


/* =========================================================================
 * "What if I sold" (tax-estimate-ui.js)
 * ========================================================================= */
#taxFlowModal { align-items: flex-start; padding-top: min(6vh, 48px); }
.tx-modal { width: min(600px, 100%); max-height: calc(100vh - min(6vh, 48px) - 24px); overflow-y: auto; }
.tx-modal .modal-head { align-items: flex-start; }
.tx-asset { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--ink2); transition: border-color var(--dur-fast), transform var(--dur-press); }
.tx-asset:hover, .tx-asset:focus-within { border-color: var(--bright); } .tx-asset:active { transform: scale(.995); }
.tx-at { flex: 1; min-width: 0; } .tx-at b { display: block; color: var(--bright); font-size: 15px; } .tx-at b small { font-weight: 600; font-size: 12px; color: var(--muted); } .tx-at > small { display: block; font-size: 12.5px; color: var(--sub); margin-top: 2px; } .tx-at > small b { display: inline; font-size: inherit; }
.tx-chev { color: var(--muted); font-size: 14px; }
.tx-asset-sel { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; background: none; font-size: 16px; }
.tx-sec { margin-top: 4px; }
.tx-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.tx-num { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; font-family: var(--mono); color: var(--muted); font-size: 15px; }
.tx-num input { width: 100%; min-width: 0; border: 0; border-bottom: 2px solid var(--line2); border-radius: 0; background: transparent; font-family: var(--mono); font-size: 30px; font-weight: 500; color: var(--bright); padding: 2px 0; outline: none; -moz-appearance: textfield; }
.tx-num input::-webkit-outer-spin-button, .tx-num input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tx-num input:focus { border-color: var(--accent); }
.tx-num.sm input { font-size: 22px; }
.tx-two .af-chips { margin-top: 8px; }
.tx-result { margin-top: 16px; background: var(--ink); border: 1px solid var(--line); border-radius: 20px; padding: 16px 18px 14px; }
.tx-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.tx-head .lab { display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.tx-big { display: block; font-family: var(--mono); font-size: 38px; font-weight: 500; letter-spacing: -.02em; color: var(--bright); line-height: 1.1; }
.tx-after { display: block; font-size: 13px; color: var(--sub); margin-top: 3px; }
.tx-eff { font-size: 13px; font-weight: 700; color: var(--sub); text-align: right; }
.tx-split { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--line); margin-top: 14px; }
.tx-split i { display: block; height: 100%; transition: width var(--dur-slow) var(--ease-settle); }
.tx-split .long { background: var(--green); } .tx-split .short { background: var(--amber-dot); }
.tx-splitl { font-size: 12px; color: var(--sub); margin-top: 6px; }
.tx-cells { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.tx-cell span { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.tx-cell b { display: block; font-family: var(--mono); font-size: 14px; font-weight: 500; color: var(--bright); margin-top: 3px; white-space: nowrap; } .tx-cell b.up { color: var(--green); } .tx-cell b.dn { color: var(--red); }
.tx-lots { display: flex; flex-direction: column; gap: 6px; }
.tx-lot { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--ink2); font-size: 13px; }
.tx-lt b { color: var(--bright); } .tx-lt small { color: var(--muted); font-size: 12px; }
.tx-lg { font-family: var(--mono); font-size: 12.5px; font-weight: 500; } .tx-lg.up { color: var(--green); } .tx-lg.dn { color: var(--red); }
.tx-bar { grid-column: 1 / -1; height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; } .tx-bar i { display: block; height: 100%; border-radius: 99px; background: var(--bright); transition: width var(--dur-slow) var(--ease-settle); }
.tx-term { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 99px; } .tx-term.long { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); } .tx-term.short { background: color-mix(in srgb, var(--amber-dot) 18%, transparent); color: var(--amber-ink); }
.tx-notes { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; } .tx-notes:empty { display: none; }
.tx-warn, .tx-info { border-radius: 12px; padding: 9px 12px; font-size: 13px; line-height: 1.45; }
.tx-warn { border: 1px solid var(--amber-dot); background: color-mix(in srgb, var(--amber-dot) 12%, transparent); color: var(--amber-ink); }
.tx-info { background: var(--ink3); color: var(--sub); } .tx-info b { color: var(--bright); }
.tx-empty { padding: 26px 8px; text-align: center; color: var(--muted); font-size: 14px; }
.tx-wait { display: flex; gap: 12px; align-items: center; margin-top: 12px; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--green); background: color-mix(in srgb, var(--green) 8%, transparent); } .tx-wait > div { flex: 1; } .tx-wait b { display: block; color: var(--bright); font-size: 14px; } .tx-wait small { display: block; font-size: 12.5px; color: var(--sub); margin-top: 2px; line-height: 1.45; }
.tx-rates { margin-top: 14px; font-size: 13px; color: var(--sub); } .tx-rates summary { cursor: pointer; font-weight: 700; color: var(--accent); } .tx-rates summary span { font-weight: 500; color: var(--muted); }
.tx-rates-in { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; margin-top: 10px; } .tx-modal .tx-rates-in label { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; margin: 0; font-family: inherit; font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--sub); }
.tx-rates-in input { width: 70px; border: 1px solid var(--line2); border-radius: 10px; padding: 6px 8px; background: var(--ink2); color: var(--bright); } .tx-rates-in small { flex-basis: 100%; color: var(--muted); }
.tx-disc { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 12px 0 0; }
.tx-foot { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); } .tx-foot .tx-note { flex: 1; font-size: 12.5px; color: var(--muted); }
#txPlan[disabled] { opacity: .5; cursor: not-allowed; }
@media (max-width: 520px) { .tx-modal { padding: 18px; } .tx-two { grid-template-columns: 1fr; } .tx-cells { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tx-big { font-size: 32px; } .tx-wait { flex-direction: column; align-items: stretch; } }

.tx-foot { position: sticky; bottom: -24px; background: var(--ink2); z-index: 3; } .tx-foot .tx-note b { color: var(--bright); font-family: var(--mono); }
@media (max-width: 520px) { .tx-foot { bottom: -18px; } }

/* What moved my money: stacked bars by holding (renderMoneyMoved in bento.js) */
.mm { position: relative; margin: 6px 0 14px; }
.mm-plot { position: relative; display: flex; align-items: stretch; gap: 2px; height: 150px; touch-action: manipulation; }
.mm-col { position: relative; flex: 1 1 0; min-width: 0; cursor: default; border-radius: 3px; transition: background .15s; }
.mm-col:hover, .mm-col.on { background: color-mix(in srgb, var(--muted) 10%, transparent); }
.mm-col i { position: absolute; left: 12%; right: 12%; border-radius: 2px; transition: opacity .2s; animation: mm-rise .5s cubic-bezier(.2, .8, .2, 1) both; }
.mm-plot.hl i[data-sym] { opacity: .16; } .mm-plot.hl i[data-sym].on { opacity: 1; }
.mm-zero { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--line2); pointer-events: none; }
.mm-net { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.mm-net path { fill: none; stroke: var(--bright); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; opacity: .9; }
.mm-axis { display: flex; justify-content: space-between; margin-top: 6px; font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.mm-card { position: absolute; top: 0; z-index: 5; min-width: 150px; padding: 9px 11px; pointer-events: none; font-family: var(--mono); font-size: 11px; line-height: 1.4; white-space: nowrap; background: rgba(255, 255, 255, .86); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border: 1px solid rgba(25, 25, 24, .08); border-radius: 14px; box-shadow: 0 10px 30px -10px rgba(25, 25, 24, .28); color: var(--bright); }
html[data-theme="dark"] .mm-card { background: rgba(30, 30, 28, .8); border-color: rgba(255, 255, 255, .1); color: #f5f5f2; }
.mm-card .ovt-ev b { margin-left: auto; padding-left: 12px; font-weight: 700; }
.dv-dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 3px; vertical-align: 1px; }
@keyframes mm-rise { from { opacity: 0; transform: scaleY(.2); } to { opacity: 1; transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .mm-col i { animation: none; } }
.ov-stats[hidden], .lv-card[hidden], .ov-compare[hidden], .mm[hidden], .mm-card[hidden], .nav-strip[hidden], .ov-rail[hidden] { display: none; }
/* phone: the chart tile is a flex column with the range tabs under the chart; the dots, zoom strip and the rows of chips follow in that order */
@media (max-width: 780px) {
  .chart-tile .pos-rail, .chart-tile .nav-strip, .chart-tile .chart-empty-msg { order: 1; }
  .chart-tile .pos-extras { order: 3; }
}

/* =========================================================================
 * Phase 2.9 (v0.9.73): Dashboard and Portfolio layouts, and the Holdings widget (holdings-ui.js)
 * ========================================================================= */
#homeView .tile.worth { grid-column: span 12; }
#homeView .worth #overviewPerfChart { height: 320px !important; }
#homeView .movers, #homeView .alloc { grid-column: span 6; }
#homeView .fgt, #homeView .upcoming { grid-column: span 6; }
.hw-tile { grid-column: span 12; padding: 0; overflow: hidden; }
#portfolioView .perf { grid-column: span 12; }
#portfolioView .drove { grid-column: span 12; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); column-gap: 34px; align-items: start; }
#portfolioView .drove > .t-head { grid-column: 1 / -1; }
#portfolioView .drove > .mm { grid-column: 1; }
#portfolioView .drove > #droveList { grid-column: 2; }
#portfolioView .drove.no-mm { grid-template-columns: minmax(0, 1fr); }
#portfolioView .drove.no-mm > #droveList { grid-column: 1; }
#portfolioView .watch, #portfolioView .income { grid-column: span 6; }

.hw-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 20px 22px 12px; }
.hw-title { display: flex; align-items: baseline; gap: 12px; }
.hw-total { font-family: var(--mono); font-size: 17px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.hw-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hw-filters { display: flex; gap: 6px; }
.hw-tf { display: flex; align-items: center; gap: 2px; background: var(--ink3); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.hw-tf-l { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 0 6px; }
.hw-tf button { border: 0; background: none; color: var(--sub); font-family: var(--mono); font-size: 12px; padding: 6px 9px; border-radius: 7px; cursor: pointer; min-height: 30px; }
.hw-tf button.on { background: var(--ink2); color: var(--bright); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.hw-sorts { display: none; }
.hw-row {
  display: grid; grid-template-columns: minmax(0, 2.3fr) repeat(3, minmax(0, 1fr)) minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1.25fr);
  column-gap: 16px; align-items: center; padding: 0 22px; min-height: 62px; border-top: 1px solid var(--line); cursor: pointer; transition: background .15s;
}
.hw-row:hover { background: color-mix(in srgb, var(--muted) 8%, transparent); }
.hw-hrow { min-height: 42px; cursor: default; }
.hw-hrow:hover { background: none; }
.hw-row .c { text-align: right; font-family: var(--mono); font-size: 14px; color: var(--bright); font-variant-numeric: tabular-nums; min-width: 0; }
.hw-row .c.up { color: var(--green); } .hw-row .c.dn { color: var(--red); }
.hw-row .c-name { text-align: left; display: flex; align-items: center; gap: 12px; font-family: var(--sans); }
.hw-hrow .c-name { display: block; }
.hw-th { border: 0; background: none; color: var(--muted); font-family: var(--sans); font-size: 12px; font-weight: 700; white-space: nowrap; display: inline-flex; gap: 5px; align-items: center; padding: 10px 0; cursor: pointer; }
.hw-th:hover, .hw-th.on { color: var(--bright); }
.hw-th i { font-style: normal; font-family: var(--mono); color: var(--accent); min-width: 8px; }
.hw-tfl { font-family: var(--mono); font-size: 10px; border: 1px solid var(--line2); border-radius: 5px; padding: 1px 4px; }
.c-pl span, .c-pl small { display: block; }
.c-pl small { font-size: 11.5px; margin-top: 2px; }
.hw-nm { min-width: 0; }
.hw-asset { display: block; max-width: 100%; border: 0; background: none; padding: 0; color: var(--bright); font: inherit; text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hw-asset b { font-weight: 800; font-size: 14.5px; }
.hw-asset:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.hw-sym { color: var(--muted); font-weight: 600; font-size: 13.5px; }
.hw-m-sym, .hw-m-amt { display: none; }
.hw-more, .hw-more[hidden] { display: none; }
.hw-wait { color: var(--muted); }
.hw-empty { padding: 26px 22px; border-top: 1px solid var(--line); color: var(--muted); font-family: var(--mono); font-size: 12px; text-align: center; }
.hw-foot { padding: 12px 22px 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.hw-link { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; }

@media (max-width: 780px) {
  #homeView .tile.worth { order: 0; } #homeView .movers { order: 1; } #homeView .alloc { order: 2; } #homeView .hw-tile { order: 3; }
  #homeView .fgt { order: 4; } #homeView .upcoming { order: 5; } #homeView .taskt { order: 6; } #homeView .streak { order: 7; }
  #portfolioView .drove { display: block; }
  .hw-head { padding: 16px 16px 10px; }
  .hw-tools { width: 100%; }
  .hw-filters { overflow-x: auto; }
  .hw-tf { width: 100%; }
  .hw-tf button { flex: 1; min-height: 36px; }
  .hw-sorts { display: flex; align-items: center; gap: 6px; overflow-x: auto; padding: 0 16px 10px; }
  .hw-sorts span { flex: none; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .hw-sorts .chip { flex: none; }
  .hw-hrow { display: none; }
  .hw-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name total" "name chg" "more more"; row-gap: 2px; padding: 10px 16px; min-height: 60px; }
  .hw-row .c-name { grid-area: name; }
  .hw-row .c-total { grid-area: total; font-size: 14.5px; }
  .hw-row .c-chg { grid-area: chg; font-size: 12px; }
  .hw-row .c-amount, .hw-row .c-price, .hw-row .c-avg, .hw-row .c-pl { display: none; }
  .hw-asset { display: none; }
  .hw-m-sym { display: block; font-weight: 800; font-size: 14.5px; color: var(--bright); }
  .hw-m-amt { display: block; margin-top: 2px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
  .hw-row.open .hw-more { grid-area: more; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; padding: 12px; border-radius: 12px; background: var(--ink3); cursor: default; }
  .hw-more i { display: block; font-style: normal; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .hw-more b { display: block; margin-top: 3px; font-family: var(--mono); font-weight: 500; font-size: 13.5px; color: var(--bright); }
  .hw-more small { display: block; font-family: var(--mono); font-size: 11px; }
  .hw-more .up b, .hw-more .up small { color: var(--green); } .hw-more .dn b, .hw-more .dn small { color: var(--red); }
  .hw-open { grid-column: 1 / -1; justify-self: start; border: 0; background: none; padding: 4px 0; min-height: 36px; color: var(--accent); font-weight: 700; font-size: 13px; cursor: pointer; }
}

/* v0.9.74 - Robinhood-style scrub label: the date above the finger, no box; anything that happened that day in small lines under it */
.scrub-top, .overview-perf-tooltip.scrub-top, .tip2.scrub-top {
  background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; border-radius: 0;
  padding: 0; transform: translateX(-50%); text-align: center; color: var(--muted); white-space: nowrap;
}
.scrub-top .scrub-date { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .02em; color: var(--sub); opacity: 1; }
.scrub-top .scrub-sub { margin-top: 2px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.scrub-top .scrub-sub .up { color: var(--green); } .scrub-top .scrub-sub .dn { color: var(--red); }
.scrub-top .ovt-ev, .scrub-top .ovt-ohlc { justify-content: center; margin-top: 3px; font-size: 11px; }
.scrub-top .ovt-ev { display: inline-flex; padding: 2px 8px; border-radius: 99px; background: var(--ink2); border: 1px solid var(--line); }
.tip2.scrub-top .v { font-weight: 500; font-size: 11px; margin-top: 0; }
.tip2.scrub-top .v:empty { display: none; }
.scrub-top .scrub-date { display: inline-block; padding: 0 6px; background: var(--ink2); }   /* the line stops under the date, as on Robinhood */
#overviewPerfChart { border: 0; background: none; border-radius: 0; }

/* v0.9.75 - CoinStats-style chart card beside the point: date, value, change since the start, then what happened that day */
.cs-card, .overview-perf-tooltip.cs-card, .tip2.cs-card {
  transform: none; text-align: left; white-space: nowrap; min-width: 140px; padding: 9px 12px; border-radius: 12px;
  background: rgba(255, 255, 255, .92); color: var(--bright); border: 1px solid rgba(25, 25, 24, .1); box-shadow: 0 8px 24px -8px rgba(25, 25, 24, .3);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); font-family: var(--mono); font-size: 11.5px; line-height: 1.45; pointer-events: none; z-index: 10;
}
html[data-theme="dark"] .cs-card, html[data-theme="dark"] .overview-perf-tooltip.cs-card, html[data-theme="dark"] .tip2.cs-card { background: rgba(32, 32, 34, .94); border-color: rgba(255, 255, 255, .12); color: #f3f3f5; }
.cs-card .ovt-date { font-size: 11px; letter-spacing: .02em; text-transform: none; color: var(--muted); }
.cs-card .ovt-val { margin-top: 2px; font-size: 14px; font-weight: 700; color: inherit; font-variant-numeric: tabular-nums; }
.cs-card .ovt-chg { margin-top: 1px; font-size: 11.5px; font-weight: 600; }
.cs-card .scrub-sub { margin-top: 3px; font-size: 11px; color: var(--muted); }
.cs-card .scrub-sub .up { color: var(--green); } .cs-card .scrub-sub .dn { color: var(--red); }
.cs-card .ovt-ev { display: flex; padding: 0; border: 0; background: none; justify-content: flex-start; }
.cs-card .ovt-ohlc { justify-content: flex-start; }
.perf-axes { position: absolute; inset: 0; pointer-events: none; z-index: 1; font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.perf-axes .pa-y { position: absolute; right: 0; transform: translateY(-50%); }
.perf-axes .pa-x { position: absolute; bottom: 2px; }

/* v0.9.77 - the asset page's headline cards: six (Market value, Avg. cost, Unrealized P&L, Today, Weight, Volatility) */
.pf-kpis.pos-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1000px) { .pf-kpis.pos-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .pf-kpis.pos-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pf-kpis.pos-kpis .kpi:first-child { grid-column: auto; } }

/* =========================================================================
 * Phase 2.9.5 (v0.9.79): the Analytics page (analytics-ui.js). Allocation, Performance, Risk, Calendar.
 * ========================================================================= */
.an-tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line); margin: 0 0 18px; overflow-x: auto; scrollbar-width: none; }
.an-tabs::-webkit-scrollbar { display: none; }
.an-tab { flex: none; border: 0; background: none; padding: 0 2px 12px; min-height: 40px; font: inherit; font-size: 15px; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.an-tab:hover { color: var(--sub); }
.an-tab.on { color: var(--bright); border-bottom-color: var(--accent); }
.an-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.an-ranges[hidden] { display: none; }
#analyticsView .an-ranges { position: relative; top: auto; right: auto; }
.an-panel[hidden] { display: none; }
.an-panel .bento > .pf-kpis { grid-column: 1 / -1; margin: 0; }
.an-kpis.an-k6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.an-kpis.an-k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.an-kpis .kpi-d { line-height: 1.35; }
.an-empty { padding: 26px 0; text-align: center; color: var(--muted); font-family: var(--mono); font-size: 12px; }
.an-note { margin: 6px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.an-note b { color: var(--sub); }
.an-foot { margin: -36px 0 40px; font-size: 12px; color: var(--muted); }
.an-th { align-items: flex-start; }
.an-th h2, .an-al-head h2 { margin: 4px 0 0; font-size: 21px; font-weight: 800; letter-spacing: -.01em; color: var(--bright); }
.an-tot { font-family: var(--mono); font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.an-tot b.up { color: var(--green); } .an-tot b.dn { color: var(--red); }
.an-sub { margin-top: 18px; }
.an-seg { display: flex; gap: 2px; background: var(--ink3); border: 1px solid var(--line); border-radius: 11px; padding: 3px; }
.an-seg button { border: 0; background: none; color: var(--sub); font: inherit; font-size: 13px; font-weight: 700; padding: 0 13px; min-height: 34px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.an-seg button.on { background: var(--ink2); color: var(--bright); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.an-back { width: 36px; height: 36px; flex: none; border-radius: 50%; border: 1px solid var(--line2); background: none; color: var(--bright); font-size: 18px; line-height: 1; cursor: pointer; }
.an-back:disabled { opacity: .35; cursor: default; }
.an-bar { display: block; position: relative; height: 6px; border-radius: 99px; background: var(--ink4); overflow: hidden; }
.an-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--green); }
.an-list { display: flex; flex-direction: column; margin-top: 4px; }
.an-li { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 44px; padding: 8px 0; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--text); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.an-li:last-child { border-bottom: 0; }
.an-li:hover { color: var(--bright); }
.an-li b { font-family: var(--mono); font-weight: 500; font-size: 13px; white-space: nowrap; }
.an-li small { color: var(--muted); font-family: var(--mono); font-size: 11.5px; margin-left: 4px; }
.an-li .up, .an-day-v.up, .an-ct .up, .an-mv-usd.up { color: var(--green); }
.an-li .dn, .an-day-v.dn, .an-ct .dn, .an-mv-usd.dn { color: var(--red); }
.an-mh { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: center; }
.an-my { font-family: var(--mono); font-size: 11.5px; color: var(--muted); align-self: center; }

/* Allocation */
#analyticsView .an-alloc { grid-column: span 12; padding: 24px 26px; }
#analyticsView .alloc2, #analyticsView .rebal { grid-column: span 6; }
.an-al-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.an-al-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.an-al-body { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 44px; align-items: center; margin-top: 18px; }
.an-donut-box { position: relative; width: 100%; max-width: 400px; aspect-ratio: 1; margin: 0 auto; }
.an-donut { width: 100%; height: 100%; display: block; overflow: visible; }
.an-donut [data-an-slice] { cursor: pointer; transition: opacity .18s, transform .18s; transform-origin: 150px 150px; }
.an-donut [data-an-slice].on { transform: scale(1.025); }
.an-hl .an-donut [data-an-slice]:not(.on), .an-hl .an-lrow:not(.on), .an-hl .an-strip i:not(.on) { opacity: .38; }
.an-center { position: absolute; inset: 22%; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 3px; pointer-events: none; }
.an-center .an-c-open { pointer-events: auto; }
.an-c-dot { width: 11px; height: 11px; border-radius: 4px; }
.an-c-l { font-size: 15px; font-weight: 800; color: var(--bright); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-c-v { font-family: var(--mono); font-size: 30px; font-weight: 500; letter-spacing: -.02em; color: var(--bright); font-variant-numeric: tabular-nums; }
.an-c-p { font-family: var(--mono); font-size: 13.5px; color: var(--muted); }
.an-c-h { margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--accent); }
.an-c-open { margin-top: 8px; border: 1px solid var(--line2); background: var(--ink2); color: var(--bright); font: inherit; font-size: 12.5px; font-weight: 700; border-radius: 99px; padding: 0 14px; min-height: 34px; cursor: pointer; }
.an-legend { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.an-lrow { display: grid; grid-template-columns: 12px minmax(110px, 1.3fr) minmax(0, 1fr) 62px 96px 14px; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 12px; border: 0; border-radius: 14px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background .15s, opacity .18s; }
.an-lrow:hover, .an-lrow.on { background: color-mix(in srgb, var(--muted) 10%, transparent); }
.an-lrow:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.an-ldot { width: 12px; height: 12px; border-radius: 4px; }
.an-lname { min-width: 0; }
.an-lname b { display: block; font-size: 15px; font-weight: 800; color: var(--bright); }
.an-lname small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-lbar { position: relative; height: 6px; border-radius: 99px; background: var(--ink4); overflow: hidden; }
.an-lbar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; }
.an-lpct, .an-lval { font-family: var(--mono); font-size: 14px; text-align: right; color: var(--bright); font-variant-numeric: tabular-nums; }
.an-lpct { color: var(--sub); }
.an-lchev { color: var(--muted); font-size: 16px; text-align: right; }
.an-strip { display: flex; gap: 2px; height: 12px; margin-top: 24px; border-radius: 99px; overflow: hidden; }
.an-strip i { display: block; height: 100%; min-width: 2px; transition: opacity .18s; }

/* Performance */
#analyticsView .an-moved, #analyticsView .an-contrib { grid-column: span 12; }
#analyticsView .an-vs, #analyticsView .an-months { grid-column: span 12; }
.an-mv { margin-top: 16px; }
.an-mv-row, .an-mv-foot { display: grid; grid-template-columns: 72px minmax(0, 1fr) minmax(0, 1fr) 104px 76px; align-items: center; gap: 14px; }
.an-mv-row { width: 100%; min-height: 38px; border: 0; background: none; color: var(--bright); font: inherit; text-align: left; cursor: pointer; padding: 0 6px; border-radius: 10px; }
.an-mv-row:hover { background: color-mix(in srgb, var(--muted) 8%, transparent); }
.an-mv-row b { font-size: 14px; font-weight: 800; }
.an-mv-neg, .an-mv-pos { display: flex; height: 20px; }
.an-mv-neg { justify-content: flex-end; }
.an-mv-pos { border-left: 1px solid var(--line2); }
.an-mv-neg i { display: block; height: 100%; border-radius: 6px 0 0 6px; background: var(--red); }
.an-mv-pos i { display: block; height: 100%; border-radius: 0 6px 6px 0; background: var(--green); }
.an-mv-usd, .an-mv-pct { font-family: var(--mono); font-size: 13.5px; text-align: right; }
.an-mv-pct { color: var(--muted); font-size: 12.5px; }
.an-mv-foot { padding: 6px 6px 0; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.an-mv-foot span:nth-child(2), .an-mv-foot span:nth-child(4), .an-mv-foot span:nth-child(5) { text-align: right; }
.an-legend2 { display: flex; flex-wrap: wrap; gap: 16px; margin: 4px 0 12px; font-size: 13px; font-weight: 700; color: var(--sub); }
.an-legend2 span { display: inline-flex; align-items: center; gap: 7px; }
.an-legend2 i { width: 14px; height: 3px; border-radius: 2px; }
.an-legend2 b { font-family: var(--mono); font-weight: 500; color: var(--bright); }
.an-chart { position: relative; touch-action: pan-y; }
.an-chart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.an-axes { position: absolute; inset: 0; pointer-events: none; font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.an-yl { position: absolute; right: 0; transform: translateY(-120%); background: var(--ink2); padding-left: 4px; }
.an-xaxis { position: relative; height: 18px; margin-top: 6px; font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.an-xl { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.an-xl:first-child { transform: none; } .an-xl:last-child { transform: translateX(-100%); }
.an-cross { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--dim); pointer-events: none; }
.an-cross[hidden], .an-card[hidden] { display: none; }
.an-card { position: absolute; top: 4px; }
.an-card-row { display: flex; align-items: center; gap: 7px; margin-top: 3px; }
.an-card-row i { width: 10px; height: 3px; border-radius: 2px; }
.an-card-row b { margin-left: auto; padding-left: 14px; font-weight: 600; }
.an-mgrid { display: grid; grid-template-columns: 40px repeat(12, minmax(0, 1fr)) 58px; gap: 4px; margin-top: 12px; align-items: center; }
.an-mc { height: 34px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 10.5px; color: var(--bright); font-variant-numeric: tabular-nums; }
.an-mc-none { background: color-mix(in srgb, var(--muted) 5%, transparent); }
.an-myr { background: none; font-size: 11.5px; justify-content: flex-end; }
.an-myr.up { color: var(--green); } .an-myr.dn { color: var(--red); }
.an-ct { margin-top: 12px; }
.an-ct-row { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)) minmax(0, .8fr) minmax(0, 1.4fr); gap: 14px; align-items: center; width: 100%; min-height: 54px; padding: 0 8px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--bright); font: inherit; text-align: right; cursor: pointer; font-family: var(--mono); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.an-ct-row:hover { background: color-mix(in srgb, var(--muted) 8%, transparent); }
.an-ct-h { min-height: 38px; cursor: default; border-top: 0; font-family: var(--sans); font-size: 12px; font-weight: 700; color: var(--muted); }
.an-ct-h:hover { background: none; }
.an-ct-row > :first-child { text-align: left; }
.an-ct-n { font-family: var(--sans); min-width: 0; }
.an-ct-n b { font-weight: 800; font-size: 14.5px; }
.an-ct-n small { margin-left: 8px; color: var(--muted); font-size: 12.5px; }
.an-ct-share { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.an-ct-share .an-bar { width: 110px; }
.an-ct-share em { width: 44px; font-style: normal; }

/* Risk */
#analyticsView .an-score { display: flex; align-items: center; gap: 24px; margin-bottom: 16px; padding: 20px 24px; }
.an-ring { width: 68px; height: 68px; flex: none; border-radius: 50%; display: grid; place-items: center; }
.an-ring b { width: 54px; height: 54px; border-radius: 50%; background: var(--ink2); display: grid; place-items: center; font-family: var(--mono); font-size: 19px; font-weight: 500; color: var(--bright); }
.an-score-t h2 { margin: 4px 0 0; font-size: 20px; font-weight: 800; line-height: 1.3; color: var(--bright); }
.an-score-t p { margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: var(--sub); }
#analyticsView [data-an-panel="risk"] > .pf-kpis { margin-bottom: 18px; }
#analyticsView .an-under { grid-column: span 12; }
#analyticsView .an-corr, #analyticsView .an-roll { grid-column: span 6; }
.an-corr-g { display: grid; gap: 4px; margin-top: 14px; align-items: center; }
.an-cc { height: 42px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 12px; color: var(--bright); }
.an-cbar { display: grid; grid-template-columns: 150px minmax(0, 1fr) 58px; align-items: center; gap: 12px; padding: 8px 0; font-size: 13.5px; color: var(--text); }
.an-cbar b { font-family: var(--mono); font-weight: 500; text-align: right; color: var(--bright); }
.an-cbar small { grid-column: 2 / -1; margin-top: -4px; font-size: 11.5px; color: var(--muted); }
.an-cbar .an-bar { height: 8px; }
.an-cnote { font-size: 12.5px; color: var(--muted); }

/* Calendar */
#analyticsView .an-cal { grid-column: span 8; }
#analyticsView .an-dayt { grid-column: span 4; }
#analyticsView .an-year { grid-column: span 12; }
#analyticsView .an-best, #analyticsView .an-recap, #analyticsView [data-an-panel="calendar"] .snaps { grid-column: span 4; }
.an-cal-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.an-cal-nav { display: flex; align-items: center; gap: 12px; }
.an-cal-nav h2 { margin: 0; font-size: 21px; font-weight: 800; color: var(--bright); }
.an-cal-sum { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.an-cal-sum b.up { color: var(--green); } .an-cal-sum b.dn { color: var(--red); }
.an-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: 16px; }
.an-month .an-day { position: relative; height: 76px; border-radius: 12px; padding: 8px 9px; display: flex; flex-direction: column; justify-content: space-between; border: 0; font: inherit; text-align: left; color: var(--bright); cursor: pointer; }
.an-month .an-day em { font-style: normal; font-family: var(--mono); font-size: 11.5px; opacity: .75; }
.an-month .an-day b { font-family: var(--mono); font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; font-variant-numeric: tabular-nums; }
.an-month .an-day-x { background: none; cursor: default; }
.an-month .an-day-none { background: color-mix(in srgb, var(--muted) 5%, transparent); cursor: default; color: var(--muted); }
.an-month .an-day.today { box-shadow: inset 0 0 0 1.5px var(--dim); }
.an-month .an-day.sel { box-shadow: inset 0 0 0 2px var(--bright); }
.an-month .an-day:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.an-day-v { margin-top: 8px; font-family: var(--mono); font-size: 30px; font-weight: 500; letter-spacing: -.02em; }
.an-day-s { margin: 2px 0 8px; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.an-trades { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--ink3); font-size: 13px; line-height: 1.6; color: var(--sub); }
.an-yearwrap { overflow-x: auto; margin-top: 14px; padding-bottom: 4px; }
.an-yearwrap > * { max-width: 920px; }
.an-year-g { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, auto); gap: 3px; min-width: 560px; }
.an-sq { width: 100%; aspect-ratio: 1; border-radius: 3px; border: 0; padding: 0; cursor: pointer; }
.an-sq.sel { box-shadow: 0 0 0 1.5px var(--bright); }
.an-sq-none { background: color-mix(in srgb, var(--muted) 6%, transparent); cursor: default; }
.an-yaxis { position: relative; height: 16px; min-width: 560px; margin-top: 6px; font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.an-yaxis span { position: absolute; top: 0; }
.an-rc { display: grid; grid-template-columns: 128px minmax(0, 1fr) auto; }
.an-rc .an-bar { margin: 0 4px; }
[data-an-panel="calendar"] .snaps .head-tools { display: flex; gap: 14px; }
.an-short { display: none; }

@media (max-width: 1000px) {
  .an-kpis.an-k6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #analyticsView .an-vs, #analyticsView .an-months, #analyticsView .an-corr, #analyticsView .an-roll { grid-column: span 12; }
  #analyticsView .an-cal, #analyticsView .an-dayt { grid-column: span 12; }
  #analyticsView .an-best, #analyticsView .an-recap, #analyticsView [data-an-panel="calendar"] .snaps { grid-column: span 6; }
  .an-al-body { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 28px; }
  .an-lrow { grid-template-columns: 11px minmax(0, 1fr) auto auto 14px; gap: 10px; padding: 8px 8px; }
  .an-lbar { display: none; }
}
@media (max-width: 780px) {
  .an-tabs { gap: 22px; margin-bottom: 14px; }
  .an-th { flex-wrap: wrap; }
  .an-tot { white-space: normal; }
  .an-kpis.an-k6, .an-kpis.an-k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .an-kpis .kpi:first-child { grid-column: auto; }
  #analyticsView .alloc2, #analyticsView .rebal, #analyticsView .an-best, #analyticsView .an-recap, #analyticsView [data-an-panel="calendar"] .snaps { grid-column: span 12; }
  #analyticsView .an-alloc { padding: 18px 16px; }
  .an-al-head .an-seg { width: 100%; }
  .an-al-head .an-seg button { flex: 1; padding: 0 6px; }
  .an-al-body { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .an-donut-box { max-width: 290px; }
  .an-c-v { font-size: 24px; }
  .an-lpct { font-size: 12.5px; }
  .an-mv-row, .an-mv-foot { grid-template-columns: 52px minmax(0, 1fr) minmax(0, 1fr) 82px; gap: 8px; }
  .an-mv-pct, .an-mv-foot span:nth-child(5) { display: none; }
  .an-ct-row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .an-ct-row > :nth-child(2), .an-ct-row > :nth-child(4), .an-ct-row > :nth-child(5) { display: none; }
  .an-ct-n small { display: block; margin: 2px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .an-ct-share .an-bar { width: 56px; }
  #analyticsView .an-score { align-items: flex-start; gap: 16px; padding: 16px; }
  .an-ring { width: 56px; height: 56px; } .an-ring b { width: 44px; height: 44px; font-size: 16px; }
  .an-score-t h2 { font-size: 17px; }
  .an-cbar { grid-template-columns: 110px minmax(0, 1fr) 52px; }
  .an-month { gap: 4px; }
  .an-month .an-day { height: 54px; padding: 5px; border-radius: 9px; }
  .an-month .an-day em { font-size: 10px; }
  .an-month .an-day b { font-size: 10px; letter-spacing: -.02em; }
  .an-full { display: none; } .an-short { display: inline; }
  .an-cal-nav h2 { font-size: 18px; }
  .an-foot { margin-top: -40px; }
}

/* v0.9.80 - one select look in every browser: iPhone Safari drew the native grey, gradient box (Showing, Allocation, filters) */
select:not([multiple]) {
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%238f8d85' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat !important; background-position: right 12px center !important; background-size: 12px 12px !important; padding-right: 32px;
}
/* the arrow survives the rules that reset a select's whole background (dark mode, the Transactions filters, Allocation) */
html select:not([multiple]) { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%238f8d85' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E") !important; }
.act-filters select.sel, select.alloc-mode { padding-right: 30px !important; background-position: right 11px center !important; }

/* v0.9.80 - phone review fixes */
.an-mgrid-half { grid-template-columns: 40px repeat(6, minmax(0, 1fr)); margin-bottom: 10px; }
.an-mgrid-half .an-mc { font-size: 11px; }
@media (max-width: 780px) {
  /* every card is full width on a phone (only the Dashboard had this; Portfolio put Watchlist and Dividend income side by side at 170px each) */
  .bento > * { grid-column: 1 / -1 !important; }
  /* the What drove header: the total drops under the title instead of squeezing it */
  #droveTile > .t-head { flex-wrap: wrap; row-gap: 2px; }
  #droveTile .drove-total { white-space: nowrap; }
  /* Transactions: Import CSV, Export CSV and Record trade on one line each */
  #activityView .page-h > div:last-child { width: 100%; }
  #activityView .page-h > div:last-child .btn { flex: 1 1 auto; white-space: nowrap; padding-left: 10px; padding-right: 10px; font-size: 13px; }
}

/* v0.9.82 - Portfolio and Holdings on a phone: CoinStats-style three columns, no KPI cards, a round Add button */
.pf-add-ico { display: none; }
.hw-sheet[hidden] { display: none; }
.hw-sheet { position: fixed; inset: 0; z-index: 1000; }
.hw-sheet-bg { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(0, 0, 0, .5); cursor: pointer; }
.hw-sheet-card { position: absolute; left: 0; right: 0; bottom: 0; background: var(--ink2); border-radius: 22px 22px 0 0; padding: 10px 22px calc(20px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -12px 40px -12px rgba(0, 0, 0, .4); }
.hw-sheet-grip { display: block; width: 44px; height: 5px; border-radius: 99px; background: var(--line2); margin: 0 auto 16px; }
.hw-sheet-card h3 { margin: 0; font-size: 20px; font-weight: 800; color: var(--bright); }
.hw-sheet-card p { margin: 4px 0 8px; font-size: 13.5px; color: var(--muted); }
.hw-sheet-opt { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 52px; padding: 0 2px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--bright); font: inherit; font-size: 16px; font-weight: 600; text-align: left; cursor: pointer; }
.hw-sheet-opt:last-child { border-bottom: 0; }
.hw-sheet-opt b { color: var(--green); font-weight: 800; }
.hwp-h, .hwp-row { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, .8fr); gap: 8px; align-items: center; }
.hwp-h { padding: 0 16px; }
.hwp-th, .hwp-tf { display: flex; align-items: center; gap: 4px; min-height: 44px; padding: 0; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer; }
.hwp-th.on, .hwp-tf { color: var(--bright); }
.hwp-tf { justify-content: center; }
.hwp-th.r { justify-content: flex-end; }
.hwp-th i, .hwp-tf i { font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--accent); }
.hwp-tf i { color: var(--muted); }
.hwp-row { width: 100%; min-height: 66px; padding: 8px 16px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.hwp-row:active { background: color-mix(in srgb, var(--muted) 10%, transparent); }
.hwp-a { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hwp-nm { min-width: 0; }
.hwp-l1 { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hwp-l1 b { font-weight: 800; font-size: 15px; color: var(--bright); }
.hwp-q { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.hwp-tot { display: block; margin-top: 3px; font-family: var(--mono); font-size: 13.5px; color: var(--bright); font-variant-numeric: tabular-nums; }
.hwp-pl { text-align: center; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.hwp-usd { display: block; font-size: 13.5px; color: var(--muted); }
.hwp-usd.up { color: var(--green); } .hwp-usd.dn { color: var(--red); }
.hwp-pill { display: inline-block; margin-top: 4px; padding: 2px 6px; border-radius: 7px; font-size: 11.5px; }
.hwp-pill.up { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.hwp-pill.dn { background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--red); }
.hwp-px { text-align: right; font-family: var(--mono); font-size: 13.5px; color: var(--bright); font-variant-numeric: tabular-nums; }
@media (max-width: 780px) {
  /* the five headline cards stay on desktop; on a phone the chart comes first */
  #portfolioView #perfKpis { display: none; }
  /* option B: a round + beside the title */
  #portfolioView .page-h { flex-wrap: nowrap; align-items: center; }
  #portfolioView .page-h > div:first-child { min-width: 0; }
  #portfolioView .pf-add { width: 44px; height: 44px; min-height: 44px; padding: 0 !important; border-radius: 50% !important; display: inline-flex; align-items: center; justify-content: center; flex: none; }
  #portfolioView .pf-add .pf-add-l { display: none; }
  #portfolioView .pf-add .pf-add-ico { display: block; }
  /* 0.12.1: Connect an account beside it, round too, the link icon only */
  #portfolioView .pf-connect { width: 44px; height: 44px; min-height: 44px; padding: 0 !important; border-radius: 50% !important; justify-content: center; flex: none; }
  #portfolioView .pf-connect .pf-connect-l { display: none; }
}
/* 0.12.1: Portfolio's Connect an account (desktop: the link icon and the words, beside + Add position) */
.pf-connect { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.pf-connect[hidden] { display: none !important; }
.pf-connect svg { flex: none; }

/* v0.9.83 - the search preview on a phone: the star and a round + (or → when you hold it) at the top right, beside the name */
.pv-ico { display: none; }
@media (max-width: 780px) {
  .pv-head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; column-gap: 10px; row-gap: 14px; align-items: start; }
  .pv-head .pv-id { grid-column: 1; grid-row: 1; min-width: 0; }
  .pv-head #pvWatch { grid-column: 2; grid-row: 1; }
  .pv-head #pvAdd { grid-column: 3; grid-row: 1; }
  .pv-head .pv-px { grid-column: 1 / -1; grid-row: 2; }
  .pv-icbtn { width: 44px; height: 44px; min-height: 44px; padding: 0 !important; border-radius: 50% !important; display: inline-flex; align-items: center; justify-content: center; flex: none; }
  .pv-icbtn[hidden] { display: none; }
  .pv-icbtn .pv-btn-l { display: none; }
  #pvWatch .pv-ico, #pvAdd .pv-ico-add { display: block; }
  #pvAdd.is-held .pv-ico-add { display: none; }
  #pvAdd.is-held .pv-ico-view { display: block; }
  #pvWatch[aria-pressed="true"] { color: var(--amber-dot); border-color: var(--amber-dot); }
  #pvWatch[aria-pressed="true"] .pv-ico { fill: currentColor; }
}

/* v0.9.86 - crypto wallets synced by address (wallets-ui.js): one sheet, three screens; centred on a desktop, from the bottom on a phone */
.cw-sheet[hidden] { display: none; }
.cw-sheet { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px; }
.cw-bg { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(0, 0, 0, .55); cursor: pointer; }
.cw-card { position: relative; width: min(860px, 100%); max-height: calc(100vh - 48px); overflow: auto; background: var(--ink2); border: 1px solid var(--line); border-radius: 24px; padding: 26px 28px; box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .55); }
#cwBody { display: flex; flex-direction: column; gap: 14px; }
.cw-head { display: flex; align-items: center; gap: 12px; }
.cw-head h2 { flex: 1; margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: var(--bright); }
.cw-round { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 1px solid var(--line2); background: none; color: var(--text); font: inherit; font-size: 20px; line-height: 1; cursor: pointer; }
.cw-sub { margin: -6px 0 4px; line-height: 1.45; display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--sub); }
.cw-ok { color: var(--green); display: inline-flex; }
.cw-search input, .cw-in { width: 100%; height: 48px; border-radius: 13px; border: 1px solid var(--line2); background: var(--ink3); color: var(--bright); font: inherit; font-size: 15px; padding: 0 14px; outline: none; box-sizing: border-box; }
.cw-search input:focus, .cw-in:focus { border-color: var(--accent); }
.cw-mono { font-family: var(--mono); font-size: 14px; }
.cw-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.cw-chips .chip { min-height: 32px; }
.cw-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cw-tile, .cw-any { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 62px; padding: 0 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--ink); color: var(--bright); font: inherit; text-align: left; cursor: pointer; }
.cw-tile:hover, .cw-any:hover { border-color: var(--dim); }
.cw-tile.soon { cursor: default; opacity: .55; }
.cw-tile.soon:hover { border-color: var(--line); }
.cw-any { grid-column: 1 / -1; justify-content: space-between; border-style: dashed; border-color: var(--line2); font-size: 14px; color: var(--sub); }
.cw-pill { flex: none; display: inline-flex; align-items: center; min-height: 36px; padding: 0 16px; border-radius: 99px; background: var(--bright); color: var(--ink2); font-weight: 800; font-size: 13.5px; }
.cw-av { width: 36px; height: 36px; flex: none; border-radius: 11px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 13px; overflow: hidden; }
.cw-av img { width: 100%; height: 100%; object-fit: cover; }
.cw-logo { background: var(--ink3); }
.cw-nm { flex: 1; min-width: 0; }
.cw-nm b { display: block; font-weight: 800; font-size: 14.5px; color: var(--bright); }
.cw-nm small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-nm small.cw-good { color: var(--green); }
.cw-nm small.cw-bad { color: var(--red); white-space: normal; }
.cw-empty { grid-column: 1 / -1; margin: 0; padding: 22px; text-align: center; color: var(--muted); font-size: 14px; }
.cw-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.cw-link { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer; min-height: 36px; }
.cw-lab { display: block; font-family: var(--mono); font-size: 10.5px; line-height: 1.2; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: -6px; }
.cw-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.cw-two .cw-lab { margin-bottom: 8px; }
.cw-nets { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--sub); }
.cw-net { border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent); border-radius: 99px; padding: 4px 11px; font-weight: 700; font-size: 12.5px; }
.cw-prev { border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px; background: var(--ink); }
.cw-prev-h { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding-bottom: 6px; }
.cw-prev-h b { font-size: 17px; letter-spacing: 0; color: var(--bright); font-weight: 500; text-transform: none; }
.cw-prow { display: grid; grid-template-columns: minmax(0, 1fr) auto 110px; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--text); }
.cw-prow b { color: var(--bright); }
.cw-prow small { color: var(--muted); font-size: 12px; }
.cw-num { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; color: var(--bright); }
.cw-more { padding-top: 8px; font-size: 12.5px; color: var(--muted); }
.cw-err { margin: 0; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); font-size: 13.5px; line-height: 1.45; }
.cw-wait, .cw-hint { margin: 0; font-size: 13.5px; color: var(--muted); }
.cw-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.cw-note { font-size: 12.5px; color: var(--muted); }
.cw-go { min-height: 46px; padding: 0 22px; border-radius: 99px; font-family: var(--sans); font-size: 14.5px; font-weight: 800; letter-spacing: 0; text-transform: none; }
.cw-go:disabled { opacity: .45; cursor: default; }
.cw-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.cw-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--line); }
.cw-row:first-child { border-top: 0; }
.cw-val { font-size: 14.5px; }
.cw-btns { display: flex; gap: 6px; }
.cw-btn { min-height: 36px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line2); background: none; color: var(--bright); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.cw-btn:disabled { opacity: .5; }
.cw-btn.warn { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); }
/* 0.12.0 - brokerages and exchanges (SnapTrade) in the same sheet: intro, where accounts go, accounts grouped by sign-in, the notice on Portfolio */
.cw-pro { flex: none; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; font-weight: 500; color: #534AB7; background: rgba(83, 74, 183, .1); border-radius: 6px; padding: 3px 6px; }
html[data-theme="dark"] .cw-pro { color: #9085e9; background: rgba(144, 133, 233, .14); }
.cw-prosub { margin: 0; flex-wrap: wrap; }
.cw-span { grid-column: 1 / -1; padding: 14px 4px; }
.cw-hero { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--sub); line-height: 1.5; }
.cw-hero .cw-av { width: 46px; height: 46px; border-radius: 13px; }
.cw-hero p { margin: 0; }
.cw-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--text); }
.cw-checks li { display: flex; gap: 10px; align-items: flex-start; }
.cw-y, .cw-n { flex: none; font-weight: 800; width: 16px; }
.cw-y { color: var(--green); }
.cw-n { color: var(--red); }
.cw-acc { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.cw-accrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cw-into { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.cw-into .cw-in { height: 40px; font-size: 14px; flex: 1; min-width: 0; max-width: 380px; }
.cw-warnline { margin: 0; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--amber-dot) 13%, transparent); color: var(--text); font-size: 13.5px; line-height: 1.45; }
.cw-warnbox { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 14px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--amber-dot) 45%, transparent); background: color-mix(in srgb, var(--amber-dot) 12%, transparent); font-size: 13.5px; line-height: 1.45; color: var(--text); }
.cw-warnbox p { margin: 0; flex: 1; min-width: 220px; }
.cw-warnbox b { color: var(--bright); }
.cw-small { min-height: 38px; padding: 0 16px; font-size: 13px; }
.cw-sec { margin: 4px 0 -4px; }
.cw-group { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.cw-group:first-child { border-top: 0; }
.cw-ghead { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 16px 10px; }
.cw-arow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 10px 16px 10px 66px; border-top: 1px dashed var(--line); }
.cw-nm small.cw-paused { color: var(--amber-ink); }
.cw-btn.pri { background: var(--accent); border-color: var(--accent); color: #fff; }
.cw-sel { height: 36px; font-size: 12.5px; font-weight: 700; padding: 0 10px; border-radius: 99px; width: auto; max-width: 180px; background: none; }
.cw-move { display: inline-flex; }
.cw-notice { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--amber-dot) 12%, transparent); font-size: 13.5px; color: var(--text); }
.cw-notice[hidden] { display: none; }
.cw-notice > span:nth-child(2) { flex: 1; min-width: 180px; }
.cw-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber-dot); flex: none; }
@media (max-width: 780px) {
  .cw-ghead { grid-template-columns: 36px minmax(0, 1fr); padding: 12px 14px 8px; }
  .cw-ghead .cw-btns { grid-column: 1 / -1; justify-content: flex-end; flex-wrap: wrap; }
  .cw-arow { grid-template-columns: minmax(0, 1fr) auto; padding: 10px 14px; row-gap: 8px; }
  .cw-arow .cw-btns { grid-column: 1 / -1; justify-content: flex-end; }
  .cw-notice { margin: 0 -16px 10px; border-radius: 0; padding: 10px 16px; }   /* flat on phones: one line across the page */
}
.add-wallet-link { margin-top: 12px; border: 1px dashed var(--line2); background: none; border-radius: 12px; padding: 12px 14px; width: 100%; text-align: left; color: var(--accent); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; min-height: 44px; }
@media (max-width: 780px) {
  .cw-sheet { align-items: flex-end; padding: 0; }
  .cw-card { width: 100%; max-height: calc(100vh - 56px); max-height: calc(100dvh - 56px); border-radius: 24px 24px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px)); border-bottom: 0; }
  .cw-head h2 { font-size: 21px; }
  .cw-grid { grid-template-columns: minmax(0, 1fr); gap: 0; border: 1px solid var(--line); border-radius: 15px; overflow: hidden; }
  .cw-tile { border: 0; border-top: 1px solid var(--line); border-radius: 0; min-height: 58px; }
  .cw-any { border-radius: 0; border: 0; border-bottom: 1px dashed var(--line2); }
  .cw-any + .cw-tile, .cw-grid > .cw-tile:first-child { border-top: 0; }
  .cw-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .cw-chips .chip { flex: none; }
  .cw-two { grid-template-columns: minmax(0, 1fr); }
  .cw-prow { grid-template-columns: minmax(0, 1fr) auto 86px; gap: 8px; }
  .cw-row { grid-template-columns: 36px minmax(0, 1fr) auto; row-gap: 10px; }
  .cw-btns { grid-column: 1 / -1; justify-content: flex-end; }
}

/* v0.9.88 - asset page on a phone: no KPI cards (the hero line above already gives the position, value and gain); desktop keeps them */
@media (max-width: 780px) {
  #positionStats { display: none; }
}

/* v0.9.89 - the asset page on a phone (asset-mobile-ui.js): the time range and one settings button under the chart (a sheet
   holds the style, what is drawn and the indicators); the bell by the name; your position and Trade in a bar above the tab bar,
   Trade popping Buy (and Sell when you hold it) upwards. Nothing here shows on a desktop. */
.pm-bell, .pm-bar, .pm-menu, .pm-dim { display: none; }
@keyframes pm-spin { from { transform: rotate(-90deg); } to { transform: none; } }
@media (max-width: 780px) {
  #positionView .ph-cta { display: none !important; }
  #positionView #positionValue { display: none; }
  #positionView .ph-l { width: 100%; }
  #positionView .ph-t { flex: 1; min-width: 0; }
  #positionView .ph-t h1 { overflow: hidden; text-overflow: ellipsis; }
  .pm-bell { display: flex; position: relative; flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line2); background: var(--ink2); color: var(--bright); align-items: center; justify-content: center; padding: 0; cursor: pointer; }
  #positionView .chart-tile .t-head { position: relative; }
  #positionView #chartRangeTabs { padding-right: 58px; }
  /* 0.10.1: the desktop rule "#positionView .chart-tile .t-head { align-items: center }" outranks the phone's stretch, so the
     strip shrank to its text and the labels ran together (1H1D1W...). On a phone it spans the screen again. */
  #positionView .tile.chart-tile .t-head { align-items: stretch; }
  #positionView #chartRangeTabs .range-tab { min-width: 0; }
  #positionView .wrap { padding-bottom: 104px; }
  .pm-bar { display: flex; position: fixed; left: 0; right: 0; bottom: calc(60px + env(safe-area-inset-bottom, 0px)); z-index: 29; align-items: center; gap: 12px; padding: 10px 16px; box-sizing: border-box; background: color-mix(in srgb, var(--ink2) 96%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
  .pm-pos { flex: 1; min-width: 0; min-height: 48px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; border: 0; background: none; padding: 0; text-align: left; font: inherit; color: var(--bright); cursor: pointer; }
  .pm-pos > span { display: block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pm-l1 { font-size: 12px; color: var(--muted); }
  .pm-l2 { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
  .pm-l3 { font-size: 12.5px; font-weight: 600; color: var(--muted); }
  .pm-l3 .up { color: var(--green); }
  .pm-l3 .dn { color: var(--red); }
  .pm-q { font-weight: 400; }
  .pm-trade { flex: none; display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 20px 0 16px; border-radius: 99px; border: 0; background: var(--bright); color: var(--ink2); font: inherit; font-weight: 800; font-size: 15px; cursor: pointer; transition: background .2s ease, color .2s ease; }
  .pm-trade .pm-ico-close { display: none; }
  .pm-trade.on { background: var(--ink3); color: var(--bright); box-shadow: inset 0 0 0 1px var(--line2); }
  .pm-trade.on .pm-ico-trade { display: none; }
  .pm-trade.on .pm-ico-close { display: block; animation: pm-spin .28s cubic-bezier(.34, 1.56, .64, 1); }
  .pm-dim { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(0, 0, 0, .55); opacity: 0; pointer-events: none; transition: opacity .22s ease; }
  .pm-dim.on { opacity: 1; pointer-events: auto; }
  .pm-dim.on ~ .pm-bar { z-index: 46; }   /* above the dimmed page and its sticky header (40) only while the menu is open */
  .pm-menu { display: flex; position: fixed; right: 16px; bottom: calc(150px + env(safe-area-inset-bottom, 0px)); z-index: 47; flex-direction: column; gap: 10px; width: min(220px, calc(100vw - 32px)); pointer-events: none; }
  .pm-menu.on { pointer-events: auto; }
  .pm-opt { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 0 16px 0 10px; border: 0; border-radius: 20px; font: inherit; text-align: left; cursor: pointer; opacity: 0; transform: translateY(22px) scale(.9); transform-origin: bottom right; box-shadow: 0 14px 34px rgba(0, 0, 0, .35); transition: transform .34s cubic-bezier(.34, 1.56, .64, 1), opacity .18s ease; }
  .pm-opt[hidden] { display: none; }
  .pm-menu.on .pm-opt { opacity: 1; transform: none; }
  .pm-menu.on .pm-opt.buy { transition-delay: .06s; }
  .pm-oi { width: 40px; height: 40px; flex: none; border-radius: 13px; display: flex; align-items: center; justify-content: center; }
  .pm-opt b { display: block; font-size: 17px; font-weight: 800; }
  .pm-opt small { display: block; font-size: 12.5px; font-weight: 600; opacity: .88; }
  .pm-opt.buy { background: #34c37a; color: #04210f; }
  .pm-opt.buy .pm-oi { background: rgba(4, 33, 15, .14); }
  .pm-opt.sell { background: #c93c3c; color: #fff; }
  .pm-opt.sell .pm-oi { background: rgba(255, 255, 255, .16); }
  #positionView.first-run .pm-bar, #positionView.first-run .pm-bell, #positionView.first-run .pm-menu, #positionView.first-run .pm-dim { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .pm-opt { transition: opacity .15s ease !important; transform: none !important; }
  .pm-trade.on .pm-ico-close { animation: none; }
}

/* v0.9.90 - one set of buttons everywhere: the bell (with a dot when an alert is set) instead of "Set alert", and Trade with
   its arrows icon, on the desktop asset page too */
.pm-dot { position: absolute; top: 1px; right: 1px; width: 10px; height: 10px; border-radius: 50%; background: var(--amber-dot); border: 2px solid var(--ink); }
.pm-dot[hidden] { display: none; }
.ph-bell { position: relative; flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line2); background: var(--ink2); color: var(--bright); display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; }
.ph-bell:hover { border-color: var(--dim); }
.ph-cta { align-items: center; }
.ph-trade { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }

/* v0.9.90 - windows and sheets on a phone: the page behind stays put (Motion.lockScroll), nothing zooms, and a window fits
   the part of the screen the keyboard leaves */
html.scroll-locked { overflow: hidden; }
.modal, .cw-card, .hw-sheet-card, .cs-box { overscroll-behavior: contain; }
@media (max-width: 780px) {
  /* an iPhone zooms into any field under 16px when it is tapped (the add flow's were 14px) */
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="button"]):not([type="submit"]), select, textarea { font-size: 16px !important; }
  /* no pinch-zoom inside a window or sheet; scrolling still works */
  .modal-overlay, .cw-sheet, .hw-sheet, .cs-panel, .pm-dim, .pm-menu { touch-action: pan-x pan-y; }
  /* follow the visible screen: with the keyboard up, a window sits above it and scrolls inside itself */
  html.scroll-locked .modal-overlay.open { top: var(--vv-top, 0px); bottom: auto; height: var(--vv-h, 100%); }
  html.scroll-locked .modal { max-height: calc(var(--vv-h, 100dvh) - 12px); }
  html.scroll-locked #addModal .add-modal { max-height: calc(var(--vv-h, 100dvh) - min(9vh, 72px) - 12px); }
  html.scroll-locked .cw-sheet, html.scroll-locked .hw-sheet, html.scroll-locked .cs-panel.is-phone { top: var(--vv-top, 0px); bottom: auto; height: var(--vv-h, 100%); }
  /* 0.12.2: the cards inside the sheets follow it too. A card was allowed the full screen height (100vh) while its sheet
     shrank to the space above the keyboard, so with the keyboard up its top (title, close, search) went off the top of the
     screen where it could not be scrolled back (Connect an account, Budget, News brief). Every sheet card now stops at
     the visible height and scrolls inside itself. */
  html.scroll-locked .ex-ov, html.scroll-locked .pf-sheet-back { top: var(--vv-top, 0px); bottom: auto; height: var(--vv-h, 100%); }
  html.scroll-locked .cw-card, html.scroll-locked .ex-card, html.scroll-locked .pf-sheet, html.scroll-locked .hw-sheet-card { max-height: calc(var(--vv-h, 100dvh) - 12px); }
  html.scroll-locked .hw-sheet-card { overflow-y: auto; }
}

/* v0.9.91 - one settings button on every chart (chart-settings-ui.js), on a phone and a desktop. The chips it replaces
   (style tabs, Show, Add, Compare with) stay in the page, hidden: the panel clicks them. */
#positionView .chart-tile .ct-left, #positionView .pos-extras .ov-show, #ovExtras .ov-show, #overviewBenchmarkTabs, .perf-extras .ov-show, .perf-right .chips { display: none !important; }
.cs-btn { position: relative; width: 40px; height: 40px; flex: none; border-radius: 50%; border: 1px solid var(--line2); background: var(--ink2); color: var(--bright); display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; transition: background .2s ease, color .2s ease, border-color .2s ease; }
.cs-btn:hover { border-color: var(--dim); }
.cs-btn svg { transition: transform .32s cubic-bezier(.34, 1.56, .64, 1); }
.cs-btn.on { background: var(--bright); color: var(--ink2); border-color: var(--bright); }
.cs-btn.on svg { transform: rotate(90deg); }
.cs-count { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 4px; box-sizing: border-box; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; animation: cs-bump .3s cubic-bezier(.34, 1.56, .64, 1); }
.cs-count[hidden] { display: none; }
@keyframes cs-bump { from { transform: scale(.4); } to { transform: none; } }
.cs-pills { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.cs-pills[hidden] { display: none; }
.cs-pill { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 4px 0 12px; border-radius: 99px; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-family: var(--mono); font-size: 12px; animation: cs-pop .26s cubic-bezier(.34, 1.56, .64, 1); }
.cs-pill button { width: 26px; height: 26px; border: 0; border-radius: 50%; background: none; color: inherit; font-size: 16px; line-height: 1; padding: 0; cursor: pointer; }
@keyframes cs-pop { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: none; } }
.cs-panel[hidden] { display: none; }
.cs-panel { position: fixed; inset: 0; z-index: 1000; }
.cs-bg { position: absolute; inset: 0; width: 100%; border: 0; padding: 0; background: transparent; cursor: default; }
.cs-box { position: fixed; width: 340px; max-width: calc(100vw - 24px); box-sizing: border-box; overflow-y: auto; overflow-x: hidden; background: var(--ink2); border: 1px solid var(--line2); border-radius: 18px; padding: 14px 18px 16px; box-shadow: 0 24px 60px rgba(0, 0, 0, .28); transform-origin: top right; opacity: 0; transform: translateY(-8px) scale(.96); transition: opacity .16s ease, transform .24s cubic-bezier(.2, .9, .3, 1.15); }
.cs-panel.on .cs-box { opacity: 1; transform: none; }
.cs-box .cs-lab, .cs-box .cs-row, .cs-box .cs-seg { opacity: 0; transform: translateY(-4px); transition: opacity .2s ease, transform .2s ease; }
.cs-panel.on .cs-box .cs-lab, .cs-panel.on .cs-box .cs-row, .cs-panel.on .cs-box .cs-seg { opacity: 1; transform: none; }
.cs-grip { display: none; }
.cs-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cs-head h2 { margin: 0; font-size: 16px; font-weight: 800; color: var(--bright); }
.cs-done { min-height: 36px; padding: 0 16px; border-radius: 99px; border: 0; background: var(--bright); color: var(--ink2); font: inherit; font-weight: 800; font-size: 13px; cursor: pointer; }
.cs-lab { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 14px 0 4px; }
.cs-seg { display: flex; gap: 4px; padding: 3px; border-radius: 12px; background: var(--ink3); border: 1px solid var(--line); }
.cs-seg button { flex: 1 1 0; min-width: 0; min-height: 34px; border: 0; border-radius: 9px; background: none; color: var(--sub); font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; }
.cs-seg button.active { background: var(--bright); color: var(--ink2); }
.cs-rows { display: flex; flex-direction: column; }
.cs-row { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 4px 6px; margin: 0 -6px; width: calc(100% + 12px); border: 0; border-radius: 8px; background: none; color: var(--bright); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.cs-row:hover { background: var(--ink3); }
.cs-row > span { flex: 1; min-width: 0; }
.cs-row small { display: block; font-size: 11.5px; color: var(--muted); }
.cs-sw { position: relative; width: 38px; height: 22px; flex: none; border-radius: 11px; background: var(--line2); transition: background .18s ease; }
.cs-sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .22s cubic-bezier(.34, 1.56, .64, 1); }
.cs-row.active .cs-sw { background: var(--accent); }
.cs-row.active .cs-sw::after { transform: translateX(16px); }
.cs-act > svg { color: var(--muted); flex: none; }
#positionView .chart-tile .t-head { display: flex; align-items: center; gap: 10px; }
#positionView .chart-tile .t-head .cs-pills { flex: 1; }
.cs-wrap-home .cs-btn { position: absolute; top: 18px; right: 22px; }
.worth .cs-wrap-home .ranges { right: 72px; }
#csHomePills { margin-top: 10px; }
.cs-wrap-perf { display: flex; align-items: center; gap: 10px; }
#csPerfPills { margin-top: 8px; }
@media (max-width: 780px) {
  .cs-panel.is-phone .cs-bg { background: rgba(0, 0, 0, .5); opacity: 0; transition: opacity .2s ease; cursor: pointer; }
  .cs-panel.is-phone.on .cs-bg { opacity: 1; }
  .cs-panel.is-phone .cs-box { left: 0; right: 0 !important; bottom: 0; top: auto !important; width: auto; max-width: none; max-height: calc(var(--vv-h, 100dvh) - 48px) !important; border-radius: 22px 22px 0 0; border-bottom: 0; padding: 10px 20px calc(20px + env(safe-area-inset-bottom, 0px)); opacity: 1; transform: translateY(100%); transition: transform .26s cubic-bezier(.2, .8, .2, 1); }
  .cs-panel.is-phone.on .cs-box { transform: none; }
  .cs-panel.is-phone .cs-grip { display: block; width: 44px; height: 5px; border-radius: 99px; background: var(--line2); margin: 0 auto 12px; }
  .cs-panel.is-phone .cs-head h2 { font-size: 20px; }
  .cs-panel.is-phone .cs-done { min-height: 44px; padding: 0 20px; font-size: 14px; }
  .cs-panel.is-phone .cs-lab { margin: 18px 0 6px; }
  .cs-panel.is-phone .cs-seg button { min-height: 40px; font-size: 14px; }
  .cs-panel.is-phone .cs-row { min-height: 52px; margin: 0; width: 100%; padding: 6px 0; border-top: 1px solid var(--line); border-radius: 0; font-size: 15px; }
  .cs-panel.is-phone .cs-rows .cs-row:first-child { border-top: 0; }
  .cs-panel.is-phone .cs-row:hover { background: none; }
  .cs-panel.is-phone .cs-sw { width: 46px; height: 28px; border-radius: 14px; }
  .cs-panel.is-phone .cs-sw::after { width: 22px; height: 22px; }
  .cs-panel.is-phone .cs-row.active .cs-sw::after { transform: translateX(18px); }
  #positionView .chart-tile .t-head .cs-btn { position: absolute; right: 0; top: 2px; }
  #positionView .chart-tile .t-head .cs-pills { flex: none; margin: 0 4px; }
  .cs-wrap { position: relative; }
  .cs-wrap .cs-btn { position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
  .tile.worth .cs-wrap-home { order: 4; }
  .worth .cs-wrap-home .ranges { right: auto; padding-right: 52px !important; }
  .tile.worth #csHomePills { order: 4; margin: 12px 0 0; }
  .cs-wrap-perf { display: block; }
  .cs-wrap-perf #perfRanges { padding-right: 52px; }
}

/* v0.9.91 - Your lots: a summary, the long-/short-term split and one row per lot; cards when the tile is narrow */
.pos-lots, #positionView .act-tile { container-type: inline-size; --lt-long: var(--teal); --lt-short: var(--amber-dot); --lt-short-ink: var(--amber-ink); }
.lt-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lt-sp { flex: 1; }
.lt-sort { display: flex; gap: 2px; padding: 3px; border-radius: 99px; background: var(--ink3); }
.lt-sort:empty { display: none; }
.lt-sort button { border: 0; background: none; color: var(--sub); font: inherit; font-size: 12.5px; font-weight: 700; min-height: 30px; padding: 0 12px; border-radius: 99px; cursor: pointer; }
.lt-sort button.on { background: var(--bright); color: var(--ink2); }
.lt-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.lt-cell { min-width: 0; }
.lt-cell small { display: block; font-size: 12px; color: var(--muted); }
.lt-cell b { display: block; margin-top: 3px; font-size: 16px; font-weight: 800; color: var(--bright); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.lt-cell b.up { color: var(--green); }
.lt-cell b.dn { color: var(--red); }
.lt-cell b span { font-size: 13px; }
.lt-split { margin-top: 16px; }
.lt-split-h { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--sub); margin-bottom: 6px; }
.lt-split-h b.long { color: var(--lt-long); }
.lt-split-h b.short { color: var(--lt-short-ink); }
.lt-split-bar { display: flex; gap: 2px; height: 8px; border-radius: 4px; overflow: hidden; background: var(--line); }
.lt-split-bar i { display: block; height: 100%; }
.lt-split-bar .long { background: var(--lt-long); }
.lt-split-bar .short { background: var(--lt-short); }
.lt-next { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
.lt-next b { color: var(--bright); }
.lt-cols, .lt-row { display: grid; grid-template-columns: 36px minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, .9fr) minmax(0, .9fr); gap: 14px; align-items: center; }
.lt-cols { padding: 16px 8px 6px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.lt-cols span:nth-child(4), .lt-cols span:nth-child(5) { text-align: right; }
.lt-lot { border-top: 1px solid var(--line); }
.lt-row { width: 100%; box-sizing: border-box; padding: 12px 8px; border: 0; background: none; color: var(--bright); font: inherit; text-align: left; cursor: pointer; border-radius: 12px; }
.lt-row:hover { background: var(--ink3); }
.lt-ic { width: 36px; height: 36px; flex: none; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; line-height: 1; }
.lt-ic.buy { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.lt-ic.sell { background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--red); }
.lt-ic.xfer { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.lt-ic.reward { background: color-mix(in srgb, var(--purple) 18%, transparent); color: var(--purple); font-size: 14px; }
.lt-ic.wallet, .lt-ic.out { background: var(--ink3); color: var(--sub); }
.lt-main, .lt-held, .lt-val, .lt-gain { min-width: 0; }
.lt-main b { font-size: 14.5px; font-weight: 800; font-variant-numeric: tabular-nums; }
.lt-first { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 6px; font-style: normal; font-family: var(--mono); font-size: 10.5px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); vertical-align: 1px; }
.lt-row small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-bar { display: block; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.lt-bar i { display: block; height: 100%; border-radius: 3px; background: var(--lt-short); }
.lt-bar i.long { background: var(--lt-long); }
.lt-held small.long { color: var(--lt-long); }
.lt-val, .lt-gain { text-align: right; font-variant-numeric: tabular-nums; }
.lt-val b, .lt-gain b { display: block; font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-gain b.up { color: var(--green); }
.lt-gain b.dn { color: var(--red); }
.lt-pct { display: inline-block; margin-top: 3px; padding: 1px 7px; border-radius: 6px; font-style: normal; font-size: 11.5px; font-weight: 700; background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
.lt-pct.dn { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.lt-pct.flat { background: var(--ink3); color: var(--muted); }
.lt-det { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 12px; align-items: center; margin: 0 8px 12px 58px; padding: 14px 16px; border-radius: 14px; background: var(--ink3); }
.lt-det .lt-cell b { font-size: 14px; }
.lt-acts { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.lt-btn { min-height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line2); background: var(--ink2); color: var(--bright); font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; }
@container (max-width: 620px) {
  .lt-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lt-cols { display: none; }
  .lt-lot { border: 1px solid var(--line); border-radius: 16px; margin-top: 10px; }
  .lt-row { grid-template-columns: 32px minmax(0, 1fr) auto; grid-template-areas: "ic main gain" "held held held"; row-gap: 10px; column-gap: 10px; padding: 12px 14px; }
  .lt-row:hover { background: none; }
  .lt-ic { grid-area: ic; width: 32px; height: 32px; }
  .lt-main { grid-area: main; }
  .lt-gain { grid-area: gain; }
  .lt-held { grid-area: held; }
  .lt-val { display: none; }
  .lt-det { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 14px 14px; }
  .lt-acts { grid-column: 1 / -1; }
  .lt-btn { flex: 1; min-height: 44px; }
}

/* v0.9.91 - the asset page's Transactions: filters with counts, months, type icons, notes, what it is worth now */
#positionView .act-tile .t-head { flex-wrap: wrap; gap: 10px; }
#positionView .act-tile .act-filters { overflow: visible; flex-wrap: wrap; width: auto; padding-bottom: 0; }
#posActTypeChips { display: flex; gap: 6px; flex-wrap: wrap; }
#posActTypeChips .chip i { font-style: normal; opacity: .7; margin-left: 4px; }
.pt-icb { width: 36px; height: 36px; flex: none; border-radius: 50%; border: 1px solid var(--line2); background: none; color: var(--bright); display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; }
.pt-mh { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; text-transform: none; letter-spacing: 0; font-weight: 400; }
.pt-mh b { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--sub); font-weight: 500; }
.pt-mh span { font-size: 12px; color: var(--muted); }
.pt-note { display: inline-block; max-width: 100%; box-sizing: border-box; margin-top: 4px; padding: 2px 8px; border-radius: 6px; background: var(--ink3); color: var(--sub); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: top; }
#positionView .act-tile .al-head .lt-ic { width: 34px; height: 34px; }
#positionView .act-tile .al-main { min-width: 0; }
#positionView .act-tile .al-end { flex: none; text-align: right; }
@media (max-width: 780px) {
  #positionView .act-tile .act-filters { width: 100%; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
  .cs-box, .cs-box .cs-lab, .cs-box .cs-row, .cs-box .cs-seg, .cs-btn svg, .cs-sw::after { transition: opacity .12s ease !important; transform: none !important; }
  .cs-pill, .cs-count { animation: none; }
}
@media (min-width: 781px) {
  /* the ranges sit right, next to the settings button, now that the style tabs have gone into the panel */
  #positionView .chart-tile .t-head #chartRangeTabs { margin-left: auto; }
  /* the net worth tile's Refresh was always covered by the ranges here; with the button beside them it showed through */
  .tile.worth > .t-head .head-tools .rf { display: none; }
}

/* v0.9.93 - one Filter button for the lists (filter-ui.js): Transactions, the asset page's transactions, Holdings and
   News. The chip rows stay in the page for the panel to click, hidden on every screen. Its panel is the charts' panel. */
#actTypeChips, #posActTypeChips, #portfolioView .hw-filters, #newsFilters { display: none !important; }
.fl-btn { position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 15px 0 13px; box-sizing: border-box; border-radius: 99px; border: 1px solid var(--line2); background: var(--ink2); color: var(--bright); font-family: var(--sans); font-weight: 700; font-size: 13.5px; cursor: pointer; transition: background .2s ease, color .2s ease, border-color .2s ease; }
.fl-btn:hover { border-color: var(--dim); }
.fl-btn svg { transition: transform .32s cubic-bezier(.34, 1.56, .64, 1); }
.fl-btn.on, .fl-btn.is-set { background: var(--bright); color: var(--ink2); border-color: var(--bright); }
.fl-btn.on svg { transform: rotate(-12deg) scale(1.08); }
.fl-count { min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; animation: cs-bump .3s cubic-bezier(.34, 1.56, .64, 1); }
.fl-count[hidden] { display: none; }
.fl-pills { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.fl-pills[hidden] { display: none; }
.fl-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.fl-box { width: 270px; transform-origin: top left; }
.fl-reset { border: 0; background: none; color: var(--accent); font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; min-height: 36px; padding: 0 4px; }
.fl-opts { display: flex; flex-direction: column; margin-top: 6px; }
.fl-opt { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 0 10px; border: 0; border-radius: 10px; background: none; color: var(--bright); font: inherit; font-size: 14px; text-align: left; cursor: pointer; opacity: 0; transform: translateY(-4px); transition: opacity .2s ease, transform .2s ease, background .15s ease; }
.cs-panel.on .fl-opt { opacity: 1; transform: none; }
.fl-opt:hover { background: var(--ink3); }
.fl-opt.on { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.fl-dot { width: 18px; height: 18px; flex: none; border-radius: 50%; border: 2px solid var(--line2); box-sizing: border-box; position: relative; transition: border-color .2s ease; }
.fl-opt.on .fl-dot { border-color: var(--accent); }
.fl-opt.on .fl-dot::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent); animation: cs-pop .22s cubic-bezier(.34, 1.56, .64, 1); }
.fl-l { flex: 1; min-width: 0; }
.fl-n { font-family: var(--mono); font-size: 12px; color: var(--muted); }
@media (max-width: 780px) {
  .cs-panel.is-phone .fl-box { width: auto; }
  .cs-panel.is-phone .fl-opt { min-height: 52px; font-size: 15px; }
  .cs-panel.is-phone .fl-opt:hover { background: none; }
  .cs-panel.is-phone .fl-opt.on { background: color-mix(in srgb, var(--accent) 12%, transparent); }
  /* the Transactions page: search across the top, then Filter and the three dropdowns two by two; nothing scrolls sideways */
  #activityView .act-tile .act-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; overflow: visible; padding-bottom: 0; }
  #activityView .act-tile .act-filters .act-search { grid-column: 1 / -1; width: 100%; box-sizing: border-box; }
  #activityView .act-tile .act-filters .sel, #activityView .act-tile .act-filters .fl-btn { width: 100%; min-width: 0; }
  #activityView .act-tile .act-filters .fl-pills { grid-column: 1 / -1; order: 9; }   /* after the dropdowns, so Filter sits beside All assets */
}

/* v0.9.93 - Alerts: a sliding switch; the highlight glides under the option that is on */
#alertFilterRow.fl-seg { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0; padding: 4px; border-radius: 14px; background: var(--ink2); border: 1px solid var(--line); box-shadow: var(--shadow-card); overflow: visible; }
#alertFilterRow .fl-thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / var(--fl-n, 4)); border-radius: 10px; background: var(--bright); transform: translateX(calc(var(--fl-i, 0) * 100%)); transition: transform .36s cubic-bezier(.34, 1.4, .64, 1); }
#alertFilterRow.fl-seg .fc { position: relative; z-index: 1; background: none !important; border: 0 !important; box-shadow: none; border-radius: 10px; padding: 9px 18px; color: var(--sub); transition: color .2s ease; }
#alertFilterRow.fl-seg .fc.on, #alertFilterRow.fl-seg .fc.active { color: var(--ink2); }
@media (max-width: 640px) {
  #alertFilterRow.fl-seg { display: grid; width: 100%; box-sizing: border-box; }
  #alertFilterRow.fl-seg .fc { padding: 10px 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .fl-opt, .fl-btn svg, #alertFilterRow .fl-thumb { transition: opacity .12s ease !important; transform: none; }
  #alertFilterRow .fl-thumb { transform: translateX(calc(var(--fl-i, 0) * 100%)) !important; }
  .fl-count, .fl-opt.on .fl-dot::after { animation: none; }
}

/* v0.9.94 - one look for every button and every toolbar dropdown: the Filter button's. A 40px pill, the card colour, a
   hairline border, the sans face at 700 / 13.5px; primary actions filled. It replaces five button styles (.btn.pri,
   .btn.gh, .btn.ghost, .btn-primary, .btn-ghost) and four dropdown styles that had drifted apart (28 to 44px, mono or
   sans, 11 to 13px). ".btn.btn" is there only to outrank those older two-class rules. Form fields inside windows keep
   their field look. */
html .btn.btn {
  min-height: 40px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 0 16px; border-radius: 99px; border: 1px solid var(--line2); background: var(--ink2); color: var(--bright);
  font-family: var(--sans); font-weight: 700; font-size: 13.5px; letter-spacing: 0; text-transform: none; line-height: 1.15;
  box-shadow: none; transform: none; transition: background .2s ease, color .2s ease, border-color .2s ease, opacity .2s ease;
}
html .btn.btn[hidden] { display: none !important; }
html .btn.btn:hover { border-color: var(--dim); }
html .btn.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html .btn.btn:is(.pri, .btn-primary) { background: var(--bright); color: var(--ink2); border-color: var(--bright); }
html .btn.btn:is(.pri, .btn-primary):hover { background: var(--bright); opacity: .88; }
html .btn.btn:is(.btn-danger, .pf-danger-btn) { background: var(--red); color: #fff; border-color: var(--red); }
html .btn.btn:disabled { opacity: .5; cursor: default; }
html .btn.btn.icon-only { width: 40px; padding: 0; }
html .btn.btn.rf { padding: 0 14px; }
html .btn.btn.rf.done { border-color: var(--green); color: var(--green); }
html .btn.btn.rf.fail { border-color: var(--red); color: var(--red); }

/* the toolbar dropdowns: Showing (portfolio), Allocation's grouping, the Transactions filters, an alert's snooze and repeat */
html :is(.scope-bar select.sel, .act-filters select.sel, select.alloc-mode, select.al-sel) {
  height: 40px; min-height: 40px; box-sizing: border-box; width: auto; max-width: 100%; border-radius: 99px;
  border: 1px solid var(--line2); background-color: var(--ink2); color: var(--bright);
  font-family: var(--sans); font-weight: 700; font-size: 13.5px; letter-spacing: 0; text-transform: none; line-height: normal;
  padding: 0 38px 0 16px !important; background-position: right 15px center !important; cursor: pointer; box-shadow: none;
  transition: border-color .2s ease;
}
html :is(.scope-bar select.sel, .act-filters select.sel, select.alloc-mode, select.al-sel):hover { border-color: var(--dim); }
html :is(.scope-bar select.sel, .act-filters select.sel, select.alloc-mode, select.al-sel):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* the Transactions search: the same pill, with a magnifier */
html .act-filters input.act-search {
  height: 40px; min-height: 40px; box-sizing: border-box; border-radius: 99px; border: 1px solid var(--line2); background-color: var(--ink2);
  color: var(--bright); font-family: var(--sans); font-weight: 500; font-size: 13.5px; letter-spacing: 0; padding: 0 16px 0 40px !important;   /* the phone filter rules set padding too */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238f8d85' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 15px center; background-size: 16px 16px; outline: none;
}
html .act-filters input.act-search::placeholder { color: var(--muted); font-family: var(--sans); }
html .act-filters input.act-search:focus { border-color: var(--accent); }
/* the newer buttons follow the same measure */
html :is(.lt-add, .lt-btn) { min-height: 40px; padding: 0 16px; font-size: 13.5px; font-weight: 700; border-color: var(--line2); }
html .pt-icb { width: 40px; height: 40px; }
@media (max-width: 780px) {
  /* a phone's dropdowns and search must be 16px (smaller makes an iPhone zoom in), so the buttons beside them follow at 15 */
  html .btn.btn, html .fl-btn, html :is(.lt-add, .lt-btn) { font-size: 15px; }
  html .modal .btn.btn { min-height: 44px; }
  html .btn.btn.rf { width: 40px; padding: 0; }
}

/* v0.9.95 - Free and Pro, the Budget tab, the Plans page.
   The PRO tag is the purple of the profile's Pro badge (gold stays for founding members). On a phone the Analytics tabs become five
   equal columns with short names and the tag on each corner, so the row fits the screen without scrolling sideways. */
.pro-tag { display: inline-flex; align-items: center; height: 17px; padding: 0 6px; border-radius: 6px; background: #534AB7; color: #fff; font-family: var(--sans); font-size: 9.5px; font-weight: 800; letter-spacing: .04em; line-height: 1; vertical-align: 2px; flex: none; }
.pro-tag-lg { height: 26px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.an-tab .pro-tag { margin-left: 7px; }
.an-tab .an-short { display: none; }
.an-locked[hidden] { display: none; }
.an-lock-card { max-width: 520px; margin: 24px auto 8px; padding: 28px; border-radius: 24px; background: var(--ink2); border: 1px solid color-mix(in srgb, #534AB7 45%, var(--line)); box-shadow: var(--shadow-card), 0 0 0 6px color-mix(in srgb, #534AB7 8%, transparent); }
.an-lock-card h2 { margin: 14px 0 6px; font-size: 22px; font-weight: 800; color: var(--bright); letter-spacing: -.01em; }
.an-lock-card p { margin: 0 0 12px; color: var(--sub); font-size: 14.5px; line-height: 1.5; }
.an-lock-card ul { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 8px; }
.an-lock-card li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text); }
.an-lock-card li svg { flex: none; margin-top: 2px; color: #7F77DD; }
.an-lock-card .an-lock-go { width: 100%; min-height: 46px; background: #534AB7 !important; border-color: #534AB7 !important; color: #fff !important; }
.an-lock-card small { display: block; text-align: center; margin-top: 10px; font-size: 12.5px; color: var(--muted); }

/* ---- Budget ---- */
.bd-host { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.bd-host > * { min-width: 0; }   /* a long bill name must never widen the column (0.9.97) */
.bd-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bd-rnd { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 1px solid var(--line2); background: var(--ink2); color: var(--bright); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.bd-rnd:disabled { opacity: .35; cursor: default; }
.bd-month { min-width: 160px; text-align: center; font-size: 18px; font-weight: 800; color: var(--bright); }
.bd-grow { flex: 1; }
.bd-bar .bd-sm { display: none; }
.bd-note { display: flex; align-items: flex-start; gap: 8px; margin: 2px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.bd-note svg { flex: none; margin-top: 1px; }
.bd-empty { text-align: center; padding: 40px 24px; }
.bd-empty h2 { margin: 12px 0 8px; font-size: 22px; font-weight: 800; color: var(--bright); }
.bd-empty > p { max-width: 560px; margin: 0 auto 18px; color: var(--sub); line-height: 1.55; font-size: 14.5px; }
.bd-empty-ic { width: 52px; height: 52px; margin: 0 auto; border-radius: 16px; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.bd-empty-acts { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }
.bd-empty .bd-note { justify-content: center; }

.bd-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }
.bd-k { background: var(--ink2); border: 1px solid var(--line); border-radius: 20px; padding: 16px 18px; box-shadow: var(--shadow-card); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bd-k-l { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.bd-k > b { font-size: 26px; font-weight: 800; color: var(--bright); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.bd-k > b small { font-size: 15px; color: var(--muted); font-weight: 700; }
.bd-k-s { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.bd-bar-track { display: block; height: 6px; border-radius: 4px; background: var(--ink4); overflow: hidden; margin: 4px 0 2px; }
.bd-bar-track i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.bd-bar-track i.over { background: var(--red); }
.bd-left { border-color: color-mix(in srgb, var(--green) 45%, var(--line)); background: linear-gradient(160deg, color-mix(in srgb, var(--green) 14%, var(--ink2)), var(--ink2) 70%); }
.bd-left .bd-k-l, .bd-left .bd-k-s { color: color-mix(in srgb, var(--green) 70%, var(--sub)); }
.bd-left > b { color: var(--green); }
.bd-left.neg { border-color: color-mix(in srgb, var(--red) 40%, var(--line)); background: var(--ink2); }
.bd-left.neg > b { color: var(--red); }
.bd-left.neg .bd-k-l, .bd-left.neg .bd-k-s { color: var(--muted); }
.bd-left-empty { background: var(--ink2); border-color: var(--line); }
.bd-left-empty > b { color: var(--muted); }
.bd-go { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; height: 32px; padding: 0 12px; border-radius: 99px; border: 0; background: var(--green); color: #04210f; font: inherit; font-weight: 800; font-size: 12.5px; cursor: pointer; }

.bd-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 14px; }
.bd-grid2 { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; }
.bd-switch { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 0; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--sub); cursor: pointer; }
.bd-switch b { position: relative; width: 34px; height: 20px; border-radius: 99px; background: var(--line2); transition: background .2s; }
.bd-switch b::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .22s cubic-bezier(.3,.7,.2,1); }
.bd-switch.on b { background: var(--accent); }
.bd-switch.on b::after { transform: translateX(14px); }
.bd-where-body { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 22px; align-items: center; margin-top: 10px; }
.bd-ring { position: relative; width: 200px; height: 200px; border-radius: 50%; }
.bd-ring > div { position: absolute; inset: 30px; border-radius: 50%; background: var(--ink2); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 6px; }
.bd-ring span { font-size: 12px; color: var(--muted); }
.bd-ring b { font-size: 22px; font-weight: 800; color: var(--bright); margin: 2px 0; }
.bd-ring-empty { background: var(--ink4); }
.bd-cats { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bd-cat { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; width: 100%; padding: 7px 8px; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.bd-cat:hover { background: var(--ink3); }
.bd-cat.on { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.bd-sw { width: 12px; height: 12px; border-radius: 4px; display: inline-block; flex: none; }
.bd-cat-n { font-size: 13.5px; font-weight: 700; color: var(--bright); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-cat-n small { font-weight: 500; color: var(--muted); font-size: 12px; }
.bd-cat-v { font-family: var(--mono); font-size: 13px; color: var(--bright); white-space: nowrap; }
.bd-cat-v small { font-family: var(--sans); font-size: 11.5px; color: var(--muted); }
.bd-cat-v small.over { color: var(--red); font-weight: 700; }
.bd-cat-bar { grid-column: 2 / 4; height: 5px; border-radius: 3px; background: var(--ink4); overflow: hidden; }
.bd-cat-bar i { display: block; height: 100%; border-radius: 3px; }
.bd-hint { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }

.bd-cols { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.bd-col { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; background: none; padding: 0; font: inherit; cursor: pointer; min-width: 0; }
.bd-col-v { font-family: var(--mono); font-size: 11.5px; color: var(--sub); min-height: 14px; }
.bd-col-track { position: relative; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.bd-col-bar { display: block; width: 62%; border-radius: 8px 8px 4px 4px; background: var(--line2); min-height: 2px; transition: background .2s; }
.bd-col:hover .bd-col-bar { background: var(--dim); }
.bd-col.now .bd-col-bar { background: var(--accent); }
.bd-in { position: absolute; left: 6%; right: 6%; height: 0; border-top: 2px dashed var(--green); }
.bd-col-n { font-size: 12px; color: var(--muted); }
.bd-col.now .bd-col-n { color: var(--bright); font-weight: 700; }
.bd-legend { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.bd-in-key { width: 16px; border-top: 2px dashed var(--green); }

.bd-tx { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 4px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; min-width: 0; }
.bd-tx:hover { background: var(--ink3); }
.bd-ic { width: 34px; height: 34px; flex: none; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; }
.bd-tx-m { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bd-tx-m b { font-size: 14px; font-weight: 700; color: var(--bright); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-tx-m small { font-size: 12px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-chip { flex: none; padding: 3px 9px; border-radius: 99px; background: var(--ink3); color: var(--sub); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.bd-chip.warn { background: color-mix(in srgb, #e8a53a 16%, transparent); color: #c98a1f; }
.bd-amt { flex: none; text-align: right; font-family: var(--mono); font-size: 13.5px; color: var(--bright); display: flex; flex-direction: column; align-items: flex-end; }
.bd-amt.in { color: var(--green); }
.bd-amt small { font-family: var(--sans); font-size: 11.5px; color: var(--muted); }
.bd-planned .bd-tx-m b::after { content: " · planned"; font-weight: 500; color: var(--muted); font-size: 12px; }
.bd-sub { display: flex; align-items: center; gap: 6px; margin: 12px 0 2px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.bd-more { display: block; width: 100%; margin-top: 8px; padding: 10px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--accent); font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; }
.bd-pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 99px; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.bd-warn-n { font-size: 12px; font-weight: 700; color: #c98a1f; white-space: nowrap; }
.bd-sugg { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-top: 1px solid var(--line); }
.bd-txs .t-more, .bd-recs .t-more { display: inline-flex; align-items: center; gap: 4px; }

/* the sheet */
.bd-card { width: min(900px, 100%); display: flex; flex-direction: column; gap: 14px; }
.bd-ht { flex: 1; min-width: 0; }
.bd-ht h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.01em; color: var(--bright); }
.bd-kick { display: block; font-size: 12.5px; color: var(--muted); font-weight: 700; }
.bd-steps { display: flex; gap: 22px; margin: 0; padding: 0; list-style: none; flex-wrap: wrap; }
.bd-steps li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.bd-steps b { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line2); display: flex; align-items: center; justify-content: center; font-size: 12px; }
.bd-steps li.on { color: var(--bright); }
.bd-steps li.on b { border-color: var(--bright); }
.bd-steps li.done b { background: var(--green); border-color: var(--green); color: #fff; }
.bd-drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 18px; border: 1.5px dashed var(--line2); border-radius: 18px; background: var(--ink3); text-align: center; cursor: pointer; }
.bd-drop:hover, .bd-drop:focus-within { border-color: var(--accent); }
.bd-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.bd-drop-ic { color: var(--accent); }
.bd-drop b { font-size: 16px; color: var(--bright); }
.bd-drop small { font-size: 13px; color: var(--muted); }
.bd-drop.busy { cursor: progress; }
.bd-prog { width: min(320px, 80%); height: 6px; border-radius: 9px; background: var(--ink4); overflow: hidden; margin-top: 6px; }
.bd-prog i { display: block; height: 100%; width: 40%; border-radius: 9px; background: linear-gradient(90deg, var(--accent), var(--purple)); animation: bd-prog 1.2s ease-in-out infinite alternate; }
@keyframes bd-prog { from { transform: translateX(-20%); } to { transform: translateX(170%); } }
.bd-kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.bd-kinds > div { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--ink2); }
.bd-kinds b { font-size: 14px; color: var(--bright); margin-right: 6px; }
.bd-kinds p { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.bd-tag { display: inline-flex; align-items: center; padding: 1px 8px; margin-left: 6px; border-radius: 99px; font-size: 11px; font-weight: 800; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); white-space: nowrap; vertical-align: 1px; }
.bd-tag.ok { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); }
.bd-tag.ai { background: color-mix(in srgb, var(--purple) 16%, transparent); color: var(--purple); }
.bd-tag.warn { background: color-mix(in srgb, #e8a53a 16%, transparent); color: #c98a1f; }
.bd-tag.dim { background: var(--ink3); color: var(--muted); }
.bd-foot { display: flex; align-items: center; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.bd-foot > span:first-child { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); }
.bd-foot b { color: var(--bright); }
.bd-foot .bd-in-t { color: var(--green); }
.bd-del { color: var(--red); margin-right: auto; }
.bd-file { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--ink3); border: 1px solid var(--line); flex-wrap: wrap; }
.bd-file-ic { width: 40px; height: 40px; flex: none; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 11px; font-weight: 500; background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.bd-acct { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.bd-acct input, .bd-f input, .bd-lim input { height: 40px; box-sizing: border-box; border-radius: 12px; border: 1px solid var(--line2); background: var(--ink2); color: var(--bright); font: inherit; font-size: 14px; padding: 0 12px; min-width: 0; }
.bd-acct input { width: 180px; }
.bd-review-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.bd-review-tags b { color: var(--bright); }
.bd-review { max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 14px; }
.bd-rr { display: grid; grid-template-columns: 28px 64px minmax(0, 1fr) 160px 110px; gap: 10px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 13.5px; }
.bd-rr:first-child { border-top: 0; }
.bd-rh { position: sticky; top: 0; z-index: 1; background: var(--ink2); font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.bd-rh span:last-child { text-align: right; }
.bd-rr.off { opacity: .45; }
.bd-rd { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.bd-rdesc { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--bright); }
.bd-cb { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--line2); background: none; padding: 0; display: flex; align-items: center; justify-content: center; color: transparent; cursor: pointer; }
.bd-cb.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.bd-cb:disabled { cursor: default; }
.bd-sel { height: 34px; width: 100%; border-radius: 99px; border: 1px solid var(--line2); background: var(--ink2); color: var(--bright); font: inherit; font-weight: 700; font-size: 12.5px; padding: 0 10px; cursor: pointer; }
.bd-sel.warn { border-color: #e8a53a; color: #c98a1f; }
.bd-done { padding: 18px; border-radius: 16px; background: color-mix(in srgb, var(--green) 10%, var(--ink2)); border: 1px solid color-mix(in srgb, var(--green) 35%, var(--line)); }
.bd-done b { font-size: 18px; color: var(--bright); }
.bd-done p { margin: 6px 0 0; color: var(--sub); font-size: 14px; }
.bd-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.bd-f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bd-f > span:first-child { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.bd-f input { height: 46px; font-size: 15px; }
.bd-seg { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); height: 44px; padding: 3px; box-sizing: border-box; border-radius: 99px; border: 1px solid var(--line2); background: var(--ink3); }
.bd-seg2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bd-th { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / 4); border-radius: 99px; background: var(--bright); transform: translateX(calc(var(--i, 0) * 100%)); transition: transform .28s cubic-bezier(.3,.7,.2,1); }
.bd-seg2 .bd-th { width: calc((100% - 6px) / 2); }
.bd-seg button { position: relative; z-index: 1; border: 0; background: none; color: var(--sub); font: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer; padding: 0 4px; transition: color .2s; }
.bd-seg button.on { color: var(--ink2); }
.bd-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.bd-chip-b { height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line2); background: var(--ink2); color: var(--sub); font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; }
.bd-chip-b.on { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.bd-preview { padding: 14px 16px; border-radius: 16px; background: var(--ink3); border: 1px solid var(--line); }
.bd-preview > div:first-child { display: flex; align-items: baseline; gap: 8px; }
.bd-preview b { font-family: var(--mono); font-size: 22px; color: var(--bright); }
.bd-preview > div:first-child > span { color: var(--muted); font-size: 13.5px; }
.bd-preview small { display: block; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.bd-tl { display: flex; gap: 5px; margin-top: 12px; }
.bd-tl i { flex: 1; height: 28px; border-radius: 7px; background: var(--ink4); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 3px; box-sizing: border-box; font-style: normal; font-family: var(--mono); font-size: 9.5px; color: var(--muted); }
.bd-tl i.hit { background: color-mix(in srgb, var(--accent) 24%, transparent); color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); }
.bd-txhead { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 14px 16px; border-radius: 14px; background: var(--ink3); }
.bd-txhead b { font-size: 15px; color: var(--bright); overflow-wrap: anywhere; }
.bd-txhead small { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); }
.bd-check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text); cursor: pointer; }
.bd-check input { width: 18px; height: 18px; }
.bd-lims { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.bd-lim { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.bd-lim > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; font-weight: 700; color: var(--bright); font-size: 14px; }
.bd-lim small { font-weight: 500; color: var(--muted); font-size: 12px; }
.bd-lim-in { display: flex; align-items: center; gap: 4px; color: var(--muted); }
.bd-lim input { width: 110px; text-align: right; font-family: var(--mono); }

/* ---- Plans ---- */
.pl-wrap { max-width: 980px; }
.pl-bill { display: flex; justify-content: center; margin: 4px 0 18px; }
.pl-seg { position: relative; display: inline-grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 4px; border-radius: 14px; background: var(--ink2); border: 1px solid var(--line); box-shadow: var(--shadow-card); }
.pl-seg .fl-thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 2); border-radius: 10px; background: var(--bright); transform: translateX(calc(var(--fl-i, 0) * 100%)); transition: transform .36s cubic-bezier(.34, 1.4, .64, 1); }
.pl-seg button { position: relative; z-index: 1; border: 0; background: none; padding: 9px 22px; border-radius: 10px; font: inherit; font-weight: 700; font-size: 14px; color: var(--sub); cursor: pointer; transition: color .2s; white-space: nowrap; }
.pl-seg button.on { color: var(--ink2); }
.pl-seg button small { font-size: 11px; font-weight: 800; color: var(--green); margin-left: 4px; }
.pl-seg button.on small { color: color-mix(in srgb, var(--green) 70%, var(--ink2)); }
.pl-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.pl-card { display: flex; flex-direction: column; gap: 6px; padding: 24px; }
.pl-card.mine { border-color: var(--line2); }
.pl-pro { border-color: color-mix(in srgb, #534AB7 50%, var(--line)); box-shadow: var(--shadow-card), 0 0 0 5px color-mix(in srgb, #534AB7 8%, transparent); }
.pl-name { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 800; color: var(--bright); }
.pl-you { margin-left: auto; padding: 3px 10px; border-radius: 99px; background: var(--ink3); color: var(--sub); font-size: 11.5px; font-weight: 800; }
.pl-price { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.pl-price b { font-size: 40px; font-weight: 800; letter-spacing: -.02em; color: var(--bright); }
.pl-price span { color: var(--muted); font-size: 15px; }
.pl-small { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.pl-list { list-style: none; margin: 12px 0 14px; padding: 0; display: grid; gap: 9px; flex: 1; align-content: start; }
.pl-list li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--text); line-height: 1.4; }
.pl-list svg { flex: none; margin-top: 1px; color: var(--green); }
.pl-pro .pl-list svg { color: #7F77DD; }
.pl-cta { width: 100%; min-height: 48px; background: #534AB7 !important; border-color: #534AB7 !important; color: #fff !important; }
.pl-cta + .pl-small { text-align: center; margin-top: 8px; }
.pl-cur { padding: 12px 14px; border-radius: 12px; background: var(--ink3); color: var(--sub); font-size: 13.5px; font-weight: 600; text-align: center; }
/* v0.11.0 paying: Upgrade opens Stripe Checkout, Manage billing the Stripe portal (plans-ui.js) */
.pl-cur.warn { background: rgba(232, 165, 58, .14); color: #e8a53a; }
.pl-manage { width: 100%; min-height: 46px; margin-top: 10px; }
.pl-link { display: block; margin: 10px auto 0; padding: 6px 4px; border: 0; background: none; color: var(--sub); font: inherit; font-size: 13px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.pl-test { display: block; margin-top: 6px; color: #e8a53a; }
.pl-table { margin-bottom: 14px; }
.pl-rows { display: grid; margin-top: 6px; }
.pl-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 120px; gap: 10px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--text); }
.pl-row > span:not(:first-child) { text-align: center; font-weight: 700; color: var(--bright); }
.pl-rh { border-top: 0; font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pl-rh > span:not(:first-child) { color: var(--muted); }
.pl-yes { color: var(--green); display: inline-flex; }
.pl-no { color: var(--dim); }
.pl-faq details { border-top: 1px solid var(--line); padding: 12px 0; }
.pl-faq summary { cursor: pointer; font-weight: 700; color: var(--bright); font-size: 14.5px; }
.pl-faq details p { margin: 8px 0 0; color: var(--sub); font-size: 14px; line-height: 1.55; }

@media (max-width: 1000px) {
  .bd-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bd-grid, .bd-grid2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 780px) {
  /* the tabs: five equal columns, short names, the PRO tag on the corner */
  .an-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; overflow: visible; padding: 3px; border: 1px solid var(--line); border-radius: 99px; background: var(--ink2); }
  .an-tab { position: relative; min-height: 38px; padding: 0 2px; border: 0; margin: 0; border-radius: 99px; font-size: 12.5px; text-align: center; white-space: nowrap; }
  .an-tab.on { background: var(--bright); color: var(--ink2); border: 0; }
  .an-tab .an-full { display: none; }
  .an-tab .an-short { display: inline; }
  .an-tab[data-an-tab="risk"] .an-short, .an-tab[data-an-tab="calendar"] .an-short, .an-tab[data-an-tab="budget"] .an-short { display: none; }
  .an-tab .pro-tag { position: absolute; top: -6px; right: -1px; height: 14px; padding: 0 4px; margin: 0; font-size: 8px; border-radius: 5px; border: 1.5px solid var(--ink); }
  .an-lock-card { margin-top: 12px; padding: 22px 18px; }
  /* the month on one row (‹ October 2026 ›), the two buttons sharing the next */
  .bd-bar { display: grid; grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1fr) 40px; gap: 10px 8px; }
  .bd-bar > .bd-rnd:first-child { grid-column: 1; }
  .bd-month { grid-column: 2 / 4; min-width: 0; font-size: 17px; white-space: nowrap; }
  .bd-grow { display: none; }
  .bd-bar .btn { grid-row: 2; min-width: 0; padding: 0 10px; }
  .bd-bar .btn:not(.pri) { grid-column: 1 / 3; }
  .bd-bar .btn.pri { grid-column: 3 / 5; }
  .bd-bar .bd-lg { display: none; }
  .bd-bar .bd-sm { display: inline; }
  /* Spent, then Left over (full width), then Money in and Fixed costs side by side */
  .bd-kpis { gap: 10px; }
  .bd-kpis .bd-k:first-child, .bd-kpis .bd-left { grid-column: 1 / -1; }
  .bd-kpis .bd-k:first-child { order: 1; } .bd-kpis .bd-left { order: 2; } .bd-kpis .bd-k:nth-child(2) { order: 3; } .bd-kpis .bd-k:last-child { order: 4; }
  .bd-k { padding: 14px; border-radius: 18px; }
  .bd-k > b { font-size: 22px; }
  .bd-where-body { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .bd-ring { width: 180px; height: 180px; }
  .bd-cats { width: 100%; }
  .bd-cols { gap: 4px; }
  .bd-col-v { font-size: 10px; }
  .bd-chip { display: none; }
  .bd-tx .bd-tx-m small::before { content: none; }
  .bd-kinds { grid-template-columns: minmax(0, 1fr); }
  .bd-review { max-height: none; }
  .bd-rh { display: none; }
  .bd-rr { grid-template-columns: 26px minmax(0, 1fr) auto; grid-template-areas: "cb desc amt" "cb date sel"; gap: 4px 10px; padding: 10px 12px; }
  .bd-rr .bd-cb { grid-area: cb; }
  .bd-rr .bd-rdesc { grid-area: desc; white-space: normal; }
  .bd-rr .bd-rd { grid-area: date; }
  .bd-rr .bd-sel { grid-area: sel; width: 150px; justify-self: end; font-size: 16px; }
  .bd-rr .bd-amt { grid-area: amt; }
  .bd-form, .bd-lims { grid-template-columns: minmax(0, 1fr); }
  .bd-acct { width: 100%; }
  .bd-acct input { flex: 1; width: auto; }
  .bd-acct input, .bd-f input, .bd-lim input, .bd-sel { font-size: 16px !important; }
  .bd-seg button { font-size: 12.5px; }
  .bd-foot .btn { flex: 1; }
  .bd-foot > span:first-child { flex-basis: 100%; }
  .bd-steps { gap: 12px; }
  .bd-steps li { font-size: 12px; }
  .pl-cards { grid-template-columns: minmax(0, 1fr); }
  .pl-row { grid-template-columns: minmax(0, 1fr) 64px 84px; font-size: 13.5px; }
  .pl-seg button { padding: 9px 16px; }
}

/* v0.9.97 - Budget: Export PDF, your own categories, and a phone layout of its own (one card, one list at a time, a round +). */
.bd-income { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px dashed color-mix(in srgb, var(--green) 45%, transparent); background: color-mix(in srgb, var(--green) 6%, transparent); color: var(--green); font: inherit; font-size: 13.5px; font-weight: 700; text-align: left; cursor: pointer; }
.bd-income span { flex: 1; }
.bd-grid-one { grid-template-columns: minmax(0, 1fr); }
.bd-grid-one .bd-where-body { grid-template-columns: 200px minmax(0, 1fr); max-width: 860px; }
.bd-st { flex: none; padding: 2px 8px; border-radius: 99px; background: var(--ink3); color: var(--sub); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.bd-st.paid { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
.bd-g { color: var(--green); }

/* the + menu, Export PDF, categories */
.bd-acts { display: flex; flex-direction: column; }
.bd-act { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 2px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.bd-act:first-child { border-top: 0; }
.bd-act-ic { width: 42px; height: 42px; flex: none; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.bd-a1 { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.bd-a2 { background: color-mix(in srgb, var(--purple) 16%, transparent); color: var(--purple); }
.bd-a3 { background: color-mix(in srgb, #e8a53a 16%, transparent); color: #c98a1f; }
.bd-a4 { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); }
.bd-a5 { background: var(--ink3); color: var(--sub); }
.bd-act .bd-tx-m b { font-size: 15.5px; }
.bd-flab { display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 4px 0 -4px; }
.bd-opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 14px; border-radius: 16px; border: 1.5px solid var(--line2); background: var(--ink2); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.bd-opt.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--ink2)); }
.bd-radio { width: 20px; height: 20px; flex: none; box-sizing: border-box; border-radius: 50%; border: 2px solid var(--line2); transition: border-width .15s; }
.bd-opt.on .bd-radio { border: 6px solid var(--accent); }
.bd-seg3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bd-seg3 .bd-th { width: calc((100% - 6px) / 3); }
.bd-tgls { display: flex; flex-direction: column; }
.bd-tgl { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 11px 0; border: 0; border-top: 1px solid var(--line); background: none; color: var(--text); font: inherit; font-size: 14.5px; cursor: pointer; }
.bd-tgl b { position: relative; width: 42px; height: 24px; flex: none; border-radius: 99px; background: var(--line2); transition: background .2s; }
.bd-tgl b::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .22s cubic-bezier(.3,.7,.2,1); }
.bd-tgl.on b { background: var(--accent); }
.bd-tgl.on b::after { transform: translateX(18px); }
.bd-foot .bd-grow { display: block; flex: 1; }
.bd-cdel { width: 30px; height: 30px; flex: none; border-radius: 50%; border: 1px solid var(--line2); background: none; color: var(--muted); font: inherit; font-size: 16px; line-height: 1; cursor: pointer; }
.bd-newcat { padding: 14px; border-radius: 16px; background: var(--ink3); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.bd-newcat .bd-flab { margin: 0; }
.bd-newcat-row { display: flex; gap: 8px; }
.bd-newcat-row input { flex: 1; min-width: 0; height: 42px; box-sizing: border-box; border-radius: 12px; border: 1px solid var(--line2); background: var(--ink2); color: var(--bright); font: inherit; font-size: 14.5px; padding: 0 12px; }
.bd-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.bd-swb { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; padding: 0; cursor: pointer; box-shadow: inset 0 0 0 2px var(--ink3); }
.bd-swb.on { border-color: var(--bright); }

/* the phone layout (budget-ui.js draws it below 780px) */
.bd-hero { border-radius: 22px; padding: 14px 16px 16px; background: var(--ink2); border: 1px solid var(--line); box-shadow: var(--shadow-card); display: flex; flex-direction: column; gap: 4px; }
.bd-hero-m { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.bd-hero-m b { font-size: 16px; color: var(--bright); }
.bd-hero-m .bd-rnd { width: 36px; height: 36px; }
.bd-hero-v { font-family: var(--mono); font-weight: 500; font-size: 34px; letter-spacing: -.02em; color: var(--bright); }
.bd-split { display: flex; height: 10px; border-radius: 9px; overflow: hidden; background: repeating-linear-gradient(135deg, var(--line2) 0 5px, var(--ink4) 5px 10px); margin-top: 6px; }
.bd-split i:first-child { display: block; height: 100%; background: var(--green); border-radius: 9px 0 0 9px; }
.bd-split i.later { display: none; }
.bd-split-l { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.bd-split-l b { color: var(--bright); }
.bd-split-l b.bd-g { color: var(--green); }
.bd-hero .bd-income { margin-top: 10px; }
.bd-hero-left { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--green) 12%, transparent); border: 1px solid color-mix(in srgb, var(--green) 35%, transparent); }
.bd-hero-left small { display: block; font-size: 12px; color: var(--green); font-weight: 700; }
.bd-hero-left b { font-family: var(--mono); font-size: 20px; color: var(--green); }
.bd-hero-left.neg { background: color-mix(in srgb, var(--red) 10%, transparent); border-color: color-mix(in srgb, var(--red) 30%, transparent); }
.bd-hero-left.neg small, .bd-hero-left.neg b { color: var(--red); }
.bd-hero-left .bd-go { margin: 0; }
.bd-pseg { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 4px; border-radius: 14px; background: var(--ink2); border: 1px solid var(--line); box-shadow: var(--shadow-card); }
.bd-pth { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 3); border-radius: 10px; background: var(--bright); transform: translateX(calc(var(--i, 0) * 100%)); transition: transform .36s cubic-bezier(.34, 1.4, .64, 1); }
.bd-pseg button { position: relative; z-index: 1; height: 40px; border: 0; background: none; font: inherit; font-weight: 700; font-size: 14px; color: var(--sub); cursor: pointer; transition: color .2s; white-space: nowrap; }
.bd-pseg button.on { color: var(--ink2); }
.bd-pseg small { font-family: var(--mono); font-size: 10.5px; opacity: .7; margin-left: 4px; }
.bd-stack { display: flex; gap: 2px; height: 12px; border-radius: 9px; overflow: hidden; }
.bd-stack i { display: block; height: 100%; }
.bd-plist { border-radius: 20px; background: var(--ink2); border: 1px solid var(--line); box-shadow: var(--shadow-card); padding: 2px 14px; }
.bd-prow { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 0; border: 0; border-top: 1px solid var(--line); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; min-width: 0; }
.bd-plist > .bd-prow:first-child, .bd-plist > .bd-sub + .bd-prow { border-top: 0; }
.bd-prow .bd-sw { width: 10px; height: 10px; }
.bd-prow .bd-tx-m b { font-size: 14.5px; }
.bd-prow.paid .bd-date { opacity: .55; }
.bd-pin { margin: -4px 0 8px 22px; padding: 4px 12px; border-radius: 12px; background: var(--ink3); }
.bd-pin div { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px; color: var(--text); border-top: 1px solid var(--line); }
.bd-pin div:first-child { border-top: 0; }
.bd-pin span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-pin small { display: block; font-size: 11.5px; color: var(--muted); }
.bd-pin b { font-family: var(--mono); font-weight: 500; flex: none; }
.bd-plink { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 13px 0; border: 0; border-top: 1px solid var(--line); background: none; color: var(--accent); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
.bd-date { width: 42px; flex: none; text-align: center; border-radius: 11px; padding: 5px 0; line-height: 1.05; background: var(--ink3); }
.bd-date b { display: block; font-size: 15px; color: var(--bright); }
.bd-date small { font-family: var(--mono); font-size: 9.5px; color: var(--muted); text-transform: uppercase; }
.bd-warnc { color: #c98a1f !important; }
.bd-pempty { text-align: center; padding: 22px 18px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bd-pempty b { font-size: 15.5px; color: var(--bright); }
.bd-pempty p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.bd-pempty .btn { margin-top: 6px; }
.bd-mini { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; align-items: end; padding: 8px 0 12px; }
.bd-mini button { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: none; padding: 0; font: inherit; cursor: pointer; }
.bd-mini i { display: block; width: 60%; min-height: 2px; border-radius: 6px 6px 3px 3px; background: var(--line2); }
.bd-mini .now i { background: var(--accent); }
.bd-mini span { font-size: 11px; color: var(--muted); }
.bd-fab { position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 30; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--bright); color: var(--ink2); display: flex; align-items: center; justify-content: center; box-shadow: 0 12px 30px -8px rgba(0,0,0,.45); cursor: pointer; }
@media (max-width: 780px) {
  .bd-host { gap: 12px; padding-bottom: 72px; }
  .bd-opt .bd-tx-m b { font-size: 15px; }
  .bd-newcat-row input { font-size: 16px !important; }
  .bd-seg3 button { font-size: 12.5px; }
}

/* v0.9.98 - Budget windows on a phone (the recurring cost, a transaction, export, categories): they scroll up and down only. A window
   that scrolls is its own scroll container, so the page's "no pinch, no sideways" rule did not reach inside it: on an iPhone the
   form could be pinched and dragged sideways, and the date field (which keeps a minimum width there) pushed it wider than the screen.
   Save stays at the bottom of the window, the amount and the next payment share a row, and the long intro hides on a phone. */
.bd-pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 780px) {
  .cw-card { touch-action: pan-y; overflow-x: hidden; overscroll-behavior: contain; }
  .bd-card { gap: 14px; padding-bottom: 0; }
  .bd-card .cw-sub.bd-lg { display: none; }
  .bd-card .bd-form.bd-pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .bd-card .bd-form > *, .bd-card .bd-f { min-width: 0; }
  .bd-card input, .bd-card select { max-width: 100%; min-width: 0; box-sizing: border-box; }
  .bd-card input[type="date"] { -webkit-appearance: none; appearance: none; display: block; width: 100%; text-align: left; line-height: 44px; }
  .bd-card input[type="date"]::-webkit-date-and-time-value { text-align: left; }
  .bd-card input[type="date"]::-webkit-calendar-picker-indicator { margin: 0; }
  .bd-card .bd-foot { position: sticky; bottom: 0; z-index: 2; margin: 4px -16px 0; padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px)); background: var(--ink2); border-top: 1px solid var(--line); }
  .bd-card .bd-foot > span:first-child:empty { display: none; }
  .bd-card .bd-foot .bd-del { flex: none; margin-right: 0; }
  .bd-card .bd-seg button { font-size: 13.5px; }
}

/* v0.9.99 - the category is a dropdown: the app's pill dropdown, with the chosen category's colour on the left */
.bd-dd { position: relative; display: block; }
.bd-dd .bd-sw { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); pointer-events: none; }
html .bd-dd select.bd-dd-sel { display: block; width: 100%; height: 46px; box-sizing: border-box; border-radius: 99px; border: 1px solid var(--line2); background-color: var(--ink2); color: var(--bright);
  font-family: var(--sans); font-weight: 700; font-size: 15px; padding: 0 40px 0 38px !important; background-position: right 16px center !important; -webkit-appearance: none; appearance: none; cursor: pointer; }
html .bd-dd select.bd-dd-sel:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 780px) { html .bd-dd select.bd-dd-sel { font-size: 16px !important; } }

/* ===================== Exit Portfolio (Pro, 0.10.1): exit-plan-ui.js ===================== */
.ex-seg-row { grid-column: span 12; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ex-seg-row:empty { display: none; }
.ex-seg { display: inline-flex; gap: 4px; padding: 3px; border-radius: 99px; background: var(--ink2); border: 1px solid var(--line); }
.ex-seg button { min-height: 36px; padding: 0 16px; border-radius: 99px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13.5px; font-weight: 800; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.ex-seg button.on { background: var(--bright); color: var(--ink2); }
.ex-rest { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--sub); cursor: pointer; }
.ex-sw { width: 44px; height: 26px; flex: none; border-radius: 99px; border: 0; padding: 3px; background: var(--line2); cursor: pointer; display: flex; justify-content: flex-start; transition: background .2s; }
.ex-sw i { width: 20px; height: 20px; border-radius: 50%; background: #fff; display: block; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.ex-sw.on { background: var(--accent); justify-content: flex-end; }
.ex-tile { grid-column: span 12; padding: 20px; }
.ex-tile[hidden], .hw-tile[hidden], .ex-fab[hidden], .ex-chipbtn[hidden], .ex-ov[hidden] { display: none !important; }
.ex-ring { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ex-ring svg { position: absolute; inset: 0; }
.ex-ring-track { stroke: color-mix(in srgb, var(--line2) 80%, transparent); }
.ex-ring-l { position: relative; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.ex-ring-l b { font-family: var(--mono); font-size: 26px; font-weight: 500; color: var(--bright); }
.ex-ring-l small { font-size: 11px; color: var(--muted); margin-top: 2px; }
.ex-ring-s { position: relative; font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--bright); }
.ex-hero { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 12px; }
.ex-main, .ex-stat { border-radius: 18px; border: 1px solid var(--line); background: var(--ink2); padding: 18px; min-width: 0; }
.ex-main { display: flex; align-items: center; gap: 18px; border-color: color-mix(in srgb, #8b6fe8 40%, var(--line)); background: linear-gradient(150deg, color-mix(in srgb, #8b6fe8 14%, transparent), color-mix(in srgb, #3987e5 5%, transparent) 55%, var(--ink2)); }
.ex-main-t { display: flex; flex-direction: column; min-width: 0; }
.ex-total { font-family: var(--mono); font-size: 32px; font-weight: 500; color: var(--bright); letter-spacing: -.02em; margin-top: 4px; }
.ex-if { font-size: 13px; color: var(--sub); }
.ex-now { font-family: var(--mono); font-size: 13px; color: var(--text); margin-top: 8px; }
.ex-stat { display: flex; flex-direction: column; gap: 2px; }
.ex-stat b { font-family: var(--mono); font-size: 22px; font-weight: 500; color: var(--bright); margin-top: 6px; }
.ex-stat b.up, .ex-stat small.up { color: var(--green); } .ex-stat b.dn, .ex-stat small.dn { color: var(--red); }
.ex-stat small { font-family: var(--mono); font-size: 13px; }
.ex-stat span:last-child { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.ex-sec { margin-top: 18px; }
.ex-sec .t-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.ex-note { font-size: 12.5px; color: var(--muted); }
.ex-table { overflow-x: auto; }
.ex-tr { display: grid; grid-template-columns: minmax(150px, 1.3fr) 110px 92px 92px minmax(180px, 1.7fr) 112px 120px 110px 64px; gap: 12px; align-items: center; padding: 12px 4px; border-top: 1px solid var(--line); min-width: 1040px; font-size: 13.5px; color: var(--text); }
.ex-th { border-top: 0; padding-top: 2px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ex-tr .r { text-align: right; }
.ex-tr small { display: block; font-size: 12px; color: var(--muted); }
.ex-tr .up, .ex-tr .up small { color: var(--green); } .ex-tr .dn, .ex-tr .dn small { color: var(--red); }
.ex-asset { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ex-asset b { display: block; color: var(--bright); }
.ex-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ex-chip-s { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 99px; background: var(--ink3); border: 1px solid var(--line); font-size: 12px; white-space: nowrap; }
.ex-chip-s b { font-weight: 500; color: var(--bright); }
.ex-bar { display: block; height: 6px; border-radius: 9px; background: var(--ink4); overflow: hidden; }
.ex-bar i { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, #3987e5, #8b6fe8); }
.ex-bar.over i { background: var(--red); }
.ex-tr .ex-bar + small { margin-top: 5px; }
.ex-edit { min-height: 34px; }
.ex-un { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-top: 1px solid var(--line); }
.ex-un-n { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ex-un-n b { color: var(--bright); } .ex-un-n small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-un-v { font-size: 14px; color: var(--text); }
.ex-empty { text-align: center; padding: 18px 10px 8px; }
.ex-empty h3 { margin: 12px 0 6px; font-size: 20px; font-weight: 800; color: var(--bright); }
.ex-empty p { margin: 0 auto 14px; max-width: 460px; color: var(--sub); font-size: 14.5px; }
.ex-foot { margin: 14px 0 0; font-size: 12px; color: var(--muted); text-align: center; }
.ex-lock { text-align: left; }
.ex-lock .ex-ring { margin-bottom: 4px; }
.ex-chipbtn { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 4px 14px 4px 4px; border-radius: 99px; border: 1px solid var(--line2); background: var(--ink2); color: var(--bright); font: inherit; cursor: pointer; text-align: left; }
.ex-chipbtn span:last-child { display: flex; flex-direction: column; line-height: 1.15; }
.ex-chipbtn small { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.ex-chipbtn b { font-family: var(--mono); font-size: 14px; font-weight: 500; }
.ex-fab { display: none; }
/* the phone */
.ex-prow { display: block; width: 100%; text-align: left; border: 0; border-top: 1px solid var(--line); background: none; color: inherit; font: inherit; padding: 13px 0; cursor: pointer; }
.ex-pl1 { display: flex; align-items: center; gap: 10px; }
.ex-pn { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ex-pn b { color: var(--bright); font-size: 14.5px; } .ex-pn small { font-size: 12px; color: var(--muted); }
.ex-pv { text-align: right; display: flex; flex-direction: column; }
.ex-pv b { font-family: var(--mono); font-weight: 500; color: var(--bright); font-size: 14.5px; }
.ex-pv small { font-family: var(--mono); font-size: 12px; } .ex-pv small.up { color: var(--green); } .ex-pv small.dn { color: var(--red); }
.ex-pl2 { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.ex-pl2 .ex-bar { flex: 1; height: 5px; }
.ex-pl2 small { font-family: var(--mono); font-size: 11.5px; color: var(--muted); width: 34px; text-align: right; }
@media (max-width: 780px) {
  .ex-tile { padding: 16px; }
  .ex-chipbtn { display: none !important; }
  .ex-rest { width: 100%; justify-content: space-between; }
  .ex-hero { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ex-main { grid-column: span 2; flex-direction: column; text-align: center; }
  .ex-main-t { align-items: center; }
  .ex-hero .ex-stat:last-child { grid-column: span 2; }
  .ex-stat b { font-size: 18px; }
  .ex-fab { display: flex; position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 30; width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--line2); background: var(--ink2); padding: 0; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 14px 34px -10px rgba(0,0,0,.6), 0 0 0 6px color-mix(in srgb, var(--ink) 60%, transparent); }
  .ex-un .btn { min-height: 40px; }
}

/* the editor: a window on a desktop, a sheet on a phone */
.ex-ov { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px; }
.ex-ov-bg { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(0, 0, 0, .55); cursor: pointer; }
.ex-card { position: relative; width: min(720px, 100%); max-height: calc(100vh - 48px); overflow-y: auto; overscroll-behavior: contain; background: var(--ink2); border: 1px solid var(--line2); border-radius: 24px; padding: 22px; box-shadow: 0 40px 100px -30px rgba(0,0,0,.7); display: flex; flex-direction: column; gap: 14px; color: var(--text); }
.ex-grip { display: none; }
.ex-ed-h { display: flex; align-items: center; gap: 12px; }
.ex-ed-h > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ex-ed-h b { font-size: 19px; font-weight: 800; color: var(--bright); }
.ex-ed-h small { font-size: 13px; color: var(--muted); }
.ex-x { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 1px solid var(--line2); background: none; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.ex-x.sm { width: 32px; height: 32px; font-size: 17px; }
.ex-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--ink3); }
.ex-facts span { display: flex; flex-direction: column; min-width: 0; }
.ex-facts b { font-family: var(--mono); font-size: 15px; font-weight: 500; color: var(--bright); margin-top: 3px; }
.ex-facts b.dn { color: var(--red); }
.ex-steps { display: flex; flex-direction: column; gap: 10px; }
.ex-step { border-radius: 16px; border: 1px solid var(--line); background: var(--ink3); padding: 12px; }
.ex-step-h { display: flex; align-items: center; justify-content: space-between; min-height: 32px; }
.ex-step-h b { font-size: 13.5px; color: var(--bright); }
.ex-step-f { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 10px; margin-top: 4px; }
.ex-step-f label { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ex-fld { display: flex; align-items: center; gap: 4px; height: 48px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line2); background: var(--ink2); }
.ex-fld:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.ex-fld input { flex: 1; min-width: 0; width: 100%; border: 0; outline: 0; background: none; color: var(--bright); font-family: var(--mono); font-size: 17px; text-align: right; padding: 0; }
.ex-fld em { font-style: normal; font-family: var(--mono); font-size: 16px; color: var(--muted); }
.ex-step-r { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.ex-step-r b { color: var(--bright); font-weight: 500; }
.ex-step-r .up { color: var(--green); } .ex-step-r .dn { color: var(--red); }
.ex-wait { color: var(--muted); }
.ex-acts { display: flex; gap: 10px; flex-wrap: wrap; }
.ex-acts .btn { min-height: 42px; }
.ex-meter-t { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; margin-bottom: 8px; }
.ex-meter-t b { color: var(--bright); } .ex-meter-t span { color: var(--muted); } .ex-meter-t span.dn { color: var(--red); }
.ex-meter .ex-bar { height: 8px; }
.ex-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; padding: 14px; border-radius: 16px; border: 1px solid color-mix(in srgb, #8b6fe8 40%, var(--line)); background: linear-gradient(150deg, color-mix(in srgb, #8b6fe8 12%, transparent), var(--ink2) 70%); }
.ex-sum span { display: flex; flex-direction: column; min-width: 0; }
.ex-sum b { font-family: var(--mono); font-size: 18px; font-weight: 500; color: var(--bright); margin-top: 3px; }
.ex-sum b.up, .ex-sum small.up { color: var(--green); } .ex-sum b.dn, .ex-sum small.dn { color: var(--red); }
.ex-sum small.mono { font-size: 12.5px; }
.ex-alert { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.ex-alert > span { flex: 1; display: flex; flex-direction: column; }
.ex-alert b { font-size: 14px; color: var(--bright); } .ex-alert small { font-size: 12.5px; color: var(--muted); }
.ex-msg { margin: 0; font-size: 13.5px; color: var(--red); }
.ex-msg:empty { display: none; }
.ex-foot-b { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ex-foot-b .grow { flex: 1; }
.ex-foot-b .btn { min-height: 44px; }
.ex-rm { color: var(--red) !important; }
@media (max-width: 780px) {
  .ex-ov { padding: 0; align-items: flex-end; }
  .ex-card { width: 100%; max-height: calc(100dvh - 40px); border-radius: 24px 24px 0 0; border-bottom: 0; padding: 10px 16px calc(16px + env(safe-area-inset-bottom, 0px)); gap: 12px; }
  .ex-grip { display: block; width: 40px; height: 5px; border-radius: 9px; background: var(--line2); margin: 0 auto 2px; }
  .ex-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 12px; }
  .ex-hide-sm { display: none !important; }
  .ex-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ex-acts .btn { flex: 1; }
  .ex-foot-b { position: sticky; bottom: calc(-16px - env(safe-area-inset-bottom, 0px)); margin: 0 -16px calc(-16px - env(safe-area-inset-bottom, 0px)); padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px)); background: var(--ink2); border-top: 1px solid var(--line); }
  .ex-foot-b .grow { display: none; }
  .ex-foot-b .btn { flex: 1; }
  .ex-foot-b .ex-rm { flex-basis: 100%; order: 3; }
}
.pm-opt.exit .pro-tag { margin-left: 6px; vertical-align: 1px; }
/* 0.10.3: Exit prices had no colour of its own (the plain button background with near-white text: invisible) */
.pm-opt.exit { background: #534AB7; color: #fff; }
.pm-opt.exit .pm-oi { background: rgba(255, 255, 255, .16); }
.pm-opt.exit .pro-tag { background: #fff; color: #534AB7; }
@media (max-width: 780px) {
  /* the asset page: the line under the name repeats the position bar at the bottom (amount, share, when): left out on a phone */
  #positionView #posMeta { display: none; }
}
/* the average cost in the asset chart's figures: a phone only (the desktop has its Avg. cost card) */
.ovs-cell.ovs-avg { display: none; }
@media (max-width: 780px) {
  .ovs-cell.ovs-avg { display: block; }
  /* 0.10.4: on an asset you hold, your average cost leads: Your avg. cost, High, Low / Best, Worst, Worst dip */
  #pcStats .ovs-avg { order: -1; }
  #pcStats > .ovs-cell:nth-child(3) { order: 5; }
}
.ovs-cell em.up { color: var(--green); } .ovs-cell em.dn { color: var(--red); }

/* ===================== The flat phone layout (0.10.2) =====================
   On a phone every page is flat, like the Dashboard's net worth: no card frames, a section title and a hairline between
   sections, 16px side margins (.wrap), charts to the screen edges with their range buttons under them. Cards stay only where
   something should stand out: Budget's "Left over to invest", the Exit Portfolio hero, the Pro card, the snapshot streak,
   the plan cards on Plans, and sheets / windows. The desktop is unchanged. Mockups: claude.ai/artifact/HMEf9w6ytpxUnv3cdLVvcu */
@media (max-width: 780px) {
  .view .bento { gap: 0 !important; }
  .view .tile:not(.streak):not(.pl-card):not(.chart-tile):not(.worth) {
    background: none !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
    padding: 22px 0 !important; margin: 0 !important;
    border-bottom: 1px solid var(--line) !important;
  }
  .view .tile:not(.streak):not(.pl-card)::before, .view .tile:not(.streak):not(.pl-card)::after { box-shadow: none; }
  .view .tile.streak { margin: 22px 0 !important; }
  .view .tile.pl-card { margin: 0 0 14px !important; }
  /* the holdings and exit plan sections carried their own inner padding for the card */
  .hw-tile .hw-head { padding: 0 0 10px; }
  .hw-tile .hwp-h, .hw-tile .hwp-row, .hw-tile .hw-foot, .hw-tile .hw-empty { padding-left: 0; padding-right: 0; }
  .ex-tile { padding: 22px 0 !important; }

  /* ---- Portfolio: the Performance chart like the Dashboard's ---- */
  .tile.perf { display: flex !important; flex-direction: column; }
  .tile.perf .perf-top, .tile.perf .perf-right { display: contents; }
  .tile.perf .perf-top > :first-child { order: 0; }
  .tile.perf #perfWrap { order: 1; margin: 14px -16px 0 !important; }
  .tile.perf .cs-wrap-perf { order: 2; position: relative; margin: 0 -16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .tile.perf #perfRanges { margin: 0; padding: 0 58px 0 8px; border: 0; background: none; border-radius: 0; width: auto; }
  .tile.perf .cs-wrap-perf .cs-btn { right: 10px; }
  .tile.perf #csPerfPills { order: 3; margin-top: 12px; }
  .tile.perf .chips { order: 4; margin-top: 12px; }
  .tile.perf #perfLegend { order: 5; }
  .tile.perf .perf-extras { order: 6; }
  .tile.perf .val { font-size: 36px; }

  /* ---- Analytics: the tabs are one underlined row, like the range buttons ---- */
  .an-tabs { display: flex; gap: 0; padding: 0; margin: 0 -16px 14px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; overflow: visible; }
  .an-tab { flex: 1 1 0; position: relative; min-height: 46px; padding: 0 2px; border: 0; border-radius: 0; margin: 0; background: none !important; color: var(--muted); font-size: 13px; display: flex; align-items: center; justify-content: center; gap: 4px; }
  .an-tab.on { color: var(--bright) !important; background: none !important; }
  .an-tab.on::after { content: ""; position: absolute; left: 16%; right: 16%; bottom: -1px; height: 3px; border-radius: 3px; background: var(--bright); }
  .an-tab .pro-tag { position: static; height: 13px; padding: 0 3px; font-size: 7.5px; border: 0; border-radius: 4px; }
  #anRanges { margin: 0 -16px 6px; padding: 0 8px; border-bottom: 1px solid var(--line); background: none; border-radius: 0; width: auto; }
  #anRanges button { flex: 1 1 0; }
}
@media (max-width: 780px) {
  /* the small figure boxes inside a section (Analytics, Transactions, Alerts, Profile, the tax estimate): a grid of figures
     between hairlines instead of mini cards */
  .view .kpi, .view .pf-stat, .view .sell-cell { background: none !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; padding: 12px 0 !important; border-top: 1px solid var(--line) !important; }
  .view .pf-stats { gap: 0 14px; }
  .view .lt-lot { background: none !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; border-top: 1px solid var(--line) !important; padding-left: 0 !important; padding-right: 0 !important; }
  /* the Analytics tabs: the PRO tag sits small above the name so five tabs fit */
  .an-tab { flex-direction: column; gap: 1px; font-size: 12.5px; min-height: 50px; padding-top: 4px; }
  .an-tab .pro-tag { height: 12px; font-size: 7px; padding: 0 3px; order: -1; }
  .an-tab:not(:has(.pro-tag))::before { content: ""; height: 12px; }
  /* the Analytics period: an underlined row like every other range */
  #anRanges { display: flex; margin: 10px -16px 0; padding: 0 8px; border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0; background: none; width: auto; }
  #anRanges[hidden] { display: none; }
  #anRanges button { flex: 1 1 0; background: none !important; color: var(--muted); border-radius: 0; padding: 10px 0 12px; position: relative; border: 0; box-shadow: none; }
  #anRanges button.active { color: var(--bright); }
  #anRanges button.active::after { content: ""; position: absolute; left: 26%; right: 26%; bottom: 0; height: 3px; border-radius: 3px; background: var(--bright); }
}
@media (max-width: 780px) {
  /* Analytics: the period row sits under the tabs, full width (it was squeezed into the header's corner) */
  #analyticsView > .wrap { display: flex; flex-direction: column; }
  #analyticsView > .wrap > * { order: 5; }
  #analyticsView > .wrap > .page-h { display: contents; }
  #analyticsView > .wrap > .page-h > :first-child { order: 0; margin-bottom: 14px; }
  #analyticsView > .wrap > .an-tabs { order: 1; }
  #analyticsView #anRanges { order: 2; margin: -14px -16px 14px; border-top: 0; max-width: none; }
}
@media (max-width: 780px) {
  /* Budget on a phone: the month and the lists are flat too; the green "Left over to invest" inside stays a card */
  .bd-hero, .bd-plist { background: none !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; padding-left: 0 !important; padding-right: 0 !important; }
  .bd-hero { padding-top: 6px !important; padding-bottom: 18px !important; border-bottom: 1px solid var(--line) !important; }
  .bd-hero .bd-hero-v { font-size: 40px; }
}

/* ===================== 0.10.4: Portfolio and lots polish =====================
   Underlined tabs switch views (Holdings | Exit plan, Analytics, chart ranges); small chips sort and filter. */
.ex-tabs { display: flex; gap: 28px; flex: 1 1 auto; min-width: 0; border-bottom: 1px solid var(--line); }
.ex-tabs button { position: relative; display: inline-flex; align-items: baseline; gap: 8px; min-height: 46px; padding: 12px 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 15px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.ex-tabs button.on { color: var(--bright); }
.ex-tabs button.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; border-radius: 3px; background: var(--bright); }
.ex-tabs button b { font-family: var(--mono); font-size: 14px; font-weight: 500; color: inherit; }
.ex-tabs .pro-tag { align-self: center; }
.ex-seg-row { align-items: flex-end; }
/* the holdings card's own title would repeat the tab: left out on Portfolio (the Dashboard keeps it) */
#pfHoldTile .hw-title { display: none; }
@media (max-width: 780px) {
  .ex-seg-row { padding-top: 18px; }
  .ex-tabs { flex: 1 1 100%; margin: 0 -16px; padding: 0 16px; gap: 24px; }
  .ex-tabs button { font-size: 14.5px; }
  .ex-rest { padding-top: 12px; }
  #pfHoldTile .hw-head { display: none; }
  #pfHoldTile.tile { padding-top: 6px !important; }
}
/* the lot order: two small chips instead of a big switch */
.lt-sort { background: none; padding: 0; gap: 6px; border-radius: 0; }
.lt-sort button { min-height: 30px; padding: 0 11px; border: 1px solid var(--line2); border-radius: 99px; font-size: 12px; color: var(--sub); background: none; }
.lt-sort button.on { background: var(--ink3); border-color: var(--dim); color: var(--bright); }
/* a lot's mark: quiet, not a green "+" that looks like an Add button */
.lt-ic.lot { background: var(--ink3) !important; color: var(--muted) !important; }

/* 0.10.5: the Portfolio figures on a phone: Invested, High, Low / Best, Worst, Worst dip (as on an asset's page) */
.ovs-cell.ovs-inv { display: none; }
@media (max-width: 780px) {
  #perfStats .ovs-inv { display: block; order: -1; }
  #perfStats > .ovs-cell:nth-child(3) { order: 5; }
}

/* 0.10.6: on a phone every window is a bottom sheet (some were held near the top as floating cards) */
@media (max-width: 780px) {
  #addModal, #editModal, #importModal, #portfoliosModal, #alertFlowModal, #taxFlowModal, .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-overlay > .modal { width: 100%; max-width: none; margin: 0; border-radius: 22px 22px 0 0; border-bottom: 0; max-height: calc(var(--vv-h, 100dvh) - 40px); }
  #addModal > .modal, #editModal > .modal, #importModal > .modal, #portfoliosModal > .modal, #alertFlowModal > .modal, #taxFlowModal > .modal { max-height: calc(var(--vv-h, 100dvh) - 40px); }
}

/* ===================== News, feed first (0.10.7): news-ui.js ===================== */
#intelView .nw-wrap { max-width: 820px; }
.nw-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 4px !important; }
.nw-refresh { flex: none; }
.nw-refresh:disabled svg { animation: nw-spin .9s linear infinite; }
@keyframes nw-spin { to { transform: rotate(360deg); } }
.nw-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin-top: 6px; overflow-x: auto; scrollbar-width: none; }
.nw-tabs::-webkit-scrollbar { display: none; }
.nw-tabs button { position: relative; flex: none; min-height: 46px; padding: 12px 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 15px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.nw-tabs button.on { color: var(--bright); }
.nw-tabs button.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 3px; background: var(--bright); }
.nw-brief { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 0; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.nw-brief-none { color: var(--muted); font-size: 14px; cursor: default; }
.nw-brief-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.nw-brief-t b { color: var(--bright); }
.nw-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.nw-chev { font-size: 22px; color: var(--muted); flex: none; }
.nw-tk { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border-radius: 6px; background: var(--ink3); font-family: var(--mono); font-size: 11.5px; color: var(--text); }
.nw-tone-pos { color: var(--green); } .nw-tone-neg { color: var(--red); } .nw-tone-neu { color: var(--muted); }
.nw-trend { display: flex; align-items: center; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
.nw-trend::-webkit-scrollbar { display: none; }
.nw-trend-l { flex: none; font-size: 13px; font-weight: 700; color: var(--muted); }
.nw-tchip { flex: none; display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--line2); background: none; color: var(--text); font-family: var(--mono); font-size: 12px; cursor: pointer; }
.nw-tchip small { color: var(--muted); font-size: 11px; }
.nw-tchip.on { background: var(--ink3); border-color: var(--dim); color: var(--bright); }
.nw-filter-on { display: flex; align-items: center; gap: 8px; padding: 12px 0 0; font-size: 13px; color: var(--sub); }
.nw-clear { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line2); background: none; color: var(--sub); font-size: 15px; line-height: 1; cursor: pointer; padding: 0; }
.nw-day { padding: 18px 0 4px; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.nw-row { display: flex; gap: 10px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.nw-row:hover .nw-h { text-decoration: underline; text-decoration-color: var(--line2); }
.nw-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nw-src { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.nw-src span { white-space: nowrap; }
.nw-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.nw-unread { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: inline-block; margin-left: 2px; }
.nw-h { display: block; margin-top: 5px; font-size: 15.5px; font-weight: 700; line-height: 1.35; color: var(--bright); }
.nw-row.read .nw-h { color: var(--sub); font-weight: 600; }
.nw-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.nw-save { flex: none; width: 40px; height: 40px; margin: -6px -8px 0 0; border: 0; background: none; color: var(--muted); display: flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 50%; }
.nw-save.on { color: #e8a53a; }
.nw-save.on svg { fill: currentColor; }
.nw-empty { padding: 34px 6px; text-align: center; color: var(--muted); font-size: 14px; }
/* the brief sheet (a window on a desktop, a sheet on a phone; Motion.showSheet / hideSheet) */
.nw-card { width: min(560px, 100%); }
.nw-grip { display: none; }
.nw-tag { display: block; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.nw-lead { margin: 8px 0 0; font-size: 17px; line-height: 1.45; color: var(--text); }
.nw-lead b { color: var(--bright); }
.nw-tonebar { display: flex; height: 10px; border-radius: 9px; overflow: hidden; margin-top: 14px; }
.nw-tonebar i { display: block; height: 100%; }
.nw-tonel { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }
.nw-rows { margin-top: 12px; }
.nw-hrow { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14px; }
.nw-hrow b { color: var(--bright); }
.nw-hrow > span:nth-child(2) { color: var(--sub); }
.nw-hrow > span:last-child { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.nw-gap { margin: 12px 0 0; font-size: 13px; color: var(--sub); }
.nw-go { width: 100%; min-height: 48px; margin-top: 16px; }
.nw-note { margin: 12px 0 0; font-size: 12px; color: var(--muted); text-align: center; }
@media (max-width: 780px) {
  .nw-head h1 { font-size: 30px; }
  .nw-tabs { margin: 6px -16px 0; padding: 0 16px; gap: 22px; }
  .nw-tabs button { font-size: 14.5px; }
  .nw-trend { margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
  .nw-grip { display: block; width: 44px; height: 5px; border-radius: 99px; background: var(--line2); margin: 0 auto 12px; }
}

/* ===================== 0.10.8 portfolios: the switcher in the header, its panel, and Move (portfolios-ui.js) ===================== */
.pf-pick { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; flex: none; min-width: 0; max-width: 220px; min-height: 44px; padding: 4px 12px 4px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--ink2); color: var(--bright); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s ease; }
.pf-pick[hidden] { display: none; }
.pf-pick:hover, .pf-pick[aria-expanded="true"] { border-color: var(--dim); }
.pf-pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pf-pick .pfs-l { font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); line-height: 1.1; }
.pf-pick .pfs-n { display: flex; align-items: center; gap: 4px; max-width: 100%; min-width: 0; font-size: 14.5px; font-weight: 800; line-height: 1.25; }
.pf-pick .pfs-n > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-pick svg { flex: none; color: var(--muted); transition: transform .2s ease; }
.pf-pick[aria-expanded="true"] svg { transform: rotate(180deg); }
.topbar.pf-on .brand .bt { display: none; }   /* the switcher takes the name's place; the logo stays */

.pfs-panel .cs-box, .pfmv-panel .cs-box { width: 360px; }
.pfs-total { font-size: 13px; color: var(--muted); }
.pfs-opts { margin: 8px -8px 0; }
.pfs-opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 8px; border: 0; border-radius: 12px; background: none; color: var(--bright); font: inherit; text-align: left; cursor: pointer; opacity: 0; transform: translateY(-4px); transition: opacity .2s ease, transform .2s ease, background .15s ease; }
.cs-panel.on .pfs-opt { opacity: 1; transform: none; }
.pfs-opt:hover { background: var(--ink3); }
.pfs-chk { width: 22px; height: 22px; flex: none; border-radius: 50%; border: 2px solid var(--line2); display: flex; align-items: center; justify-content: center; box-sizing: border-box; }
.pfs-opt.on .pfs-chk { background: var(--bright); border-color: var(--bright); color: var(--ink2); }
.pfs-nm { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pfs-nm b { font-size: 15px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pfs-nm small { font-size: 12.5px; color: var(--muted); }
.pfs-v { font-size: 14px; color: var(--text); }
.pfs-acts { display: grid; grid-template-columns: auto 1fr; gap: 8px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.cs-panel .pfs-acts .btn { min-height: 44px; height: auto; padding: 0 16px; justify-content: center; white-space: nowrap; }

.pfmv-panel .cs-lab { display: block; font-family: inherit; font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 16px 0 8px; }
.pfmv-x { width: 36px; height: 36px; flex: none; border-radius: 50%; border: 0; background: var(--ink3); color: var(--sub); font-size: 20px; line-height: 1; cursor: pointer; }
.pfmv-seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 6px; padding: 4px; border-radius: 14px; background: var(--ink); }
.pfmv-seg button { min-height: 48px; padding: 6px 10px; border: 0; border-radius: 11px; background: none; color: var(--sub); font: inherit; font-size: 14px; font-weight: 800; line-height: 1.25; cursor: pointer; overflow-wrap: anywhere; }
.pfmv-seg button small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
.pfmv-seg button.on { background: var(--ink2); color: var(--bright); box-shadow: 0 0 0 1px var(--line2); }
.pfmv-seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pfmv-fixed { margin: 0; font-size: 14px; color: var(--sub); }
.pfmv-fixed b { color: var(--bright); }
.pfmv-qty, .pfmv-amt { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 0 14px; min-height: 50px; border-radius: 12px; border: 1px solid var(--line2); background: var(--ink); }
.pfmv-qty:focus-within, .pfmv-amt:focus-within { border-color: var(--bright); }
.pfmv-qty input, .pfmv-amt input { flex: 1; min-width: 0; width: auto; height: auto; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--bright); font: 500 18px var(--mono); outline: none; }
.pfmv-qty span { color: var(--muted); font-size: 14px; white-space: nowrap; }
.pfmv-amt span { color: var(--muted); font: 500 18px var(--mono); }
.pfmv-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pfmv-chips .chip { min-height: 36px; font-size: 12.5px; color: var(--text); }
.pfmv-note { margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--ink); font-size: 13px; color: var(--sub); line-height: 1.5; }
.pfmv-note b { color: var(--bright); }
.pfmv-new { display: flex; gap: 8px; }
.pfmv-new .pfm-in { flex: 1; min-width: 0; }
.pfmv-panel .add-msg { margin-top: 10px; }
.pfmv-go { width: 100%; min-height: 50px; margin-top: 14px; justify-content: center; font-size: 15px; }
.pfmv-go:disabled { opacity: .5; cursor: default; }
.pos-actions2 { flex-wrap: wrap; }
.pm-opt.move { background: #2a78d6; color: #fff; }
.pm-opt.move .pm-oi { background: rgba(255, 255, 255, .16); }

@media (max-width: 780px) {
  /* the header keeps one row: the switcher takes the name's place, search shrinks to its icon (it still opens full width), and the
     light/dark switch moves to the profile menu, where it already is */
  .topbar.pf-on .brand .bt, .topbar.pf-on .theme-toggle { display: none; }
  .topbar.pf-on .pf-pick { flex: 0 1 auto; max-width: 46vw; padding: 3px 10px 3px 8px; }
  .topbar.pf-on .pf-pick .pfs-n { font-size: 14px; }
  .topbar.pf-on .hdr-right { flex: 0 0 auto; margin-left: auto; }
  .topbar.pf-on .search-box:not(.open):not(:focus-within) { flex: 0 0 40px; width: 40px; padding: 0; justify-content: center; }
  .topbar.pf-on .search-box:not(.open):not(:focus-within) .sb-input { position: absolute; inset: 0; width: 100%; opacity: 0; }
  .cs-panel.is-phone.pfs-panel .pfs-opts { margin: 4px 0 0; }
  .cs-panel.is-phone .pfs-opt { min-height: 62px; padding: 8px 2px; border-radius: 0; border-top: 1px solid var(--line); }
  .cs-panel.is-phone .pfs-opt:first-child { border-top: 0; }
  .cs-panel.is-phone .pfs-opt:hover { background: none; }
  .cs-panel.is-phone .pfs-acts { padding-top: 12px; }
}

/* ===================== 0.10.9 the loading mark: "Orbit" (lib/loader.js) =====================
   The logo with a comet running round it. Light theme: a burnished gold with no glow round the black logo (a glow on white only
   smudges). Dark theme: a bright gold with a glow round the gold logo. The small ring (xs) takes the text colour inside a button. */
.mde-load { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--muted); --mde-c1: #c9952f; --mde-c2: #8a5e10; --mde-track: #ece7da; --mde-glow: none; }
html[data-theme="dark"] .mde-load { --mde-c1: #f3d98b; --mde-c2: #fff6d6; --mde-track: rgba(232, 197, 107, .2); --mde-glow: drop-shadow(0 0 6px rgba(243, 217, 139, .85)); }
.mde-load-t { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); text-align: center; }
.mde-ring { position: relative; display: block; flex: none; width: 96px; height: 96px; }
.mde-load--md .mde-ring { width: 56px; height: 56px; }
.mde-ring > i { position: absolute; inset: 0; display: block; border-radius: 50%; }
.mde-track { box-shadow: inset 0 0 0 1.5px var(--mde-track); }
.mde-orbit { background: conic-gradient(from 0deg, transparent 0deg, transparent 190deg, var(--mde-c1) 320deg, var(--mde-c2) 356deg, transparent 360deg);
  -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px), #000 calc(100% - .5px), transparent 100%);
  mask: radial-gradient(closest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px), #000 calc(100% - .5px), transparent 100%);
  filter: var(--mde-glow); animation: mde-spin 1.15s linear infinite; }
.mde-ring > .mde-logo { inset: 23%; border-radius: 0; background: url(logo-gold.png) center / contain no-repeat; filter: brightness(0); }
html[data-theme="dark"] .mde-ring > .mde-logo { filter: none; }
@keyframes mde-spin { to { transform: rotate(360deg); } }
/* the small ring: in a line of text it is gold, in a button it takes the button's own text colour */
.mde-load--xs { display: inline-flex; flex-direction: row; gap: 8px; vertical-align: middle; }
.mde-load--xs .mde-orbit { position: relative; display: inline-block; flex: none; width: 16px; height: 16px; border-radius: 50%; filter: none;
  background: conic-gradient(from 0deg, transparent 0deg, transparent 150deg, var(--mde-c1) 330deg, var(--mde-c2) 360deg);
  -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 2.6px), #000 calc(100% - 2.2px)); mask: radial-gradient(closest-side, transparent calc(100% - 2.6px), #000 calc(100% - 2.2px)); }
.mde-load--xs .mde-load-t { font-family: inherit; font-size: inherit; letter-spacing: 0; text-transform: none; color: inherit; }
.btn .mde-load--xs, button .mde-load--xs { color: inherit; --mde-c1: currentColor; --mde-c2: currentColor; }
/* where a chart is drawn: the mark sits in the middle of the chart's own space */
.chart-load { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 2; }
.chart-load-box { position: relative; }

/* 0.10.10: the gold logo on the dark theme (header and sign-in), the black one on the light theme */
.brand-logo.brand-logo-gold, .wordmark-logo.wordmark-gold { display: none; }
html[data-theme="dark"] .brand-logo.brand-logo-ink, html[data-theme="dark"] .wordmark-logo.wordmark-ink { display: none; }
html[data-theme="dark"] .brand-logo.brand-logo-gold, html[data-theme="dark"] .wordmark-logo.wordmark-gold { display: block; filter: none; }

/* ===================== 0.10.11 Transactions: one row per thing that happened (bento.js txRowHtml) ===================== */
#activityView .act-cols { grid-template-columns: minmax(0, 1fr); }
.tx-notes { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin: 12px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--ink2); border: 1px solid var(--line); font-size: 13px; color: var(--sub); }
.tx-notes[hidden] { display: none; }
.tx-notes b { color: var(--bright); font-weight: 800; }
.tx-notes span { font-family: var(--mono); font-size: 12.5px; color: var(--text); }
.tx-notes em { font-style: normal; color: var(--red); }
.tx-notes small { flex-basis: 100%; font-size: 11.5px; color: var(--muted); }
#activityTableWrap .tx-th, #activityTableWrap .tx-head { display: grid; grid-template-columns: 64px minmax(0, 1fr) 150px 130px; column-gap: 16px; align-items: center; }
#activityTableWrap.tx-pfcol .tx-th, #activityTableWrap.tx-pfcol .tx-head { grid-template-columns: 64px minmax(0, 1fr) 200px 150px 130px; }
.tx-th { padding: 0 4px 8px; border-bottom: 1px solid var(--line); font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tx-th > span:last-child, .tx-head .al-end { text-align: right; justify-self: end; }
.tx-mh { display: flex; justify-content: space-between; gap: 12px; }
.tx-mh span:last-child { text-transform: none; letter-spacing: 0; font-weight: 700; }
.tx-day, .tx-det { font-size: 12.5px; color: var(--sub); white-space: nowrap; }
.tx-act { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tx-pf { display: inline-flex; align-items: center; gap: 7px; min-width: 0; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-pf i { width: 8px; height: 8px; flex: none; border-radius: 50%; }
.tx-head .al-main b { font-size: 14px; }
.tx-head .al-main small { font-size: 12px; }
.tx-head .al-end b { font-size: 14px; }
.tx-in { color: var(--green) !important; }
.tx-out { color: var(--red) !important; }
.tx-neu { color: var(--bright) !important; }
.tx-mv { color: var(--sub) !important; }
.al-ic.tx-mv { background: var(--ink3); color: var(--sub) !important; display: inline-flex; align-items: center; justify-content: center; }
.tx-tag { display: inline-block; margin-left: 7px; padding: 1px 7px; border-radius: 6px; background: var(--ink3); color: var(--sub); font-size: 11px; font-weight: 800; vertical-align: 1px; white-space: nowrap; }
.tx-tag-reward, .tx-tag-transfer-in, .tx-tag-transfer-out { background: rgba(42, 120, 214, .12); color: #2a78d6; }
html[data-theme="dark"] .tx-tag-reward, html[data-theme="dark"] .tx-tag-transfer-in, html[data-theme="dark"] .tx-tag-transfer-out { background: rgba(127, 176, 240, .14); color: #7fb0f0; }
/* 0.12.0: a connected account's history: a small link badge on the icon (the portfolio dot says which account), no edit
   buttons, a note where they were; a row of chips above the ledger shows one account, or only what was typed in */
.al-icw.tx-linked { position: relative; }
.tx-link { position: absolute; right: -4px; bottom: -4px; width: 15px; height: 15px; box-sizing: border-box; border-radius: 50%; background: var(--ink2); border: 1px solid var(--line2); color: var(--sub); display: grid; place-items: center; pointer-events: none; }
.tx-pdot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; vertical-align: 0; }
.chips.tx-src { margin: 2px 0 12px; }
.chips.tx-src[hidden] { display: none; }
.tx-src .chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--sans); font-size: 12px; font-weight: 700; padding: 6px 12px; }
.tx-src .chip i { font-style: normal; font-family: var(--mono); font-size: 10.5px; opacity: .7; }
.tx-src-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; }
.tx-src-ic { flex: none; }
.tx-dnote.tx-synced { margin: 10px 0 2px; font-size: 12.5px; color: var(--muted); }
.tx-hist .tx-head { cursor: default; }
.tx-note-p, .tx-day-p { display: none; }
.tx-dnote { margin: 4px 0 8px; font-size: 12px; color: var(--muted); }
@media (max-width: 780px) {
  #activityTableWrap .tx-th { display: none; }
  #activityTableWrap .tx-head, #activityTableWrap.tx-pfcol .tx-head { display: flex; flex-wrap: nowrap; }
  .tx-head .tx-day, .tx-head .tx-pf, .tx-head .tx-det, .tx-note-d { display: none; }
  .tx-note-p { display: inline; }
  .tx-day-p { display: block; font-weight: 600; color: var(--muted); }
  .tx-act { flex: 1 1 0; min-width: 0; }
  .tx-head .al-end { flex: none; }
  .tx-tag { display: none; }
  .tx-mh span:last-child { display: none; }
  .chips.tx-src { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 0 10px; }
  .chips.tx-src::-webkit-scrollbar { display: none; }
  .tx-src .chip { flex: none; }
}

/* 0.10.12 phone: the Dashboard and Portfolio heroes lose their label rows ("Net worth", "Performance") and the "11 positions"
   line; Live and refresh sit on the same line as the big number, to its right */
@media (max-width: 780px) {
  #portfolioView .page-h #portfolioSub { display: none; }
  .tile.worth > .t-head { position: absolute; top: 4px; right: 0; z-index: 3; margin: 0; padding: 0; min-height: 0; border: 0; }
  .tile.worth > .t-head > .t-label { display: none; }
  .tile.perf .perf-top > div:first-child { position: relative; }
  .tile.perf .perf-top .t-label { position: absolute; top: 4px; right: 0; z-index: 3; margin: 0; }
  .tile.perf .perf-top .t-label > span:first-child { display: none; }
}

/* 0.10.13 the desktop's Trade menu: the phone's four options as a drop-down under the Trade button (asset-mobile-ui.js) */
.ph-trade-panel .cs-box { width: 300px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.ph-trade-panel .pm-opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 0 14px 0 9px; border: 0; border-radius: 16px; font: inherit; text-align: left; cursor: pointer; opacity: 0; transform: translateY(-6px); transition: opacity .18s ease, transform .22s cubic-bezier(.2, .9, .3, 1.1), filter .15s ease; }
.ph-trade-panel.on .pm-opt { opacity: 1; transform: none; }
.ph-trade-panel.on .pm-opt:nth-child(2) { transition-delay: .03s; } .ph-trade-panel.on .pm-opt:nth-child(3) { transition-delay: .06s; } .ph-trade-panel.on .pm-opt:nth-child(4) { transition-delay: .09s; }
.ph-trade-panel .pm-opt:hover { filter: brightness(1.06); }
.ph-trade-panel .pm-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ph-trade-panel .pm-oi { width: 40px; height: 40px; flex: none; border-radius: 13px; display: flex; align-items: center; justify-content: center; }
.ph-trade-panel .pm-opt b { display: block; font-size: 16px; font-weight: 800; }
.ph-trade-panel .pm-opt small { display: block; font-size: 12.5px; font-weight: 600; opacity: .88; }
.ph-trade-panel .pm-opt.buy { background: #34c37a; color: #04210f; }
.ph-trade-panel .pm-opt.buy .pm-oi { background: rgba(4, 33, 15, .14); }
.ph-trade-panel .pm-opt.sell { background: #c93c3c; color: #fff; }
.ph-trade-panel .pm-opt.sell .pm-oi { background: rgba(255, 255, 255, .16); }
.ph-trade-panel .pm-opt .pro-tag { margin-left: 6px; }
@media (max-width: 780px) {
  /* 0.10.13: a little wider, so "Move · To another portfolio · Main 1,563.55" stays on its lines */
  .pm-menu { width: min(256px, calc(100vw - 32px)); }
  .pm-opt small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pm-opt > span:last-child { min-width: 0; }
}
