:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --text: #201714;
  --muted: #7d6a61;
  --line: #f0d9cf;
  --soft: #fff7f2;
  --green: #087443;
  --teal: #f97316;
  --amber: #b45309;
  --red: #d92d20;
  --orange: #ff6b2a;
  --gold: #ffb020;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --blue-line: #bfdbfe;
  --blue-text: #1e3a8a;
  --purple: #7c3aed;
  --purple-soft: #f5f3ff;
  --purple-line: #ddd6fe;
  --purple-text: #4c1d95;
  --satellite: #0f766e;
  --satellite-soft: #ecfdf5;
  --satellite-line: #99f6e4;
  --satellite-text: #115e59;
  --stable: #16a34a;
  --stable-soft: #f0fdf4;
  --stable-line: #bbf7d0;
  --stable-text: #166534;
  --quality: #64748b;
  --quality-soft: #f8fafc;
  --quality-line: #cbd5e1;
  --quality-text: #334155;
  --nasdaq: #0891b2;
  --nasdaq-soft: #ecfeff;
  --nasdaq-line: #a5f3fc;
  --nasdaq-text: #155e75;
  --theme-etf: #0d9488;
  --theme-etf-soft: #f0fdfa;
  --theme-etf-line: #99f6e4;
  --theme-etf-text: #115e59;
  --guru: #b45309;
  --guru-soft: #fffbeb;
  --guru-line: #fde68a;
  --guru-text: #92400e;
  --custom: #ef4444;
  --custom-soft: #fff1f2;
  --custom-line: #fecdd3;
  --custom-text: #9f1239;
  --shadow: 0 18px 42px rgba(122, 43, 25, 0.09), 0 1px 2px rgba(122, 43, 25, 0.05);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: #ffffff;
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
}

.shell {
  width: min(1240px, calc(100% - 160px));
  margin: 0 auto;
  padding: 0 0 22px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(239, 63, 47, 0.18);
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--red);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.02em;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 31px;
  line-height: 1.18;
}

h2 {
  font-size: 17px;
}

.stamp {
  display: grid;
  gap: 6px;
  text-align: right;
  color: var(--muted);
  font-size: 13px;
}

.stamp strong {
  color: var(--red);
  font-size: 20px;
}

.topbar-actions {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.panel {
  margin-bottom: 0;
  padding: 20px;
  background: var(--panel);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.hero-panel {
  border-top: 4px solid var(--red);
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  min-width: 0;
  margin-bottom: 0;
}

.conclusion-panel {
  border-top: 0;
  padding-top: 0;
  padding-bottom: 14px;
}

.conclusion-panel h3 {
  margin: 2px 0 16px;
  color: #24120d;
  font-size: 24px;
  line-height: 1.35;
}

.merged-holdings-block {
  margin-top: 24px;
  border-top: 0;
  padding-top: 0;
}

.merged-holdings-head {
  align-items: center;
  margin-bottom: 14px;
}

.merged-holdings-head .stats-inline {
  flex-wrap: nowrap;
}

.reference-combo-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px;
}

.title-jump-wrap {
  color: #8f7b73;
  font-size: 15px;
  font-weight: 800;
}

.title-jump-wrap a {
  color: #8f7b73;
  text-decoration: none;
  border-bottom: 1px solid rgba(143, 123, 115, 0.35);
}

.title-jump-wrap a:hover {
  color: var(--orange);
  border-bottom-color: rgba(255, 99, 38, 0.45);
}

#annual-history-section {
  scroll-margin-top: 86px;
}

.portfolio-disclaimer {
  margin: 4px 0 0;
  color: #9a877f;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-head h2 {
  color: #24120d;
  font-size: 19px;
  font-weight: 900;
  line-height: 1.25;
}

.segmented {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.segmented button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 6px 11px;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
}

.segmented button.active {
  border-color: #93c5fd;
  background: var(--blue-soft);
  color: var(--blue);
  box-shadow: 0 5px 14px rgba(37, 99, 235, 0.1);
}

.section-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 12px;
  border-radius: 999px;
  color: var(--red);
  background: #fff0e8;
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

.pill.bull {
  color: var(--red);
  background: #fff0e8;
}

.pill.defense {
  color: var(--amber);
  background: #fef3c7;
}

.decision-board {
  display: grid;
  gap: 0;
  min-width: 0;
}

.market-strategy-overview {
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.overview-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 11px;
  border-bottom: 1px solid rgba(241, 213, 203, 0.8);
}

.market-strategy-overview h3 {
  margin: 0;
  color: #24120d;
  font-size: 22px;
  line-height: 1.3;
}

.market-strategy-overview p {
  margin: 7px 0 0;
  color: #4b332b;
  font-size: 13px;
  line-height: 1.55;
}

.overview-conclusions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.overview-conclusions span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(241, 213, 203, 0.95);
  border-radius: 999px;
  background: #fffaf7;
  padding: 5px 10px;
  color: #4b332b;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
}

.overview-conclusions span:first-child {
  border-color: rgba(217, 45, 32, 0.26);
  background: #fff0e8;
  color: #7a3425;
}

.overview-body {
  display: grid;
  gap: 13px;
  padding-top: 0;
}

.overview-left {
  min-width: 0;
}

.overview-mini-gauges {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.overview-gauge-card {
  min-width: 0;
  border: 1px solid #f1d5cb;
  border-top: 4px solid var(--red);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #fffaf7);
  padding: 10px 12px;
  text-align: center;
}

.overview-gauge-card .mini-gauge {
  width: fit-content;
  min-height: 54px;
  margin: 0 auto;
  border: 0;
  background: transparent;
  grid-template-columns: 58px auto;
  padding: 7px;
  justify-content: center;
  text-align: left;
}

.overview-gauge-card .mini-gauge strong {
  font-size: 17px;
}

.overview-gauge-card .mini-gauge span {
  font-size: 12px;
}

.overview-gauge-card p {
  display: -webkit-box;
  margin: 6px auto 0;
  overflow: hidden;
  color: #b85a32;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  text-align: center;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.overview-content-row {
  display: grid;
  grid-template-columns: minmax(360px, 0.38fr) minmax(0, 0.62fr);
  gap: 10px 18px;
}

.overview-content-row .event-chip-row {
  margin-top: 0;
}

.overview-insight-row {
  display: block;
}

.overview-insight-row .market-brief {
  max-width: 100%;
  margin: 0;
  padding-left: 21px;
  color: #4f382f;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.75;
  letter-spacing: 0;
}

.overview-insight-row .market-brief li {
  padding-left: 2px;
}

.overview-insight-row .action-insight-inline {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 28px;
}

.overview-insight-row .action-insight-inline p {
  color: #5d4339;
  font-size: 13px;
  line-height: 1.68;
  letter-spacing: 0.01em;
  -webkit-line-clamp: 4;
}

.overview-insight-row .action-insight-inline b {
  margin-right: 8px;
  font-size: 13px;
}

.decision-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.decision-card {
  min-width: 0;
  border: 1px solid #f2d9cf;
  border-radius: 8px;
  background: var(--soft);
  padding: 14px;
}

.decision-card p {
  margin-top: 10px;
  color: #4b332b;
  font-size: 13px;
  line-height: 1.55;
}

.decision-card .gauge {
  grid-template-columns: 86px minmax(0, 1fr);
  min-height: 76px;
  border: 0;
  background: transparent;
  padding: 0;
}

.decision-card .gauge-copy strong {
  font-size: 24px;
}

.strategy-action {
  min-width: 0;
  border-top: 0;
  padding-top: 14px;
}

.strategy-action-head {
  display: block;
  border: 1px solid #f1d5cb;
  border-radius: 8px;
  background:
    radial-gradient(circle at 94% 18%, rgba(255, 107, 42, 0.12), transparent 30%),
    linear-gradient(180deg, #ffffff, #fffaf7);
  padding: 14px;
}

.strategy-action-main {
  min-width: 0;
}

.strategy-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.strategy-action-head h4 {
  margin: 0;
  color: #24120d;
  font-size: 16px;
}

.strategy-action-head p {
  margin: 7px 0 0;
  color: #4b332b;
  font-size: 13px;
  line-height: 1.55;
}

.strategy-action-head strong {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #fff0e8;
  padding: 7px 11px;
  color: var(--red);
  font-size: 13px;
  white-space: nowrap;
}

.strategy-brief-row {
  display: grid;
  grid-template-columns: minmax(360px, 0.40fr) minmax(0, 0.60fr);
  gap: 10px 18px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 0;
}

.strategy-tag-stack {
  display: grid;
  gap: 8px;
  align-content: start;
}

.strategy-brief-row .event-chip-row {
  align-content: flex-start;
  margin-top: 0;
}

.strategy-brief-row .event-chip-row span {
  min-height: 24px;
  padding: 3px 8px;
  font-size: 11px;
}

.action-mini-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.action-mini-tags span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 25px;
  border: 1px solid rgba(241, 213, 203, 0.95);
  border-radius: 999px;
  background: #ffffff;
  padding: 3px 9px;
  color: #4b332b;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.action-mini-tags span:first-child {
  border-color: rgba(217, 45, 32, 0.28);
  background: #fff0e8;
}

.action-mini-tags span.metric-positive {
  border-color: rgba(8, 116, 67, 0.24);
  background: #f0fdf7;
}

.action-mini-tags span.metric-negative {
  border-color: rgba(217, 45, 32, 0.24);
  background: #fff7f2;
}

.action-mini-tags em {
  color: var(--muted);
  font-style: normal;
}

.action-mini-tags b {
  color: #24120d;
  font-size: 11px;
  font-weight: 850;
}

.action-mini-tags span.metric-positive b {
  color: var(--green);
}

.action-mini-tags span.metric-negative b {
  color: var(--red);
}

.action-insight-inline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 14px;
}

