:root {
  color-scheme: dark;
  --ink: #e8eef5;
  --muted: #96a4b4;
  --line: #223242;
  --page: #081018;
  --panel: #101a24;
  --panel-soft: #142130;
  --panel-softer: #172636;
  --teal: #41d6c3;
  --blue: #68a7ff;
  --gold: #f2bd5c;
  --rose: #ff6b8a;
  --green: #5be38b;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  --mobile-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(160deg, rgba(65, 214, 195, 0.14), transparent 38%),
    linear-gradient(24deg, rgba(104, 167, 255, 0.1), transparent 42%),
    var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px 28px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(28px, 8vw, 44px);
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
  letter-spacing: 0;
}

.refresh-btn {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}

.mini-btn {
  min-height: 24px;
  margin-top: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  background: var(--panel-soft);
  color: var(--teal);
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.visibility-toggle {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  touch-action: manipulation;
}

.visibility-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.visibility-toggle .eye-closed,
.visibility-toggle.is-hidden .eye-open {
  display: none;
}

.visibility-toggle.is-hidden .eye-closed {
  display: block;
}

.refresh-btn:disabled {
  cursor: progress;
  opacity: 0.72;
}

.refresh-btn:hover,
.visibility-toggle:hover,
.text-toggle:hover {
  filter: brightness(1.08);
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.metric-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.metric-head > span {
  flex: 0 0 auto;
}

.metric-head > strong {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
}

.metric-head > .refresh-btn {
  flex: 0 0 auto;
}

.text-toggle {
  width: 100%;
  min-height: 40px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}

.text-toggle[hidden] {
  display: none;
}

.sort-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: -4px 0 12px;
}

.sort-tabs button {
  min-width: 0;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.sort-tabs button[aria-pressed="true"] {
  border-color: rgba(65, 214, 195, 0.42);
  background: rgba(65, 214, 195, 0.13);
  color: var(--teal);
}

.compact-toggle {
  min-height: 32px;
  margin-top: 10px;
  font-size: 13px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.metric,
.panel {
  background: rgba(16, 26, 36, 0.92);
  border: 1px solid rgba(55, 74, 94, 0.72);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  min-height: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: start;
}

.metric span,
.metric small,
.panel-head span,
.row-meta {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  font-size: clamp(24px, 6vw, 38px);
  line-height: 1;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.metric.primary {
  background: linear-gradient(135deg, #0e2a34, #101a24 62%);
  color: #fff;
  border-color: rgba(65, 214, 195, 0.26);
}

.metric.primary span,
.metric.primary small {
  color: rgba(255, 255, 255, 0.72);
}

.metric.primary .metric-head strong {
  font-size: clamp(24px, 5vw, 36px);
}

.data-freshness {
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
  line-height: 1.35;
}

.data-freshness.is-stale {
  color: var(--gold);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 14px;
}

.hero-stat {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}

.hero-stat span {
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  white-space: nowrap;
}

.hero-stat b {
  font-size: 13px;
  line-height: 1.1;
  color: #fff;
  white-space: nowrap;
}

.hero-stat b.positive { color: var(--green); }
.hero-stat b.negative { color: var(--rose); }

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.panel {
  padding: 18px;
  min-width: 0;
}

.panel.wide {
  grid-column: span 2;
}

.panel[hidden] {
  display: none;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.donut-wrap {
  position: relative;
  width: min(230px, 70vw);
  aspect-ratio: 1;
  margin: 2px auto 18px;
}

.donut {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  overflow: visible;
}

.donut circle {
  fill: none;
  stroke-width: 7;
}

.donut-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 4px;
}

.donut-label strong {
  font-size: 28px;
}

.donut-label span {
  color: var(--muted);
  font-size: 12px;
}

.holdings-list,
.sector-legend {
  display: grid;
  gap: 10px;
}

.sector-legend {
  max-height: 320px;
  overflow: auto;
  padding-right: 2px;
  min-width: 0;
  overflow-wrap: break-word;
}

.sector-group {
  min-width: 0;
  overflow: hidden;
}

.holding-row {
  display: grid;
  gap: 8px;
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.insight-item {
  min-width: 0;
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 3px 8px;
}

.insight-item span,
.insight-item small,
.insight-note {
  color: var(--muted);
  font-size: 12px;
}

.insight-item strong {
  font-size: 18px;
  line-height: 1;
  text-align: right;
}

.insight-item small {
  grid-column: 1 / -1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.insight-note {
  margin-top: 10px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(65, 214, 195, 0.09);
  color: var(--teal);
  line-height: 1.45;
}

.report-section-list {
  display: grid;
  gap: 8px;
}

.report-section {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.report-section strong {
  display: block;
  font-size: 14px;
}

.report-section span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.report-section small {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
}

.report-section b {
  flex: 0 0 auto;
  border-radius: 8px;
  padding: 5px 8px;
  background: var(--panel-softer);
  color: var(--muted);
  font-size: 12px;
}

.report-section.is-ready b {
  background: rgba(65, 214, 195, 0.12);
  color: var(--teal);
}

.holding-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.holding-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.ticker {
  font-weight: 850;
}

.row-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-value {
  text-align: right;
  font-weight: 800;
  min-width: max-content;
}

.row-pnl.positive {
  color: var(--green);
}

.row-pnl.negative {
  color: var(--rose);
}

.sector-chart {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  align-items: start;
  justify-content: start;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.sector-donut-wrap {
  position: relative;
  width: 160px;
  aspect-ratio: 1;
  margin: 0 auto;
}

.sector-donut-wrap .donut-label strong {
  font-size: 20px;
}

.sector-donut-wrap .donut-label span {
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sector-legend-item {
  display: grid;
  grid-template-columns: 10px minmax(60px, 1fr) 44px minmax(60px, 130px);
  gap: 4px 6px;
  align-items: center;
  min-height: 26px;
}

.sector-legend-item strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.sector-legend-item > span:nth-child(3) {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.sector-pnl-positive { color: var(--green); font-weight: 600; font-size: 11px; text-align: right; }
.sector-pnl-negative { color: var(--rose); font-weight: 600; font-size: 11px; text-align: right; }
.sector-group { margin-bottom: 2px; }
.sector-tickers { padding-left: 16px; color: var(--muted); font-size: 11px; line-height: 1.3; word-break: break-all; }

.recommendation-card {
  display: grid;
  gap: 10px;
}

.recommendation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.recommendation-head strong {
  display: block;
  font-size: 22px;
  line-height: 1;
}

.recommendation-head span {
  color: var(--muted);
  font-size: 12px;
}

.recommendation-head b {
  flex: 0 0 auto;
  border-radius: 8px;
  padding: 6px 10px;
  background: rgba(65, 214, 195, 0.12);
  color: var(--teal);
  font-size: 13px;
}

.recommendation-card > p {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.recommendation-plan {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.recommendation-plan div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.recommendation-plan span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.recommendation-plan strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  line-height: 1.25;
}

.recommendation-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.recommendation-list div {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.recommendation-list span {
  color: var(--muted);
  font-size: 12px;
}

.recommendation-list p {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.4;
}

.recommendation-list .risk {
  background: rgba(255, 107, 138, 0.1);
}

.analysis-list,
.potential-list,
.news-radar-list {
  display: grid;
  gap: 10px;
}

.decision-row {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.decision-row.risk {
  background: rgba(255, 107, 138, 0.09);
  border-color: rgba(255, 107, 138, 0.28);
}

.decision-row.opportunity {
  background: rgba(91, 227, 139, 0.08);
  border-color: rgba(91, 227, 139, 0.22);
}

.decision-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.decision-main strong {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 16px;
}

.decision-main strong em {
  border-radius: 8px;
  padding: 3px 6px;
  background: rgba(242, 189, 92, 0.12);
  color: var(--gold);
  font-size: 11px;
  font-style: normal;
  line-height: 1;
}

.direction-badge { font-size: 11px; font-weight: 700; margin-left: 6px; padding: 1px 5px; border-radius: 4px; line-height: 1.2; }
.dir-add { background: rgba(22,163,74,0.1); color: #16a34a; }
.dir-cut { background: rgba(220,38,38,0.1); color: #dc2626; }
.dir-hold { background: rgba(100,116,139,0.1); color: #64748b; }
.dir-watch { background: rgba(37,99,235,0.1); color: #2563eb; }

.decision-main span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.decision-main b {
  color: var(--teal);
  font-size: 14px;
  text-align: right;
  white-space: nowrap;
  flex-shrink: 0;
}

.decision-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.decision-metrics {
  color: var(--muted);
  font-size: 11px;
}

.decision-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.decision-tags span {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 4px 7px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font-size: 12px;
  line-height: 1;
}

.decision-row p,
.decision-row small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.decision-row small {
  color: var(--ink);
}

.decision-diagnostic {
  justify-self: end;
}

.focus-main span a {
  color: inherit;
  text-decoration: none;
}

.focus-main span a:hover {
  color: var(--teal);
}

.focus-list {
  display: grid;
  gap: 10px;
}

.focus-summary {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.focus-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.focus-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.focus-main strong {
  display: block;
  font-size: 18px;
  line-height: 1.1;
}

.focus-main span,
.focus-detail span {
  color: var(--muted);
  font-size: 12px;
}

.focus-badges {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.focus-badges b,
.focus-badges em {
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 12px;
  font-style: normal;
  line-height: 1;
}

.focus-badges b {
  background: rgba(65, 214, 195, 0.12);
  color: var(--teal);
}

.focus-badges em {
  background: var(--panel-softer);
  color: var(--muted);
}

.focus-badges .risk-high {
  background: rgba(255, 107, 138, 0.12);
  color: var(--rose);
}

.focus-badges .risk-mid {
  background: rgba(242, 189, 92, 0.12);
  color: var(--gold);
}

.focus-badges .risk-low {
  background: rgba(65, 214, 195, 0.1);
  color: var(--teal);
}

.focus-item > p {
  font-size: 13px;
  line-height: 1.45;
}

.focus-detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.focus-detail div {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-softer);
}

.focus-detail p {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.4;
}

.potential-item,
.news-item {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.signal-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.signal-list span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 8px;
  background: var(--panel-softer);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.25;
}

.risk-copy,
.news-item > p {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.source-link {
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.diagnostic-panel {
  display: grid;
  gap: 10px;
}

.diagnostic-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.diagnostic-head strong {
  display: block;
  font-size: 22px;
  line-height: 1;
}

.diagnostic-head span,
.diagnostic-grid span,
.diagnostic-columns span {
  color: var(--muted);
  font-size: 12px;
}

.diagnostic-head b {
  border-radius: 8px;
  padding: 6px 10px;
  background: rgba(65, 214, 195, 0.12);
  color: var(--teal);
  font-size: 13px;
}

.diagnostic-grid,
.diagnostic-columns {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.diagnostic-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.diagnostic-grid div,
.diagnostic-columns div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.diagnostic-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.diagnostic-columns p {
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.4;
}

.diagnostic-news {
  display: grid;
  gap: 6px;
}

.diagnostic-news a {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  text-decoration: none;
}

.diagnostic-news a:hover {
  color: var(--teal);
}

.diagnostic-dimensions {
  display: grid;
  gap: 8px;
}

.diagnostic-dimension {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-soft);
}

.diagnostic-dimension .dimension-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.diagnostic-dimension .dimension-header > span {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.diagnostic-dimension .dimension-header b {
  font-size: 12px;
  font-weight: 700;
}

.diagnostic-dimension > p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
  margin: 2px 0 8px;
}

.dimension-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.dimension-details div { font-size: 12px; }
.dimension-details small { color: var(--muted); }
.dimension-details span { display: block; margin-top: 1px; }

.catalyst-item {
  font-size: 12px;
  line-height: 1.4;
  padding: 3px 0;
}

.catalyst-item b { margin-right: 4px; }
.catalyst-item small { display: block; color: var(--muted); font-size: 11px; }

.insider-trade {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 2px 0;
}

.dimension-recommendation {
  border-left: 3px solid var(--teal);
}

.diagnostic-tags {
  display: flex;
  gap: 6px;
  align-items: center;
}

.diagnostic-tags small {
  color: var(--muted);
  font-size: 11px;
}

.diagnostic-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}

.diagnostic-sources a {
  color: var(--muted);
  text-decoration: none;
}

.diagnostic-sources a:hover { color: var(--teal); }

.empty,
.error {
  color: var(--muted);
  padding: 18px 0;
}

.error {
  color: var(--rose);
}

@media (max-width: 760px) {
  body {
    background:
      linear-gradient(160deg, rgba(65, 214, 195, 0.13), transparent 320px),
      var(--page);
  }

  .shell {
    padding: max(12px, env(safe-area-inset-top)) 12px calc(22px + env(safe-area-inset-bottom));
  }

  h1 {
    font-size: 22px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .refresh-btn {
    min-height: 34px;
    padding: 0 10px;
    font-size: 13px;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
    margin-bottom: 10px;
  }

  .metric {
    padding: 14px;
    border-radius: 8px;
    box-shadow: var(--mobile-shadow);
  }

  .metric.primary {
    min-height: 0;
  }

  .metric span,
  .metric small,
  .panel-head span,
  .row-meta {
    font-size: 12px;
  }

  .metric strong {
    font-size: 24px;
  }

  .metric.primary strong {
    font-size: 28px;
  }

  .asset-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 10px;
  }

  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-stat b {
    font-size: 12px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .panel.wide {
    grid-column: auto;
  }

  .panel {
    padding: 14px;
    box-shadow: var(--mobile-shadow);
  }

  .recommendation-plan,
  .recommendation-list {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .recommendation-head strong {
    font-size: 20px;
  }

  .focus-main,
  .focus-detail,
  .diagnostic-grid,
  .diagnostic-columns {
    display: grid;
    grid-template-columns: 1fr;
  }

  .focus-badges {
    justify-content: flex-start;
  }

  .panel-head {
    margin-bottom: 12px;
  }

  h2 {
    font-size: 16px;
  }

  .donut-wrap {
    width: min(210px, 62vw);
    margin-bottom: 14px;
  }

  .donut-label strong {
    font-size: 24px;
  }

  .insight-grid {
    gap: 8px;
  }

  .insight-item {
    min-height: 42px;
    padding: 7px 8px;
  }

  .insight-item strong {
    font-size: 17px;
  }

  .holding-row {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 58px;
    padding-bottom: 12px;
  }

  .ticker {
    font-size: 15px;
  }

  .row-value {
    font-size: 14px;
    padding-left: 8px;
  }

  .sector-chart {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .sector-donut-wrap {
    width: 140px;
  }

  .sector-legend {
    grid-template-columns: 1fr;
    gap: 4px;
    max-height: none;
  }

  .sector-legend-item {
    grid-template-columns: 10px minmax(50px, 1fr) 38px minmax(40px, 100px);
    min-height: 20px;
  }

  .sector-legend-item strong,
  .sector-legend-item > span:last-child {
    font-size: 12px;
  }

  .sector-tickers { font-size: 10px; }
}

@media (max-width: 390px) {
  .shell {
    padding-inline: 10px;
  }

  h1 {
    font-size: 20px;
  }

  .metric {
    padding: 12px;
  }

  .metric.primary strong {
    font-size: 30px;
  }

  .metric strong {
    font-size: 21px;
  }

}

/* Data Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 4px;
}
.data-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 500;
  font-size: 11px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table .total-row td {
  font-weight: 600;
  border-top: 2px solid var(--line);
  border-bottom: none;
}
.data-table .positive { color: var(--green); }
.data-table .negative { color: var(--rose); }
