: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: 14px;
  border-top: 0;
  padding-top: 0;
}

.merged-holdings-head {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  margin-bottom: 14px;
}

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

.reference-combo-heading-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
}

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

.auth-lock-overlay {
  position: fixed;
  top: min(max(var(--auth-lock-top, 520px), 50vh), calc(100vh - 390px));
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

.auth-lock-overlay[hidden] {
  display: none;
}

html.auth-locked-root,
html.auth-locked-root body {
  overflow: hidden;
}

body.auth-locked .shell {
  pointer-events: none;
}

.auth-lock-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.auth-card {
  position: relative;
  pointer-events: auto;
  touch-action: auto;
  display: grid;
  grid-template-columns: 300px 286px;
  align-items: center;
  gap: 36px;
  width: min(700px, calc(100vw - 48px));
  min-height: 315px;
  margin: 0 auto;
  border: 1px solid rgba(255, 99, 38, 0.2);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  padding: 28px 38px;
  box-shadow: 0 28px 80px rgba(65, 28, 16, 0.18);
}

.auth-card-copy {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 22px;
  min-width: 0;
}

.auth-brand-logo {
  width: 100px;
  height: 100px;
  object-fit: contain;
}

.auth-slogan {
  margin: 0;
  background: linear-gradient(105deg, #ff6b2a 0%, #f5a735 48%, #8f7a70 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.45;
  text-align: center;
  white-space: nowrap;
}

.auth-login-form {
  display: grid;
  gap: 0;
  align-content: center;
}

.auth-line-field {
  display: flex;
  align-items: center;
  min-height: 54px;
  border-bottom: 1px solid #edf0f2;
}

.auth-login-form input {
  width: 100%;
  height: 56px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  color: #333333;
  font: inherit;
  font-size: 17px;
  font-weight: 400;
  outline: none;
}

.auth-login-form input::placeholder {
  color: #a8aeb8;
  opacity: 1;
}

.auth-login-form input:focus {
  box-shadow: none;
}

.auth-country-code {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-right: 28px;
  color: #2e2e2e;
  font-size: 17px;
  font-weight: 400;
  white-space: nowrap;
}

.auth-country-code::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.auth-code-row {
  gap: 16px;
}

.auth-login-form button {
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-weight: inherit;
  cursor: pointer;
}

#auth-send-code {
  flex: 0 0 auto;
  height: 42px;
  padding: 0;
  background: transparent;
  color: #c5c5c5;
  font-size: 17px;
  font-weight: 400;
  white-space: nowrap;
}

#auth-send-code.is-ready {
  color: #4f83b7;
}

#auth-send-code:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.auth-login-form .auth-submit {
  height: 48px;
  margin-top: 28px;
  background: var(--orange);
  color: #ffffff;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 500;
  box-shadow: 0 10px 22px rgba(255, 99, 38, 0.22);
}

.auth-submit:hover {
  background: #f05c1f;
}

.auth-status {
  min-height: 0;
  margin: 0;
  color: #8b6d63;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.4;
}

.auth-status:empty {
  display: none;
}

.auth-status[data-tone="ok"] {
  color: var(--green);
}

.auth-status[data-tone="error"] {
  color: var(--red);
}

@media (max-width: 820px) {
  .auth-lock-overlay {
    top: min(max(var(--auth-lock-top, 380px), 42vh), calc(100vh - 440px));
    padding: 20px 14px;
  }

  .auth-card {
    position: relative;
    top: auto;
    grid-template-columns: 1fr;
    gap: 18px;
    width: min(440px, calc(100vw - 28px));
    min-height: 0;
    padding: 20px;
  }

  .auth-brand-logo {
    width: 82px;
    height: 82px;
  }

  .auth-slogan {
    font-size: 13px;
    line-height: 1.55;
  }

  .auth-code-row {
    gap: 10px;
  }

  .auth-login-form input {
    font-size: 17px;
  }

  .auth-country-code {
    margin-right: 16px;
    font-size: 18px;
  }

  #auth-send-code {
    font-size: 15px;
  }
}

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

.strategy-variant-switch:empty {
  display: none;
}