.action-insight-inline p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #5d4339;
  font-size: 14px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.action-insight-inline b {
  display: inline-flex;
  margin-right: 7px;
  color: #24120d;
  font-size: 14px;
}

.action-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: stretch;
  margin-top: 10px;
  overflow-x: auto;
}

.action-grid span {
  flex: 0 1 168px;
  min-width: 0;
  max-width: 250px;
  border: 1px solid #f1d5cb;
  border-radius: 8px;
  background: #ffffff;
  padding: 8px 10px;
}

.action-grid span:nth-child(1) {
  flex-basis: 230px;
}

.action-grid span:nth-child(3) {
  flex-basis: 250px;
}

.action-grid span:nth-child(4),
.action-grid span:nth-child(5) {
  flex-basis: 138px;
}

.action-grid span:first-child {
  border-color: rgba(217, 45, 32, 0.32);
  background: #fff0e8;
}

.action-grid span.metric-positive {
  border-color: rgba(8, 116, 67, 0.26);
  background: #f0fdf7;
}

.action-grid span.metric-negative {
  border-color: rgba(217, 45, 32, 0.28);
  background: #fff7f2;
}

.action-grid em {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.25;
}

.action-grid b {
  display: block;
  margin-top: 3px;
  color: #24120d;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.action-grid span.metric-positive b {
  color: var(--green);
}

.action-grid span.metric-negative b {
  color: var(--red);
}

.event-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.event-chip-row span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid rgba(255, 107, 42, 0.24);
  border-radius: 999px;
  background: #fff7f2;
  padding: 4px 9px;
  color: #7a3425;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.action-insight-summary {
  min-width: 0;
  border: 1px solid #f1d5cb;
  border-radius: 8px;
  background:
    radial-gradient(circle at 96% 0%, rgba(255, 107, 42, 0.10), transparent 28%),
    linear-gradient(180deg, #ffffff, #fffaf7);
  margin-top: 10px;
  padding: 13px;
}

.action-insight-summary h5 {
  margin: 0 0 8px;
  color: #24120d;
  font-size: 14px;
  line-height: 1.35;
}

.action-insight-summary div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 14px;
}

.action-insight-summary p {
  color: #5d4339;
  font-size: 12px;
  line-height: 1.55;
}

.action-insight-summary b {
  display: inline-flex;
  margin-right: 6px;
  color: #24120d;
  font-size: 12px;
}

.gauge {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 90px;
  border: 1px solid #f2d9cf;
  border-radius: 8px;
  background: #fbfcfe;
  padding: 11px;
}

.gauge-dial {
  position: relative;
  width: 86px;
  height: 46px;
  overflow: hidden;
}

.gauge-dial::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 86px 86px 0 0;
  background: conic-gradient(from 270deg, #ff6b2a calc(var(--value) * 1.8deg), #efe3dd 0 180deg, transparent 0);
}

.gauge-dial::after {
  content: "";
  position: absolute;
  right: 9px;
  bottom: 0;
  left: 9px;
  height: 35px;
  border-radius: 70px 70px 0 0;
  background: var(--soft);
}

.gauge-needle {
  position: absolute;
  z-index: 2;
  bottom: 0;
  left: 42px;
  width: 2px;
  height: 39px;
  background: #172033;
  transform: rotate(var(--angle));
  transform-origin: bottom center;
}

.gauge-dial b {
  position: absolute;
  z-index: 3;
  bottom: -6px;
  left: 36px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #172033;
}

.gauge-copy span,
.gauge-copy em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.gauge-copy strong {
  display: block;
  margin: 2px 0 3px;
  color: #24120d;
  font-size: 26px;
  font-variant-numeric: tabular-nums;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.gauge-card,
.holding-card,
.candidate-card,
.metric-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.gauge-card {
  padding: 16px;
}

.gauge-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.gauge-top span {
  color: var(--muted);
  font-size: 13px;
}

.gauge-top strong {
  font-size: 24px;
}

.bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #f6e4dc;
}

.bar b {
  display: block;
  width: var(--value);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--red));
}

.gauge-card p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.market-mini {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 13px;
}

.market-mini em,
.stats-inline span {
  display: inline-flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  font-style: normal;
}

.market-mini b,
.stats-inline b {
  color: var(--text);
  font-size: inherit;
  font-weight: 850;
}

.stats-inline span.metric-positive {
  border: 0;
  background: transparent;
}

.stats-inline span.metric-positive b {
  color: var(--green);
}

.stats-inline span.metric-negative {
  border: 0;
  background: transparent;
}

.stats-inline span.metric-negative b {
  color: var(--red);
}

.stats-inline span.metric-plain {
  border: 0;
  background: transparent;
}

.stats-inline {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 18px;
  align-items: center;
}

.stats-inline span {
  align-items: baseline;
  padding: 0;
  min-height: 20px;
  color: var(--muted);
  white-space: nowrap;
}

.holding-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.holding-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 14px;
  border-top: 4px solid var(--red);
}

.candidate-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stock-card-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.stock-title-block {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.stock-title-block h3 {
  min-width: 0;
  flex: 0 0 auto;
  margin: 0;
  color: #24120d;
  font-size: 20px;
  line-height: 1.15;
}

.stock-title-block > .stock-title-name {
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.title-rank-chip {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #6b4b40;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.title-allocation-text {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 0;
  color: #6b4b40;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.company-brief {
  display: -webkit-box;
  min-height: 18px;
  margin: 5px 0 2px;
  overflow: hidden;
  color: #8a7a73;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.stock-symbol-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
  border-bottom: 2px solid rgba(217, 45, 32, 0.46);
  padding-bottom: 2px;
  transition:
    border-color 0.18s ease,
    color 0.18s ease;
}

.stock-symbol-link:hover {
  color: var(--red);
  border-bottom-color: var(--red);
}

.rank-context {
  display: flex;
  flex-wrap: nowrap;
  flex: 0 0 auto;
  gap: 5px;
  margin: 0;
  min-width: max-content;
  overflow: visible;
}

.rank-context span {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 4px;
  min-height: 20px;
  border: 1px solid #f1c9bc;
  border-radius: 999px;
  background: #fff8f4;
  padding: 2px 7px;
  color: #7a5a50;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.rank-context em {
  font-style: normal;
}

.rank-context b {
  color: var(--ink);
  font-size: 11px;
}

.card-badges {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  flex: 0 0 auto;
  gap: 5px;
  min-width: max-content;
  max-width: none;
  overflow: visible;
}

.stock-tag-row {
  display: grid;
  grid-template-rows: repeat(3, 20px);
  gap: 5px;
  min-height: 70px;
  max-height: 70px;
  margin: 8px 0 0;
  overflow: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
}

.stock-tag-row::-webkit-scrollbar {
  display: none;
}

.stock-tag-line {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.stock-tag-line::-webkit-scrollbar {
  display: none;
}

.card-badges span,
.card-badges button,
.source-chip-row span,
.source-chip-row button,
.candidate-type,
.rank-chip,
.earnings-chip,
.estimate-chip,
.nasdaq-weight-chip,
.context-chip,
.trend-chip,
.fresh-detail-chip {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 20px;
  border: 0;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.card-badges button,
.source-chip-row button {
  cursor: pointer;
  font: inherit;
}

.card-badges button:hover,
.source-chip-row button:hover {
  box-shadow: inset 0 0 0 1px currentColor;
}

.role-main {
  background: #fff0e8;
  color: var(--red);
}

.role-satellite {
  background: var(--satellite-soft);
  color: var(--satellite-text);
}

.role-allocation {
  background: #fff7f2;
  color: #795548;
}

.role-fresh {
  background: #fff7cc;
  color: #8a5a00;
}

.rank-chip {
  background: #fff7f2;
  color: #7a5a50;
}

.earnings-chip {
  background: #f7fbff;
  color: #2563eb;
}

.earnings-soon {
  background: #fff7e6;
  color: #9a5b00;
}

.earnings-urgent {
  background: #fff0ed;
  color: var(--red);
}

.earnings-past {
  background: #f5f5f5;
  color: #7a6a62;
}

.nasdaq-weight-chip {
  border: 1px solid var(--nasdaq-line);
  background: var(--nasdaq-soft);
  color: var(--nasdaq-text);
}

.context-chip {
  border: 1px solid rgba(217, 45, 32, 0.14);
  background: #fff9f5;
  color: #7a4b3f;
}

.industry-chip {
  border-color: rgba(8, 145, 178, 0.16);
  background: rgba(236, 253, 255, 0.72);
  color: #087589;
}

.estimate-chip {
  border: 1px solid var(--line);
  background: #ffffff;
  color: #6b4b40;
}

.peer-chip {
  border-color: rgba(0, 151, 178, 0.16);
  background: rgba(236, 253, 255, 0.72);
  color: #087589;
}

.rating-chip {
  border-color: rgba(126, 58, 242, 0.16);
  background: rgba(245, 243, 255, 0.78);
  color: #6d28d9;
}

.target-chip {
  border-color: rgba(22, 163, 74, 0.18);
  background: rgba(240, 253, 244, 0.78);
  color: #15803d;
}

.grade-chip {
  border-color: rgba(245, 158, 11, 0.2);
  background: rgba(255, 251, 235, 0.86);
  color: #9a5b00;
}

.trend-chip {
  gap: 5px;
  border: 1px solid rgba(22, 163, 74, 0.18);
  background: rgba(240, 253, 244, 0.78);
  color: var(--stable-text);
}

.trend-chip em {
  color: inherit;
  font-style: normal;
  opacity: 0.76;
}

.trend-chip b {
  color: inherit;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
}

.trend-chip.steady-chip {
  border-color: rgba(217, 45, 32, 0.18);
  background: #fff0e8;
  color: var(--red);
}

.fresh-detail-chip {
  background: #fff7cc;
  color: #8a5a00;
}

.fresh-highlight {
  box-shadow: 0 0 0 2px rgba(255, 176, 32, 0.42), var(--shadow);
}

.analysis-link,
.analysis-actions button {
  border: 1px solid #f1cdbc;
  border-radius: 999px;
  background: #fff7f2;
  color: #8a2f21;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}

.analysis-link {
  min-height: 28px;
  padding: 5px 10px;
  background: #ffffff;
}

.analysis-link:hover,
.analysis-actions button:hover {
  border-color: rgba(217, 45, 32, 0.45);
  background: #fff0e8;
  transform: translateY(-1px);
}

.analysis-actions button:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.metric-card {
  padding: 9px;
  background: #fffaf7;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric-card strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
}

.mini-gauge-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.mini-gauge {
  display: flex;
  min-width: 0;
  min-height: 74px;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  border: 1px solid #f1d5cb;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #fffaf7);
  padding: 6px 4px 5px;
}

.mini-gauge-dial {
  position: relative;
  width: 50px;
  height: 28px;
  flex: 0 0 auto;
  overflow: hidden;
}

.mini-gauge-dial::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 62px 62px 0 0;
  background: conic-gradient(from 270deg, var(--mini-color, var(--orange)) calc(var(--value) * 1.8deg), var(--mini-track, #f2e3dc) 0 180deg, transparent 0);
}

.mini-gauge-dial::after {
  content: "";
  position: absolute;
  right: 7px;
  bottom: 0;
  left: 7px;
  height: 21px;
  border-radius: 48px 48px 0 0;
  background: #ffffff;
}

.mini-gauge-needle {
  position: absolute;
  z-index: 2;
  bottom: 0;
  left: 24px;
  width: 2px;
  height: 24px;
  border-radius: 999px;
  background: #24120d;
  transform: rotate(var(--angle));
  transform-origin: bottom center;
}

.mini-gauge-dial b {
  position: absolute;
  z-index: 3;
  bottom: -4px;
  left: 21px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #24120d;
}

.mini-gauge span {
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mini-gauge strong {
  max-width: 100%;
  overflow: hidden;
  color: #24120d;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.candidate-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.candidate-pool {
  display: grid;
  gap: 10px;
}

.candidate-pool-panel {
  border-top: 0;
  padding-top: 18px;
}

.candidate-pool-panel > .panel-head {
  margin-bottom: 10px;
}

.custom-universe-open-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  min-height: 28px;
  margin-left: auto;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 0;
  color: var(--orange);
  cursor: pointer;
}

.custom-universe-open-icon {
  display: block;
  width: 22px;
  height: 22px;
  background: url("./assets/add-plus.png") center / contain no-repeat;
}

.custom-universe-open-button:hover {
  background: transparent;
  color: var(--orange);
}

.custom-universe-editor {
  display: grid;
  grid-template-columns: minmax(130px, 180px) minmax(0, 1fr);
  gap: 10px;
  margin: 0 0 12px;
  border: 1px solid var(--custom-line);
  border-radius: 8px;
  background: #fffafa;
  padding: 12px;
}

.custom-universe-editor[hidden] {
  display: none;
}

.custom-universe-editor label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.custom-universe-symbol-box {
  min-width: 0;
}

.custom-universe-editor input,
.custom-universe-editor textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 8px 10px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
}

.custom-universe-editor textarea {
  min-height: 76px;
  resize: vertical;
}

.custom-universe-editor input:focus,
.custom-universe-editor textarea:focus {
  border-color: var(--custom);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.custom-universe-editor-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.custom-universe-editor-actions p {
  flex: 1 1 auto;
  margin: 0;
  color: var(--custom-text);
  font-size: 12px;
  line-height: 1.5;
}

.custom-universe-editor-actions button {
  min-height: 32px;
  border: 1px solid var(--custom);
  border-radius: 999px;
  background: var(--custom-soft);
  padding: 6px 12px;
  color: var(--custom-text);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
}

.custom-universe-editor-actions .custom-universe-cancel {
  border-color: var(--line);
  background: #ffffff;
  color: var(--muted);
}

.stock-search-overlay {
  position: fixed;
  top: 88px;
  right: 22px;
  left: auto;
  z-index: 28;
  width: min(1120px, calc(100vw - 44px));
  max-height: calc(100vh - 112px);
  overflow: auto;
}

.stock-search-modal {
  border-top: 4px solid var(--blue);
  box-shadow: 0 24px 70px rgba(64, 21, 12, 0.22), 0 2px 8px rgba(64, 21, 12, 0.12);
}

.stock-search-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.stock-search-form {
  display: flex;
  flex: 1 1 390px;
  gap: 8px;
  justify-content: flex-end;
}

.stock-search-form input {
  width: min(320px, 100%);
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 8px 14px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
}

.stock-search-form input:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.stock-search-form button {
  min-height: 38px;
  border: 1px solid #93c5fd;
  border-radius: 999px;
  background: var(--blue-soft);
  padding: 8px 15px;
  color: var(--blue);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
}

.search-close-button {
  min-height: 38px;
  border: 1px solid #f1d5cb;
  border-radius: 999px;
  background: #fffaf7;
  padding: 8px 13px;
  color: #7a3425;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
}

.stock-search-result {
  min-width: 0;
}

.stock-search-empty {
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  padding: 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.stock-search-layout {
  display: grid;
  grid-template-columns: minmax(310px, 0.36fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.stock-search-current {
  padding: 14px;
  border-top: 4px solid var(--blue);
}

.search-basic-card {
  border-top-color: var(--quality);
}

.stock-search-tags {
  padding-right: 0;
}

.stock-search-history {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #fffaf7);
  padding: 14px;
}

.stock-search-history-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.stock-search-history-head h3 {
  font-size: 17px;
}

.stock-search-history-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.stock-search-history-head span {
  align-self: start;
  border-radius: 999px;
  background: #fff0e8;
  padding: 5px 9px;
  color: var(--red);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.stock-search-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.stock-search-stats .metric-card {
  padding: 10px;
}

.stock-search-stats .metric-card strong {
  font-size: 15px;
}

.stock-search-table-wrap {
  max-height: 460px;
}

.stock-search-table {
  min-width: 860px;
}

.stock-search-table td b,
.stock-search-table td span,
.stock-search-table td small {
  display: block;
}

.stock-search-table td span {
  margin-top: 3px;
  color: #4b332b;
  font-size: 12px;
}

.stock-search-table td small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.stock-search-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.fresh-detections-panel {
  border-top: 4px solid var(--gold);
}

.fresh-detections {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.fresh-empty {
  min-width: 0;
  border: 1px solid #f4d68b;
  border-radius: 8px;
  background:
    radial-gradient(circle at 94% 12%, rgba(255, 176, 32, 0.16), transparent 32%),
    linear-gradient(180deg, #ffffff, #fffaf0);
  padding: 13px;
}

.fresh-empty {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.fresh-card {
  box-shadow: 0 0 0 2px rgba(255, 176, 32, 0.28), var(--shadow);
}

.fresh-card .candidate-type {
  background: #fff7cc;
  color: #8a5a00;
}

.fresh-holding {
  border-color: #f1b993 !important;
}

.fresh-noTrend {
  border-color: var(--purple-line) !important;
}

.fresh-satellite {
  border-color: var(--satellite-line) !important;
}

.fresh-lowPosition {
  border-color: var(--blue-line) !important;
}

.fresh-stableTrend {
  border-color: var(--stable-line) !important;
}

.fresh-qualityTrend {
  border-color: var(--quality-line) !important;
}

.candidate-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.legend-chip,
.candidate-type {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.legend-chip {
  min-height: 26px;
  padding: 4px 9px;
}

.legend-chip.momentum {
  background: #fff0e8;
  color: var(--red);
}

.legend-chip.fresh {
  background: #fff7cc;
  color: #8a5a00;
}

.legend-chip.no-trend {
  background: var(--purple-soft);
  color: var(--purple-text);
}

.legend-chip.low {
  background: var(--blue-soft);
  color: var(--blue-text);
}

.legend-chip.satellite {
  background: var(--satellite-soft);
  color: var(--satellite-text);
}

.legend-chip.stable {
  background: var(--stable-soft);
  color: var(--stable-text);
}

.legend-chip.quality {
  background: var(--quality-soft);
  color: var(--quality-text);
}

.candidate-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #fffaf7);
  padding: 14px;
}

.candidate-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.candidate-group-head h3 {
  color: #24120d;
  font-size: 17px;
}

.candidate-group-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.candidate-group p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.no-trend-card-group {
  border-color: var(--purple-line);
  background: linear-gradient(180deg, #ffffff, #fbfaff);
}

.satellite-card-group {
  border-color: var(--satellite-line);
  background: linear-gradient(180deg, #ffffff, #f7fffc);
}

.low-position-card-group {
  border-color: var(--blue-line);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.candidate-card {
  padding: 14px;
}

.candidate-type {
  background: #fff0e8;
  color: var(--red);
}

.source-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 0 0 10px;
}

.source-filter-row button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 5px 10px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
}

.source-filter-row button b {
  font-variant-numeric: tabular-nums;
}

.source-filter-row button.active {
  border-color: currentColor;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.12);
}

.source-filter-row .source-all {
  background: #fffaf7;
  color: #6b4b40;
}

.opportunity-section {
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.opportunity-section + .opportunity-section {
  margin-top: 14px;
}

.candidate-load-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

.candidate-load-more button {
  min-height: 34px;
  border: 1px solid #93c5fd;
  border-radius: 999px;
  background: var(--blue-soft);
  padding: 7px 13px;
  color: var(--blue);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
}

.candidate-load-more span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.opportunity-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.opportunity-section-head h3 {
  margin-bottom: 5px;
  color: #24120d;
  font-size: 17px;
}

.opportunity-section-head p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.opportunity-section-head > span {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #fff0e8;
  padding: 5px 9px;
  color: var(--red);
  font-size: 12px;
  font-weight: 850;
}

.observation-section {
  border-color: #d7e7d8;
  background: linear-gradient(180deg, #ffffff, #f9fffb);
}

.observation-section .opportunity-section-head > span {
  background: var(--stable-soft);
  color: var(--stable-text);
}

.source-chip-row {
  display: flex;
  flex-wrap: nowrap;
  flex: 0 0 auto;
  gap: 5px;
  margin: 0;
  min-width: max-content;
  overflow: visible;
  padding-right: 0;
}

.source-fresh {
  background: #fff7cc;
  color: #8a5a00;
}

.source-momentum {
  background: #fff0e8;
  color: var(--red);
}

.source-satellite {
  background: var(--satellite-soft);
  color: var(--satellite-text);
}

.source-no-trend {
  background: var(--purple-soft);
  color: var(--purple-text);
}

.source-short {
  background: var(--blue-soft);
  color: var(--blue-text);
}

.source-low {
  background: var(--blue-soft);
  color: var(--blue-text);
}

.source-stable {
  background: var(--stable-soft);
  color: var(--stable-text);
}

.source-quality {
  background: var(--quality-soft);
  color: var(--quality-text);
}

.source-guru {
  background: var(--guru-soft);
  color: var(--guru-text);
}

.source-theme-etf {
  background: var(--theme-etf-soft);
  color: var(--theme-etf-text);
}

.source-custom {
  background: var(--custom-soft);
  color: var(--custom-text);
}

.custom-universe-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 12px;
  border: 1px solid var(--custom-line);
  border-radius: 8px;
  background: var(--custom-soft);
  padding: 10px 12px;
}

.custom-universe-section-head h3 {
  margin: 0;
  color: var(--custom-text);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.25;
}

.custom-universe-section-head p {
  margin: 4px 0 0;
  color: #7f1d1d;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.custom-universe-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border: 1px solid var(--custom-line);
  border-radius: 50%;
  background: #ffffff;
  color: var(--custom);
  cursor: pointer;
  font: inherit;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.custom-universe-remove:hover {
  background: #ffe4e6;
}

.custom-universe-empty {
  border: 1px dashed var(--custom-line);
  border-radius: 8px;
  background: #fffafa;
  padding: 14px;
  color: var(--custom-text);
  font-size: 13px;
  line-height: 1.55;
}

.estimate-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 5px;
  margin-top: 5px;
}

.estimate-row span,
.estimate-row small {
  min-width: 0;
  border: 1px solid #ead9d1;
  border-radius: 8px;
  background: rgba(255, 253, 251, 0.82);
  padding: 6px 6px;
}

.estimate-row em {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.estimate-row b {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: #24120d;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.estimate-row small {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8a463b;
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}

.opportunity-grid .candidate-card {
  border-top: 4px solid var(--orange) !important;
}

.opportunity-grid .satellite-card {
  border-top-color: var(--satellite) !important;
}

.opportunity-grid .no-trend-card {
  border-top-color: var(--purple) !important;
}

.opportunity-grid .short-term-card {
  border-top-color: var(--blue) !important;
}

.opportunity-grid .low-position-card {
  border-top-color: var(--blue) !important;
}

.opportunity-grid .stable-trend-card {
  border-top-color: var(--stable) !important;
}

.opportunity-grid .quality-trend-card {
  border-top-color: var(--quality) !important;
}

.opportunity-grid .nasdaq-card {
  border-top-color: var(--nasdaq) !important;
}

.opportunity-grid .custom-card {
  border-top-color: var(--custom) !important;
}

.candidate-card:nth-child(-n + 3) {
  border-top: 4px solid var(--orange);
}

.low-position-panel {
  border-top: 4px solid var(--blue);
}

.no-trend-card {
  border-color: var(--purple-line);
  background:
    radial-gradient(circle at 88% 18%, rgba(124, 58, 237, 0.12), transparent 30%),
    linear-gradient(180deg, #ffffff, #fbfaff);
}

.no-trend-card:nth-child(-n + 3) {
  border-top: 4px solid var(--purple);
}

.no-trend-card h3 {
  color: var(--purple-text);
}

.no-trend-card .stock-title-block > span {
  color: #6d5a9c;
}

.no-trend-card .candidate-type {
  background: var(--purple-soft);
  color: var(--purple-text);
}

.no-trend-card .mini-gauge {
  border-color: var(--purple-line);
  background: linear-gradient(180deg, #ffffff, #fbfaff);
}

.no-trend-card .mini-gauge-dial {
  --mini-color: var(--purple);
  --mini-track: #ede9fe;
}

.no-trend-card .mini-gauge span {
  color: #6d5a9c;
}

.no-trend-card .mini-gauge strong {
  color: var(--purple-text);
}

.holding-card.satellite-card,
.candidate-card.satellite-card {
  border-color: var(--satellite-line);
  background:
    radial-gradient(circle at 88% 18%, rgba(15, 118, 110, 0.12), transparent 30%),
    linear-gradient(180deg, #ffffff, #f7fffc);
}

.holding-card.satellite-card {
  border-top-color: var(--satellite);
}

.candidate-card.satellite-card:nth-child(-n + 3) {
  border-top: 4px solid var(--satellite);
}

.satellite-card .candidate-type {
  background: var(--satellite-soft);
  color: var(--satellite-text);
}

.satellite-card h3 {
  color: var(--satellite-text);
}

.satellite-card .stock-title-block > span {
  color: #4f766f;
}

.satellite-card .mini-gauge {
  border-color: var(--satellite-line);
  background: linear-gradient(180deg, #ffffff, #f7fffc);
}

.satellite-card .mini-gauge-dial {
  --mini-color: var(--satellite);
  --mini-track: #ccfbf1;
}

.satellite-card .mini-gauge span {
  color: #4f766f;
}

.satellite-card .mini-gauge strong {
  color: var(--satellite-text);
}

.low-position-card,
.short-term-card {
  border-color: var(--blue-line);
  background:
    radial-gradient(circle at 88% 18%, rgba(37, 99, 235, 0.12), transparent 30%),
    linear-gradient(180deg, #ffffff, #f8fbff);
}

.low-position-card:nth-child(-n + 3),
.short-term-card:nth-child(-n + 3) {
  border-top: 4px solid var(--blue);
}

.low-position-card .candidate-type,
.short-term-card .candidate-type {
  background: var(--blue-soft);
  color: var(--blue-text);
}

.low-position-card h3,
.short-term-card h3 {
  color: #102a56;
}

.low-position-card .stock-title-block > span,
.short-term-card .stock-title-block > span {
  color: #4f6b9b;
}

.low-position-card .mini-gauge,
.short-term-card .mini-gauge {
  border-color: var(--blue-line);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.low-position-card .mini-gauge-dial,
.short-term-card .mini-gauge-dial {
  --mini-color: var(--blue);
  --mini-track: #dbeafe;
}

.low-position-card .mini-gauge span,
.short-term-card .mini-gauge span {
  color: #4f6b9b;
}

.low-position-card .mini-gauge strong,
.short-term-card .mini-gauge strong {
  color: #102a56;
}

.low-position-card .chip-row span,
.short-term-card .chip-row span {
  background: var(--blue-soft);
  color: var(--blue-text);
}

.stable-trend-card {
  border-color: var(--stable-line);
  background:
    radial-gradient(circle at 88% 18%, rgba(22, 163, 74, 0.12), transparent 30%),
    linear-gradient(180deg, #ffffff, #f8fff9);
}

.stable-trend-card:nth-child(-n + 3) {
  border-top: 4px solid var(--stable);
}

.stable-trend-card .candidate-type {
  background: var(--stable-soft);
  color: var(--stable-text);
}

.stable-trend-card h3 {
  color: var(--stable-text);
}

.stable-trend-card .stock-title-block > span {
  color: #4f7c5d;
}

.stable-trend-card .mini-gauge {
  border-color: var(--stable-line);
  background: linear-gradient(180deg, #ffffff, #f8fff9);
}

.stable-trend-card .mini-gauge-dial {
  --mini-color: var(--stable);
  --mini-track: #dcfce7;
}

.stable-trend-card .mini-gauge span {
  color: #4f7c5d;
}

.stable-trend-card .mini-gauge strong {
  color: var(--stable-text);
}

.quality-trend-card {
  border-color: var(--quality-line);
  background:
    radial-gradient(circle at 88% 18%, rgba(100, 116, 139, 0.12), transparent 30%),
    linear-gradient(180deg, #ffffff, #f8fafc);
}

.quality-trend-card:nth-child(-n + 3) {
  border-top: 4px solid var(--quality);
}

.quality-trend-card .candidate-type {
  background: var(--quality-soft);
  color: var(--quality-text);
}

.quality-trend-card h3 {
  color: var(--quality-text);
}

.quality-trend-card .stock-title-block > span {
  color: #64748b;
}

.quality-trend-card .mini-gauge {
  border-color: var(--quality-line);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.quality-trend-card .mini-gauge-dial {
  --mini-color: var(--quality);
  --mini-track: #e2e8f0;
}

.quality-trend-card .mini-gauge span {
  color: #64748b;
}

.quality-trend-card .mini-gauge strong {
  color: var(--quality-text);
}

.nasdaq-card {
  border-color: var(--nasdaq-line);
  background:
    radial-gradient(circle at 88% 18%, rgba(8, 145, 178, 0.12), transparent 30%),
    linear-gradient(180deg, #ffffff, #f4fdff);
}

.nasdaq-card:nth-child(-n + 3) {
  border-top: 4px solid var(--nasdaq);
}

.nasdaq-card .candidate-type {
  background: var(--nasdaq-soft);
  color: var(--nasdaq-text);
}

.nasdaq-card h3 {
  color: var(--nasdaq-text);
}

.nasdaq-card .stock-title-block > span {
  color: #467989;
}

.nasdaq-card .mini-gauge {
  border-color: var(--nasdaq-line);
  background: linear-gradient(180deg, #ffffff, #f4fdff);
}

.nasdaq-card .mini-gauge-dial {
  --mini-color: var(--nasdaq);
  --mini-track: #cffafe;
}

.guru-card {
  border-color: var(--guru-line);
  background:
    radial-gradient(circle at 88% 18%, rgba(180, 83, 9, 0.12), transparent 30%),
    linear-gradient(180deg, #ffffff, #fffaf0);
}

.guru-card:nth-child(-n + 3) {
  border-top: 4px solid var(--guru);
}

.guru-card .candidate-type {
  background: var(--guru-soft);
  color: var(--guru-text);
}

.guru-card h3 {
  color: var(--guru-text);
}

.guru-card .stock-title-block > span {
  color: #8a6743;
}

.guru-card .mini-gauge {
  border-color: var(--guru-line);
  background: linear-gradient(180deg, #ffffff, #fffaf0);
}

.guru-card .mini-gauge-dial {
  --mini-color: var(--guru);
  --mini-track: #fef3c7;
}

.theme-etf-card {
  border-color: var(--theme-etf-line);
  background:
    radial-gradient(circle at 88% 18%, rgba(13, 148, 136, 0.12), transparent 30%),
    linear-gradient(180deg, #ffffff, #f0fdfa);
}

.theme-etf-card:nth-child(-n + 3) {
  border-top: 4px solid var(--theme-etf);
}

.theme-etf-card .candidate-type {
  background: var(--theme-etf-soft);
  color: var(--theme-etf-text);
}

.theme-etf-card h3 {
  color: var(--theme-etf-text);
}

.theme-etf-card .stock-title-block > span {
  color: #3a766e;
}

.theme-etf-card .mini-gauge {
  border-color: var(--theme-etf-line);
  background: linear-gradient(180deg, #ffffff, #f0fdfa);
}

.theme-etf-card .mini-gauge-dial {
  --mini-color: var(--theme-etf);
  --mini-track: #ccfbf1;
}

.nasdaq-card .mini-gauge span {
  color: #467989;
}

.nasdaq-card .mini-gauge strong {
  color: var(--nasdaq-text);
}

.theme-etf-card .mini-gauge span {
  color: #3a766e;
}

.theme-etf-card .mini-gauge strong {
  color: var(--theme-etf-text);
}

/* Neutral surfaces: category color is carried only by the top strip. */
.panel,
.overview-gauge-card,
.decision-card,
.strategy-action-head,
.holding-card,
.candidate-card,
.candidate-group,
.opportunity-section,
.fresh-empty,
.metric-card,
.mini-gauge,
.estimate-row span,
.estimate-row small,
.market-mini em,
.stats-inline span,
.overview-conclusions span,
.pill,
.segmented button,
.source-filter-row button,
.stock-search-empty,
.stock-search-history,
.stock-search-current,
.search-basic-card,
.stock-search-form input,
.stock-search-form button,
.search-close-button,
.analysis-link,
.analysis-actions button {
  background: #ffffff !important;
  background-image: none !important;
  box-shadow: none !important;
}

.holding-card,
.candidate-card {
  border-right-color: var(--line) !important;
  border-bottom-color: var(--line) !important;
  border-left-color: var(--line) !important;
}

.candidate-group,
.opportunity-section,
.overview-gauge-card,
.metric-card,
.mini-gauge,
.estimate-row span,
.estimate-row small,
.market-mini em,
.stats-inline span {
  border-color: var(--line) !important;
}

.card-badges span,
.card-badges button,
.source-chip-row span,
.source-chip-row button,
.candidate-type,
.rank-chip,
.earnings-chip,
.estimate-chip,
.title-rank-chip,
.nasdaq-weight-chip,
.rank-context span,
.trend-chip,
.context-chip,
.fresh-detail-chip,
.legend-chip,
.source-filter-row button,
.overview-conclusions span,
.pill {
  border: 1px solid var(--line) !important;
  background: #ffffff !important;
  background-image: none !important;
  color: #6b4b40 !important;
  box-shadow: none !important;
}

.stock-title-block > .title-rank-chip,
.stock-title-block > .title-allocation-text {
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  background-image: none !important;
  color: #6b4b40 !important;
  box-shadow: none !important;
}

.stock-tag-row,
.stock-tag-row .card-badges,
.stock-tag-row .rank-context,
.stock-tag-row .source-chip-row {
  flex-wrap: nowrap !important;
  overflow: visible;
}

.stock-tag-row .card-badges,
.stock-tag-row .rank-context,
.stock-tag-row .source-chip-row {
  display: inline-flex !important;
  flex: 0 0 auto;
  min-width: max-content;
}

.stock-tag-row {
  min-height: 70px !important;
  max-height: 70px !important;
  margin: 8px 0 0 !important;
  overflow: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
}

.stock-tag-row.tag-lines-1 {
  grid-template-rows: repeat(1, 20px) !important;
  min-height: 20px !important;
  max-height: 20px !important;
}

.stock-tag-row.tag-lines-2 {
  grid-template-rows: repeat(2, 20px) !important;
  min-height: 45px !important;
  max-height: 45px !important;
}

.stock-tag-row.tag-lines-3 {
  grid-template-rows: repeat(3, 20px) !important;
  min-height: 70px !important;
  max-height: 70px !important;
}

.stock-tag-row::-webkit-scrollbar {
  display: none;
}

.stock-tag-row .card-badges span,
.stock-tag-row .card-badges button,
.stock-tag-row .source-chip-row span,
.stock-tag-row .source-chip-row button,
.stock-tag-row .candidate-type,
.stock-tag-row .rank-chip,
.stock-tag-row .earnings-chip,
.stock-tag-row .nasdaq-weight-chip,
.stock-tag-row .rank-context span,
.stock-tag-row .trend-chip,
.stock-tag-row .estimate-chip,
.stock-tag-row .context-chip,
.stock-tag-row .fresh-detail-chip {
  min-height: 20px !important;
  flex: 0 0 auto !important;
  padding: 2px 7px !important;
  border-radius: 999px !important;
  font-size: 11px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.stock-tag-row .estimate-chip {
  border-color: var(--line) !important;
  background: #ffffff !important;
  color: #6b4b40 !important;
  padding-right: 5px !important;
  padding-left: 5px !important;
  font-size: 10.5px !important;
}

.stock-tag-row .nasdaq-weight-chip {
  border-color: var(--nasdaq-line) !important;
  background: var(--nasdaq-soft) !important;
  color: var(--nasdaq-text) !important;
}

.stock-tag-row .earnings-chip {
  border-color: rgba(37, 99, 235, 0.16) !important;
  background: #f7fbff !important;
  color: #2563eb !important;
}

.stock-tag-row .earnings-soon {
  border-color: rgba(154, 91, 0, 0.18) !important;
  background: #fff7e6 !important;
  color: #9a5b00 !important;
}

.stock-tag-row .earnings-urgent {
  border-color: rgba(230, 43, 30, 0.18) !important;
  background: #fff0ed !important;
  color: var(--red) !important;
}

.stock-tag-row .earnings-past {
  border-color: rgba(122, 106, 98, 0.16) !important;
  background: #f5f5f5 !important;
  color: #7a6a62 !important;
}

.stock-tag-row .peer-chip {
  border-color: rgba(0, 151, 178, 0.16) !important;
  background: rgba(236, 253, 255, 0.72) !important;
  color: #087589 !important;
}

.stock-tag-row .rating-chip {
  border-color: rgba(126, 58, 242, 0.16) !important;
  background: rgba(245, 243, 255, 0.78) !important;
  color: #6d28d9 !important;
}

.stock-tag-row .target-chip {
  border-color: rgba(22, 163, 74, 0.18) !important;
  background: rgba(240, 253, 244, 0.78) !important;
  color: #15803d !important;
}

.stock-tag-row .grade-chip {
  border-color: rgba(245, 158, 11, 0.2) !important;
  background: rgba(255, 251, 235, 0.86) !important;
  color: #9a5b00 !important;
}

.stock-tag-row .industry-chip {
  border-color: rgba(8, 145, 178, 0.16) !important;
  background: rgba(236, 253, 255, 0.72) !important;
  color: #087589 !important;
}

.stock-tag-row .guru-holding-chip {
  border-color: rgba(183, 87, 22, 0.2) !important;
  background: rgba(255, 247, 237, 0.88) !important;
  color: #b45309 !important;
}

.stock-tag-row.tag-unified {
  display: grid !important;
  grid-template-rows: 20px 45px !important;
  gap: 5px !important;
  min-height: 70px !important;
  max-height: 70px !important;
  overflow: hidden !important;
}

.stock-tag-row.tag-unified.no-estimates {
  grid-template-rows: 45px !important;
  min-height: 45px !important;
  max-height: 45px !important;
}

.stock-tag-row.tag-unified .stock-tag-line {
  min-width: 0 !important;
  overflow: hidden !important;
}

.stock-tag-row.tag-unified .stock-tag-line-estimates {
  flex-wrap: nowrap !important;
}

.stock-tag-row.tag-unified .stock-tag-line-extra {
  align-content: flex-start !important;
  align-items: flex-start !important;
  flex-wrap: wrap !important;
  max-height: 45px !important;
  overflow: hidden !important;
}

.stock-tag-row.tag-unified .card-badges,
.stock-tag-row.tag-unified .rank-context,
.stock-tag-row.tag-unified .source-chip-row {
  display: contents !important;
}

.card-badges button:hover,
.source-chip-row button:hover,
.source-filter-row button:hover,
.analysis-link:hover,
.analysis-actions button:hover {
  background: #ffffff !important;
  box-shadow: none !important;
}

.no-trend-card h3,
.satellite-card h3,
.low-position-card h3,
.short-term-card h3,
.stable-trend-card h3,
.quality-trend-card h3,
.no-trend-card .stock-title-block > span,
.satellite-card .stock-title-block > span,
.low-position-card .stock-title-block > span,
.short-term-card .stock-title-block > span,
.stable-trend-card .stock-title-block > span,
.quality-trend-card .stock-title-block > span,
.no-trend-card .mini-gauge span,
.satellite-card .mini-gauge span,
.low-position-card .mini-gauge span,
.short-term-card .mini-gauge span,
.stable-trend-card .mini-gauge span,
.quality-trend-card .mini-gauge span {
  color: var(--muted) !important;
}

.no-trend-card .mini-gauge strong,
.satellite-card .mini-gauge strong,
.low-position-card .mini-gauge strong,
.short-term-card .mini-gauge strong,
.stable-trend-card .mini-gauge strong,
.quality-trend-card .mini-gauge strong {
  color: #24120d !important;
}

.fresh-highlight,
.fresh-card {
  box-shadow: none !important;
}

.bar {
  background: #efe8e4 !important;
}

.bar b {
  background: #24120d !important;
}

.source-filter-row .source-all {
  border-color: #8b6f64 !important;
  color: #6b4b40 !important;
}

.source-filter-row .source-momentum {
  border-color: var(--orange) !important;
  color: var(--orange) !important;
}

.source-filter-row .source-low {
  border-color: var(--blue) !important;
  color: var(--blue) !important;
}

.source-filter-row .source-stable {
  border-color: var(--stable) !important;
  color: var(--stable) !important;
}

.source-filter-row .source-quality {
  border-color: var(--quality) !important;
  color: var(--quality) !important;
}

.source-filter-row .source-nasdaq {
  border-color: var(--nasdaq) !important;
  color: var(--nasdaq) !important;
}

.source-filter-row .source-theme-etf {
  border-color: var(--theme-etf) !important;
  color: var(--theme-etf) !important;
}

.source-filter-row .source-guru {
  border-color: var(--guru) !important;
  color: var(--guru) !important;
}

.source-filter-row .source-custom {
  border-color: var(--custom) !important;
  color: var(--custom) !important;
}

.source-filter-row .source-no-trend {
  border-color: var(--purple) !important;
  color: var(--purple) !important;
}

.source-filter-row .source-short {
  border-color: var(--blue) !important;
  color: var(--blue) !important;
}

.source-filter-row .source-satellite {
  border-color: var(--satellite) !important;
  color: var(--satellite) !important;
}

.source-filter-row .source-fresh {
  border-color: var(--gold) !important;
  color: #8a5a00 !important;
}

.source-filter-row button.active {
  box-shadow: inset 0 0 0 1px currentColor !important;
}

.source-filter-row .custom-universe-open-button {
  width: 28px;
  height: 28px;
  min-height: 28px;
  margin-left: auto;
  align-self: center;
  border: 0 !important;
  border-radius: 8px;
  background: transparent !important;
  padding: 0;
  color: var(--orange) !important;
  box-shadow: none !important;
}

.source-filter-row .custom-universe-open-icon {
  display: block;
  width: 22px;
  height: 22px;
  background: url("./assets/add-plus.png") center / contain no-repeat !important;
}

.source-filter-row .custom-universe-open-button:hover {
  background: transparent !important;
}

.overview-gauge-card {
  border-top-color: var(--red) !important;
  border-top-width: 4px !important;
}

.analysis-panel {
  position: fixed;
  top: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  width: min(720px, calc(100vw - 36px));
  margin: 0;
  overflow: auto;
  border-top: 4px solid #a23524;
  box-shadow: 0 24px 70px rgba(64, 21, 12, 0.22), 0 2px 8px rgba(64, 21, 12, 0.12);
}

.analysis-drawer {
  animation: drawerReveal 0.18s ease-out;
}

@keyframes drawerReveal {
  from {
    opacity: 0;
    transform: translateX(10px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.analysis-empty {
  border: 1px dashed #efcabc;
  border-radius: 8px;
  background: #fffaf7;
  padding: 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.analysis-workspace {
  display: grid;
  gap: 14px;
}

.analysis-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid #f1d5cb;
  border-radius: 8px;
  background:
    radial-gradient(circle at 96% 8%, rgba(255, 107, 42, 0.1), transparent 34%),
    linear-gradient(180deg, #ffffff, #fffaf7);
  padding: 14px;
}

.analysis-title-row h3 {
  color: #24120d;
  font-size: 23px;
  line-height: 1.2;
}

.analysis-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 460px;
}

.analysis-actions button {
  min-height: 34px;
  padding: 7px 11px;
}

.analysis-actions button:first-child {
  border-color: rgba(217, 45, 32, 0.32);
  background: #fff0e8;
  color: var(--red);
}

.analysis-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.analysis-facts span {
  min-width: 0;
  border: 1px solid #f1d5cb;
  border-radius: 8px;
  background: #fffaf7;
  padding: 9px 10px;
}

.analysis-facts em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.3;
}

.analysis-facts b {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: #24120d;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  gap: 12px;
}

.analysis-grid-single {
  grid-template-columns: 1fr;
}

.analysis-box {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.analysis-box span {
  color: #5d4339;
  font-size: 13px;
  font-weight: 850;
}

.analysis-box textarea {
  width: 100%;
  min-height: 440px;
  resize: vertical;
  border: 1px solid #f1d5cb;
  border-radius: 8px;
  background: #fffdfb;
  color: #24120d;
  padding: 13px;
  font: inherit;
  font-size: 13px;
  line-height: 1.65;
}

#analysis-output {
  min-height: 360px;
}

.analysis-status {
  min-height: 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.analysis-status.success {
  color: var(--green);
  font-weight: 750;
}

.analysis-status.warning {
  color: var(--amber);
  font-weight: 750;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.chip-row span {
  padding: 5px 7px;
  border-radius: 999px;
  background: #fff0e8;
  color: #8a463b;
  font-size: 12px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.table-wrap.large {
  max-height: 680px;
}

table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff7f2;
  color: #4b332b;
  font-size: 12px;
  white-space: nowrap;
}

td {
  color: #34221b;
}

td.positive {
  color: var(--green);
  font-weight: 750;
}

td.negative {
  color: var(--red);
  font-weight: 750;
}

.muted-cell {
  color: var(--muted);
}

.annual-history {
  display: grid;
  gap: 10px;
}

.year-head {
  display: grid;
  grid-template-columns: 24px 68px 88px 88px 88px 88px minmax(190px, 1fr) minmax(190px, 1fr);
  gap: 10px;
  padding: 0 14px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.year-block {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.year-block summary {
  display: grid;
  grid-template-columns: 24px 68px 88px 88px 88px 88px minmax(190px, 1fr) minmax(190px, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
  background: linear-gradient(180deg, #ffffff, #fffaf7);
}

.year-block summary::-webkit-details-marker {
  display: none;
}

.year-toggle {
  position: relative;
  width: 22px;
  height: 22px;
  border: 1px solid #f1d5cb;
  border-radius: 50%;
  background: #fff7f2;
}

.year-toggle::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 7px;
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--red);
  border-bottom: 2px solid var(--red);
  transform: rotate(-45deg);
}

.year-block[open] .year-toggle::before {
  top: 5px;
  transform: rotate(45deg);
}

.year-block summary strong {
  color: #24120d;
  font-size: 18px;
}

.year-block summary em {
  font-size: 15px;
  font-style: normal;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.year-block summary small {
  overflow: hidden;
  color: #5d4339;
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.year-block summary em.positive,
.year-months td.positive {
  color: var(--green);
}

.year-block summary em.negative,
.year-months td.negative,
.month-block summary em.negative {
  color: var(--red);
}

.year-months {
  overflow: auto;
  border-top: 1px solid var(--line);
  background: #fffdfb;
}

.month-head,
.month-block summary {
  display: grid;
  grid-template-columns: 22px 86px 72px 72px 72px 72px minmax(180px, 1.1fr) minmax(210px, 1.25fr) minmax(210px, 1.25fr) 92px;
  gap: 10px;
  align-items: center;
  min-width: 1120px;
}

.month-head {
  padding: 11px 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  background: #fff7f2;
}

.month-block {
  border-top: 1px solid var(--line);
}

.month-block:first-of-type {
  border-top: 0;
}

.month-block summary {
  min-height: 56px;
  padding: 10px 18px;
  cursor: pointer;
  list-style: none;
  background: #fffdfb;
}

.month-block summary::-webkit-details-marker {
  display: none;
}

.month-block[open] summary {
  background: linear-gradient(180deg, #fffaf7, #ffffff);
}

.month-toggle {
  position: relative;
  width: 18px;
  height: 18px;
  border: 1px solid #f1d5cb;
  border-radius: 50%;
  background: #ffffff;
}

.month-toggle::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 6px;
  width: 5px;
  height: 5px;
  border-right: 2px solid var(--red);
  border-bottom: 2px solid var(--red);
  transform: rotate(-45deg);
}

.month-block[open] .month-toggle::before {
  top: 4px;
  transform: rotate(45deg);
}

.month-block summary strong {
  color: #2a1710;
  font-size: 14px;
  font-weight: 850;
}

.month-block summary em {
  font-size: 13px;
  font-style: normal;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.month-block summary small {
  overflow: hidden;
  color: #5d4339;
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.month-block summary em.positive {
  color: var(--green);
}

.month-weeks {
  overflow: auto;
  border-top: 1px solid #f3ddd4;
  background: #fffaf7;
}

.month-weeks table {
  min-width: 1120px;
  box-shadow: none;
}

.month-weeks th {
  top: 0;
  background: #fff1e9;
}

.month-weeks td {
  background: #fffdfb;
}

.month-weeks td strong {
  display: block;
  font-weight: 850;
}

.month-weeks td small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

/* Final neutral pass for late-defined drawers, tables, and gauges. */
.analysis-panel,
.analysis-empty,
.analysis-title-row,
.analysis-facts span,
.analysis-box textarea,
.chip-row span,
th,
.year-block,
.year-block summary,
.year-toggle,
.year-months,
.year-months th,
.gauge,
.gauge-card {
  background: #ffffff !important;
  background-image: none !important;
  box-shadow: none !important;
}

.gauge,
.gauge-card,
.analysis-empty,
.analysis-title-row,
.analysis-facts span,
.analysis-box textarea,
.chip-row span,
.year-block,
.year-toggle {
  border-color: var(--line) !important;
}

.gauge-dial::after,
.mini-gauge-dial::after {
  background: #ffffff !important;
}

.overview-gauge-card {
  padding: 16px 12px 14px;
}

.overview-gauge-card .mini-gauge {
  display: flex;
  width: 112px;
  min-height: 66px;
  margin: 0 auto;
  padding: 0;
}

.overview-gauge-card .mini-gauge span,
.overview-gauge-card .mini-gauge strong {
  display: none;
}

.overview-gauge-card .mini-gauge-dial {
  width: 112px;
  height: 62px;
}

.overview-gauge-card .mini-gauge-dial::before {
  border-radius: 112px 112px 0 0;
}

.overview-gauge-card .mini-gauge-dial::after {
  right: 14px;
  left: 14px;
  height: 45px;
  border-radius: 90px 90px 0 0;
}

.overview-gauge-card .mini-gauge-needle {
  left: 55px;
  height: 52px;
}

.overview-gauge-card .mini-gauge-dial b {
  bottom: -6px;
  left: 50px;
  width: 14px;
  height: 14px;
}

.overview-gauge-card p {
  margin-top: 8px;
  color: #b85a32;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.overview-gauge-value {
  display: block;
  margin-top: 10px;
  color: #201714;
  font-size: 17px;
  font-weight: 950;
  line-height: 1.18;
  text-align: center;
}

@media (max-width: 1100px) {
  .shell {
    width: min(100% - 48px, 1240px);
  }

  .dashboard-grid,
  .holding-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow-x: visible;
  }

  .action-grid span {
    max-width: none;
  }

  .candidate-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fresh-detections {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stock-search-layout {
    grid-template-columns: 1fr;
  }

  .overview-body {
    grid-template-columns: 1fr;
  }

  .overview-mini-gauges {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-content-row {
    grid-template-columns: 1fr;
  }

  .overview-insight-row .action-insight-inline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stock-search-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .year-head {
    display: none;
  }

  .year-block summary {
    grid-template-columns: 24px 58px repeat(4, minmax(62px, 1fr));
  }

  .year-block summary small {
    grid-column: 3 / -1;
    white-space: normal;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 24px, 1320px);
    padding-top: 0;
  }

  .holding-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .panel-head {
    display: grid;
  }

  .segmented {
    justify-content: flex-start;
  }

  .stock-search-form {
    justify-content: flex-start;
  }

  .stock-search-form input {
    width: 100%;
  }

  .custom-universe-editor {
    grid-template-columns: 1fr;
  }

  .custom-universe-editor-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .custom-universe-editor-actions p {
    width: 100%;
  }

  .stock-search-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stamp {
    text-align: left;
  }

  h1 {
    font-size: 25px;
  }

  .strategy-action-head {
    display: grid;
  }

  .strategy-title-row,
  .strategy-brief-row,
  .action-insight-inline {
    grid-template-columns: 1fr;
  }

  .analysis-title-row,
  .analysis-grid,
  .analysis-facts {
    grid-template-columns: 1fr;
  }

  .overview-body,
  .overview-mini-gauges,
  .overview-content-row,
  .action-insight-inline,
  .overview-insight-row .action-insight-inline {
    grid-template-columns: 1fr;
  }

  .analysis-title-row {
    display: grid;
  }

  .analysis-actions {
    justify-content: flex-start;
  }

  .analysis-panel {
    top: 10px;
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
    padding: 16px;
  }

  .strategy-action-head strong {
    justify-self: start;
  }

  .action-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .action-grid span {
    max-width: none;
  }

  .action-insight-summary div {
    grid-template-columns: 1fr;
  }

  .candidate-grid {
    grid-template-columns: 1fr;
  }

  .fresh-detections {
    grid-template-columns: 1fr;
  }

  .metric-grid,
  .market-mini {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.portfolio-shell .panel {
  margin-bottom: 22px;
}

.portfolio-hero {
  padding-top: 0;
}

.portfolio-overview-panel {
  padding-top: 0;
}

.portfolio-overview-head {
  align-items: center;
}

.portfolio-hero-head {
  align-items: center;
}

.portfolio-hero h1 {
  color: #24120d;
  font-size: 31px;
  line-height: 1.18;
}

.portfolio-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.portfolio-list-head {
  align-items: stretch;
}

.portfolio-form,
.portfolio-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.portfolio-form {
  flex: 1 1 430px;
}

.portfolio-form input {
  width: min(360px, 100%);
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  padding: 8px 14px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
}

.portfolio-form .portfolio-weight-input {
  width: 96px;
  flex: 0 0 96px;
}

.portfolio-form input:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.portfolio-form button,
.portfolio-actions button,
.portfolio-card-remove button,
.portfolio-allocation-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: #6b4b40;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
}

.portfolio-form button {
  height: 38px;
  min-height: 38px;
  border-color: var(--line);
  background: #ffffff;
  padding: 0 18px;
  color: var(--muted);
  line-height: 1;
  white-space: nowrap;
}

.portfolio-actions button {
  padding: 8px 13px;
}

.portfolio-card-remove {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.portfolio-card-remove button {
  min-height: 28px;
  padding: 5px 10px;
  font-size: 12px;
}

.portfolio-allocation-button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 11px;
  color: #795548;
  font-size: 15px;
}

.portfolio-allocation-button:hover {
  border-color: rgba(217, 45, 32, 0.35);
  color: var(--red);
}

.portfolio-status {
  min-height: 20px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.portfolio-status.success {
  color: var(--green);
  font-weight: 750;
}

.portfolio-status.warning {
  color: var(--amber);
  font-weight: 750;
}

.portfolio-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.portfolio-stats .metric-card {
  min-height: 76px;
}

.portfolio-stats .metric-card.positive strong,
.portfolio-metric-strip .metric-card.positive strong {
  color: var(--green);
}

.portfolio-stats .metric-card.negative strong,
.portfolio-metric-strip .metric-card.negative strong {
  color: var(--red);
}

.portfolio-alerts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.portfolio-alert {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  border-left-width: 4px;
  background: #ffffff;
  padding: 12px;
}

.portfolio-alert.good {
  border-left-color: var(--green);
}

.portfolio-alert.warn {
  border-left-color: var(--amber);
}

.portfolio-alert.danger {
  border-left-color: var(--red);
}

.portfolio-alert.missing {
  border-left-color: var(--quality);
}

.portfolio-alert div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.portfolio-alert strong {
  color: #24120d;
  font-size: 17px;
}

.portfolio-alert span {
  flex: 0 0 auto;
  color: #6b4b40;
  font-size: 12px;
  font-weight: 850;
}

.portfolio-alert p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.portfolio-market-overview .overview-body {
  gap: 14px;
}

.portfolio-overview-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.portfolio-overview-strip .metric-card {
  min-height: 74px;
}

.portfolio-overview-strip .metric-card.positive strong {
  color: var(--green);
}

.portfolio-overview-strip .metric-card.negative strong {
  color: var(--red);
}

.portfolio-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.portfolio-summary-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

.portfolio-summary-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.portfolio-summary-card h3 {
  color: #24120d;
  font-size: 17px;
}

.portfolio-summary-card-head span {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  color: #6b4b40;
  font-size: 12px;
  font-weight: 850;
}

.portfolio-summary-note {
  margin: -2px 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.portfolio-summary-text-card {
  padding: 12px 14px;
}

.portfolio-summary-lines {
  display: grid;
  gap: 8px;
}

.portfolio-summary-line {
  display: block;
  color: #5d4339;
  font-size: 14px;
  font-weight: 720;
  line-height: 1.75;
}

.portfolio-summary-label {
  margin-right: 8px;
  font-size: 14px;
  font-weight: 950;
  white-space: nowrap;
}

.portfolio-summary-label.overall {
  color: var(--blue);
}

.portfolio-summary-label.mutation {
  color: var(--red);
}

.portfolio-summary-label.reason {
  color: var(--amber);
}

.portfolio-summary-label.news {
  color: var(--satellite);
}

.portfolio-summary-line span {
  color: #5d4339;
}

.portfolio-summary-list {
  display: grid;
  gap: 8px;
}

.portfolio-summary-list article,
.portfolio-summary-list a {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  background: #ffffff;
  padding: 9px 10px;
  text-decoration: none;
}

.portfolio-summary-list article.good {
  border-left-color: var(--green);
}

.portfolio-summary-list article.warn {
  border-left-color: var(--amber);
}

.portfolio-summary-list article.danger {
  border-left-color: var(--red);
}

.portfolio-summary-list article.missing,
.portfolio-summary-list a.placeholder {
  border-left-color: var(--quality);
}

.portfolio-summary-list div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.portfolio-summary-list strong,
.portfolio-summary-list span {
  color: #24120d;
  font-size: 13px;
  font-weight: 850;
}

.portfolio-summary-list span {
  color: #6b4b40;
  white-space: nowrap;
}

.portfolio-summary-list p {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-overflow: ellipsis;
}

.portfolio-grid {
  align-items: stretch;
}

.portfolio-card {
  padding: 14px;
  border-top: 4px solid var(--orange);
}

.portfolio-card.position-held-card {
  border-top-color: var(--orange) !important;
}

.portfolio-card.position-watch-card {
  border-top-color: var(--quality) !important;
}

.portfolio-card.position-watch-card .portfolio-allocation-button {
  color: var(--quality-text);
}

.portfolio-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  color: #6b4b40;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.portfolio-status-pill.good {
  border-color: rgba(8, 116, 67, 0.25);
  color: var(--green);
}

.portfolio-status-pill.warn {
  border-color: rgba(180, 83, 9, 0.28);
  color: var(--amber);
}

.portfolio-status-pill.danger {
  border-color: rgba(217, 45, 32, 0.26);
  color: var(--red);
}

.portfolio-status-pill.missing {
  color: var(--quality-text);
}

.portfolio-source-row {
  max-width: 100%;
}

.portfolio-alert-chip.good {
  border-color: rgba(8, 116, 67, 0.25) !important;
  color: var(--green) !important;
}

.portfolio-alert-chip.warn {
  border-color: rgba(180, 83, 9, 0.28) !important;
  color: var(--amber) !important;
}

.portfolio-alert-chip.danger {
  border-color: rgba(217, 45, 32, 0.26) !important;
  color: var(--red) !important;
}

.portfolio-alert-chip.missing {
  color: var(--quality-text) !important;
}

.portfolio-news-links {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.portfolio-news-links a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 7px 9px;
  text-decoration: none;
}

.portfolio-news-links span {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 7px;
  color: #6b4b40;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.portfolio-news-links b {
  overflow: hidden;
  color: #24120d;
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portfolio-news-links a.placeholder b,
.portfolio-summary-news a.placeholder p {
  color: var(--muted);
}

.portfolio-metric-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.portfolio-metric-strip .metric-card {
  min-height: 62px;
  padding: 8px;
}

.portfolio-metric-strip .metric-card span {
  font-size: 11px;
}

.portfolio-metric-strip .metric-card strong {
  font-size: 14px;
}

.portfolio-reminders {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.portfolio-reminder {
  min-width: 0;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  padding: 9px 10px;
}

.portfolio-reminder.good {
  border-left-color: var(--green);
}

.portfolio-reminder.warn {
  border-left-color: var(--amber);
}

.portfolio-reminder.danger {
  border-left-color: var(--red);
}

.portfolio-reminder.missing {
  border-left-color: var(--quality);
}

.portfolio-reminder.neutral {
  border-left-color: var(--line);
}

.portfolio-reminder strong {
  display: block;
  color: #24120d;
  font-size: 13px;
}

.portfolio-reminder span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.portfolio-empty {
  grid-column: 1 / -1;
}

@media (max-width: 1100px) {
  .portfolio-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .portfolio-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .portfolio-list-head {
    display: grid;
  }

  .portfolio-form input {
    width: 100%;
  }

  .portfolio-form .portfolio-weight-input {
    width: 100%;
    flex-basis: 120px;
  }

  .portfolio-overview-strip,
  .portfolio-summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .portfolio-hero-head {
    align-items: flex-start;
  }

  .portfolio-hero h1 {
    font-size: 25px;
  }

  .portfolio-form,
  .portfolio-actions {
    flex-wrap: wrap;
  }

  .portfolio-form {
    flex: 1 1 auto;
  }

  .portfolio-actions {
    justify-content: flex-start;
  }

  .portfolio-stats,
  .portfolio-alerts,
  .portfolio-metric-strip,
  .portfolio-overview-strip {
    grid-template-columns: 1fr;
  }

  .portfolio-alert div,
  .portfolio-card .stock-card-top {
    display: grid;
  }
}