.strategy-variant-options {
  display: flex;
  justify-content: flex-start;
  gap: 18px;
  flex-wrap: nowrap;
  width: max-content;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.strategy-variant-options button {
  position: relative;
  flex: 0 0 auto;
  min-height: 30px;
  border: 0;
  border-radius: 0;
  padding: 5px 1px 9px;
  background: transparent;
  color: #8f7b73;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  box-shadow: none;
}

.strategy-variant-options button small {
  margin-left: 4px;
  color: #b8aaa3;
  font-size: 10px;
  font-weight: 750;
}

.strategy-variant-options button.active {
  border-color: transparent;
  background: transparent;
  color: var(--orange);
  box-shadow: none;
}

.strategy-variant-options button.active::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 999px;
  background: var(--orange);
  content: "";
}

.strategy-variant-options button:hover:not(:disabled) {
  color: var(--orange);
}

.strategy-variant-options button.is-pending,
.strategy-variant-options button:disabled {
  color: #a99b94;
  cursor: default;
  opacity: 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-history-link {
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.stats-history-link:hover {
  color: #1d4ed8;
}

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

.snapshot-date-nav {
  display: inline-grid;
  grid-template-columns: 24px minmax(0, 1fr) 24px;
  align-items: center;
  width: 220px;
  gap: 3px;
  font-variant-numeric: tabular-nums;
}

.snapshot-date-nav > span {
  width: 100%;
  justify-content: center;
}

.snapshot-date-nav button {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--red);
  font: 900 25px/1 ui-rounded, "SF Pro Rounded", sans-serif;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.snapshot-date-nav button:hover:not(:disabled) {
  background: var(--soft);
  transform: translateY(-1px);
}

.snapshot-date-nav button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--red) 55%, transparent);
  outline-offset: 1px;
}

.snapshot-date-nav button:disabled {
  color: color-mix(in srgb, var(--muted) 38%, transparent);
  cursor: default;
}

.snapshot-date-nav.is-loading span {
  opacity: 0.62;
}

.snapshot-date-nav.is-error button:not(:disabled) {
  color: #b45309;
}

.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-grid.is-five-wide {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

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

.holding-card.composite-card {
  border-top-color: #23875d;
}

.basket-composition {
  display: grid;
  gap: 8px;
  margin-top: 22px;
  padding: 14px 0 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.basket-composition strong {
  color: #23875d;
  font-size: 14px;
}

.basket-composition span {
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.5;
}

.basket-composition small,
.basket-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.basket-note {
  margin: 12px 0 0;
}

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

.rank-move-chip {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 18px;
  padding: 2px 6px;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.rank-move-down {
  border-color: #dbe4f0;
  background: #f8fafc;
  color: #64748b;
}

.rank-move-major.rank-move-up {
  border-color: #fecaca;
  background: #fff1f2;
  color: #dc2626;
}

.rank-move-major.rank-move-down {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #475569;
}

.first-appearance-chip {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 18px;
  padding: 2px 6px;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: #f0fdf4;
  color: #15803d;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  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;
}

.title-allocation-text.observation-allocation-text {
  color: #0f766e;
}

.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(4, 20px);
  gap: 5px;
  min-height: 95px;
  max-height: 95px;
  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-observation {
  background: #ecfdf5;
  color: #0f766e;
}

.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: 4px;
}

.candidate-pool-panel {
  border-top: 0;
  padding-top: 4px;
  content-visibility: auto;
  contain-intrinsic-size: auto 1200px;
}

.candidate-pool-loading {
  min-height: 120px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.momentum-board-split {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 14px;
  min-width: 0;
}

.momentum-board-split::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: #f1d5cb;
  transform: translateX(-0.5px);
  pointer-events: none;
}

.sector-momentum-panel {
  margin-top: 0;
  padding: 4px 0 10px;
  border: 0;
}

.momentum-board-pane {
  min-width: 0;
  overflow: hidden;
}

.momentum-board-pane + .momentum-board-pane {
  border-left: 0;
  padding-left: 0;
}

.sector-momentum-head {
  align-items: center;
  margin-bottom: 12px;
}

.sector-momentum-head > div {
  min-width: 0;
}

.momentum-board-note {
  max-width: 100%;
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sector-momentum-toggle {
  flex: 0 0 auto;
  min-height: 34px;
  border: 1px solid #f1d5cb;
  border-radius: 999px;
  background: #ffffff;
  padding: 6px 14px;
  color: var(--orange);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.sector-momentum {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.momentum-board-pane .sector-momentum,
.momentum-board-pane .sector-momentum.is-expanded {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.momentum-board-pane .sector-momentum.is-heatmap {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-flow: dense;
  grid-auto-rows: minmax(0, 1fr);
  gap: 0;
  height: 308px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.momentum-heatmap-tile {
  --heatmap-text: #ffffff;
  --heatmap-muted: rgba(255, 255, 255, 0.84);
  --heatmap-shadow: 0 1px 2px rgba(20, 10, 14, 0.42);
  display: flex;
  min-width: 0;
  overflow: hidden;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  border: 0;
  border-radius: 0;
  box-shadow: inset 0 0 0 1px rgba(22, 25, 34, 0.42);
  padding: 4px 6px;
  color: var(--heatmap-text);
  text-align: center;
  text-shadow: var(--heatmap-shadow);
  transition: filter 140ms ease, transform 140ms ease;
}

.momentum-heatmap-tile:hover {
  z-index: 1;
  filter: brightness(1.12);
  transform: scale(1.015);
}

.heatmap-size-lead {
  grid-column: span 2;
  grid-row: span 2;
}

.heatmap-size-featured {
  grid-column: span 2;
}

.momentum-heatmap-title {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
}

.momentum-heatmap-title h3 {
  min-width: 0;
  overflow: hidden;
  margin: 0;
  color: #ffffff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.momentum-heatmap-title span {
  position: absolute;
  top: 50%;
  right: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 8px;
  font-weight: 400;
  transform: translateY(-50%);
}

.momentum-heatmap-tile strong {
  align-self: center;
  padding: 0;
  color: #ffffff;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 400;
  line-height: 1;
}

.momentum-heatmap-tile strong em {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.55em;
  font-style: normal;
  white-space: nowrap;
}

.momentum-heatmap-tile small {
  overflow: hidden;
  align-self: center;
  max-width: 100%;
  padding: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 10px;
  font-weight: 400;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.heatmap-size-lead {
  gap: 3px;
  padding: 6px 8px;
}

.heatmap-size-lead .momentum-heatmap-title h3 {
  font-size: 15px;
}

.heatmap-size-lead strong {
  font-size: 16px;
}

.heatmap-size-standard {
  gap: 2px;
  padding: 4px;
}

.heatmap-size-standard .momentum-heatmap-title {
  padding: 0 13px;
}

.heatmap-size-featured,
.heatmap-size-standard {
  gap: 1px;
  padding: 2px 4px;
}

.heatmap-size-featured .momentum-heatmap-title h3,
.heatmap-size-standard .momentum-heatmap-title h3 {
  font-size: 11px;
}

.heatmap-size-featured strong,
.heatmap-size-standard strong {
  font-size: 10px;
}

.heatmap-size-featured small,
.heatmap-size-standard small {
  display: block;
  font-size: 9px;
}

#sector-momentum.is-heatmap .momentum-heatmap-tile:nth-last-child(-n + 4) {
  grid-column: span 2;
}

.heatmap-tone-hot {
  background: #e62b4c;
}

.heatmap-tone-positive {
  background: #a91e37;
}

.heatmap-tone-warm {
  background: #5d1723;
}

.heatmap-tone-flat {
  background: #8c94a3;
}

.heatmap-tone-cool {
  background: #174437;
}

.heatmap-tone-cold {
  background: #147454;
}

.momentum-board-pane .sector-momentum-tile,
.momentum-board-pane .sector-momentum.is-expanded .sector-momentum-tile {
  height: 204px;
  min-height: 204px;
}

.ai-momentum-pane {
  background: linear-gradient(90deg, rgba(255, 247, 242, 0.46), transparent 32%);
}

.ai-momentum-tile {
  border-top-color: #7c3aed;
}

.ai-momentum-tile.sector-tone-strong-positive {
  border-top-color: var(--red);
}

.ai-momentum-tile.sector-tone-strong-negative {
  border-top-color: #7c8b82;
}

.ai-diagnosis-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
}

.ai-diagnosis-line em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-diagnosis-line span {
  flex: 0 0 auto;
  color: #24120d;
  font-weight: 750;
  white-space: nowrap;
}

.sector-momentum-tile {
  position: relative;
  display: grid;
  align-content: space-between;
  gap: 7px;
  min-width: 0;
  min-height: 174px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 4px solid var(--red);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px 12px 13px;
  color: #24120d;
}

.sector-momentum.is-expanded {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.sector-momentum.is-expanded .sector-momentum-tile {
  min-height: 174px;
  align-content: space-between;
}

.sector-tone-strong-positive,
.sector-tone-positive {
  border-right-color: var(--line);
  border-bottom-color: var(--line);
  border-left-color: var(--line);
}

.sector-tone-strong-negative,
.sector-tone-negative {
  border-right-color: var(--line);
  border-bottom-color: var(--line);
  border-left-color: var(--line);
}

.sector-tone-strong-positive {
  border-top-color: var(--red);
}

.sector-tone-positive {
  border-top-color: var(--orange);
}

.sector-tone-strong-negative {
  border-top-color: var(--green);
}

.sector-tone-negative {
  border-top-color: #cdb9af;
}

.sector-tone-neutral {
  border-right-color: var(--line);
  border-bottom-color: var(--line);
  border-left-color: var(--line);
  border-top-color: #f1d5cb;
}

.sector-tile-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.sector-tile-title h3 {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  margin: 0;
  color: #24120d;
  font-size: 16px;
  font-weight: 950;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sector-tile-title span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.sector-tile-title .rank-move-chip {
  font-size: 10px;
  font-weight: 900;
}

.sector-tile-groups {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.sector-gauge-grid {
  gap: 4px;
  margin-top: 0;
}

.sector-gauge-grid .mini-gauge {
  min-height: 50px;
  border-color: #f1d5cb;
  border-radius: 7px;
  padding: 4px 2px 3px;
}

.sector-gauge-grid .mini-gauge-dial {
  width: 36px;
  height: 20px;
}

.sector-gauge-grid .mini-gauge-dial::after {
  right: 5px;
  left: 5px;
  height: 15px;
}

.sector-gauge-grid .mini-gauge-needle {
  left: 17px;
  width: 1.5px;
  height: 17px;
}

.sector-gauge-grid .mini-gauge-dial b {
  bottom: -3px;
  left: 15px;
  width: 8px;
  height: 8px;
}

.sector-gauge-grid .mini-gauge span {
  font-size: 9px;
  font-weight: 400;
}

.sector-gauge-grid .mini-gauge strong {
  font-size: 11px;
  font-weight: 500;
}

.sector-tile-group {
  display: block;
  min-width: 0;
  color: #6b4b40;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}

.sector-tile-group em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  line-height: inherit;
  white-space: nowrap;
}

.sector-tile-group span {
  min-width: 0;
  color: #6b4b40;
}

.sector-tile-group .stock-symbol-link {
  display: inline-flex;
  color: inherit;
  border-bottom-width: 1px;
  border-bottom-color: rgba(116, 82, 71, 0.24);
  padding-bottom: 0;
}

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

.sector-relative-line span {
  color: #24120d;
  font-variant-numeric: tabular-nums;
}

.sector-tone-strong-positive .sector-relative-line span {
  color: var(--red);
}

.sector-tone-strong-negative .sector-relative-line span {
  color: var(--green);
}

.sector-momentum-empty {
  grid-column: 1 / -1;
  border: 1px dashed #f1d5cb;
  border-radius: 8px;
  background: #fffaf7;
  padding: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.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,
.broad-momentum-filter-row,
.guru-manager-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 0 0 10px;
}

.source-filter-row button,
.broad-momentum-filter-row button,
.guru-manager-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,
.broad-momentum-filter-row button b,
.guru-manager-filter-row button b {
  font-variant-numeric: tabular-nums;
}

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

.guru-manager-filter-row {
  margin: -2px 0 14px;
}

.broad-momentum-filter-row button,
.guru-manager-filter-row button {
  min-height: 26px;
  padding: 4px 9px;
  font-size: 11px;
  background: var(--guru-soft);
  color: var(--guru-text);
}

.broad-momentum-filter-row {
  gap: 6px;
  margin: 0 0 2px;
}

.broad-momentum-filter-row button {
  min-height: 24px;
  border-color: #f0c8b8;
  background: #ffffff;
  padding: 3px 8px;
  color: #9a4d31;
  font-size: 11px;
}

.broad-momentum-filter-row button.active {
  border-color: var(--orange);
  color: var(--orange);
}

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

.holding-card.observation-card {
  border-top-color: #0f766e;
}

.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-title-block > .observation-allocation-text {
  color: #0f766e !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: 95px !important;
  max-height: 95px !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 70px !important;
  gap: 5px !important;
  min-height: 95px !important;
  max-height: 95px !important;
  overflow: hidden !important;
}

.stock-tag-row.tag-unified.no-estimates {
  grid-template-rows: 95px !important;
  min-height: 95px !important;
  max-height: 95px !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 {
  gap: 3px !important;
  flex-wrap: nowrap !important;
}

.stock-tag-row.tag-unified .stock-tag-line-estimates .estimate-chip {
  padding-right: 4px !important;
  padding-left: 4px !important;
  font-size: 10px !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: 70px !important;
  overflow: hidden !important;
}

.stock-tag-row.tag-unified.no-estimates .stock-tag-line-extra {
  max-height: 95px !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;
}

.stock-title-block > .rank-move-chip,
.sector-tile-title > .rank-move-chip {
  min-height: 18px !important;
  padding: 2px 6px !important;
  border: 1px solid #fed7aa !important;
  border-radius: 999px !important;
  background: #fff7ed !important;
  color: #c2410c !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  box-shadow: none !important;
}

.stock-title-block > .rank-move-down,
.sector-tile-title > .rank-move-down {
  border-color: #dbe4f0 !important;
  background: #f8fafc !important;
  color: #64748b !important;
}

.stock-title-block > .rank-move-major.rank-move-up,
.sector-tile-title > .rank-move-major.rank-move-up {
  border-color: #fecaca !important;
  background: #fff1f2 !important;
  color: #dc2626 !important;
}

.stock-title-block > .rank-move-major.rank-move-down,
.sector-tile-title > .rank-move-major.rank-move-down {
  border-color: #cbd5e1 !important;
  background: #f1f5f9 !important;
  color: #475569 !important;
}

.stock-title-block > span.first-appearance-chip {
  min-height: 18px !important;
  padding: 2px 6px !important;
  border: 1px solid #bbf7d0 !important;
  border-radius: 999px !important;
  background: #f0fdf4 !important;
  color: #15803d !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  box-shadow: none !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,
.guru-manager-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,
.guru-manager-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;
}

/* Match the primary candidate switch to the strategy switch above it. */
.source-filter-row.candidate-source-tabs {
  display: flex;
  justify-content: flex-start;
  gap: 18px;
  flex-wrap: nowrap;
  width: 100%;
  margin-bottom: 2px;
  overflow-x: auto;
  padding: 0 0 2px;
  scrollbar-width: none;
}

.source-filter-row.candidate-source-tabs::-webkit-scrollbar {
  display: none;
}

.source-filter-row.candidate-source-tabs button[data-source-filter] {
  position: relative;
  flex: 0 0 auto;
  min-height: 30px;
  border: 0 !important;
  border-radius: 0;
  padding: 5px 1px 9px;
  background: transparent !important;
  color: #8f7b73 !important;
  font-size: 14px;
  font-weight: 800;
  box-shadow: none !important;
}

.source-filter-row.candidate-source-tabs button[data-source-filter] b {
  margin-left: -1px;
  color: inherit;
  font-size: 12px;
  font-weight: 800;
}

.source-filter-row.candidate-source-tabs button[data-source-filter].active {
  border-color: transparent !important;
  color: var(--orange) !important;
  box-shadow: none !important;
}

.source-filter-row.candidate-source-tabs button[data-source-filter].active::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 999px;
  background: var(--orange);
  content: "";
}

.source-filter-row.candidate-source-tabs button[data-source-filter]:hover {
  color: var(--orange) !important;
}

.source-filter-row.candidate-source-tabs button[data-source-filter]:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--orange) 55%, white);
  outline-offset: 3px;
}

.source-filter-row.candidate-source-tabs .custom-universe-open-button {
  flex: 0 0 28px;
  margin-left: auto;
}

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

.performance-curve-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 18px 18px 14px;
}

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

.performance-curve-head h3 {
  color: #24120d;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.25;
}

.performance-curve-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.performance-range-tabs {
  justify-content: flex-end;
  max-width: 520px;
}

.performance-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin: 2px 0 10px;
  color: #4b332b;
  font-size: 13px;
  font-weight: 800;
}

.performance-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.performance-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.performance-legend b {
  font-variant-numeric: tabular-nums;
}

.legend-strategy {
  background: var(--orange);
}

.legend-benchmark {
  background: #94a3b8;
}

.legend-excess {
  background: var(--blue);
}

.legend-exposure {
  background: var(--green);
}

.performance-chart-svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 360px;
}

.performance-chart-wrap {
  position: relative;
  touch-action: pan-y;
}

.performance-chart-tooltip {
  position: absolute;
  z-index: 3;
  top: 10px;
  left: 50%;
  display: grid;
  min-width: 250px;
  transform: translateX(-50%);
  border: 1px solid #d7e5f7;
  border-radius: 6px;
  background: rgba(239, 246, 255, 0.96);
  box-shadow: 0 8px 24px rgba(51, 65, 85, 0.14);
  padding: 9px 11px;
  pointer-events: none;
  color: #334155;
  font-size: 12px;
  line-height: 1.35;
}

.performance-chart-tooltip strong {
  margin-bottom: 5px;
  color: #64748b;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}

.performance-chart-tooltip span {
  display: grid;
  grid-template-columns: 8px minmax(70px, auto) auto auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.performance-chart-tooltip i {
  width: 8px;
  height: 3px;
  border-radius: 2px;
}

.performance-chart-tooltip em {
  overflow: hidden;
  font-style: normal;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.performance-chart-tooltip b,
.performance-chart-tooltip small {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.performance-chart-tooltip b {
  color: #24120d;
  font-size: 12px;
}

.performance-chart-tooltip span:nth-of-type(1) b {
  color: var(--orange);
}

.performance-chart-tooltip span:nth-of-type(2) b {
  color: #64748b;
}

.performance-chart-tooltip span:nth-of-type(3) b {
  color: var(--blue);
}

.performance-chart-tooltip span:nth-of-type(4) b {
  color: var(--green);
}

.performance-chart-tooltip small {
  color: #64748b;
  font-size: 10px;
}

.performance-hover-hitbox {
  fill: transparent;
  cursor: crosshair;
  pointer-events: all;
}

.performance-hover-line {
  stroke: #94a3b8;
  stroke-width: 1;
  stroke-dasharray: 3 3;
  pointer-events: none;
}

.performance-hover-dot {
  stroke: #ffffff;
  stroke-width: 2;
  pointer-events: none;
}

.performance-hover-dot.is-strategy {
  fill: var(--orange);
}

.performance-hover-dot.is-benchmark {
  fill: #94a3b8;
}

.performance-hover-dot.is-excess {
  fill: var(--blue);
}

.performance-grid-line line {
  stroke: #f0e1da;
  stroke-width: 1;
}

.performance-grid-line text,
.performance-time-tick text,
.performance-exposure-axis text {
  fill: var(--muted);
  font-weight: 650;
}

.performance-grid-line text {
  font-size: 8px;
}

.performance-time-tick text {
  font-size: 8px;
}

.performance-exposure-axis text {
  fill: var(--green);
  font-size: 8px;
  opacity: 0.78;
}

.performance-time-tick line {
  stroke: #f4e7e0;
  stroke-width: 1;
  stroke-dasharray: 2 5;
}

.performance-time-tick.is-edge line {
  stroke: transparent;
}

.performance-zero-line {
  stroke: #d8c4bb;
  stroke-width: 1.2;
  stroke-dasharray: 4 5;
}

.performance-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.performance-line-strategy {
  stroke: var(--orange);
}

.performance-line-benchmark {
  stroke: #94a3b8;
}

.performance-line-excess {
  stroke: var(--blue);
}

.performance-line-exposure {
  stroke: var(--green);
  stroke-width: 1.7;
  stroke-dasharray: 5 5;
  opacity: 0.9;
}

.performance-hover-dot.is-exposure {
  fill: var(--green);
}

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

.history-variant-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
}

.history-variant-head h1 {
  color: #24120d;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.25;
}

.history-variant-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.annual-data-head {
  margin: 12px 0 2px;
}

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

.annual-data-head .section-note {
  margin-top: 6px;
}

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

.overview-gauge-card {
  padding: 8px 10px 9px;
}

.overview-gauge-card .mini-gauge {
  width: 78px;
  min-height: 42px;
}

.overview-gauge-card .mini-gauge-dial {
  width: 78px;
  height: 42px;
}

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

.overview-gauge-card .mini-gauge-dial::after {
  right: 10px;
  left: 10px;
  height: 31px;
  border-radius: 62px 62px 0 0;
}

.overview-gauge-card .mini-gauge-needle {
  bottom: 0;
  left: 50%;
  width: 10px;
  height: 31px;
  border-radius: 50% 50% 35% 35%;
  background: #24120d;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  transform: translateX(-50%) rotate(var(--angle));
  transform-origin: 50% 100%;
}

.overview-gauge-card .mini-gauge-dial b {
  display: none;
}

.overview-gauge-value {
  margin-top: 4px;
  font-size: 14px;
}

.overview-gauge-card p {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.35;
  -webkit-line-clamp: 2;
}

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

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

  .holding-grid.is-five-wide {
    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;
  }

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

  .conclusion-panel,
  .merged-holdings-block,
  .merged-holdings-head > div {
    min-width: 0;
  }

  .merged-holdings-head .stats-inline {
    max-width: 100%;
    flex-wrap: wrap;
  }

  .merged-holdings-head {
    grid-template-columns: 1fr;
  }

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

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

  .history-variant-head {
    display: grid;
  }

  .strategy-variant-options {
    gap: 18px;
    width: fit-content;
  }

  .source-filter-row.candidate-source-tabs {
    gap: 18px;
    width: max-content;
    min-width: 100%;
  }

  .performance-curve-head {
    display: grid;
    gap: 12px;
  }

  .performance-range-tabs {
    max-width: 100%;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 3px;
  }

  .performance-range-tabs button {
    flex: 0 0 auto;
  }

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

@media (max-width: 1100px) {
  .sector-momentum {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .sector-momentum.is-expanded {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .momentum-board-pane .sector-momentum,
  .momentum-board-pane .sector-momentum.is-expanded {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .momentum-board-pane .sector-momentum.is-heatmap {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    height: 392px;
  }

  .momentum-board-pane .sector-momentum-tile,
  .momentum-board-pane .sector-momentum.is-expanded .sector-momentum-tile {
    height: 218px;
    min-height: 218px;
  }
}

@media (max-width: 860px) {
  .momentum-board-split {
    grid-template-columns: 1fr;
  }

  .momentum-board-split::after {
    display: none;
  }

  .momentum-board-pane + .momentum-board-pane {
    border-top: 1px solid #f1d5cb;
    border-left: 0;
    padding-top: 14px;
    padding-left: 0;
  }

  .momentum-board-pane .sector-momentum,
  .momentum-board-pane .sector-momentum.is-expanded {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .momentum-board-pane .sector-momentum.is-heatmap {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    height: 308px;
  }

  .momentum-board-pane .sector-momentum-tile,
  .momentum-board-pane .sector-momentum.is-expanded .sector-momentum-tile {
    height: 204px;
    min-height: 204px;
  }
}

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

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

  .sector-momentum.is-expanded {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .momentum-board-pane .sector-momentum,
  .momentum-board-pane .sector-momentum.is-expanded {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .momentum-board-pane .sector-momentum.is-heatmap {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    height: 412px;
  }

  .sector-momentum-tile {
    min-height: 174px;
  }

  .sector-momentum.is-expanded .sector-momentum-tile {
    min-height: 174px;
  }

  .momentum-board-pane .sector-momentum-tile,
  .momentum-board-pane .sector-momentum.is-expanded .sector-momentum-tile {
    height: auto;
    min-height: 218px;
  }
}
