:root {
  color-scheme: dark;
  --bg: #0b1116;
  --base: #101820;
  --surface: #151f28;
  --surface-2: #1b2732;
  --surface-3: #24323e;
  --line: #2a3945;
  --line-strong: #3d5362;
  --text: #edf4f6;
  --muted: #9baab4;
  --faint: #6f818d;
  --accent: #37c5a6;
  --accent-strong: #7fe2ca;
  --accent-soft: rgba(55, 197, 166, .14);
  --green: #27c982;
  --green-soft: rgba(39, 201, 130, .15);
  --red: #f05f5f;
  --red-soft: rgba(240, 95, 95, .14);
  --blue: #6aa7ff;
  --blue-soft: rgba(106, 167, 255, .15);
  --amber: #d7a84f;
  --amber-soft: rgba(215, 168, 79, .14);
  --bg-mid: #0e161d;
  --shadow: 0 12px 34px rgba(0, 0, 0, .24);
  --radius: 8px;
  --sidebar: 208px;
  --mobile-nav-safe: 112px;
  font-family: "Bahnschrift", "Segoe UI", "Microsoft YaHei", sans-serif;
}

/* Real research loop: source transparency and mobile A-share overview. */
.research-candidate-source {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid #dce9ec;
  border-radius: 8px;
  background: #f7fbfb;
  color: #60717d;
}

.research-candidate-source strong {
  color: #087f80;
  font-size: 13px;
}

.research-candidate-source span {
  min-width: 0;
  overflow: hidden;
  color: #71808b;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.research-candidate-source.failed {
  border-color: #f2c9ce;
  background: #fff7f8;
}

.research-candidate-source.failed strong {
  color: #d83d4c;
}

.pd5-real-overview {
  margin: 0 16px 14px;
  padding: 15px;
  border: 1px solid #e1eaed;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 5px 16px rgba(8, 24, 38, 0.05);
}

.pd5-real-overview .pd5-section-head {
  align-items: flex-end;
  margin-bottom: 12px;
}

.pd5-real-overview .pd5-section-head span,
.pd5-real-overview .pd5-section-head small {
  color: #8897a2;
  font-size: 11px;
}

.pd5-real-overview .pd5-section-head h3 {
  margin: 3px 0 0;
  color: #081826;
  font-size: 18px;
}

.pd5-real-overview > p {
  margin: 11px 0 0;
  color: #71808b;
  font-size: 12px;
  line-height: 1.55;
}

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

.pd5-index-grid article {
  min-width: 0;
  padding: 10px 8px;
  border: 1px solid #e4edef;
  border-radius: 7px;
  background: #fbfdfd;
}

.pd5-index-grid article span,
.pd5-index-grid article strong,
.pd5-index-grid article em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pd5-index-grid article span {
  color: #6f7f8b;
  font-size: 11px;
}

.pd5-index-grid article strong {
  margin-top: 5px;
  color: #081826;
  font-size: 15px;
}

.pd5-index-grid article em {
  margin-top: 3px;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.pd5-index-grid .pd5-data-note {
  grid-column: 1 / -1;
  margin: 0;
  padding: 11px;
  border: 1px dashed #d7e3e6;
  border-radius: 7px;
  color: #7d8c96;
  background: #f8fbfb;
  font-size: 12px;
}

@media (max-width: 520px) {
  .research-candidate-source {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .research-candidate-source span {
    overflow: visible;
    white-space: normal;
  }
}

/* 20260703 research-loop: make daily candidates evidence-first instead of recommendation-like. */
.research-candidate-panel {
  border-color: rgba(8, 168, 178, 0.18) !important;
}

.research-loop-note,
.candidate-quality-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.research-loop-note span,
.candidate-quality-row span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 10px;
  border: 1px solid rgba(8, 168, 178, 0.16);
  border-radius: 999px;
  background: rgba(8, 168, 178, 0.07);
  color: #526675;
  font-size: 12px;
  line-height: 1.2;
}

.candidate-quality-row {
  margin: 12px 0 4px;
}

.candidate-quality-row b {
  margin-left: 4px;
  color: #081826;
}

@media (max-width: 720px) {
  .research-loop-note,
  .candidate-quality-row {
    gap: 6px;
  }

  .research-loop-note span,
  .candidate-quality-row span {
    max-width: 100%;
    font-size: 11px;
  }
}

/* 20260703 ashare-polish: A-share module gate. */
.ashare-gate-card {
  border-color: rgba(0, 168, 107, 0.18) !important;
}

.ashare-gate-summary,
.ashare-module-grid {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.ashare-gate-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ashare-gate-summary span,
.ashare-module-pill {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(8, 168, 178, 0.16);
  border-radius: 14px;
  background: #f8fcfd;
}

.ashare-gate-summary b,
.ashare-module-pill strong {
  display: block;
  color: #081826;
  font-weight: 950;
}

.ashare-gate-summary span {
  color: #647583;
  font-size: 12px;
}

.ashare-module-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ashare-module-pill {
  display: grid;
  gap: 5px;
  min-height: 82px;
}

.ashare-module-pill span {
  color: #647583;
  font-size: 12px;
  font-weight: 850;
}

.ashare-module-pill small {
  overflow: hidden;
  color: #8a97a3;
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ashare-module-pill.ready {
  border-color: rgba(0, 168, 107, 0.22);
  background: rgba(0, 168, 107, 0.07);
}

.ashare-module-pill.cached,
.ashare-module-pill.pending {
  border-color: rgba(245, 158, 11, 0.24);
  background: rgba(245, 158, 11, 0.08);
}

.ashare-module-pill.missing,
.ashare-module-pill.failed {
  border-color: rgba(240, 68, 82, 0.24);
  background: rgba(240, 68, 82, 0.07);
}

@media (max-width: 820px) {
  .ashare-gate-summary,
  .ashare-module-grid {
    grid-template-columns: 1fr;
  }

  .ashare-module-pill {
    min-height: 0;
  }
}

@media (max-width: 760px) {
  body.is-detail-page .mobile-nav {
    display: none !important;
  }

  body.is-detail-page .app-shell {
    padding-bottom: 96px;
  }

  body.is-detail-page .mobile-detail-bar {
    display: grid !important;
    z-index: 60;
  }

  .trade-ticket {
    align-items: end;
    padding: 12px;
  }

  .trade-ticket-card {
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 12px;
  }

  .trade-ticket-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin: 12px -2px 0;
    padding-top: 10px;
    background: linear-gradient(180deg, transparent, var(--surface) 24%, var(--surface));
  }

  .trade-ticket-actions button {
    min-height: 44px;
    flex: 1 1 140px;
  }
}

/* Final detail-page overrides for the C-end redesign. */
.detail-sticky .detail-title,
.detail-sticky .quote-card {
  display: none;
}

.compact-detail .compact-visible {
  display: flex !important;
}

.compact-detail .quote-card.compact-visible {
  display: block !important;
}

.compact-detail .detail-title h2 {
  font-size: 24px;
}

.compact-detail .quote-card strong {
  font-size: 28px;
}

.compact-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.compact-side-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
}

.detail-sticky .detail-section {
  border-top: 0;
}

.detail-sticky .detail-card {
  border-top: 1px solid #dde9ee;
}

.detail-reading-layout .data-hub-section,
.detail-reading-layout .detail-card,
.detail-reading-layout .detail-kline-card {
  background: #fff;
}

.detail-reading-layout .kline-preview {
  border-radius: 16px;
}

.detail-reading-layout .deep-module-card {
  background: #fff;
}

@media (min-width: 1021px) {
  .workspace.detail-page .module-panel {
    max-width: 1180px;
    margin: 0 auto;
  }

  .detail-reading-main .deep-module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .detail-reading-layout,
  .detail-reading-main {
    gap: 12px !important;
  }

  .detail-action-rail {
    display: contents;
  }

  .detail-action-rail .decision-panel {
    order: 8;
  }

  .detail-action-rail .detail-card.compact {
    order: 9;
  }

  .detail-hero {
    margin-top: 4px;
  }

  .detail-hero-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .detail-hero-meta span,
  .detail-status-chip {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .detail-kline-card .kline-chart {
    height: 128px !important;
  }

  .mobile-detail-bar {
    grid-template-columns: 1fr 1.35fr !important;
  }
}

@media (max-width: 390px) {
  .detail-hero-meta {
    grid-template-columns: 1fr !important;
  }
}

/* C-end stock detail redesign */
.stock-detail-page {
  width: min(1180px, 100%);
}

.detail-sticky {
  gap: 16px;
}

.detail-sticky.standalone-detail {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.detail-hero,
.detail-card,
.detail-kline-card,
.detail-action-rail .decision-panel {
  border: 1px solid #dde9ee;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(22, 86, 112, .08);
}

.detail-hero {
  overflow: hidden;
  padding: 18px;
}

.detail-hero.up {
  border-color: color-mix(in srgb, var(--green) 22%, #dde9ee);
}

.detail-hero.down {
  border-color: color-mix(in srgb, var(--red) 20%, #dde9ee);
}

.detail-hero-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
}

.detail-identity h2 {
  margin: 4px 0 6px;
  color: #081826;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.05;
  letter-spacing: 0;
}

.detail-identity p {
  margin: 0;
  color: var(--muted);
  font-weight: 720;
}

.detail-price-card {
  min-width: 180px;
  border: 1px solid #edf2f4;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f6fafb);
  padding: 14px;
  text-align: right;
}

.detail-price-card span,
.detail-price-card em {
  display: block;
}

.detail-price-card span {
  color: var(--faint);
  font-size: 12px;
  font-weight: 760;
}

.detail-price-card strong {
  display: block;
  margin: 5px 0;
  color: #081826;
  font-size: 34px;
  line-height: 1;
}

.detail-price-card em {
  font-style: normal;
  font-weight: 900;
}

.detail-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.detail-hero-meta span:not(.detail-status-chip) {
  border: 1px solid #edf2f4;
  border-radius: 999px;
  background: #f6fafb;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.detail-status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid #dcebef;
  border-radius: 999px;
  background: #f6fafb;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.detail-status-chip.ready {
  border-color: rgba(0, 168, 107, .24);
  background: rgba(0, 168, 107, .10);
  color: #00895c;
}

.detail-status-chip.cached,
.detail-status-chip.partial {
  border-color: rgba(10, 166, 166, .28);
  background: rgba(10, 166, 166, .10);
  color: #087f89;
}

.detail-status-chip.failed {
  border-color: rgba(240, 68, 82, .26);
  background: rgba(240, 68, 82, .10);
  color: #d93645;
}

.detail-status-chip.loading,
.detail-status-chip.planned {
  border-color: #dcebef;
  background: #f1f5f7;
  color: #667987;
}

.detail-reading-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 16px;
  align-items: start;
}

.detail-reading-main {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.detail-action-rail {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 12px;
  min-width: 0;
}

.detail-card,
.detail-kline-card {
  padding: 16px;
}

.detail-card.compact {
  padding: 14px;
}

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

.detail-card-head h3,
.detail-card h3 {
  margin: 3px 0 0;
  color: #081826;
  font-size: 18px;
}

.detail-card p {
  color: var(--muted);
  line-height: 1.65;
}

.detail-card.data-hub-section code {
  background: #f6fafb;
}

.data-module.cached {
  border-color: rgba(10, 166, 166, .28);
  background: rgba(10, 166, 166, .08);
}

.detail-kline-card {
  margin: 0;
}

.detail-kline-card .kline-chart {
  height: 156px;
  margin: 12px 0;
}

.detail-kline-card .kline-chart polyline {
  stroke-width: 4;
}

.kline-stat-grid,
.research-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.kline-stat-grid span,
.research-summary-grid div {
  min-width: 0;
  border: 1px solid #edf2f4;
  border-radius: 12px;
  background: #f8fbfc;
  padding: 10px;
}

.kline-stat-grid small,
.kline-stat-grid b,
.research-summary-grid small,
.research-summary-grid p {
  display: block;
}

.kline-stat-grid small,
.research-summary-grid small {
  color: var(--faint);
  font-size: 11px;
  font-weight: 820;
}

.kline-stat-grid b {
  overflow-wrap: anywhere;
  margin-top: 4px;
  color: #081826;
  font-size: 13px;
}

.research-summary-grid p {
  margin: 5px 0 0;
  color: #263f4c;
  font-size: 13px;
  line-height: 1.5;
}

.detail-research-summary .execution-box {
  margin-top: 12px;
}

.detail-research-modules .deep-module-grid {
  margin-bottom: 0;
}

.detail-desktop-actions {
  display: grid;
}

.detail-action-rail .decision-panel {
  position: static;
}

@media (max-width: 1020px) {
  .detail-reading-layout {
    grid-template-columns: 1fr;
  }

  .detail-action-rail {
    position: static;
  }
}

@media (max-width: 820px) {
  .detail-hero,
  .detail-card,
  .detail-kline-card,
  .detail-action-rail .decision-panel {
    border-radius: 14px !important;
    box-shadow: 0 10px 26px rgba(28, 93, 120, .08) !important;
  }

  .detail-hero {
    padding: 15px;
  }

  .detail-hero-main {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .detail-price-card {
    width: 100%;
    min-width: 0;
    text-align: left;
  }

  .detail-price-card strong {
    font-size: 32px;
  }

  .detail-hero-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-hero-meta span {
    min-width: 0;
    justify-content: center;
    text-align: center;
  }

  .detail-card,
  .detail-kline-card {
    padding: 14px !important;
  }

  .detail-card-head {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .detail-card-head .detail-status-chip {
    width: fit-content;
  }

  .detail-kline-card .kline-chart {
    height: 132px;
  }

  .kline-stat-grid,
  .research-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .deep-module-grid,
  .data-module-grid {
    grid-template-columns: 1fr !important;
  }

  .detail-desktop-actions {
    display: none !important;
  }
}

@media (max-width: 390px) {
  .detail-identity h2 {
    font-size: 26px;
  }

  .detail-hero-meta,
  .kline-stat-grid,
  .research-summary-grid,
  .plan-grid.vertical,
  .deep-metric-row {
    grid-template-columns: 1fr !important;
  }
}

.capability-panel {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid #dde9ee;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfc 100%);
  box-shadow: 0 16px 36px rgba(18, 88, 116, .08);
}

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

.capability-head h3 {
  margin: 4px 0 0;
  color: #081826;
}

.capability-head p {
  margin: 0;
  color: #8a97a3;
  font-size: 13px;
  text-align: right;
}

.capability-sample-row,
.capability-grid,
.capability-chip-row {
  display: grid;
  gap: 12px;
}

.capability-sample-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 14px;
}

.capability-sample-row button {
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid #dde9ee;
  border-radius: 12px;
  background: #fff;
  color: #081826;
  text-align: left;
  box-shadow: 0 8px 20px rgba(28, 93, 120, .06);
}

.capability-sample-row strong,
.capability-sample-row span {
  display: block;
}

.capability-sample-row span {
  margin-top: 3px;
  color: #8a97a3;
  font-size: 12px;
}

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

.capability-card {
  padding: 14px;
  border: 1px solid #dde9ee;
  border-radius: 14px;
  background: #fff;
}

.capability-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.capability-card-head strong,
.capability-card-head span {
  display: block;
}

.capability-card-head strong {
  color: #081826;
  font-size: 16px;
}

.capability-card-head span,
.capability-card p {
  color: #8a97a3;
  font-size: 12px;
}

.capability-card-head em {
  min-width: 34px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e8f7f7;
  color: #0aa6a6;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  text-align: center;
}

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

.capability-chip {
  padding: 8px;
  border: 1px solid #edf2f4;
  border-radius: 10px;
  background: #f9fbfc;
}

.capability-chip b,
.capability-chip small {
  display: block;
}

.capability-chip b {
  color: #081826;
  font-size: 12px;
}

.capability-chip small {
  margin-top: 2px;
  color: #8a97a3;
  font-size: 11px;
  text-transform: uppercase;
}

.capability-chip.ready {
  border-color: rgba(0, 168, 107, .25);
  background: #f0fbf7;
}

.capability-chip.ready small {
  color: #00a86b;
}

.capability-chip.partial,
.capability-chip.cached {
  border-color: rgba(10, 166, 166, .24);
  background: #f0fbfc;
}

.capability-chip.partial small,
.capability-chip.cached small {
  color: #0aa6a6;
}

.capability-chip.failed {
  border-color: rgba(240, 68, 82, .24);
  background: #fff5f6;
}

.capability-chip.failed small {
  color: #f04452;
}

.capability-chip.planned small {
  color: #8a97a3;
}

.expansion-panel,
.ranking-panel {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid #dde9ee;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(18, 88, 116, .07);
}

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

.expansion-card,
.ranking-card {
  padding: 14px;
  border: 1px solid #edf2f4;
  border-radius: 14px;
  background: #fbfdfe;
}

.expansion-card > strong,
.ranking-card-head strong {
  display: block;
  color: #081826;
  font-size: 15px;
}

.expansion-card > div,
.ranking-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.expansion-card button,
.ranking-list button {
  display: grid;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: #fff;
  color: #081826;
  text-align: left;
}

.expansion-card button {
  grid-template-columns: 1fr auto;
  padding: 9px 10px;
}

.expansion-card em,
.ranking-card-head span,
.ranking-list small {
  color: #8a97a3;
  font-size: 12px;
  font-style: normal;
}

.ranking-card-head {
  display: grid;
  gap: 3px;
}

.ranking-list button {
  grid-template-columns: 24px minmax(0, 1fr) auto;
  padding: 8px;
}

.ranking-list i {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 8px;
  background: #e8f7f7;
  color: #0aa6a6;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.ranking-list b,
.ranking-list small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-list em {
  font-style: normal;
  font-weight: 900;
}

.ranking-list p {
  margin: 0;
  color: #8a97a3;
  font-size: 13px;
}

@media (max-width: 760px) {
  .capability-panel {
    margin: 14px 0;
    padding: 14px;
    border-radius: 16px;
    box-shadow: 0 10px 26px rgba(28, 93, 120, .07);
  }

  .capability-head {
    display: block;
  }

  .capability-head p {
    margin-top: 6px;
    text-align: left;
  }

  .capability-sample-row,
  .capability-grid,
  .expansion-grid,
  .ranking-grid {
    grid-template-columns: 1fr;
  }

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

/* Final consumer UI overrides. Keep this block last so old responsive rules cannot win. */
:root[data-theme="light"] {
  --bg: #f6fbff;
  --base: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3f8fc;
  --surface-3: #e9f4fb;
  --line: #d8e7ef;
  --line-strong: #b6d1df;
  --text: #102a3a;
  --muted: #5c7180;
  --faint: #8aa0ad;
  --accent: #0aa37f;
  --accent-strong: #00bd8e;
  --accent-soft: rgba(10, 163, 127, .12);
  --blue: #247fd1;
  --blue-soft: rgba(36, 127, 209, .12);
  --shadow: 0 16px 42px rgba(24, 92, 128, .10);
}

@media (min-width: 821px) {
  .mobile-nav { display: none !important; }
}

@media (max-width: 820px) {
  .sidebar,
  .market-strip,
  .module-toolbar,
  .detail-panel,
  .toolbar {
    display: none !important;
  }

  .app-shell,
  .disclaimer {
    margin-left: 0 !important;
  }

  .app-shell {
    padding-bottom: calc(84px + env(safe-area-inset-bottom)) !important;
  }

  .topbar {
    position: sticky;
    top: 0;
    min-height: auto !important;
    padding: 14px 14px 10px !important;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .96) !important;
    backdrop-filter: blur(18px);
  }

  .topbar h1 { font-size: 24px !important; }

  .workspace {
    display: block !important;
    padding: 10px 12px calc(98px + env(safe-area-inset-bottom)) !important;
  }

  .workspace.detail-page {
    padding-bottom: calc(112px + env(safe-area-inset-bottom)) !important;
  }

  .module-panel {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  .mobile-nav {
    position: fixed !important;
    inset: auto 0 0 0 !important;
    z-index: 30 !important;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 0 !important;
    border: 0 !important;
    border-top: 1px solid var(--line) !important;
    border-radius: 0 !important;
    background: rgba(255, 255, 255, .96) !important;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)) !important;
    box-shadow: 0 -10px 30px rgba(21, 86, 112, .10) !important;
    backdrop-filter: blur(18px);
  }

  .mobile-tab-button {
    display: grid;
    justify-items: center;
    gap: 3px;
    min-height: 54px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    font-weight: 760;
  }

  .mobile-tab-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: transparent;
    color: #748391;
  }

  .mobile-tab-button.active {
    color: var(--accent-strong);
    background: transparent;
    box-shadow: none;
  }

  .mobile-tab-button.active .mobile-tab-icon {
    background: rgba(18, 168, 181, .12);
    color: var(--accent-strong);
  }

  .mobile-tab-icon svg {
    display: block;
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .stock-detail-page {
    padding-bottom: 92px !important;
  }

  .detail-sticky.standalone-detail {
    max-height: none !important;
    overflow: visible !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 0 92px !important;
  }

  .detail-title,
  .quote-card,
  .detail-section,
  .data-hub-section,
  .kline-preview,
  .deep-module-card {
    border-radius: 14px !important;
    background: #fff !important;
    box-shadow: 0 10px 26px rgba(28, 93, 120, .08) !important;
  }

  .plan-grid.vertical,
  .deep-module-grid,
  .deep-metric-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .action-row.stacked {
    display: none !important;
  }

  .mobile-detail-bar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 40;
    display: grid !important;
    grid-template-columns: 1fr 1.4fr;
    gap: 10px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .96);
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    backdrop-filter: blur(18px);
  }

  .mobile-detail-bar button {
    min-height: 48px;
  }

  .trade-ticket {
    align-items: end !important;
    padding: 0 !important;
  }

  .trade-ticket-card {
    width: 100% !important;
    max-width: none !important;
    max-height: min(82vh, 720px) !important;
    border-radius: 18px 18px 0 0 !important;
    border-width: 1px 0 0 !important;
    padding: 16px !important;
  }
}

/* Final Product Design override: must stay at EOF so older layers cannot win. */
:root,
:root[data-theme="light"] {
  --pd-bg: #f4fbfa;
  --pd-bg-strong: #e8f6f4;
  --pd-card: rgba(255, 255, 255, .96);
  --pd-card-solid: #ffffff;
  --pd-line: #d7e7e9;
  --pd-text: #061a2a;
  --pd-muted: #6b7f8e;
  --pd-faint: #9aacb7;
  --pd-green: #07a889;
  --pd-green-2: #11c79e;
  --pd-green-soft: rgba(7, 168, 137, .12);
  --pd-red: #f04452;
  --pd-blue: #2d8cff;
  --pd-shadow: 0 14px 38px rgba(7, 35, 48, .09);
  --pd-shadow-soft: 0 8px 22px rgba(7, 35, 48, .06);
  --accent: var(--pd-green) !important;
  --accent-strong: var(--pd-green-2) !important;
  --accent-soft: var(--pd-green-soft) !important;
  --line: var(--pd-line) !important;
  --text: var(--pd-text) !important;
  --muted: var(--pd-muted) !important;
  --surface: var(--pd-card-solid) !important;
  --surface-2: #f8fcfb !important;
}

html,
body {
  background:
    linear-gradient(180deg, #ffffff 0%, var(--pd-bg) 48%, var(--pd-bg-strong) 100%) !important;
  color: var(--pd-text) !important;
  letter-spacing: 0 !important;
}

.app-shell {
  background:
    linear-gradient(90deg, rgba(255,255,255,.78) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, rgba(255,255,255,.76) 0 1px, transparent 1px 100%) !important;
  background-size: 28px 28px !important;
}

.sidebar,
.topbar,
.mobile-nav,
.mobile-detail-bar {
  background: rgba(255, 255, 255, .90) !important;
  border-color: rgba(202, 224, 227, .92) !important;
  box-shadow: var(--pd-shadow-soft) !important;
  backdrop-filter: blur(18px) saturate(1.12) !important;
}

.sidebar {
  border-radius: 0 22px 22px 0 !important;
}

.brand-mark {
  border-radius: 14px !important;
  background: linear-gradient(145deg, #dff9ea 0%, #9beacb 100%) !important;
  color: #006d5a !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85), 0 10px 24px rgba(7, 168, 137, .18) !important;
}

.brand-copy strong,
.section-head h2,
.panel-head h2,
.mobile-page-title h2,
.mobile-hero-search h2,
.detail-hero h2,
.agent-ask-hero h3,
.screener-hero h3 {
  color: var(--pd-text) !important;
  letter-spacing: 0 !important;
}

.eyebrow,
.panel-subtitle,
.mobile-page-title p,
.section-head p {
  color: var(--pd-muted) !important;
}

.nav-button {
  border-radius: 14px !important;
  color: #536b7d !important;
}

.nav-button:hover,
.nav-button.active {
  background: linear-gradient(180deg, #ecfbf7 0%, #e7f7f7 100%) !important;
  color: #005f52 !important;
  transform: translateX(1px);
}

.nav-button.active {
  box-shadow: inset 4px 0 0 var(--pd-green), 0 8px 18px rgba(7, 168, 137, .09) !important;
}

.nav-icon {
  color: var(--pd-green) !important;
}

.module-panel,
.overview-main,
.settings-panel,
.settings-card,
.stat-card,
.index-card,
.quote-card,
.pick-card,
.tracking-table,
.ledger-item,
.history-card,
.review-card,
.universe-card,
.universe-status-panel,
.search-result-panel,
.watchlist-panel,
.today-route-panel,
.alert-panel,
.market-overview,
.screener-workbench,
.agent-ask-panel,
.detail-card,
.detail-hero,
.detail-kline-card,
.deep-module-card,
.data-hub-section,
.account-profile-panel,
.source-health-panel,
.mobile-section,
.mobile-page-title,
.mobile-hero-search,
.mobile-stock-card,
.mobile-watch-row,
.mobile-report-card,
.mobile-market-entry,
.screener-result-card,
.agent-summary-card,
.agent-verdict-card,
.agent-source-digest,
.agent-text-list,
.research-workflow-card {
  border: 1px solid rgba(202, 224, 227, .92) !important;
  background: var(--pd-card) !important;
  box-shadow: var(--pd-shadow-soft) !important;
}

.module-panel,
.overview-main,
.screener-workbench,
.agent-ask-panel,
.detail-hero,
.account-profile-panel {
  background:
    linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(247,253,252,.96) 100%) !important;
  box-shadow: var(--pd-shadow) !important;
}

.search,
.global-search,
#globalSearch,
.mobile-search-pill,
.mobile-hero-search input,
.screener-input input,
.agent-prompt-row textarea,
.risk-settings input,
.custom-stock-form input {
  border: 1px solid #d5e6e8 !important;
  background: #f6f9fa !important;
  color: var(--pd-text) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95) !important;
}

.search:focus-within,
.mobile-hero-search.focused,
.screener-input:focus-within,
.agent-prompt-row textarea:focus {
  border-color: rgba(7, 168, 137, .55) !important;
  box-shadow: 0 0 0 4px rgba(7, 168, 137, .11) !important;
}

.action-button,
.screener-run,
.agent-prompt-row .action-button,
.mobile-detail-bar .action-button {
  border: 0 !important;
  background: linear-gradient(135deg, var(--pd-green-2), var(--pd-green)) !important;
  color: #ffffff !important;
  box-shadow: 0 14px 26px rgba(7, 168, 137, .25) !important;
}

.action-button:hover,
.screener-run:hover,
.agent-prompt-row .action-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(7, 168, 137, .30) !important;
}

.mini-button,
.filter-button,
.chip,
.sort-button,
.screener-chip,
.screener-control-group button,
.mobile-segmented button,
.mobile-market-tabs button,
.agent-quick-grid button {
  border-color: #d7e8ea !important;
  background: #ffffff !important;
  color: #314b5e !important;
  box-shadow: 0 5px 14px rgba(7, 35, 48, .04) !important;
}

.mini-button:hover,
.filter-button:hover,
.chip:hover,
.screener-chip:hover,
.screener-control-group button:hover,
.agent-quick-grid button:hover {
  border-color: rgba(7, 168, 137, .42) !important;
  background: #effbf8 !important;
}

.filter-button.active,
.chip.active,
.sort-button.active,
.screener-chip.active,
.screener-control-group button.active,
.mobile-segmented button.active,
.mobile-market-tabs button.active {
  border-color: rgba(7, 168, 137, .58) !important;
  background: linear-gradient(180deg, #eafbf6 0%, #ffffff 100%) !important;
  color: #007b68 !important;
  box-shadow: inset 0 -2px 0 var(--pd-green), 0 8px 18px rgba(7, 168, 137, .10) !important;
}

.market-pill,
.signal,
.trade-type,
.risk-tag,
.capability-chip,
.agent-template-badge,
.screener-source-pill,
.agent-state,
.detail-status-chip {
  border-color: rgba(7, 168, 137, .20) !important;
  background: #edf9f6 !important;
  color: #078b78 !important;
}

.overview-metric,
.selection-brief,
.execution-box,
.mini-metric,
.detail-price-card,
.account-profile-grid span,
.source-health-card,
.research-workflow-step,
.agent-key-metric-card,
.screener-decision-strip span {
  border-color: #dce9eb !important;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfb 100%) !important;
  box-shadow: 0 6px 18px rgba(7, 35, 48, .045) !important;
}

.positive,
.up,
.price-up,
.change-up {
  color: #00a86b !important;
}

.negative,
.down,
.price-down,
.change-down,
.risk {
  color: var(--pd-red) !important;
}

.screener-strategy-card,
.detail-origin-card {
  border-color: rgba(7, 168, 137, .24) !important;
  background: linear-gradient(180deg, #ffffff 0%, #f1fbf8 100%) !important;
}

.screener-result-card,
.mobile-stock-card,
.mobile-watch-row,
.agent-stock-card {
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease !important;
}

.screener-result-card:hover,
.mobile-stock-card:hover,
.mobile-watch-row:hover,
.agent-stock-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--pd-shadow) !important;
  border-color: rgba(7, 168, 137, .24) !important;
}

@media (max-width: 820px) {
  body {
    background: linear-gradient(180deg, #ffffff 0%, #f5fbfa 48%, #eaf6f5 100%) !important;
  }

  .app-shell {
    padding-bottom: calc(78px + env(safe-area-inset-bottom)) !important;
  }

  .mobile-screen {
    gap: 12px !important;
  }

  .mobile-nav {
    border-radius: 20px 20px 0 0 !important;
    padding-top: 6px !important;
  }

  .mobile-nav button,
  .mobile-nav .nav-button {
    min-height: 54px !important;
    border-radius: 14px !important;
  }

  .mobile-nav button.active,
  .mobile-nav .nav-button.active {
    background: transparent !important;
    box-shadow: none !important;
    color: var(--pd-green) !important;
  }

  .mobile-page-title,
  .mobile-hero-search,
  .mobile-section,
  .mobile-stock-card,
  .mobile-watch-row,
  .mobile-report-card,
  .screener-result-card {
    border-radius: 16px !important;
  }

  .mobile-stock-list {
    gap: 10px !important;
  }

  .product-market-switch,
  .mobile-segmented {
    background: transparent !important;
    box-shadow: none !important;
  }

  .agent-prompt-row .action-button,
  .screener-run {
    min-height: 46px !important;
  }

  .mobile-detail-bar {
    box-shadow: 0 -14px 30px rgba(7, 35, 48, .12) !important;
  }
}

/* Product Design polish layer: bright consumer finance app */
:root,
:root[data-theme="light"] {
  --base: #f6faf9;
  --base-2: #eef7f6;
  --surface: #ffffff;
  --surface-2: #f8fbfb;
  --surface-3: #eef5f5;
  --text: #061a2a;
  --muted: #667789;
  --faint: #91a0ad;
  --line: #dce9eb;
  --accent: #08a88f;
  --accent-strong: #00b894;
  --accent-soft: rgba(0, 184, 148, .11);
  --blue: #2d8cff;
  --blue-soft: rgba(45, 140, 255, .10);
  --warning: #c77900;
  --radius: 16px;
  --shadow-card: 0 12px 32px rgba(8, 35, 48, .07);
  --shadow-soft: 0 6px 18px rgba(8, 35, 48, .055);
  --shadow-float: 0 18px 48px rgba(8, 35, 48, .12);
}

html {
  background: linear-gradient(180deg, #ffffff 0%, #f3faf9 42%, #eef7f6 100%);
}

body {
  background:
    radial-gradient(circle at 18% 0%, rgba(0, 184, 148, .08), transparent 26%),
    linear-gradient(180deg, #ffffff 0%, #f5fbfa 48%, #edf7f7 100%) !important;
  color: var(--text);
  letter-spacing: 0;
}

.sidebar,
.topbar,
.mobile-nav {
  background: rgba(255, 255, 255, .86) !important;
  border-color: rgba(194, 216, 220, .76) !important;
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 32px rgba(8, 35, 48, .055);
}

.sidebar {
  border-radius: 0 18px 18px 0;
}

.brand-mark {
  border-radius: 12px !important;
  background: linear-gradient(145deg, #dff8e7, #9be7c9) !important;
  color: #026d5d !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 10px 20px rgba(0, 184, 148, .16);
}

.nav-button {
  border-radius: 12px !important;
  color: #52697b !important;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.nav-button:hover,
.nav-button.active {
  background: linear-gradient(180deg, #ecfbf7 0%, #e5f6f8 100%) !important;
  color: #06483f !important;
}

.nav-button.active {
  box-shadow: inset 3px 0 0 var(--accent), 0 8px 18px rgba(0, 184, 148, .08) !important;
}

.nav-icon {
  color: var(--accent) !important;
}

.search,
.global-search,
#globalSearch,
.mobile-search-pill,
.mobile-hero-search input,
.screener-input input,
.agent-prompt-row textarea,
.risk-settings input,
.custom-stock-form input {
  border-color: #d7e7ea !important;
  background: #f6f9fa !important;
  color: var(--text) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}

.search:focus-within,
.mobile-hero-search.focused,
.screener-input:focus-within,
.agent-prompt-row textarea:focus {
  border-color: rgba(0, 184, 148, .48) !important;
  box-shadow: 0 0 0 4px rgba(0, 184, 148, .10) !important;
}

.overview-main,
.module-panel,
.settings-panel,
.settings-card,
.stat-card,
.index-card,
.quote-card,
.pick-card,
.tracking-table,
.ledger-item,
.history-card,
.review-card,
.universe-card,
.universe-status-panel,
.search-result-panel,
.watchlist-panel,
.today-route-panel,
.alert-panel,
.market-overview,
.screener-workbench,
.agent-ask-panel,
.detail-card,
.detail-hero,
.detail-kline-card,
.deep-module-card,
.data-hub-section,
.account-profile-panel,
.source-health-panel,
.mobile-stock-card,
.mobile-watch-row,
.mobile-report-card,
.mobile-market-entry,
.screener-result-card,
.agent-summary-card,
.agent-verdict-card,
.agent-source-digest,
.agent-text-list {
  border-color: rgba(201, 223, 226, .86) !important;
  background: rgba(255, 255, 255, .92) !important;
  box-shadow: var(--shadow-soft) !important;
}

.overview-main,
.screener-workbench,
.agent-ask-panel,
.detail-hero,
.account-profile-panel {
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,253,252,.94)) !important;
  box-shadow: var(--shadow-card) !important;
}

.section-head h2,
.panel-head h2,
.mobile-page-title h2,
.mobile-hero-search h2,
.detail-hero h2,
.agent-ask-hero h3,
.screener-hero h3 {
  color: #061a2a !important;
  letter-spacing: 0;
}

.eyebrow {
  color: #6c8290 !important;
  letter-spacing: .08em !important;
}

.action-button,
.screener-run,
.agent-prompt-row .action-button,
.mobile-detail-bar .action-button {
  border: 0 !important;
  background: linear-gradient(135deg, #10cfa5 0%, #08a88f 100%) !important;
  color: #fff !important;
  box-shadow: 0 12px 24px rgba(0, 184, 148, .24) !important;
}

.action-button:hover,
.screener-run:hover,
.agent-prompt-row .action-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(0, 184, 148, .28) !important;
}

.mini-button,
.filter-button,
.chip,
.sort-button,
.screener-chip,
.screener-control-group button,
.mobile-segmented button,
.mobile-market-tabs button,
.agent-quick-grid button {
  border-color: #d7e7ea !important;
  background: #ffffff !important;
  color: #314b5e !important;
  box-shadow: 0 4px 12px rgba(8, 35, 48, .035);
}

.mini-button:hover,
.filter-button:hover,
.chip:hover,
.screener-chip:hover,
.screener-control-group button:hover,
.agent-quick-grid button:hover {
  border-color: rgba(0, 184, 148, .38) !important;
  background: #effbf8 !important;
}

.filter-button.active,
.chip.active,
.sort-button.active,
.screener-chip.active,
.screener-control-group button.active,
.mobile-segmented button.active,
.mobile-market-tabs button.active {
  border-color: rgba(0, 184, 148, .55) !important;
  background: linear-gradient(180deg, #eafbf6 0%, #f7fdfb 100%) !important;
  color: #00846f !important;
  box-shadow: inset 0 -2px 0 var(--accent), 0 8px 18px rgba(0, 184, 148, .10) !important;
}

.positive,
.up,
.price-up,
.change-up {
  color: #00a86b !important;
}

.negative,
.down,
.price-down,
.change-down,
.risk {
  color: #f04452 !important;
}

.market-pill,
.signal,
.trade-type,
.risk-tag,
.capability-chip,
.agent-template-badge,
.screener-source-pill,
.agent-state {
  border-color: rgba(0, 184, 148, .18) !important;
  background: #edf9f6 !important;
  color: #078b78 !important;
}

.overview-metric,
.selection-brief,
.execution-box,
.mini-metric,
.detail-price-card,
.detail-status-chip,
.account-profile-grid span,
.source-health-card,
.research-workflow-step,
.agent-key-metric-card,
.screener-decision-strip span {
  border-color: #dce9eb !important;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfb 100%) !important;
  box-shadow: 0 6px 18px rgba(8, 35, 48, .04) !important;
}

.mobile-nav {
  border-radius: 18px 18px 0 0;
  padding-top: 5px !important;
}

.mobile-nav button,
.mobile-nav .nav-button {
  min-height: 54px;
  border-radius: 12px !important;
}

.mobile-nav button.active,
.mobile-nav .nav-button.active {
  background: transparent !important;
  box-shadow: none !important;
  color: var(--accent) !important;
}

.mobile-nav button.active svg,
.mobile-nav .nav-button.active svg {
  filter: drop-shadow(0 6px 10px rgba(0, 184, 148, .20));
}

.mobile-detail-bar {
  background: rgba(255,255,255,.92) !important;
  border-color: rgba(201,223,226,.86) !important;
  box-shadow: 0 -12px 28px rgba(8, 35, 48, .10) !important;
  backdrop-filter: blur(18px);
}

.screener-strategy-card,
.research-workflow-card,
.detail-origin-card {
  border-color: rgba(0, 184, 148, .22) !important;
  background: linear-gradient(180deg, #ffffff 0%, #f3fbf8 100%) !important;
}

.screener-result-card:hover,
.mobile-stock-card:hover,
.mobile-watch-row:hover,
.agent-stock-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-card) !important;
}

@media (max-width: 820px) {
  body {
    background: linear-gradient(180deg, #ffffff 0%, #f4fbfa 54%, #edf7f7 100%) !important;
  }

  .app-shell {
    padding-bottom: calc(76px + env(safe-area-inset-bottom)) !important;
  }

  .mobile-screen {
    gap: 12px;
  }

  .mobile-page-title,
  .mobile-hero-search,
  .mobile-section {
    border-radius: 16px !important;
  }

  .mobile-page-title {
    background: rgba(255,255,255,.78);
  }

  .mobile-stock-card,
  .mobile-watch-row,
  .mobile-report-card,
  .screener-result-card {
    border-radius: 14px !important;
  }

  .mobile-stock-list {
    gap: 10px !important;
  }

  .product-market-switch,
  .mobile-segmented {
    background: transparent !important;
    box-shadow: none !important;
  }

  .account-profile-actions {
    gap: 8px !important;
  }

  .agent-prompt-row .action-button,
  .screener-run {
    min-height: 46px !important;
  }
}

.account-profile-panel {
  border: 1px solid rgba(10, 166, 166, .18);
  background: linear-gradient(180deg, #ffffff 0%, #f7fcfb 100%);
  box-shadow: 0 14px 34px rgba(8, 24, 38, .06);
}

.account-profile-panel h3 {
  margin: 4px 0 6px;
  color: var(--text);
}

.account-profile-warning {
  margin-top: 8px;
  color: var(--warning, #b96a00);
  font-weight: 700;
}

.account-profile-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.account-profile-grid span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.account-profile-grid strong {
  overflow: hidden;
  color: var(--text);
  font-size: 1.05rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-profile-grid em {
  color: var(--muted);
  font-style: normal;
  font-size: .78rem;
}

.account-profile-actions {
  align-items: center;
}

@media (max-width: 820px) {
  .mobile-account-profile {
    margin: 0;
    border-radius: 16px;
  }

  .mobile-profile-page {
    display: grid;
    gap: 12px;
  }

  .product-market-switch {
    position: static !important;
    top: auto !important;
    z-index: auto !important;
    margin: 0 0 10px !important;
    border-bottom: 1px solid var(--line);
    background: transparent !important;
    box-shadow: none !important;
  }

  .product-market-title {
    margin-top: 0;
  }

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

  .account-profile-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .account-profile-actions .action-button {
    grid-column: 1 / -1;
  }
}

/* Final UI repair layer: keeps the market page and detail page from old CSS regressions. */
@media (max-width: 820px) {
  .mobile-screen.mobile-market-page {
    padding-top: 0 !important;
  }

  .mobile-screen.mobile-market-page .mobile-section:first-child {
    position: sticky;
    top: 58px;
    z-index: 16;
    margin: 0 -12px 10px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .97);
    padding: 8px 12px 10px;
    backdrop-filter: blur(16px);
  }

  .mobile-market-tabs {
    position: static !important;
    z-index: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .mobile-screen.mobile-market-page .mobile-segmented {
    position: static !important;
    top: auto !important;
    z-index: auto !important;
    margin: 0 0 10px !important;
  }

  .mobile-stock-list {
    padding-top: 0 !important;
  }

  .mobile-stock-card,
  .mobile-watch-row {
    position: relative;
    z-index: 1;
  }

  .detail-reading-layout,
  .detail-reading-main {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: 100% !important;
  }

  .detail-action-rail {
    position: static !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: 100% !important;
  }

  .detail-hero,
  .detail-card,
  .detail-kline-card,
  .detail-action-rail .decision-panel {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 14px !important;
  }

  .detail-card-head {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }

  .detail-hero-main,
  .detail-hero-meta,
  .kline-stat-grid,
  .research-summary-grid,
  .deep-module-grid,
  .deep-metric-row,
  .plan-grid.vertical,
  .data-module-grid {
    grid-template-columns: 1fr !important;
  }

  .detail-price-card {
    width: 100% !important;
    min-width: 0 !important;
    text-align: left !important;
  }

  .detail-desktop-actions {
    display: none !important;
  }
}

@media (min-width: 821px) {
  .workspace.detail-page {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .workspace.detail-page .module-panel {
    width: min(1180px, 100%) !important;
    max-width: 1180px !important;
    margin: 0 auto !important;
    overflow: visible !important;
  }

  .workspace.detail-page .stock-detail-page,
  .workspace.detail-page .detail-sticky,
  .workspace.detail-page .detail-reading-layout {
    width: 100% !important;
    max-width: 100% !important;
  }

  .workspace.detail-page .detail-reading-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px) !important;
    gap: 16px !important;
  }

  .workspace.detail-page .detail-action-rail {
    position: sticky !important;
    top: 92px !important;
    align-self: start !important;
  }
}

/* Final detail-page overrides for the C-end redesign. */
.detail-sticky .detail-title,
.detail-sticky .quote-card {
  display: none;
}

.detail-sticky .detail-section {
  border-top: 0;
}

.detail-sticky .detail-card {
  border-top: 1px solid #dde9ee;
}

.detail-reading-layout .data-hub-section,
.detail-reading-layout .detail-card,
.detail-reading-layout .detail-kline-card {
  background: #fff;
}

.detail-reading-layout .kline-preview {
  border-radius: 16px;
}

.detail-reading-layout .deep-module-card {
  background: #fff;
}

@media (min-width: 1021px) {
  .workspace.detail-page .module-panel {
    max-width: 1180px;
    margin: 0 auto;
  }

  .detail-reading-main .deep-module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .detail-reading-layout,
  .detail-reading-main {
    gap: 12px !important;
  }

  .detail-action-rail {
    display: contents;
  }

  .detail-action-rail .decision-panel {
    order: 8;
  }

  .detail-action-rail .detail-card.compact {
    order: 9;
  }

  .detail-hero {
    margin-top: 4px;
  }

  .detail-hero-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .detail-hero-meta span,
  .detail-status-chip {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .detail-kline-card .kline-chart {
    height: 128px !important;
  }

  .mobile-detail-bar {
    grid-template-columns: 1fr 1.35fr !important;
  }
}

@media (max-width: 390px) {
  .detail-hero-meta {
    grid-template-columns: 1fr !important;
  }
}

/* Mobile color match: keep this as the final mobile palette override. */
@media (max-width: 820px) {
  :root,
  :root[data-theme="light"] {
    color-scheme: light;
    --bg: #ffffff;
    --base: #ffffff;
    --surface: #ffffff;
    --surface-2: #f6fafb;
    --surface-3: #f1f3f5;
    --line: #edf2f4;
    --line-strong: #dde9ee;
    --text: #081826;
    --muted: #6f7f8d;
    --faint: #8a97a3;
    --accent: #0aa6a6;
    --accent-strong: #08a8b2;
    --accent-soft: rgba(10, 166, 166, .10);
    --green: #00a86b;
    --green-soft: rgba(0, 168, 107, .10);
    --red: #f04452;
    --red-soft: rgba(240, 68, 82, .10);
    --blue: #2c7fae;
    --blue-soft: rgba(44, 127, 174, .10);
    --shadow: 0 8px 18px rgba(15, 42, 55, .055);
  }

  html,
  body {
    background: #ffffff !important;
  }

  body {
    color: var(--text) !important;
    font-family: "Bahnschrift", "Segoe UI", "Microsoft YaHei", sans-serif !important;
  }

  .app-shell {
    background: linear-gradient(180deg, #ffffff 0%, #ffffff 30%, #f6fafb 100%) !important;
  }

  .workspace {
    max-width: 420px !important;
    padding: 14px 12px calc(92px + env(safe-area-inset-bottom)) !important;
  }

  .mobile-screen {
    gap: 13px !important;
  }

  .mobile-app-header {
    padding: 0 0 2px !important;
  }

  .mobile-app-header h1 {
    color: var(--text) !important;
    font-size: 25px !important;
    font-weight: 950 !important;
  }

  .mobile-bell {
    width: 40px !important;
    height: 40px !important;
    background: #ffffff !important;
    border: 1px solid #e7eef2 !important;
    box-shadow: 0 6px 14px rgba(15, 42, 55, .05) !important;
  }

  .mobile-bell::before {
    border-color: var(--text) !important;
  }

  .mobile-bell::after {
    background: var(--red) !important;
  }

  .mobile-search-pill,
  .mobile-search-box {
    min-height: 42px !important;
    border: 0 !important;
    border-radius: 9px !important;
    background: #f1f3f5 !important;
    color: #8a97a3 !important;
    box-shadow: none !important;
  }

  .mobile-search-icon {
    border-color: #a1adb7 !important;
  }

  .mobile-search-icon::after {
    background: #a1adb7 !important;
  }

  .mobile-market-tabs,
  .mobile-segmented {
    min-height: 39px !important;
    gap: 24px !important;
    border-bottom: 1px solid #edf2f4 !important;
  }

  .mobile-market-tabs button,
  .mobile-segmented button {
    color: #6f7f8d !important;
    font-size: 15px !important;
    font-weight: 900 !important;
  }

  .mobile-market-tabs button.active,
  .mobile-segmented button.active {
    color: var(--accent-strong) !important;
  }

  .mobile-market-tabs button.active::after,
  .mobile-segmented button.active::after {
    height: 3px !important;
    background: var(--accent-strong) !important;
  }

  .mobile-section-title {
    margin-bottom: 10px !important;
  }

  .mobile-section-title h2 {
    color: var(--text) !important;
    font-size: 17px !important;
    font-weight: 950 !important;
  }

  .mobile-section-title span,
  .mobile-section-title button {
    color: #8a97a3 !important;
    font-size: 12px !important;
    font-weight: 800 !important;
  }

  .mobile-index-grid {
    gap: 8px !important;
  }

  .mobile-index-card {
    min-height: 126px !important;
    border: 1px solid #dde9ee !important;
    border-radius: 7px !important;
    background: #ffffff !important;
    box-shadow: 0 6px 14px rgba(15, 42, 55, .045) !important;
    padding: 11px 9px !important;
  }

  .mobile-index-card span {
    color: #344655 !important;
    font-size: 12px !important;
    font-weight: 850 !important;
  }

  .mobile-index-card strong {
    color: var(--green) !important;
    font-size: clamp(16px, 4.3vw, 18px) !important;
  }

  .mobile-index-card em {
    color: var(--green) !important;
    font-size: 11px !important;
  }

  .mobile-sparkline {
    color: #22bd80 !important;
  }

  .mobile-sparkline.down,
  .down {
    color: var(--red) !important;
  }

  .up {
    color: var(--green) !important;
  }

  .mobile-quick-grid {
    gap: 7px !important;
    padding: 6px 0 8px !important;
  }

  .mobile-quick-grid button {
    color: #475b68 !important;
    font-size: 11px !important;
    font-weight: 850 !important;
  }

  .mobile-quick-grid span {
    width: 29px !important;
    height: 29px !important;
    border-radius: 8px !important;
    background: var(--accent-strong) !important;
    color: #ffffff !important;
    box-shadow: 0 6px 12px rgba(8, 168, 178, .18) !important;
  }

  .mobile-watch-preview,
  .mobile-research-preview {
    border-top: 8px solid #f6fafb !important;
    padding-top: 14px !important;
  }

  .mobile-watch-list {
    gap: 0 !important;
    border-radius: 0 !important;
    background: #ffffff !important;
  }

  .mobile-watch-row {
    min-height: 62px !important;
    border-radius: 0 !important;
    border: 0 !important;
    border-bottom: 1px solid #edf2f4 !important;
    background: #ffffff !important;
    box-shadow: none !important;
    padding: 8px 0 !important;
  }

  .mobile-watch-row:last-child {
    border-bottom: 0 !important;
  }

  .mobile-watch-name strong {
    color: var(--text) !important;
    font-size: 15px !important;
  }

  .mobile-watch-name span {
    color: #9aa5af !important;
    font-size: 11px !important;
  }

  .mobile-watch-price strong {
    font-size: 14px !important;
  }

  .mobile-watch-price span {
    font-size: 11px !important;
  }

  .mobile-report-list {
    gap: 8px !important;
  }

  .mobile-report-card {
    border: 1px solid #dde9ee !important;
    border-radius: 7px !important;
    background: #ffffff !important;
    box-shadow: 0 6px 14px rgba(15, 42, 55, .045) !important;
    padding: 12px !important;
  }

  .mobile-report-card strong {
    color: var(--text) !important;
    font-size: 14px !important;
  }

  .mobile-report-card span {
    color: #8a97a3 !important;
  }

  .mobile-nav {
    border-top: 1px solid #edf2f4 !important;
    background: rgba(255, 255, 255, .98) !important;
    box-shadow: 0 -8px 20px rgba(15, 42, 55, .055) !important;
  }

  .mobile-tab-button {
    color: #8b98a6 !important;
    background: transparent !important;
    box-shadow: none !important;
    font-weight: 850 !important;
  }

  .mobile-tab-button.active {
    color: var(--accent-strong) !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .mobile-tab-icon {
    width: 28px !important;
    height: 26px !important;
    border-radius: 9px !important;
    background: transparent !important;
    color: #8b98a6 !important;
  }

  .mobile-tab-button.active .mobile-tab-icon {
    background: rgba(8, 168, 178, .10) !important;
    color: var(--accent-strong) !important;
  }

  .mobile-tab-icon svg {
    width: 21px !important;
    height: 21px !important;
    stroke: currentColor !important;
    stroke-width: 2 !important;
  }

  .mobile-stock-row,
  .mobile-watch-card,
  .mobile-metric {
    border: 1px solid #edf2f4 !important;
    background: #ffffff !important;
    box-shadow: none !important;
  }
}

/* Mobile A polish: app-like first screen, matching the bright professional direction. */
@media (max-width: 820px) {
  :root {
    color-scheme: light;
    --bg: #f7fbfd;
    --base: #ffffff;
    --surface: #ffffff;
    --surface-2: #f4f7f9;
    --surface-3: #edf5f7;
    --line: #e6eef2;
    --line-strong: #d5e3e9;
    --text: #121f2c;
    --muted: #71808d;
    --faint: #9aa9b3;
    --accent: #12a8b5;
    --accent-strong: #0798a6;
    --accent-soft: rgba(18, 168, 181, .12);
    --green: #13b981;
    --red: #f04452;
    --shadow: 0 10px 26px rgba(31, 75, 94, .09);
  }

  body {
    background:
      linear-gradient(180deg, #ffffff 0%, #f7fbfd 38%, #eef8fa 100%) !important;
    color: var(--text) !important;
  }

  .topbar {
    display: none !important;
  }

  .app-shell {
    min-height: 100vh !important;
    padding: 0 0 calc(76px + env(safe-area-inset-bottom)) !important;
    background: transparent !important;
  }

  .workspace {
    width: 100% !important;
    max-width: 440px !important;
    margin: 0 auto !important;
    padding: 16px 14px 20px !important;
  }

  .module-panel,
  .mobile-screen {
    padding: 0 !important;
    gap: 14px !important;
  }

  .mobile-app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 2px 4px;
  }

  .mobile-app-header h1 {
    margin: 0;
    color: #12202c;
    font-size: 24px;
    font-weight: 950;
    line-height: 1.12;
    letter-spacing: 0;
  }

  .mobile-app-kicker {
    display: none;
  }

  .mobile-bell {
    position: relative;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 19px;
    background: #fff;
    box-shadow: inset 0 0 0 1px var(--line), 0 8px 18px rgba(23, 63, 82, .08);
  }

  .mobile-bell::before {
    content: "";
    position: absolute;
    left: 12px;
    top: 9px;
    width: 12px;
    height: 14px;
    border: 2px solid #142330;
    border-bottom: 0;
    border-radius: 9px 9px 5px 5px;
  }

  .mobile-bell::after {
    content: "1";
    position: absolute;
    right: 6px;
    top: 5px;
    min-width: 14px;
    height: 14px;
    border-radius: 7px;
    background: var(--red);
    color: #fff;
    font-size: 9px;
    font-weight: 900;
    line-height: 14px;
  }

  .mobile-search-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 42px;
    border: 0;
    border-radius: 10px;
    background: #f0f3f6;
    color: #909aa5;
    padding: 0 13px;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
  }

  .mobile-search-icon {
    position: relative;
    width: 15px;
    height: 15px;
    border: 2px solid #a7b1ba;
    border-radius: 50%;
    flex: 0 0 auto;
  }

  .mobile-search-icon::after {
    content: "";
    position: absolute;
    right: -6px;
    bottom: -4px;
    width: 7px;
    height: 2px;
    border-radius: 2px;
    background: #a7b1ba;
    transform: rotate(45deg);
  }

  .mobile-market-tabs {
    display: flex;
    align-items: flex-end;
    gap: 22px;
    min-height: 38px;
    border-bottom: 1px solid var(--line);
  }

  .mobile-market-tabs button {
    position: relative;
    min-height: 38px;
    border: 0;
    background: transparent;
    color: #7c8792;
    padding: 0 0 10px;
    font-size: 15px;
    font-weight: 900;
  }

  .mobile-market-tabs button.active {
    color: var(--accent-strong);
  }

  .mobile-market-tabs button.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 3px;
    border-radius: 2px;
    background: var(--accent);
  }

  .mobile-segmented {
    display: flex !important;
    align-items: flex-end !important;
    gap: 22px !important;
    min-height: 38px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--line) !important;
    border-radius: 0 !important;
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
  }

  .mobile-segmented button {
    position: relative !important;
    min-height: 38px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #7c8792 !important;
    padding: 0 0 10px !important;
    font-size: 15px !important;
    font-weight: 900 !important;
    box-shadow: none !important;
  }

  .mobile-segmented button.active {
    color: var(--accent-strong) !important;
  }

  .mobile-segmented button.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 3px;
    border-radius: 2px;
    background: var(--accent);
  }

  .mobile-section {
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  .mobile-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
  }

  .mobile-section-title h2 {
    margin: 0;
    color: var(--text);
    font-size: 16px;
    font-weight: 950;
    letter-spacing: 0;
  }

  .mobile-section-title span,
  .mobile-section-title button {
    border: 0;
    background: transparent;
    color: #a0a9b1;
    font-size: 12px;
    font-weight: 800;
  }

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

  .mobile-index-card {
    min-height: 112px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(31, 75, 94, .07);
    padding: 10px 8px;
    overflow: hidden;
  }

  .mobile-index-card span {
    display: block;
    margin-bottom: 7px;
    color: #3a4854;
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-index-card strong {
    display: block;
    color: var(--green);
    font-size: clamp(15px, 4.2vw, 18px);
    font-weight: 950;
    line-height: 1.1;
  }

  .mobile-index-card em {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    font-style: normal;
    font-weight: 850;
  }

  .mobile-sparkline {
    width: 100%;
    height: 34px;
    margin-top: 7px;
    color: #5ccf96;
  }

  .mobile-sparkline.down,
  .down {
    color: var(--red) !important;
  }

  .up {
    color: var(--green) !important;
  }

  .mobile-quick-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    padding: 2px 0 4px;
  }

  .mobile-quick-grid button {
    min-width: 0;
    min-height: 58px;
    border: 0;
    background: transparent;
    color: #63717e;
    padding: 0;
    font-size: 11px;
    font-weight: 850;
  }

  .mobile-quick-grid span {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    margin: 0 auto 6px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 13px;
    line-height: 1;
    box-shadow: 0 8px 14px rgba(18, 168, 181, .22);
  }

  .mobile-quick-grid em {
    display: block;
    overflow: hidden;
    font-style: normal;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-watch-list,
  .mobile-report-list {
    display: grid;
    gap: 6px;
  }

  .mobile-watch-preview,
  .mobile-research-preview {
    border-top: 8px solid #f4f7f9 !important;
    padding-top: 14px !important;
  }

  .mobile-watch-row {
    display: grid;
    grid-template-columns: minmax(90px, 1fr) minmax(76px, .82fr) minmax(78px, .78fr);
    align-items: center;
    gap: 8px;
    min-height: 58px;
    border: 0;
    border-radius: 8px;
    background: #fff;
    padding: 8px 2px;
  }

  .mobile-watch-name {
    min-width: 0;
  }

  .mobile-watch-name strong {
    display: block;
    overflow: hidden;
    color: var(--text);
    font-size: 15px;
    font-weight: 950;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-watch-name span {
    display: block;
    margin-top: 3px;
    color: #9aa5ae;
    font-size: 11px;
    font-weight: 750;
  }

  .mobile-watch-row .mobile-sparkline {
    height: 34px;
    margin: 0;
  }

  .mobile-watch-price {
    min-width: 0;
    text-align: right;
  }

  .mobile-watch-price strong {
    display: block;
    overflow: hidden;
    font-size: 15px;
    font-weight: 950;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-watch-price span {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    font-weight: 850;
  }

  .mobile-report-card {
    display: block;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(31, 75, 94, .06);
    padding: 12px;
  }

  .mobile-report-card strong {
    display: block;
    color: var(--text);
    font-size: 14px;
    font-weight: 900;
    line-height: 1.45;
  }

  .mobile-report-card span {
    display: block;
    margin-top: 8px;
    color: #929da7;
    font-size: 12px;
    font-weight: 750;
  }

  .mobile-nav {
    height: auto !important;
    min-height: 66px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .96) !important;
    box-shadow: 0 -10px 28px rgba(31, 75, 94, .08) !important;
    padding: 7px 10px calc(7px + env(safe-area-inset-bottom)) !important;
    backdrop-filter: blur(18px);
  }

  .mobile-tab-button {
    gap: 3px !important;
    min-width: 0;
    min-height: 48px !important;
    border-radius: 8px !important;
    color: #798694 !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 11px !important;
    font-weight: 900 !important;
  }

  .mobile-tab-button.active {
    color: var(--accent-strong) !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .mobile-tab-icon {
    width: 24px !important;
    height: 22px !important;
    border-radius: 8px !important;
    background: transparent !important;
    color: inherit !important;
    font-size: 17px !important;
    line-height: 1 !important;
  }

  .mobile-tab-icon svg {
    width: 22px;
    height: 22px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .mobile-tab-button.active .mobile-tab-icon {
    background: transparent !important;
    color: var(--accent-strong) !important;
  }

  .mobile-hero-search {
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  .mobile-hero-search h2 {
    font-size: 22px !important;
    color: var(--text) !important;
  }

  .mobile-search-box {
    border: 0 !important;
    border-radius: 10px !important;
    background: #f0f3f6 !important;
    box-shadow: none !important;
  }

  .mobile-search-box span {
    display: none !important;
  }

  .mobile-search-box input {
    min-height: 42px !important;
    color: var(--text) !important;
    font-size: 14px !important;
  }

  .mobile-stock-row,
  .mobile-watch-card,
  .mobile-metric {
    border-radius: 8px !important;
    background: #fff !important;
    box-shadow: 0 8px 18px rgba(31, 75, 94, .06) !important;
  }

  .mobile-status-card,
  .mobile-market-entry-grid {
    display: none !important;
  }
}

/* Consumer mobile redesign: bright professional finance product */
:root[data-theme="light"] {
  --bg: #f6fbff;
  --base: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3f8fc;
  --surface-3: #e9f4fb;
  --line: #d8e7ef;
  --line-strong: #b6d1df;
  --text: #102a3a;
  --muted: #5c7180;
  --faint: #8aa0ad;
  --accent: #0aa37f;
  --accent-strong: #00bd8e;
  --accent-soft: rgba(10, 163, 127, .12);
  --blue: #247fd1;
  --blue-soft: rgba(36, 127, 209, .12);
  --shadow: 0 16px 42px rgba(24, 92, 128, .10);
}

:root {
  --consumer-radius: 8px;
  --touch: 44px;
}

body {
  background:
    radial-gradient(circle at 18% 0%, rgba(122, 213, 255, .20), transparent 28%),
    linear-gradient(180deg, var(--bg), #ffffff 55%, #f4fbff);
}

.topbar,
.sidebar,
.mobile-nav,
.detail-panel,
.module-panel,
.market-strip > *,
.overview-board,
.daily-recommendation-panel,
.settings-panel,
.quote-status-panel,
.market-board-panel,
.universe-card,
.watchlist-card,
.history-card,
.ledger-item,
.detail-section,
.quote-card,
.data-hub-section {
  border-radius: var(--consumer-radius);
}

.topbar {
  border-bottom: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
  background: color-mix(in srgb, var(--base) 90%, transparent);
}

.brand-mark,
.action-button,
.mobile-status-card,
.mobile-tab-button.active {
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
}

.action-button,
.danger-button,
.mini-button,
.filter-button,
.icon-button {
  min-height: 38px;
}

.mobile-screen {
  display: grid;
  gap: 14px;
}

.mobile-hero-search {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(176, 211, 226, .78);
  border-radius: 16px;
  background: linear-gradient(145deg, #ffffff, #edf9ff);
  padding: 16px;
  box-shadow: 0 12px 34px rgba(27, 111, 151, .10);
}

.mobile-hero-search h2,
.mobile-page-title h2 {
  margin: 4px 0 0;
  font-size: 24px;
  line-height: 1.12;
  letter-spacing: 0;
}

.mobile-search-box {
  display: grid;
  gap: 7px;
}

.mobile-search-box span {
  color: var(--faint);
  font-size: 11px;
  font-weight: 780;
}

.mobile-search-box input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}

.mobile-status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 16px 40px rgba(6, 139, 108, .22);
}

.mobile-status-card h2 {
  margin: 4px 0;
  font-size: 22px;
}

.mobile-status-card p,
.mobile-status-card .eyebrow {
  color: rgba(255, 255, 255, .82);
}

.mobile-status-card .mini-button {
  color: #0e513f;
  background: rgba(255, 255, 255, .92);
  border: 0;
}

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

.mobile-metric,
.mobile-section,
.mobile-watch-card,
.mobile-empty,
.mobile-page-title {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 10px 26px rgba(28, 93, 120, .08);
}

.mobile-metric {
  min-height: 94px;
  padding: 13px;
}

.mobile-metric span,
.mobile-stock-main span,
.mobile-market-entry small {
  color: var(--faint);
  font-size: 11px;
}

.mobile-metric strong {
  display: block;
  margin: 7px 0 4px;
  font-size: 18px;
}

.mobile-metric p,
.mobile-page-title p,
.mobile-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.mobile-section,
.mobile-page-title {
  padding: 14px;
}

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

.mobile-section-head h3,
.mobile-result-group h4 {
  margin: 3px 0 0;
  font-size: 17px;
}

.mobile-stock-list {
  display: grid;
  gap: 9px;
}

.mobile-stock-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 70px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.mobile-stock-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.mobile-stock-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.mobile-stock-price {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.mobile-stock-price b {
  font-size: 14px;
}

.mobile-stock-price em {
  font-style: normal;
  font-weight: 800;
  font-size: 12px;
}

.mobile-signal {
  grid-column: 1 / -1;
  justify-self: start;
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
}

.mobile-signal.buy,
.mobile-signal.ready,
.mobile-signal.connected {
  background: var(--green-soft);
  color: var(--green);
}

.mobile-signal.risk,
.mobile-signal.failed {
  background: var(--red-soft);
  color: var(--red);
}

.mobile-market-entry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.mobile-market-entry {
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #f3faff);
  color: var(--text);
  text-align: left;
  padding: 12px;
}

.mobile-market-entry span,
.mobile-market-entry strong,
.mobile-market-entry small {
  display: block;
}

.mobile-market-entry strong {
  margin: 7px 0 4px;
  font-size: 16px;
}

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

.mobile-segmented {
  position: static;
  top: auto;
  z-index: auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .94);
  padding: 6px;
  backdrop-filter: blur(14px);
}

.mobile-segmented button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.mobile-segmented button.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.mobile-result-group {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.mobile-empty {
  padding: 16px;
  text-align: center;
}

.mobile-detail-bar {
  display: none;
}

@media (min-width: 821px) {
  .mobile-nav {
    display: none;
  }
}

@media (max-width: 820px) {
  body {
    background: #f6fbff;
  }

  .topbar {
    min-height: auto;
    gap: 10px;
    padding: 14px 14px 10px;
  }

  .topbar-title {
    width: 100%;
  }

  .topbar h1 {
    font-size: 24px;
  }

  .toolbar {
    display: none;
  }

  .workspace {
    display: block;
    padding: 10px 12px calc(96px + env(safe-area-inset-bottom));
  }

  .market-strip,
  .module-toolbar,
  .detail-panel {
    display: none;
  }

  .module-panel {
    border: 0;
    background: transparent !important;
    box-shadow: none;
    padding: 0;
  }

  .stock-detail-page {
    padding-bottom: 88px;
  }

  .detail-sticky.standalone-detail {
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0 0 88px;
  }

  .detail-title,
  .quote-card,
  .detail-section,
  .data-hub-section,
  .kline-preview,
  .deep-module-card {
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(28, 93, 120, .08);
  }

  .detail-title {
    border: 1px solid var(--line);
    padding: 14px;
  }

  .quote-card strong {
    font-size: 30px;
  }

  .plan-grid.vertical,
  .deep-module-grid,
  .deep-metric-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .action-row.stacked {
    display: none;
  }

  .mobile-detail-bar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 40;
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 10px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .96);
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    backdrop-filter: blur(18px);
  }

  .mobile-detail-bar button {
    min-height: 48px;
  }

  .mobile-nav {
    inset: auto 0 0 0;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    border-width: 1px 0 0;
    border-radius: 0;
    background: rgba(255, 255, 255, .96);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -10px 30px rgba(21, 86, 112, .10);
  }

  .mobile-tab-button {
    display: grid;
    justify-items: center;
    gap: 3px;
    min-height: 54px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    font-weight: 760;
  }

  .mobile-tab-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--accent);
    font-size: 12px;
    font-weight: 900;
  }

  .mobile-tab-button.active {
    color: #fff;
    box-shadow: 0 8px 20px rgba(6, 139, 108, .18);
  }

  .mobile-tab-button.active .mobile-tab-icon {
    background: rgba(255, 255, 255, .22);
    color: #fff;
  }

  .trade-ticket {
    align-items: end;
    padding: 0;
  }

  .trade-ticket-card {
    width: 100%;
    max-width: none;
    max-height: min(82vh, 720px);
    border-radius: 18px 18px 0 0;
    border-width: 1px 0 0;
    padding: 16px;
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f8fcff;
  --base: #ffffff;
  --surface: #ffffff;
  --surface-2: #f0f8fc;
  --surface-3: #e1f0f6;
  --line: #cce2ec;
  --line-strong: #9cc6d7;
  --text: #12303b;
  --muted: #58717f;
  --faint: #8297a4;
  --accent: #13a881;
  --accent-strong: #10c695;
  --accent-soft: rgba(19, 168, 129, .12);
  --green: #16a66a;
  --green-soft: rgba(22, 166, 106, .13);
  --red: #e05252;
  --red-soft: rgba(224, 82, 82, .12);
  --blue: #2386d1;
  --blue-soft: rgba(35, 134, 209, .13);
  --amber: #f3b73f;
  --amber-soft: rgba(243, 183, 63, .18);
  --bg-mid: #e6f7ff;
  --shadow: 0 12px 28px rgba(36, 111, 148, .10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--bg), var(--bg-mid) 42%, var(--base));
  color: var(--text);
  letter-spacing: 0;
}

button,
input,
textarea { font: inherit; }
button { cursor: pointer; }

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

a { color: inherit; text-decoration: none; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--base) 92%, transparent);
  padding: 18px 14px;
  backdrop-filter: blur(18px);
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 4px 4px 10px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: #1d1608;
  font-size: 13px;
  font-weight: 900;
  box-shadow: inset 0 1px rgba(255, 255, 255, .35), 0 14px 32px rgba(215, 168, 79, .22);
}

.brand-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 780;
}

.brand-kicker,
.eyebrow,
.panel-label,
.stat-label {
  color: var(--faint);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav-button {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  padding: 10px 9px;
  text-align: left;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}

.nav-button:hover,
.nav-button.active {
  background: var(--surface-2);
  color: var(--text);
}

.nav-button.active { box-shadow: inset 3px 0 0 var(--accent); }
.nav-icon { color: var(--accent); font-weight: 900; text-align: center; }
.nav-count { color: var(--faint); font-size: 11px; }

.sidebar-panel {
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 13px;
}

.sidebar-panel strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 18px;
}

.sidebar-panel span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.app-shell {
  min-height: 100vh;
  margin-left: var(--sidebar);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 70px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--base) 90%, transparent);
  backdrop-filter: blur(18px);
}

.topbar h1,
.section-head h2,
.pick-card h3,
.universe-card h3,
.detail-title h2 {
  margin: 0;
  line-height: 1.05;
}

.topbar h1 { font-size: clamp(22px, 3vw, 34px); }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(360px, 36vw);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--faint);
  padding: 9px 11px;
}

.search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.search-suggest {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  width: min(440px, calc(100vw - 28px));
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 98%, transparent);
  box-shadow: var(--shadow);
}

.suggest-head,
.suggest-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.suggest-head strong {
  color: var(--text);
  font-size: 13px;
}

.suggest-head small {
  color: var(--faint);
  font-size: 11px;
}

.suggest-list {
  display: grid;
  max-height: 360px;
  overflow: auto;
}

.suggest-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
}

.suggest-item:hover {
  background: var(--surface-2);
}

.suggest-item span,
.suggest-item b,
.suggest-item small {
  display: block;
  min-width: 0;
}

.suggest-item b {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggest-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.suggest-item em {
  flex: 0 0 auto;
  font-style: normal;
  font-weight: 800;
}

.suggest-empty {
  display: grid;
  gap: 5px;
  padding: 14px 12px;
}

.suggest-empty b {
  color: var(--text);
  font-size: 13px;
}

.suggest-empty small {
  color: var(--muted);
  font-size: 12px;
}

.suggest-actions {
  border-top: 0;
  border-bottom: 0;
  background: color-mix(in srgb, var(--surface-2) 60%, transparent);
}

.suggest-actions button {
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 0;
}

.icon-button,
.mini-button,
.action-button,
.danger-button,
.filter-button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 9px 12px;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}

.icon-button {
  width: 40px;
  height: 40px;
  padding: 0;
}

.mini-button {
  color: var(--muted);
  background: var(--surface-2);
}

.action-button {
  color: #1d1608;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  border-color: transparent;
  font-weight: 760;
}

.danger-button {
  color: #fff8f5;
  background: linear-gradient(135deg, #df6a61, #ab403b);
  border-color: transparent;
  font-weight: 760;
}

.compact {
  padding: 7px 9px;
  font-size: 12px;
}

button:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

button:disabled {
  cursor: wait;
  opacity: .62;
  transform: none;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  padding: 18px 22px 0;
}

.content-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.market-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 12px;
}

.stat-card,
.pick-card,
.detail-panel,
.tracking-table,
.ledger-item,
.history-card,
.review-card,
.settings-card,
.settings-panel,
.universe-card,
.universe-status-panel,
.quote-card,
.search-result-panel,
.empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow);
}

.stat-card {
  padding: 14px;
  min-height: 106px;
}

.stat-card strong {
  display: block;
  margin: 10px 0 4px;
  font-size: 27px;
}

.stat-card p,
.section-head p,
.pick-card p,
.detail-section p,
.ledger-item p,
.settings-card p,
.settings-panel p,
.universe-card p,
.disclaimer p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.module-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.preference-group {
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
}

.filter-button {
  color: var(--muted);
  padding: 8px 11px;
}

.filter-button.active {
  color: var(--text);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
}

.module-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  padding: 8px 2px;
}

.section-head h2 {
  margin-top: 4px;
  font-size: clamp(22px, 3vw, 34px);
}

.section-head p {
  max-width: 520px;
  font-size: 13px;
}

.quote-status-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, .9fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow);
  padding: 14px;
}

.quote-status-panel.connected {
  border-color: color-mix(in srgb, var(--green) 34%, var(--line));
  background: color-mix(in srgb, var(--green-soft) 28%, var(--surface));
}

.quote-status-panel.local,
.quote-status-panel.loading {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 38%, var(--surface));
}

.quote-status-panel.warning {
  border-color: color-mix(in srgb, var(--red) 38%, var(--line));
  background: color-mix(in srgb, var(--red-soft) 32%, var(--surface));
}

.quote-status-copy {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.quote-badge {
  flex: 0 0 auto;
  min-width: 68px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 80%, transparent);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  padding: 6px 10px;
}

.quote-status-copy strong {
  display: block;
  margin-bottom: 4px;
  font-size: 18px;
}

.quote-status-copy p,
.quote-status-meta span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.quote-status-meta {
  display: grid;
  gap: 5px;
}

.quote-status-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.universe-status-panel {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 14px;
}

.universe-status-panel.connected {
  border-color: color-mix(in srgb, var(--green) 34%, var(--line));
  background: color-mix(in srgb, var(--green-soft) 24%, var(--surface));
}

.universe-status-panel.loading,
.universe-status-panel.local {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 28%, var(--surface));
}

.universe-status-panel strong {
  display: block;
  margin: 4px 0 5px;
  font-size: 18px;
}

.universe-status-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.search-result-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 34%, var(--surface));
}

.search-result-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.search-result-head h3 {
  margin: 4px 0 5px;
  font-size: 20px;
}

.search-result-head p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

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

.search-result-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.search-result-card {
  display: grid;
  gap: 6px;
  min-height: 118px;
  padding: 12px;
  text-align: left;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
}

.search-result-card strong {
  color: var(--text);
  font-size: 17px;
}

.search-result-card small {
  color: var(--muted);
  line-height: 1.45;
}

.search-result-card em {
  align-self: end;
  font-style: normal;
  font-weight: 800;
}

.search-result-empty {
  min-height: 96px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.search-result-empty strong {
  display: block;
  margin-bottom: 5px;
  color: var(--text);
}

.search-result-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

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

.daily-recommendation-panel {
  display: grid;
  gap: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line));
  border-radius: var(--radius);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 42%, var(--surface)), var(--surface));
  padding: 14px;
}

.daily-recommendation-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.daily-recommendation-head h3 {
  margin: 4px 0 0;
  font-size: 21px;
}

.daily-recommendation-head p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  text-align: right;
}

.today-route-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow);
  padding: 14px;
}

.market-board-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid color-mix(in srgb, var(--blue) 26%, var(--line));
  border-radius: var(--radius);
  background: linear-gradient(135deg, color-mix(in srgb, var(--blue-soft) 38%, var(--surface)), var(--surface));
  padding: 14px;
}

.market-board-panel strong {
  display: block;
  margin: 4px 0;
  font-size: 20px;
}

.market-board-panel p,
.market-board-panel small {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.global-pools-overview {
  display: grid;
  gap: 12px;
  border: 1px solid color-mix(in srgb, var(--blue) 18%, var(--line));
  border-radius: var(--radius);
  background: linear-gradient(180deg, color-mix(in srgb, #fff7da 42%, var(--surface)), var(--surface));
  padding: 14px;
  box-shadow: var(--shadow);
}

.global-pools-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.global-pools-head h3 {
  margin: 4px 0 0;
  font-size: 21px;
}

.global-pools-head p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  text-align: right;
}

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

.global-pool-card {
  min-width: 0;
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  padding: 12px;
}

.global-pool-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.global-pool-title > span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--blue-soft) 72%, white);
  color: var(--blue);
  font-weight: 900;
  font-size: 13px;
}

.global-pool-title strong,
.global-pool-title small {
  display: block;
}

.global-pool-title strong {
  font-size: 18px;
}

.global-pool-title small,
.global-pool-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.global-pool-card p {
  margin: 0;
}

.global-pool-list {
  display: grid;
  gap: 8px;
}

.global-pool-list button {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  padding: 9px 10px;
  cursor: pointer;
  text-align: left;
}

.global-pool-list button:hover {
  border-color: color-mix(in srgb, var(--blue) 42%, var(--line));
  background: color-mix(in srgb, var(--blue-soft) 32%, var(--surface));
}

.global-pool-list b,
.global-pool-list small {
  display: block;
}

.global-pool-list b {
  font-size: 13px;
}

.global-pool-list small,
.global-pool-empty {
  color: var(--muted);
  font-size: 11px;
}

.global-pool-list em {
  flex: 0 0 auto;
  font-style: normal;
  font-size: 12px;
}

.global-pool-empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.today-route-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 12px;
}

.today-route-head h3 {
  margin: 4px 0 0;
  font-size: 20px;
}

.today-route-head p {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: right;
}

.today-route-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.today-route-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 72%, transparent);
  padding: 11px;
}

.today-route-item.done {
  border-color: color-mix(in srgb, var(--green) 36%, var(--line));
  background: color-mix(in srgb, var(--green-soft) 30%, var(--surface));
}

.today-route-item > span {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.today-route-item.done > span {
  background: var(--green-soft);
  color: var(--green);
}

.today-route-item b,
.today-route-item strong,
.today-route-item small {
  display: block;
}

.today-route-item b {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
}

.today-route-item strong {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.today-route-item small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.today-route-item .mini-button {
  grid-column: 2;
  width: fit-content;
  margin-top: 2px;
  padding: 7px 10px;
}

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

.daily-progress-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  padding: 12px 14px;
}

.daily-progress-head strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.daily-progress-head > span {
  color: var(--muted);
  font-size: 12px;
}

.daily-review-panel {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(280px, 1.1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  padding: 15px;
}

.daily-review-panel.done {
  border-left-color: var(--green);
}

.daily-review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.daily-review-head h3 {
  margin: 3px 0 5px;
}

.daily-review-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.daily-review-head > span {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  padding: 6px 9px;
  font-size: 12px;
}

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

.daily-review-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.action-step {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  align-items: start;
  color: var(--text);
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  padding: 12px;
}

.action-step.done {
  border-color: color-mix(in srgb, var(--green) 36%, var(--line));
  background: color-mix(in srgb, var(--green-soft) 32%, var(--surface));
}

.action-step > span {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 900;
}

.action-step.done > span {
  background: var(--green-soft);
  color: var(--green);
}

.action-step strong {
  display: block;
  margin-bottom: 4px;
}

.action-step p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.daily-actions-footer {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface));
  padding: 12px 14px;
}

.daily-actions-footer strong {
  display: block;
  margin-bottom: 4px;
}

.daily-actions-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.daily-actions-footer button {
  flex: 0 0 auto;
}

.daily-actions-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.alert-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow);
  padding: 14px;
}

.alert-panel-head,
.alert-list {
  display: flex;
  gap: 10px;
}

.alert-panel-head {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.alert-panel-head strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.alert-panel-head > span {
  color: var(--muted);
  font-size: 12px;
}

.alert-list {
  flex-wrap: wrap;
}

.alert-item {
  flex: 1 1 210px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  padding: 10px;
  text-align: left;
}

.alert-item span {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 800;
}

.alert-item.risk span {
  color: var(--red);
  background: var(--red-soft);
}

.alert-item.positive span {
  color: var(--green);
  background: var(--green-soft);
}

.alert-item strong,
.alert-item b,
.alert-item em {
  display: block;
}

.alert-item b {
  margin-top: 7px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.alert-item.risk b {
  color: var(--red);
}

.alert-item.positive b {
  color: var(--green);
}

.alert-item strong {
  margin: 5px 0 3px;
}

.alert-item em,
.alert-empty {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.alert-empty {
  margin: 0;
}

.market-overview {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow);
  padding: 14px;
}

.market-overview.positive {
  border-color: color-mix(in srgb, var(--green) 34%, var(--line));
}

.market-overview.risk {
  border-color: color-mix(in srgb, var(--red) 34%, var(--line));
}

.market-overview-head,
.index-strip,
.index-card {
  display: flex;
  gap: 10px;
}

.market-overview-head {
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.market-overview-head strong {
  display: block;
  margin: 4px 0;
  font-size: 20px;
}

.market-overview-head p,
.market-overview-head > span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.market-overview-head > span {
  flex: 0 0 auto;
  max-width: 220px;
  text-align: right;
}

.index-strip {
  flex-wrap: wrap;
}

.index-card {
  flex: 1 1 150px;
  min-width: 0;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 10px;
}

.index-card span,
.index-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.index-card strong {
  font-size: 22px;
}

.breadth-panel {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 12px;
}

.breadth-panel.positive {
  border-color: color-mix(in srgb, var(--green) 38%, var(--line));
  background: color-mix(in srgb, var(--green-soft) 34%, var(--surface-2));
}

.breadth-panel.risk {
  border-color: color-mix(in srgb, var(--red) 38%, var(--line));
  background: color-mix(in srgb, var(--red-soft) 34%, var(--surface-2));
}

.breadth-panel strong {
  display: block;
  margin: 4px 0;
  font-size: 18px;
}

.breadth-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.breadth-panel > p {
  max-width: 280px;
  text-align: right;
}

.pick-card {
  position: relative;
  overflow: hidden;
  padding: 16px;
  min-height: 356px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pick-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--accent);
}

.pick-card.hk::before { background: var(--blue); }
.pick-card.ashare::before { background: var(--green); }

.pick-topline,
.ticker-row,
.action-row,
.detail-title,
.table-row,
.ledger-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.market-pill,
.signal,
.trade-type,
mark {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 780;
  background: var(--surface-2);
  color: var(--muted);
}

.signal.positive,
.trade-type.buy {
  color: var(--green);
  background: var(--green-soft);
}

.signal.risk,
.trade-type.sell {
  color: var(--red);
  background: var(--red-soft);
}

.ticker-row h3 { font-size: 30px; }
.ticker-row p { margin-top: 3px; font-size: 13px; }
.ticker-row strong { text-align: right; font-size: 18px; }
.ticker-row strong span { display: block; font-size: 13px; }

.up { color: var(--green); }
.down { color: var(--red); }

.strategy-line {
  color: var(--accent) !important;
  font-weight: 760;
}

.selection-brief,
.selection-detail,
.execution-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 11px;
}

.selection-brief span,
.execution-box span {
  display: block;
  color: var(--faint);
  font-size: 11px;
  font-weight: 780;
}

.selection-brief strong,
.execution-box strong,
.selection-detail strong {
  display: block;
  margin: 5px 0 4px;
}

.selection-brief p,
.selection-detail p,
.execution-box p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.selection-detail {
  margin-bottom: 10px;
}

.selection-detail ul {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding-left: 17px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.execution-box {
  margin: 10px 0;
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
}

.execution-box.positive {
  border-color: color-mix(in srgb, var(--green) 42%, var(--line));
  background: color-mix(in srgb, var(--green-soft) 38%, var(--surface-2));
}

.execution-box.risk {
  border-color: color-mix(in srgb, var(--red) 42%, var(--line));
  background: color-mix(in srgb, var(--red-soft) 38%, var(--surface-2));
}

.execution-line {
  border-left: 3px solid var(--accent);
  padding-left: 9px;
  font-size: 13px !important;
}

.insight-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.insight-row span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 5px 8px;
  font-size: 11px;
  line-height: 1.2;
}

.rationale {
  flex: 1;
  font-size: 14px;
}

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

.plan-grid.vertical {
  grid-template-columns: 1fr;
}

.mini-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 9px;
  min-width: 0;
}

.mini-metric small {
  color: var(--faint);
  font-size: 11px;
}

.mini-metric strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tracking-table {
  overflow: hidden;
}

.table-head,
.table-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr .9fr .8fr .65fr .9fr 1.1fr;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
}

.table-head {
  color: var(--faint);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: .1em;
  text-transform: uppercase;
  background: var(--surface-2);
}

.table-row {
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.table-row strong,
.ledger-item strong {
  display: block;
  color: var(--text);
}

.table-row small {
  display: block;
  margin-top: 3px;
  color: var(--faint);
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.ledger-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ledger-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  padding: 12px 14px;
}

.ledger-toolbar span {
  color: var(--muted);
  font-size: 12px;
}

.tracking-status-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  padding: 8px;
}

.tracking-status-controls > div {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tracking-status-controls span {
  color: var(--muted);
  font-size: 12px;
}

.watchlist-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  padding: 12px;
}

.watchlist-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.watchlist-head strong {
  display: block;
  margin-top: 4px;
  font-size: 17px;
}

.watchlist-head > span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

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

.watchlist-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 10px;
}

.watchlist-card strong {
  color: var(--text);
  font-size: 18px;
}

.watchlist-card p {
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watchlist-card em {
  font-style: normal;
  font-weight: 800;
}

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

.review-card {
  padding: 13px;
  box-shadow: none;
}

.review-card strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 24px;
}

.review-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.portfolio-risk-panel {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(320px, 1.4fr);
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  padding: 14px;
}

.portfolio-risk-panel.positive {
  border-left-color: var(--green);
}

.portfolio-risk-panel.warning {
  border-left-color: var(--amber);
}

.portfolio-risk-panel.risk {
  border-left-color: var(--red);
}

.portfolio-risk-copy strong {
  display: block;
  margin: 4px 0 5px;
  font-size: 18px;
}

.portfolio-risk-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

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

.ledger-item {
  padding: 13px;
}

.ledger-item > div {
  flex: 1;
  min-width: 0;
}

.ledger-item b {
  white-space: nowrap;
}

.ledger-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

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

.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-card {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 14px;
  padding: 14px;
}

.history-date strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
}

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

.history-pick {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  padding: 10px;
  text-align: left;
}

.history-pick span {
  color: var(--accent);
  font-weight: 800;
}

.history-pick strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-pick em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

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

.settings-card {
  padding: 14px;
  box-shadow: none;
}

.settings-card strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 24px;
}

.use-status-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(260px, 1.4fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  padding: 14px;
}

.use-status-panel.connected {
  border-left-color: var(--green);
}

.use-status-panel.warning {
  border-left-color: var(--red);
}

.use-status-panel.local {
  border-left-color: var(--amber);
}

.use-status-panel.loading {
  border-left-color: var(--accent);
}

.use-status-main h3 {
  margin: 3px 0 5px;
}

.use-status-main p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

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

.use-status-steps span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 9px 10px;
}

.use-status-steps b {
  color: var(--text);
  font-size: 13px;
}

.use-status-steps small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.use-status-steps .done {
  border-color: color-mix(in srgb, var(--green) 45%, var(--line));
}

.use-status-steps .todo {
  border-color: color-mix(in srgb, var(--amber) 45%, var(--line));
}

.use-status-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.settings-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px;
  box-shadow: none;
}

.settings-panel h3 {
  margin: 0 0 6px;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.service-launch-panel {
  align-items: flex-start;
}

.service-launch-steps {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.service-launch-steps span {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
  padding: 7px 9px;
  font-size: 12px;
  line-height: 1.35;
}

.risk-settings {
  display: grid;
  grid-template-columns: minmax(120px, 160px) minmax(110px, 140px) auto;
  gap: 8px;
  align-items: end;
}

.custom-stock-panel {
  align-items: flex-end;
}

.custom-stock-form {
  display: grid;
  grid-template-columns: 96px 120px 110px 120px 96px auto;
  gap: 8px;
  align-items: end;
}

.custom-stock-form label,
.risk-settings label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.custom-stock-form input,
.risk-settings input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  padding: 9px 10px;
  outline: 0;
}

.universe-card {
  padding: 14px;
}

.universe-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.universe-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.universe-card h3 {
  margin-top: 14px;
  font-size: 24px;
}

.score-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.score-row {
  display: grid;
  grid-template-columns: 72px 1fr 34px;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.score-row i {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.score-row b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.score-row.risk b {
  background: var(--red);
}

.detail-panel {
  align-self: start;
  min-width: 0;
  padding: 0;
}

.workspace.detail-page {
  grid-template-columns: minmax(0, 1fr);
}

.workspace.detail-page .detail-panel {
  display: none;
}

.stock-detail-page {
  display: grid;
  gap: 12px;
  width: min(980px, 100%);
  margin: 0 auto;
}

.detail-page-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-sticky {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
}

.detail-sticky.standalone-detail {
  position: static;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .12);
}

.detail-title h2 {
  font-size: 34px;
}

.detail-title p {
  margin: 4px 0 0;
  color: var(--muted);
}

.quote-card {
  padding: 14px;
  background: var(--surface-2);
  box-shadow: none;
}

.quote-card span,
.quote-card small {
  display: block;
  color: var(--faint);
}

.quote-card strong {
  display: block;
  margin: 6px 0;
  font-size: 30px;
}

.decision-panel {
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--line));
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 88%, transparent);
  padding: 13px;
}

.decision-panel.positive {
  border-color: color-mix(in srgb, var(--green) 42%, var(--line));
  border-left-color: var(--green);
}

.decision-panel.risk {
  border-color: color-mix(in srgb, var(--red) 42%, var(--line));
  border-left-color: var(--red);
}

.decision-panel strong {
  display: block;
  margin: 4px 0 5px;
  font-size: 18px;
}

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

.empty-state {
  display: grid;
  gap: 10px;
  align-content: center;
  min-height: 120px;
  padding: 20px;
  color: var(--muted);
}

.empty-state strong {
  color: var(--text);
  font-size: 15px;
}

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

.empty-state .mini-button {
  width: fit-content;
}

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

.decision-points span {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 8px;
}

.decision-points small,
.decision-points b {
  display: block;
}

.decision-points small {
  color: var(--faint);
  font-size: 11px;
}

.decision-points b {
  overflow: hidden;
  margin-top: 3px;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.decision-points .positive b {
  color: var(--green);
}

.decision-points .risk b {
  color: var(--red);
}

.detail-section {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.detail-section h3 {
  margin: 0 0 8px;
}

.data-hub-section code {
  display: block;
  overflow-wrap: anywhere;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.data-module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.data-module {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface-2) 84%, transparent);
  padding: 9px;
}

.data-module.ready {
  border-color: color-mix(in srgb, var(--green) 38%, var(--line));
  background: color-mix(in srgb, var(--green-soft) 28%, var(--surface));
}

.data-module.failed {
  border-color: color-mix(in srgb, var(--red) 34%, var(--line));
  background: color-mix(in srgb, var(--red-soft) 24%, var(--surface));
}

.data-module b,
.data-module small {
  display: block;
}

.data-module b {
  margin-bottom: 4px;
  font-size: 12px;
}

.data-module small {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.kline-preview {
  border: 1px solid color-mix(in srgb, var(--blue) 22%, var(--line));
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, white), color-mix(in srgb, var(--surface-2) 86%, white)),
    var(--surface);
  padding: 12px;
  margin: 10px 0 12px;
}

.kline-preview-head,
.kline-preview-foot,
.kline-preview.empty,
.kline-preview.loading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.kline-preview-head strong,
.kline-preview.empty strong,
.kline-preview.loading strong {
  display: block;
  margin-bottom: 3px;
  font-size: 13px;
}

.kline-preview-head span,
.kline-preview-foot,
.kline-preview.empty span,
.kline-preview.loading span,
.kline-preview.empty small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.kline-preview-head em {
  font-style: normal;
  font-weight: 800;
}

.kline-chart {
  display: block;
  width: 100%;
  height: 88px;
  margin: 8px 0;
}

.kline-chart polyline {
  fill: none;
  stroke: var(--green);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.kline-preview.down .kline-chart polyline {
  stroke: var(--red);
}

.kline-preview.empty,
.kline-preview.loading {
  background: color-mix(in srgb, var(--surface-2) 78%, transparent);
}

.kline-preview.empty small {
  overflow-wrap: anywhere;
  text-align: right;
}

.deep-module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.deep-module-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface-2) 88%, transparent);
  padding: 11px;
}

.deep-module-card.ready {
  border-color: color-mix(in srgb, var(--green) 26%, var(--line));
}

.deep-module-card.failed {
  border-color: color-mix(in srgb, var(--red) 32%, var(--line));
  background: color-mix(in srgb, var(--red-soft) 18%, var(--surface));
}

.deep-module-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.deep-module-head strong {
  font-size: 13px;
}

.deep-module-head span,
.deep-module-card p,
.deep-module-card small,
.deep-list span,
.deep-list em,
.deep-metric-row small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.deep-module-head span {
  max-width: 52%;
  overflow-wrap: anywhere;
  text-align: right;
}

.deep-module-card p {
  margin: 0 0 6px;
}

.deep-module-card small {
  display: block;
  overflow-wrap: anywhere;
}

.deep-metric-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.deep-metric-row span {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 7px;
}

.deep-metric-row small,
.deep-metric-row b {
  display: block;
}

.deep-metric-row b {
  overflow: hidden;
  margin-top: 3px;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.deep-list div {
  min-width: 0;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.deep-list div:first-child {
  border-top: 0;
  padding-top: 0;
}

.deep-list b,
.deep-list span,
.deep-list em {
  display: block;
}

.deep-list b {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deep-list span {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 3px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.deep-list em {
  margin-top: 3px;
  font-style: normal;
}

.note-input {
  width: 100%;
  resize: vertical;
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  padding: 10px 11px;
  line-height: 1.55;
  outline: 0;
}

.note-input::placeholder {
  color: var(--faint);
}

.note-save {
  width: 100%;
  margin-top: 9px;
}

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

.stacked button {
  width: 100%;
}

.empty-state {
  padding: 20px;
  color: var(--muted);
  box-shadow: none;
}

.disclaimer {
  margin-left: var(--sidebar);
  padding: 18px 22px 88px;
  color: var(--muted);
  font-size: 12px;
}

.mobile-nav {
  display: none;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 70;
  max-width: min(360px, calc(100vw - 32px));
  border: 1px solid color-mix(in srgb, var(--accent) 48%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  color: var(--text);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  font-size: 14px;
  backdrop-filter: blur(16px);
}

.toast[hidden],
.trade-ticket[hidden],
.onboarding[hidden] {
  display: none;
}

.trade-ticket {
  position: fixed;
  inset: 0;
  z-index: 78;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, .48);
  backdrop-filter: blur(10px);
}

.trade-ticket-card {
  width: min(560px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 18px;
}

.trade-ticket-head,
.trade-ticket-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.trade-ticket-head {
  align-items: flex-start;
  margin-bottom: 14px;
}

.trade-ticket-head h2 {
  margin: 5px 0 6px;
  font-size: 26px;
  line-height: 1.12;
}

.trade-ticket-head p,
.trade-ticket-risk {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.trade-ticket-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.trade-ticket-form label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.trade-ticket-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  padding: 10px 11px;
  outline: 0;
}

.trade-ticket-form input:focus {
  border-color: color-mix(in srgb, var(--accent) 56%, var(--line));
}

.trade-ticket-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.trade-ticket-note {
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 11px;
}

.trade-ticket-note.positive {
  border-color: color-mix(in srgb, var(--green) 42%, var(--line));
  background: color-mix(in srgb, var(--green-soft) 38%, var(--surface-2));
}

.trade-ticket-note.risk {
  border-color: color-mix(in srgb, var(--red) 42%, var(--line));
  background: color-mix(in srgb, var(--red-soft) 38%, var(--surface-2));
}

.trade-ticket-note strong {
  display: block;
  margin-bottom: 4px;
}

.trade-ticket-note p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.trade-ticket-actions {
  align-items: center;
  justify-content: flex-end;
  margin-top: 14px;
  flex-wrap: wrap;
}

.onboarding {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  display: block;
  width: min(460px, calc(100vw - 32px));
  background: transparent;
  pointer-events: none;
}

.onboarding-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 20px;
  pointer-events: auto;
}

.onboarding-card h2 {
  margin: 8px 0 10px;
  font-size: 26px;
  line-height: 1.18;
}

.onboarding-card p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.65;
}

.onboarding-card button {
  width: 100%;
}

.brand-mark {
  color: #06221c;
  box-shadow: none;
}

.sidebar {
  gap: 12px;
  padding: 14px 12px;
}

.brand {
  padding: 2px 2px 8px;
}

.brand-mark {
  width: 34px;
  height: 34px;
}

.nav-button {
  grid-template-columns: 22px 1fr auto;
  gap: 8px;
  padding: 8px;
}

.sidebar-panel {
  padding: 11px;
}

.topbar {
  min-height: 62px;
  padding: 12px 18px;
}

.topbar h1 {
  font-size: 24px;
}

.toolbar {
  gap: 8px;
}

.search {
  width: min(520px, 44vw);
  padding: 8px 10px;
}

.icon-button,
.mini-button,
.action-button,
.danger-button,
.filter-button {
  min-height: 36px;
  padding: 8px 11px;
}

.icon-button {
  width: 36px;
  height: 36px;
}

.action-button {
  color: #06221c;
  background: var(--accent-strong);
}

:root[data-theme="light"] .action-button {
  color: #fff;
  background: linear-gradient(135deg, #16c995, #0d9f78);
}

:root[data-theme="light"] body {
  background:
    linear-gradient(180deg, #fbfdff 0%, #e8f8ff 46%, #ffffff 100%);
}

:root[data-theme="light"] .sidebar,
:root[data-theme="light"] .topbar,
:root[data-theme="light"] .mobile-nav {
  background: rgba(255, 255, 255, .88);
}

:root[data-theme="light"] .brand-mark {
  background: linear-gradient(135deg, #ffe58a 0%, #37d39f 100%);
  color: #10333a;
}

:root[data-theme="light"] .nav-button:hover,
:root[data-theme="light"] .nav-button.active {
  background: #eaf8ff;
}

:root[data-theme="light"] .nav-button.active {
  box-shadow: inset 3px 0 0 #f3b73f;
}

:root[data-theme="light"] .search,
:root[data-theme="light"] .stat-card,
:root[data-theme="light"] .pick-card,
:root[data-theme="light"] .detail-panel,
:root[data-theme="light"] .tracking-table,
:root[data-theme="light"] .ledger-item,
:root[data-theme="light"] .history-card,
:root[data-theme="light"] .review-card,
:root[data-theme="light"] .settings-card,
:root[data-theme="light"] .settings-panel,
:root[data-theme="light"] .universe-card,
:root[data-theme="light"] .universe-status-panel,
:root[data-theme="light"] .quote-card,
:root[data-theme="light"] .search-result-panel,
:root[data-theme="light"] .empty-state,
:root[data-theme="light"] .overview-board,
:root[data-theme="light"] .watchlist-panel,
:root[data-theme="light"] .today-route-panel,
:root[data-theme="light"] .alert-panel,
:root[data-theme="light"] .market-overview {
  background: rgba(255, 255, 255, .92);
}

:root[data-theme="light"] .overview-main {
  border-color: #bfe7d7;
  background: linear-gradient(135deg, rgba(255, 230, 137, .42), rgba(224, 248, 255, .86));
}

:root[data-theme="light"] .overview-main.connected {
  border-color: #a8e1cf;
  background: linear-gradient(135deg, rgba(222, 249, 236, .92), rgba(229, 248, 255, .92));
}

:root[data-theme="light"] .overview-main.warning,
:root[data-theme="light"] .overview-main.risk {
  border-color: #ffc1bc;
  background: linear-gradient(135deg, rgba(255, 240, 226, .94), rgba(255, 247, 217, .72));
}

:root[data-theme="light"] .overview-metric,
:root[data-theme="light"] .index-card,
:root[data-theme="light"] .today-route-item,
:root[data-theme="light"] .selection-brief,
:root[data-theme="light"] .selection-detail,
:root[data-theme="light"] .execution-box,
:root[data-theme="light"] .mini-metric,
:root[data-theme="light"] .quote-card,
:root[data-theme="light"] .alert-item,
:root[data-theme="light"] .watchlist-card {
  background: linear-gradient(180deg, #ffffff, #f3fbff);
}

:root[data-theme="light"] .filter-button.active {
  background: rgba(255, 226, 120, .34);
  border-color: #e9bd42;
  color: #12303b;
}

:root[data-theme="light"] .mini-button {
  background: #eef8fd;
  color: #42616e;
}

:root[data-theme="light"] .market-pill,
:root[data-theme="light"] .signal,
:root[data-theme="light"] .trade-type,
:root[data-theme="light"] mark,
:root[data-theme="light"] .insight-row span {
  background: #edf8fc;
}

.workspace {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
  gap: 14px;
  padding: 14px 18px 0;
}

.content-column,
.module-panel {
  gap: 12px;
}

.market-strip {
  grid-template-columns: repeat(7, minmax(128px, 1fr));
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.stat-card,
.pick-card,
.detail-panel,
.tracking-table,
.ledger-item,
.history-card,
.review-card,
.settings-card,
.settings-panel,
.universe-card,
.universe-status-panel,
.quote-card,
.search-result-panel,
.empty-state,
.overview-board,
.global-pools-overview,
.overview-main,
.overview-metric,
.today-route-panel,
.alert-panel,
.market-overview {
  box-shadow: 0 8px 22px rgba(0, 0, 0, .16);
}

.stat-card {
  min-height: 78px;
  padding: 10px 12px;
}

.stat-card strong {
  margin: 6px 0 3px;
  font-size: 20px;
}

.stat-card p {
  font-size: 12px;
  line-height: 1.4;
}

.module-toolbar {
  align-items: center;
}

.filter-button {
  padding: 7px 10px;
}

.section-head {
  padding: 4px 2px;
}

.section-head h2 {
  font-size: 26px;
}

.overview-board {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  padding: 12px;
}

.agent-hub-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 44%, var(--line));
  border-left: 5px solid var(--accent);
  border-radius: var(--radius);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent-soft) 54%, var(--surface)), color-mix(in srgb, var(--blue-soft) 34%, var(--surface)));
  padding: 13px 14px;
}

.agent-hub-banner.warning {
  border-color: color-mix(in srgb, var(--amber) 54%, var(--line));
  border-left-color: var(--amber);
}

.agent-hub-banner.loading {
  border-color: color-mix(in srgb, var(--blue) 42%, var(--line));
  border-left-color: var(--blue);
}

.agent-hub-banner strong {
  display: block;
  margin: 4px 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.25;
}

.agent-hub-banner p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.agent-hub-badges {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.agent-hub-badges span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  color: var(--muted);
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 760;
  white-space: nowrap;
}

.overview-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent-soft) 38%, var(--surface));
  padding: 12px 14px;
}

.overview-main.connected {
  border-color: color-mix(in srgb, var(--green) 36%, var(--line));
  background: color-mix(in srgb, var(--green-soft) 30%, var(--surface));
}

.overview-main.warning,
.overview-main.risk {
  border-color: color-mix(in srgb, var(--red) 36%, var(--line));
  background: color-mix(in srgb, var(--red-soft) 28%, var(--surface));
}

.overview-main strong {
  display: block;
  margin: 4px 0;
  font-size: 20px;
}

.overview-main p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

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

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

.overview-metric {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 10px;
}

.overview-metric strong {
  display: block;
  overflow: hidden;
  margin: 6px 0 4px;
  color: var(--text);
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-metric p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.quote-status-panel,
.today-route-panel,
.market-board-panel,
.alert-panel,
.market-overview,
.daily-progress-head,
.daily-review-panel,
.use-status-panel,
.portfolio-risk-panel,
.ledger-toolbar,
.tracking-status-controls {
  box-shadow: none;
}

.quote-status-panel {
  grid-template-columns: minmax(0, 1.25fr) minmax(220px, .8fr) auto;
  padding: 12px;
}

.quote-badge {
  min-width: 60px;
}

.market-overview,
.today-route-panel,
.alert-panel {
  padding: 12px;
}

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

.index-card {
  flex: none;
  padding: 9px 10px;
}

.index-card strong {
  font-size: 20px;
}

.breadth-panel {
  margin-top: 10px;
  padding: 10px;
}

.today-route-list {
  gap: 8px;
}

.today-route-item {
  padding: 10px;
}

.daily-actions {
  gap: 8px;
}

.action-step {
  grid-template-columns: 28px 1fr;
  gap: 8px;
  padding: 10px;
}

.action-step > span {
  width: 28px;
  height: 28px;
}

.daily-actions-footer,
.daily-progress-head,
.daily-review-panel,
.use-status-panel {
  padding: 12px;
}

.pick-grid {
  gap: 10px;
}

.pick-card {
  min-height: 0;
  padding: 14px;
  gap: 10px;
}

.ticker-row h3 {
  font-size: 24px;
}

.ticker-row strong {
  font-size: 16px;
}

.selection-brief,
.selection-detail,
.execution-box {
  padding: 10px;
}

.selection-brief p,
.rationale,
.execution-line {
  font-size: 12px !important;
  line-height: 1.45;
}

.rationale {
  flex: 0;
}

.insight-row span {
  padding: 4px 7px;
}

.plan-grid {
  gap: 7px;
}

.mini-metric {
  padding: 8px;
}

.detail-sticky {
  top: 76px;
  max-height: calc(100vh - 90px);
  overflow: auto;
  gap: 12px;
  padding: 14px;
}

.detail-title h2 {
  font-size: 27px;
}

.quote-card strong {
  font-size: 26px;
}

.decision-points {
  gap: 7px;
}

.disclaimer {
  padding: 14px 18px 84px;
}

@media (max-width: 1120px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .detail-sticky {
    position: static;
    max-height: none;
  }

  .pick-grid,
  .today-route-list,
  .daily-actions,
  .review-grid,
  .settings-grid,
  .universe-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .history-card {
    grid-template-columns: 1fr;
  }

  .use-status-panel {
    grid-template-columns: 1fr;
  }

  .daily-review-panel {
    grid-template-columns: 1fr;
  }

  .portfolio-risk-panel {
    grid-template-columns: 1fr;
  }

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

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

  .universe-status-panel {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 820px) {
  :root { --sidebar: 0px; }

  .sidebar {
    display: none;
  }

  .app-shell,
  .disclaimer {
    margin-left: 0;
  }

  .app-shell {
    padding-bottom: var(--mobile-nav-safe);
  }

  .disclaimer {
    padding-bottom: calc(var(--mobile-nav-safe) + 18px);
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar {
    width: 100%;
    justify-content: stretch;
  }

  .search {
    width: 100%;
  }

  .market-strip,
  .pick-grid,
  .today-route-list,
  .daily-actions,
  .review-grid,
  .history-picks,
  .settings-grid,
  .universe-grid,
  .overview-grid,
  .index-strip,
  .watchlist-strip {
    grid-template-columns: 1fr;
  }

  .watchlist-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .daily-recommendation-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .watchlist-head > span {
    text-align: left;
  }

  .daily-recommendation-head p {
    max-width: none;
    text-align: left;
  }

  .overview-main {
    align-items: stretch;
    flex-direction: column;
  }

  .agent-hub-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .agent-hub-badges {
    justify-content: flex-start;
  }

  .overview-actions,
  .overview-actions button {
    width: 100%;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .global-pools-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .global-pools-head p {
    max-width: none;
    text-align: left;
  }

  .global-pool-grid {
    grid-template-columns: 1fr;
  }

  .quote-status-panel,
  .market-board-panel,
  .quote-status-copy {
    grid-template-columns: 1fr;
  }

  .quote-status-panel {
    align-items: stretch;
  }

  .market-board-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .quote-status-copy {
    align-items: flex-start;
    flex-direction: column;
  }

  .quote-status-panel button {
    width: 100%;
  }

  .quote-status-actions {
    justify-content: stretch;
  }

  .quote-status-actions button {
    flex: 1 1 130px;
  }

  .search-result-head {
    flex-direction: column;
  }

  .search-result-actions,
  .search-result-actions button {
    width: 100%;
  }

  .search-result-list {
    grid-template-columns: 1fr;
  }

  .today-route-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .today-route-head p {
    max-width: none;
    text-align: left;
  }

  .today-route-item {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
  }

  .today-route-item .mini-button {
    grid-column: auto;
    align-self: center;
  }

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

  .use-status-actions {
    justify-content: stretch;
  }

  .use-status-actions button {
    flex: 1 1 130px;
  }

  .daily-progress-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .daily-review-head {
    align-items: flex-start;
    flex-direction: column;
  }

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

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

  .daily-review-actions {
    justify-content: stretch;
  }

  .daily-review-actions button {
    flex: 1 1 130px;
  }

  .daily-actions-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .daily-actions-footer button {
    width: 100%;
  }

  .daily-actions-buttons {
    width: 100%;
  }

  .alert-panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .alert-item {
    flex-basis: 100%;
  }

  .market-overview-head {
    flex-direction: column;
  }

  .market-overview-head > span {
    max-width: none;
    text-align: left;
  }

  .breadth-panel {
    flex-direction: column;
  }

  .breadth-panel > p {
    max-width: none;
    text-align: left;
  }

  .data-module-grid {
    grid-template-columns: 1fr;
  }

  .table-head {
    display: none;
  }

  .table-row {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    padding: 12px;
  }

  .tracking-table {
    display: grid;
    gap: 8px;
    border: 0;
    background: transparent !important;
    box-shadow: none;
  }

  .row-actions {
    width: 100%;
    justify-content: stretch;
  }

  .row-actions button {
    flex: 1 1 88px;
  }

  .detail-page-head {
    align-items: stretch;
    flex-direction: column;
  }

  .detail-page-head button {
    width: 100%;
  }

  .detail-sticky.standalone-detail {
    padding: 12px;
  }

  .mobile-nav {
    position: fixed;
    inset: auto max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--base) 94%, transparent);
    padding: 8px;
    backdrop-filter: blur(18px);
  }

  .mobile-nav .nav-button {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 3px;
    padding: 8px 4px;
    font-size: 11px;
  }

  .mobile-nav .nav-label {
    font-size: 0;
  }

  .mobile-nav .nav-label::after {
    content: attr(data-short-label);
    font-size: 11px;
    line-height: 1.15;
  }

  .mobile-nav .nav-count {
    display: none;
  }

  .settings-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-actions {
    justify-content: stretch;
  }

  .settings-actions button {
    flex: 1 1 130px;
  }

  .risk-settings {
    grid-template-columns: 1fr;
  }

  .custom-stock-form {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .toast {
    right: 10px;
    bottom: 84px;
  }

  .trade-ticket {
    align-items: end;
    padding: 10px;
  }

  .trade-ticket-card {
    max-height: calc(100vh - 24px);
    overflow: auto;
  }

  .trade-ticket-grid {
    grid-template-columns: 1fr;
  }

  .trade-ticket-form {
    grid-template-columns: 1fr;
  }

  .trade-ticket-actions button {
    flex: 1 1 150px;
  }
}

/* Final consumer UI overrides. Keep this block last so old responsive rules cannot win. */
:root[data-theme="light"] {
  --bg: #f6fbff;
  --base: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3f8fc;
  --surface-3: #e9f4fb;
  --line: #d8e7ef;
  --line-strong: #b6d1df;
  --text: #102a3a;
  --muted: #5c7180;
  --faint: #8aa0ad;
  --accent: #0aa37f;
  --accent-strong: #00bd8e;
  --accent-soft: rgba(10, 163, 127, .12);
  --blue: #247fd1;
  --blue-soft: rgba(36, 127, 209, .12);
  --shadow: 0 16px 42px rgba(24, 92, 128, .10);
}

@media (min-width: 821px) {
  .mobile-nav { display: none !important; }
}

@media (max-width: 820px) {
  .sidebar,
  .market-strip,
  .module-toolbar,
  .detail-panel,
  .toolbar {
    display: none !important;
  }

  .app-shell,
  .disclaimer {
    margin-left: 0 !important;
  }

  .app-shell {
    padding-bottom: calc(84px + env(safe-area-inset-bottom)) !important;
  }

  .topbar {
    position: sticky;
    top: 0;
    min-height: auto !important;
    padding: 14px 14px 10px !important;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .96) !important;
    backdrop-filter: blur(18px);
  }

  .topbar h1 { font-size: 24px !important; }

  .workspace {
    display: block !important;
    padding: 10px 12px calc(98px + env(safe-area-inset-bottom)) !important;
  }

  .workspace.detail-page {
    padding-bottom: calc(112px + env(safe-area-inset-bottom)) !important;
  }

  .module-panel {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  .mobile-nav {
    position: fixed !important;
    inset: auto 0 0 0 !important;
    z-index: 30 !important;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 0 !important;
    border: 0 !important;
    border-top: 1px solid var(--line) !important;
    border-radius: 0 !important;
    background: rgba(255, 255, 255, .96) !important;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)) !important;
    box-shadow: 0 -10px 30px rgba(21, 86, 112, .10) !important;
    backdrop-filter: blur(18px);
  }

  .mobile-tab-button {
    display: grid;
    justify-items: center;
    gap: 3px;
    min-height: 54px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    font-weight: 760;
  }

  .mobile-tab-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--accent);
    font-size: 12px;
    font-weight: 900;
  }

  .mobile-tab-button.active {
    color: #fff;
    background: linear-gradient(135deg, var(--accent-strong), var(--accent));
    box-shadow: 0 8px 20px rgba(6, 139, 108, .18);
  }

  .mobile-tab-button.active .mobile-tab-icon {
    background: rgba(255, 255, 255, .22);
    color: #fff;
  }

  .stock-detail-page {
    padding-bottom: 92px !important;
  }

  .detail-sticky.standalone-detail {
    max-height: none !important;
    overflow: visible !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 0 92px !important;
  }

  .detail-title,
  .quote-card,
  .detail-section,
  .data-hub-section,
  .kline-preview,
  .deep-module-card {
    border-radius: 14px !important;
    background: #fff !important;
    box-shadow: 0 10px 26px rgba(28, 93, 120, .08) !important;
  }

  .plan-grid.vertical,
  .deep-module-grid,
  .deep-metric-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .action-row.stacked {
    display: none !important;
  }

  .mobile-detail-bar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 40;
    display: grid !important;
    grid-template-columns: 1fr 1.4fr;
    gap: 10px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .96);
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    backdrop-filter: blur(18px);
  }

  .mobile-detail-bar button {
    min-height: 48px;
  }

  .trade-ticket {
    align-items: end !important;
    padding: 0 !important;
  }

  .trade-ticket-card {
    width: 100% !important;
    max-width: none !important;
    max-height: min(82vh, 720px) !important;
    border-radius: 18px 18px 0 0 !important;
    border-width: 1px 0 0 !important;
    padding: 16px !important;
  }
}

/* Product research layer: smart screener and source health surfaces. */
.screener-panel,
.source-health-panel {
  background: #ffffff;
  border: 1px solid #dde9ee;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(8, 24, 38, 0.06);
  padding: 18px;
  margin: 16px 0;
}

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

.screener-card,
.source-health-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%);
  border: 1px solid #e3edf2;
  border-radius: 12px;
  padding: 12px;
  min-width: 0;
}

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

.screener-list button {
  min-height: 44px;
}

.source-health-card {
  display: grid;
  gap: 8px;
}

.source-health-card div {
  display: grid;
  gap: 3px;
}

.source-health-card strong {
  color: #081826;
  font-size: 0.95rem;
}

.source-health-card span,
.source-health-card small,
.source-health-card p {
  color: #778796;
  font-size: 0.78rem;
  line-height: 1.45;
  margin: 0;
  overflow-wrap: anywhere;
}

.source-health-card em {
  justify-self: start;
  border-radius: 999px;
  padding: 3px 8px;
  background: #edf8f6;
  color: #00a86b;
  font-style: normal;
  font-weight: 800;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.source-health-card.partial em,
.source-health-card.cached em {
  background: #fff7e8;
  color: #b96a00;
}

.source-health-card.failed em,
.source-health-card.planned em {
  background: #fff1f3;
  color: #f04452;
}

@media (max-width: 1100px) {
  .screener-grid,
  .source-health-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .screener-panel,
  .source-health-panel {
    border-radius: 14px;
    box-shadow: 0 8px 22px rgba(8, 24, 38, 0.05);
    padding: 14px;
  }

  .screener-grid,
  .source-health-grid {
    grid-template-columns: 1fr;
  }

  .mobile-source-health {
    margin: 12px 0;
  }
}

/* Screener + Agent ask product surfaces. */
.screener-workbench,
.agent-ask-panel {
  display: grid;
  gap: 16px;
  background: #ffffff;
  border: 1px solid #dde9ee;
  border-radius: 18px;
  box-shadow: 0 16px 36px rgba(8, 24, 38, 0.07);
  margin: 16px 0;
  padding: 18px;
  min-width: 0;
}

.screener-hero,
.agent-ask-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.screener-hero h3,
.agent-ask-hero h3 {
  color: #081826;
  font-size: 1.35rem;
  margin: 4px 0 6px;
}

.screener-hero p,
.agent-ask-hero p {
  color: #6f7f8d;
  line-height: 1.65;
  margin: 0;
  max-width: 720px;
}

.screener-source-pill,
.agent-state {
  flex: 0 0 auto;
  display: grid;
  gap: 2px;
  min-width: 132px;
  border-radius: 999px;
  background: #edf8f6;
  color: #078b8e;
  padding: 9px 14px;
  text-align: center;
}

.screener-source-pill strong,
.agent-state {
  font-weight: 900;
}

.screener-source-pill span {
  color: #6f7f8d;
  font-size: 0.76rem;
  overflow-wrap: anywhere;
}

.agent-state.ready {
  background: #eafaf3;
  color: #00a86b;
}

.agent-state.loading {
  background: #fff7e8;
  color: #b96a00;
}

.screener-presets,
.agent-quick-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.screener-chip,
.agent-quick-grid button {
  min-height: 38px;
  border: 1px solid #dbe9ee;
  border-radius: 999px;
  background: #f8fbfc;
  color: #2b3d4c;
  font-weight: 800;
  padding: 8px 12px;
}

.screener-chip:hover,
.agent-quick-grid button:hover {
  border-color: #0aa6a6;
  color: #078b8e;
}

.screener-chip.active {
  border-color: #0aa6a6;
  background: #edf8f6;
  color: #078b8e;
}

.screener-strategy-card,
.agent-template-group,
.research-workflow-card,
.detail-workflow-card {
  border: 1px solid #e1ebef;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(8, 24, 38, 0.045);
  min-width: 0;
  padding: 14px;
}

.screener-strategy-card strong,
.agent-template-group strong,
.research-workflow-head strong {
  color: #081826;
  display: block;
  font-size: 0.98rem;
}

.screener-strategy-card p {
  color: #536675;
  line-height: 1.55;
  margin: 8px 0 0;
}

.screener-strategy-card div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.screener-strategy-card span,
.agent-template-badge {
  border-radius: 999px;
  background: #f1f5f7;
  color: #617282;
  font-size: 0.74rem;
  font-weight: 850;
  padding: 5px 9px;
}

.agent-template-groups {
  display: grid;
  gap: 10px;
}

.agent-template-group {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.agent-template-badge {
  justify-self: start;
}

.screener-advanced-toggle {
  display: none;
  min-height: 44px;
  border: 1px solid #dbe9ee;
  border-radius: 12px;
  background: #f8fbfc;
  color: #078b8e;
  font-weight: 900;
}

.screener-controls {
  display: grid;
  grid-template-columns: 1.1fr 1.35fr minmax(150px, 1fr) minmax(150px, 1fr) 90px 128px;
  gap: 10px;
  align-items: end;
}

.screener-control-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.screener-control-group button {
  min-height: 40px;
  border: 1px solid #dbe9ee;
  border-radius: 999px;
  background: #ffffff;
  color: #617282;
  font-weight: 900;
  padding: 8px 12px;
}

.screener-control-group button.active {
  border-color: #0aa6a6;
  background: #edf8f6;
  color: #078b8e;
}

.screener-input {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.screener-input span {
  color: #7b8b99;
  font-size: 0.76rem;
  font-weight: 800;
}

.screener-input input,
.agent-prompt-row textarea {
  width: 100%;
  border: 1px solid #dbe9ee;
  border-radius: 12px;
  background: #f8fbfc;
  color: #081826;
  font: inherit;
  font-weight: 750;
  outline: none;
}

.screener-input input {
  min-height: 42px;
  padding: 0 12px;
}

.agent-prompt-row textarea {
  min-height: 92px;
  padding: 13px 14px;
  resize: vertical;
}

.screener-input input:focus,
.agent-prompt-row textarea:focus {
  border-color: #0aa6a6;
  box-shadow: 0 0 0 3px rgba(10, 166, 166, 0.12);
}

.screener-run {
  min-height: 42px;
  white-space: nowrap;
}

.screener-health-strip,
.agent-health-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.screener-health-strip span,
.agent-health-row span {
  border: 1px solid #e4edf1;
  border-radius: 999px;
  background: #fbfdfe;
  color: #6f7f8d;
  font-size: 0.78rem;
  font-weight: 850;
  padding: 6px 10px;
}

.screener-health-strip .risk {
  border-color: #ffd9df;
  background: #fff5f6;
  color: #f04452;
}

.screener-result-grid,
.agent-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.screener-result-card,
.agent-stock-card,
.agent-summary-card,
.agent-text-list,
.agent-empty,
.agent-error {
  border: 1px solid #e1ebef;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfe 100%);
  box-shadow: 0 8px 20px rgba(8, 24, 38, 0.045);
  min-width: 0;
  padding: 12px;
}

.screener-result-main,
.agent-stock-card > button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
}

.screener-result-main i {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #edf8f6;
  color: #078b8e;
  font-style: normal;
  font-weight: 950;
}

.screener-result-main strong,
.agent-stock-card strong {
  display: block;
  color: #081826;
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.screener-result-main small,
.agent-stock-card span,
.agent-stock-card small,
.agent-stock-card p {
  color: #728392;
  font-size: 0.78rem;
  line-height: 1.45;
}

.screener-result-main em {
  font-style: normal;
  font-weight: 950;
}

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

.screener-result-metrics span {
  display: grid;
  gap: 3px;
  border: 1px solid #e5eef2;
  border-radius: 10px;
  background: #f8fbfc;
  color: #081826;
  font-size: 0.82rem;
  font-weight: 900;
  min-width: 0;
  padding: 8px;
}

.screener-result-metrics b {
  color: #7b8b99;
  font-size: 0.7rem;
}

.screener-result-metrics em {
  font-style: normal;
}

.screener-result-source,
.agent-stock-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.screener-result-source span,
.agent-stock-meta span {
  border-radius: 999px;
  background: #f1f5f7;
  color: #6f7f8d;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 8px;
}

.screener-result-reason {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  border: 1px solid #e5eef2;
  border-radius: 12px;
  background: #fbfdfe;
  color: #536675;
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.45;
  padding: 8px 10px;
}

.screener-result-reason span {
  min-width: 0;
}

.screener-result-reason b {
  color: #081826;
  display: block;
  font-size: 0.7rem;
  margin-bottom: 2px;
}

.screener-decision-strip,
.agent-action-checklist,
.tracking-insight-panel {
  border: 1px solid #dce9ee;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(8, 24, 38, 0.04);
  padding: 12px;
}

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

.screener-decision-strip span,
.screener-next-step,
.agent-action-checklist span {
  border: 1px solid #e6eef2;
  border-radius: 12px;
  background: #f8fbfc;
  color: #536675;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.45;
  padding: 8px 10px;
}

.screener-decision-strip b,
.agent-action-checklist b {
  color: #081826;
  display: block;
  font-size: 0.72rem;
}

.screener-next-step {
  margin-top: 10px;
}

.data-state-pill.ready {
  background: #eafaf3;
  color: #00a86b;
}

.data-state-pill.cached,
.data-state-pill.partial {
  background: #fff7e8;
  color: #b96a00;
}

.data-state-pill.failed {
  background: #fff1f3;
  color: #f04452;
}

.risk-tag {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #f1f5f7;
  color: #617282;
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 950;
  padding: 4px 8px;
}

.risk-tag.positive {
  background: #eafaf3;
  color: #00a86b;
}

.risk-tag.warning {
  background: #fff7e8;
  color: #b96a00;
}

.risk-tag.risk {
  background: #fff1f3;
  color: #f04452;
}

.screener-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.screener-card-actions button {
  min-height: 34px;
}

.agent-prompt-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 10px;
  align-items: stretch;
}

.agent-prompt-row .action-button {
  min-height: 92px;
}

.agent-result-panel {
  display: grid;
  gap: 12px;
}

.agent-action-checklist {
  display: grid;
  gap: 10px;
}

.agent-action-checklist strong,
.tracking-insight-panel strong {
  color: #081826;
  display: block;
}

.agent-action-checklist > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.agent-action-checklist span b {
  align-items: center;
  background: #edf8f6;
  border-radius: 50%;
  color: #078b8e;
  display: inline-grid;
  height: 22px;
  margin-bottom: 5px;
  place-items: center;
  width: 22px;
}

.research-workflow-card {
  display: grid;
  gap: 12px;
}

.research-workflow-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.research-workflow-head > span {
  border-radius: 999px;
  background: #edf8f6;
  color: #078b8e;
  font-size: 0.76rem;
  font-weight: 900;
  padding: 6px 10px;
}

.research-workflow-steps {
  display: grid;
  gap: 8px;
}

.research-workflow-step {
  align-items: start;
  border: 1px solid #e5eef2;
  border-radius: 12px;
  background: #fbfdfe;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 10px;
}

.research-workflow-step i {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #edf8f6;
  color: #078b8e;
  font-style: normal;
  font-weight: 950;
}

.research-workflow-step b {
  color: #081826;
  display: block;
}

.research-workflow-step small {
  color: #6f7f8d;
  display: block;
  line-height: 1.5;
  margin-top: 3px;
}

.research-workflow-step.cached i,
.research-workflow-step.partial i {
  background: #fff7e8;
  color: #b96a00;
}

.research-workflow-step.failed i {
  background: #fff1f3;
  color: #f04452;
}

.decision-hint-row {
  display: grid;
  gap: 8px;
}

.decision-hint-row span {
  border: 1px solid #e5eef2;
  border-radius: 12px;
  background: #fbfdfe;
  color: #536675;
  display: grid;
  gap: 4px;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.45;
  padding: 10px;
}

.decision-hint-row b {
  color: #081826;
}

.decision-hint-row .positive {
  border-color: #cfeee6;
  background: #f3fcf8;
}

.decision-hint-row .warning {
  border-color: #ffe1ad;
  background: #fffaf0;
}

.decision-hint-row .risk {
  border-color: #ffd7dd;
  background: #fff6f7;
}

.agent-verdict-card,
.agent-source-digest {
  border: 1px solid #e1ebef;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(8, 24, 38, 0.045);
  min-width: 0;
  padding: 14px;
}

.agent-verdict-card span,
.agent-key-metric-card span {
  color: #7b8b99;
  font-size: 0.74rem;
  font-weight: 900;
}

.agent-verdict-card strong {
  display: block;
  color: #081826;
  font-size: 1.18rem;
  line-height: 1.38;
  margin-top: 4px;
}

.agent-verdict-card p,
.agent-source-digest p {
  color: #536675;
  line-height: 1.6;
  margin: 8px 0 0;
}

.agent-verdict-card small,
.agent-key-metric-card small {
  color: #8a97a3;
  display: block;
  font-size: 0.76rem;
  font-weight: 800;
  margin-top: 8px;
}

.agent-verdict-card.positive {
  border-color: #cfeee6;
  background: linear-gradient(180deg, #ffffff 0%, #f3fcf8 100%);
}

.agent-verdict-card.warning {
  border-color: #ffe1ad;
  background: linear-gradient(180deg, #ffffff 0%, #fffaf0 100%);
}

.agent-verdict-card.risk {
  border-color: #ffd7dd;
  background: linear-gradient(180deg, #ffffff 0%, #fff6f7 100%);
}

.agent-key-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.agent-key-metric-card {
  border: 1px solid #e1ebef;
  border-radius: 12px;
  background: #fbfdfe;
  min-width: 0;
  padding: 11px;
}

.agent-key-metric-card strong {
  display: block;
  color: #081826;
  font-size: 1rem;
  line-height: 1.3;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.agent-key-metric-card.positive strong {
  color: #00a86b;
}

.agent-key-metric-card.risk strong {
  color: #f04452;
}

.agent-key-metric-card.warning strong {
  color: #b96a00;
}

.agent-summary-card strong {
  display: block;
  color: #081826;
  font-size: 1.08rem;
  line-height: 1.45;
  margin-top: 4px;
}

.agent-summary-card p,
.agent-text-list p,
.agent-stock-card p {
  margin: 8px 0 0;
}

.agent-stock-card > button {
  grid-template-columns: minmax(0, 1fr);
}

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

.agent-text-list strong {
  color: #081826;
}

.agent-text-list ul {
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
  padding-left: 18px;
}

.agent-text-list li {
  color: #5d6e7c;
  line-height: 1.55;
}

.agent-text-list.risk {
  border-color: #ffd9df;
}

.agent-error {
  border-color: #ffd9df;
  background: #fff5f6;
  color: #f04452;
  font-weight: 850;
}

.agent-empty {
  color: #6f7f8d;
  font-weight: 800;
}

.tracking-insight-panel {
  display: grid;
  gap: 12px;
}

.tracking-insight-panel p {
  color: #536675;
  line-height: 1.55;
  margin: 6px 0 0;
}

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

.tracking-alert-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tracking-alert-list button {
  align-items: center;
  border: 1px solid #ffd7dd;
  border-radius: 999px;
  background: #fff6f7;
  color: #f04452;
  display: inline-flex;
  gap: 6px;
  min-height: 34px;
  padding: 6px 10px;
}

.tracking-origin,
.mobile-origin {
  color: #078b8e;
  font-weight: 900;
}

.tracking-task-list,
.mobile-task-list,
.tracking-origin-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.tracking-task-list em,
.mobile-task-list em,
.tracking-origin-meta span {
  border-radius: 999px;
  background: #edf8f6;
  color: #078b8e;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  padding: 5px 7px;
}

.mobile-task-list {
  margin-top: 5px;
}

.detail-origin-card {
  border-color: #cfeee6;
  background: linear-gradient(180deg, #ffffff 0%, #f4fcf9 100%);
}

.detail-origin-card p {
  color: #536675;
  line-height: 1.6;
}

.detail-task-list {
  margin: 12px 0;
}

@media (max-width: 1180px) {
  .screener-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .screener-decision-strip,
  .tracking-insight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .screener-run {
    grid-column: span 2;
  }
}

@media (max-width: 820px) {
  .screener-workbench,
  .agent-ask-panel {
    border-radius: 14px;
    box-shadow: 0 8px 22px rgba(8, 24, 38, 0.05);
    margin: 12px 0;
    padding: 14px;
  }

  .screener-hero,
  .agent-ask-hero {
    display: grid;
    gap: 10px;
  }

  .screener-hero h3,
  .agent-ask-hero h3 {
    font-size: 1.15rem;
  }

  .screener-source-pill,
  .agent-state {
    justify-self: start;
    min-width: 0;
    text-align: left;
  }

  .screener-controls,
  .screener-result-grid,
  .agent-prompt-row,
  .agent-card-grid,
  .agent-section-grid,
  .agent-key-metrics {
    grid-template-columns: 1fr;
  }

  .screener-run {
    grid-column: auto;
    min-height: 46px;
  }

  .screener-advanced-toggle {
    display: block;
  }

  .screener-controls.collapsed {
    display: none;
  }

  .screener-chip,
  .screener-control-group button,
  .agent-quick-grid button {
    min-height: 44px;
  }

  .agent-prompt-row .action-button {
    min-height: 48px;
  }

  .screener-result-main {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

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

  .screener-card-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .screener-card-actions button {
    min-width: 0;
    padding-left: 8px;
    padding-right: 8px;
  }
}

/* Final UI repair layer at EOF: prevents old mobile/detail rules from winning. */
html,
body {
  overflow-x: hidden;
}

@media (max-width: 820px) {
  .mobile-screen.mobile-market-page .mobile-section:first-child {
    position: static !important;
    top: auto !important;
    z-index: auto !important;
    margin: 0 -12px 10px !important;
    border-bottom: 1px solid var(--line) !important;
    background: rgba(255, 255, 255, .97) !important;
    padding: 8px 12px 10px !important;
    backdrop-filter: blur(16px);
  }

  .mobile-market-tabs {
    position: static !important;
    z-index: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .mobile-stock-list {
    padding-top: 0 !important;
  }

  .mobile-stock-card,
  .mobile-watch-row {
    position: relative !important;
    z-index: 1 !important;
  }

  .detail-reading-layout,
  .detail-reading-main,
  .detail-action-rail {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: 100% !important;
  }

  .detail-action-rail {
    position: static !important;
  }

  .detail-hero,
  .detail-card,
  .detail-kline-card,
  .detail-action-rail .decision-panel {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 14px !important;
  }

  .detail-card-head,
  .detail-hero-main,
  .detail-hero-meta,
  .kline-stat-grid,
  .research-summary-grid,
  .deep-module-grid,
  .deep-metric-row,
  .plan-grid.vertical,
  .data-module-grid {
    grid-template-columns: 1fr !important;
  }

  .detail-price-card {
    width: 100% !important;
    min-width: 0 !important;
    text-align: left !important;
  }

  .detail-desktop-actions {
    display: none !important;
  }
}

@media (min-width: 821px) {
  .workspace.detail-page {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .workspace.detail-page .module-panel {
    width: min(1180px, 100%) !important;
    max-width: 1180px !important;
    margin: 0 auto !important;
    overflow: visible !important;
  }

  .workspace.detail-page .stock-detail-page,
  .workspace.detail-page .detail-sticky,
  .workspace.detail-page .detail-reading-layout {
    width: 100% !important;
    max-width: 100% !important;
  }

  .workspace.detail-page .detail-reading-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px) !important;
    gap: 16px !important;
  }

  .workspace.detail-page .detail-action-rail {
    position: sticky !important;
    top: 92px !important;
    align-self: start !important;
  }
}
/* Product Design v3: consumer finance redesign. Keep this layer at EOF. */
:root {
  --pd-bg: #f6fafb;
  --pd-surface: #ffffff;
  --pd-surface-soft: #f1f5f6;
  --pd-line: #dfeaec;
  --pd-line-soft: #edf3f4;
  --pd-text: #071724;
  --pd-muted: #7d8c98;
  --pd-brand: #0aa6a6;
  --pd-brand-strong: #008f94;
  --pd-green: #00a86b;
  --pd-red: #f04452;
  --pd-shadow: 0 10px 28px rgba(15, 55, 72, .08);
  --pd-shadow-soft: 0 6px 18px rgba(15, 55, 72, .06);
}

html,
body {
  background: var(--pd-bg) !important;
  color: var(--pd-text) !important;
}

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
}

.app-shell,
.content-column,
.module-panel,
.mobile-screen {
  background: var(--pd-bg) !important;
}

.topbar,
.sidebar,
.market-strip,
.module-toolbar,
.disclaimer {
  background: rgba(255, 255, 255, .92) !important;
  border-color: var(--pd-line-soft) !important;
  box-shadow: none !important;
}

.pd-mobile-home,
.pd-market-page,
.pd-reports-page,
.pd-profile-page {
  display: grid;
  gap: 14px;
  padding-bottom: calc(var(--mobile-nav-safe, 112px) + 10px);
}

.pd-home-hero,
.pd-page-hero,
.pd-market-hero,
.pd-section,
.screener-workbench,
.agent-ask-panel,
.account-profile-panel,
.source-health-panel,
.settings-panel,
.detail-hero,
.detail-card,
.detail-kline-card,
.detail-action-rail .decision-panel {
  background: var(--pd-surface) !important;
  border: 1px solid var(--pd-line) !important;
  border-radius: 18px !important;
  box-shadow: var(--pd-shadow-soft) !important;
}

.pd-home-hero {
  padding: 18px;
}

.pd-hero-top,
.pd-section-head,
.pd-market-summary,
.detail-card-head,
.agent-ask-hero,
.screener-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.pd-hero-top span,
.pd-page-hero .eyebrow,
.pd-market-summary span,
.eyebrow {
  color: var(--pd-brand-strong) !important;
  font-weight: 800;
}

.pd-hero-top h1,
.pd-page-hero h2,
.pd-market-summary h2,
.mobile-page-title h2,
.agent-ask-hero h3,
.screener-hero h3 {
  color: var(--pd-text) !important;
  letter-spacing: 0 !important;
}

.pd-hero-top h1 {
  margin: 4px 0 0;
  font-size: clamp(1.85rem, 8vw, 2.35rem);
  line-height: 1.08;
}

.pd-search-entry,
.mobile-search-pill,
.search,
.mobile-search-box {
  background: #f1f4f5 !important;
  border: 1px solid transparent !important;
  border-radius: 12px !important;
  color: var(--pd-muted) !important;
  box-shadow: none !important;
}

.pd-search-entry {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 48px;
  margin-top: 18px;
  padding: 0 14px;
  text-align: left;
}

.pd-search-entry span {
  width: 18px;
  height: 18px;
  border: 2px solid #9aa8b1;
  border-radius: 50%;
  margin-right: 10px;
  position: relative;
}

.pd-search-entry span::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: -5px;
  width: 8px;
  height: 2px;
  background: #9aa8b1;
  transform: rotate(45deg);
}

.pd-search-entry strong {
  color: #8c99a3;
  font-size: .95rem;
  font-weight: 700;
}

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

.pd-hero-picks button,
.pd-market-grid button,
.pd-research-actions button {
  background: #ffffff;
  border: 1px solid var(--pd-line-soft);
  border-radius: 12px;
  color: var(--pd-text);
  min-width: 0;
  padding: 10px;
  text-align: left;
  box-shadow: 0 4px 12px rgba(15, 55, 72, .04);
}

.pd-hero-picks b,
.pd-market-grid strong,
.pd-research-actions strong {
  display: block;
  overflow: hidden;
  color: var(--pd-text);
  font-size: .86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pd-hero-picks em,
.up,
.positive {
  color: var(--pd-green) !important;
}

.down,
.risk,
.failed {
  color: var(--pd-red) !important;
}

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

.pd-data-strip article,
.mobile-index-card,
.mobile-metric,
.screener-result-card,
.agent-stock-card,
.agent-summary-card,
.agent-text-list,
.research-workflow-card {
  background: var(--pd-surface) !important;
  border: 1px solid var(--pd-line) !important;
  border-radius: 14px !important;
  box-shadow: var(--pd-shadow-soft) !important;
}

.pd-data-strip article {
  padding: 12px;
}

.pd-data-strip span,
.mobile-index-card span,
.mobile-metric span,
.screener-result-source,
.agent-stock-card small,
.mobile-stock-main span,
.mobile-watch-name span {
  color: var(--pd-muted) !important;
}

.pd-data-strip strong {
  display: block;
  margin-top: 4px;
  color: var(--pd-text);
  font-size: 1.05rem;
}

.pd-data-strip small {
  color: var(--pd-muted);
  display: block;
  margin-top: 4px;
}

.pd-section {
  padding: 14px;
}

.pd-section-head {
  margin-bottom: 12px;
}

.pd-section-head h3 {
  margin: 0;
  color: var(--pd-text);
  font-size: 1.05rem;
}

.pd-section-head button,
.pd-market-summary button,
.screener-advanced-toggle,
.mini-button,
.icon-button {
  background: #edf8f6 !important;
  border: 1px solid #d5efea !important;
  color: var(--pd-brand-strong) !important;
  border-radius: 10px !important;
  font-weight: 800;
}

.action-button,
.screener-run,
.agent-prompt-row .action-button {
  background: var(--pd-brand) !important;
  border-color: var(--pd-brand) !important;
  color: #ffffff !important;
  border-radius: 10px !important;
  box-shadow: 0 10px 22px rgba(10, 166, 166, .2) !important;
}

.danger-button {
  background: #fff1f3 !important;
  border-color: #ffd2d8 !important;
  color: var(--pd-red) !important;
  border-radius: 10px !important;
}

.pd-market-grid,
.pd-research-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.pd-research-actions {
  grid-template-columns: 1fr;
}

.pd-market-grid span,
.pd-research-actions span {
  color: var(--pd-muted);
  display: block;
  font-size: .72rem;
  margin-top: 3px;
}

.mobile-market-overview {
  border: 0 !important;
  box-shadow: none !important;
  margin: 14px 0 0 !important;
  padding: 0 !important;
}

.mobile-index-grid {
  gap: 8px !important;
}

.mobile-quick-grid {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 8px !important;
  margin-top: 14px !important;
}

.mobile-quick-grid button {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: var(--pd-muted) !important;
  min-width: 0;
  padding: 0 !important;
}

.mobile-quick-grid button span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: 0 auto 6px;
  background: var(--pd-brand) !important;
  border-radius: 10px;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(10, 166, 166, .18);
}

.mobile-quick-grid em {
  color: #52616e;
  display: block;
  font-size: .7rem;
  font-style: normal;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.pd-market-hero {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.pd-market-tabs,
.mobile-segmented,
.mobile-market-tabs {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  display: flex !important;
  gap: 18px !important;
  margin: 0 !important;
  padding: 0 !important;
  position: static !important;
}

.pd-market-tabs button,
.mobile-segmented button,
.mobile-market-tabs button {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  color: #758391 !important;
  min-height: 36px;
  padding: 0 0 7px !important;
  position: relative;
}

.pd-market-tabs button.active,
.mobile-segmented button.active,
.mobile-market-tabs button.active {
  color: var(--pd-brand) !important;
}

.pd-market-tabs button.active::after,
.mobile-segmented button.active::after,
.mobile-market-tabs button.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--pd-brand);
  border-radius: 999px;
}

.pd-market-summary {
  align-items: center;
}

.pd-market-summary h2 {
  margin: 2px 0 4px;
  font-size: 1.3rem;
}

.pd-market-summary p {
  color: var(--pd-muted);
  margin: 0;
}

.mobile-stock-row,
.mobile-watch-row {
  background: #ffffff !important;
  border: 1px solid var(--pd-line-soft) !important;
  border-radius: 14px !important;
  box-shadow: 0 5px 14px rgba(15, 55, 72, .04) !important;
  min-height: 88px;
  padding: 14px !important;
}

.mobile-stock-price,
.mobile-watch-price {
  text-align: right;
}

.screener-workbench,
.agent-ask-panel {
  padding: 14px !important;
}

.screener-hero,
.agent-ask-hero {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.screener-presets,
.agent-quick-grid {
  gap: 8px !important;
}

.screener-chip,
.agent-quick-grid button {
  background: #f2f7f7 !important;
  border: 1px solid var(--pd-line-soft) !important;
  border-radius: 999px !important;
  color: #52616e !important;
  font-weight: 800;
}

.screener-chip.active {
  background: #e5f7f4 !important;
  border-color: #b9e8df !important;
  color: var(--pd-brand-strong) !important;
}

.agent-result-panel,
.agent-report-panel {
  display: grid;
  gap: 12px;
}

.agent-summary-card {
  border-color: #bde9e1 !important;
  background: #f7fffd !important;
}

.mobile-nav {
  background: rgba(255, 255, 255, .96) !important;
  border-top: 1px solid var(--pd-line) !important;
  box-shadow: 0 -12px 26px rgba(15, 55, 72, .08) !important;
}

.mobile-nav .mobile-tab-button,
.mobile-nav .nav-button {
  background: transparent !important;
  border: 0 !important;
  color: #7d8b98 !important;
}

.mobile-nav .mobile-tab-button.active,
.mobile-nav .nav-button.active {
  color: var(--pd-brand) !important;
}

.mobile-nav svg {
  stroke: currentColor !important;
  stroke-width: 2.1 !important;
  fill: none !important;
}

.mobile-detail-bar {
  background: rgba(255, 255, 255, .96) !important;
  border-top: 1px solid var(--pd-line) !important;
  box-shadow: 0 -12px 26px rgba(15, 55, 72, .08) !important;
}

.detail-reading-layout {
  gap: 18px !important;
}

.detail-hero {
  padding: 18px !important;
}

.detail-price-card {
  background: #f7fffd !important;
  border: 1px solid #c8eee6 !important;
  border-radius: 16px !important;
}

.detail-card,
.detail-kline-card {
  padding: 16px !important;
}

.detail-status-chip,
.data-state-pill,
.market-pill {
  border-radius: 999px !important;
  font-weight: 800 !important;
}

@media (max-width: 820px) {
  .pd-mobile-home,
  .pd-market-page,
  .pd-reports-page,
  .pd-profile-page {
    padding: 12px 12px calc(var(--mobile-nav-safe, 112px) + 10px) !important;
  }

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

  .pd-market-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pd-market-grid button {
    min-height: 82px;
  }

  .pd-hero-picks {
    grid-template-columns: 1fr;
  }

  .pd-hero-picks button {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .pd-market-summary {
    display: grid;
    grid-template-columns: 1fr;
  }

  .screener-result-metrics,
  .mobile-metric-grid,
  .pd-profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .screener-card-actions,
  .mobile-card-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .mobile-card-actions button,
  .screener-card-actions button {
    min-height: 42px;
    min-width: 0;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }
}

@media (min-width: 821px) {
  .workspace:not(.detail-page) .module-panel {
    max-width: 1160px;
    margin: 0 auto;
  }

  .screener-result-grid,
  .agent-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .agent-section-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
/* Product Design v4: visible desktop redesign. Keep at EOF. */
:root {
  --pd4-bg: #eef8f7;
  --pd4-card: #ffffff;
  --pd4-text: #071724;
  --pd4-muted: #748695;
  --pd4-brand: #0aa6a6;
  --pd4-brand-dark: #00888d;
  --pd4-line: #d7e8ea;
  --pd4-shadow: 0 18px 45px rgba(9, 52, 66, .10);
}

@media (min-width: 821px) {
  body {
    background:
      radial-gradient(circle at 12% 8%, rgba(10, 166, 166, .16), transparent 28%),
      linear-gradient(180deg, #f7fcfc 0%, var(--pd4-bg) 100%) !important;
  }

  .sidebar {
    width: 220px !important;
    padding: 18px 14px !important;
    background: rgba(255, 255, 255, .82) !important;
    border-right: 1px solid var(--pd4-line) !important;
    backdrop-filter: blur(22px);
  }

  .brand {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 8px 6px 18px !important;
  }

  .brand-mark {
    background: var(--pd4-brand) !important;
    color: #fff !important;
    border-radius: 12px !important;
  }

  .nav-list {
    gap: 6px !important;
  }

  .nav-button {
    min-height: 42px !important;
    border-radius: 13px !important;
    border: 1px solid transparent !important;
    background: transparent !important;
    color: #5d6f7f !important;
  }

  .nav-button.active {
    background: #e7f8f5 !important;
    border-color: #c6ece5 !important;
    color: var(--pd4-brand-dark) !important;
    box-shadow: none !important;
  }

  .app-shell {
    background: transparent !important;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 74px !important;
    padding: 14px 28px !important;
    background: rgba(247, 252, 252, .86) !important;
    backdrop-filter: blur(22px);
  }

  .topbar-title h1 {
    font-size: 1.35rem !important;
  }

  .toolbar {
    gap: 8px !important;
  }

  .toolbar .search {
    min-width: 340px !important;
    background: #fff !important;
    border: 1px solid var(--pd4-line) !important;
    border-radius: 999px !important;
    box-shadow: 0 8px 24px rgba(9, 52, 66, .06) !important;
  }

  .workspace:not(.detail-page) {
    display: block !important;
    padding: 22px 30px 40px !important;
  }

  .workspace:not(.detail-page) .content-column {
    width: min(1220px, 100%) !important;
    margin: 0 auto !important;
  }

  .workspace:not(.detail-page) .detail-panel {
    display: none !important;
  }

  .market-strip,
  .module-toolbar {
    display: none !important;
  }

  .workspace:not(.detail-page) .module-panel {
    max-width: none !important;
  }

  .pd4-desktop-home {
    display: grid;
    gap: 22px;
  }

  .pd4-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 22px;
    min-height: 320px;
    padding: 34px;
    border: 1px solid rgba(185, 232, 226, .95);
    border-radius: 28px;
    background:
      linear-gradient(135deg, rgba(255,255,255,.96) 0%, rgba(235,250,248,.96) 100%);
    box-shadow: var(--pd4-shadow);
  }

  .pd4-hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .pd4-kicker {
    color: var(--pd4-brand-dark);
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
  }

  .pd4-hero h2 {
    margin: 12px 0 12px;
    max-width: 720px;
    color: var(--pd4-text);
    font-size: clamp(3rem, 5vw, 5.2rem);
    line-height: .96;
    letter-spacing: 0 !important;
  }

  .pd4-hero p {
    max-width: 720px;
    color: #536675;
    font-size: 1.05rem;
    line-height: 1.8;
  }

  .pd4-search {
    display: flex;
    align-items: center;
    width: min(680px, 100%);
    min-height: 58px;
    margin-top: 24px;
    padding: 0 20px;
    border: 1px solid var(--pd4-line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(9, 52, 66, .08);
    color: #81909b;
    text-align: left;
  }

  .pd4-search span {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    border: 2px solid #96a8b2;
    border-radius: 50%;
    position: relative;
  }

  .pd4-search span::after {
    content: "";
    position: absolute;
    right: -7px;
    bottom: -5px;
    width: 9px;
    height: 2px;
    background: #96a8b2;
    transform: rotate(45deg);
  }

  .pd4-search strong {
    font-size: 1rem;
    font-weight: 800;
  }

  .pd4-hero-panel {
    display: grid;
    gap: 12px;
    align-content: center;
  }

  .pd4-hero-panel div,
  .pd4-card {
    border: 1px solid var(--pd4-line);
    border-radius: 20px;
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 12px 30px rgba(9, 52, 66, .07);
  }

  .pd4-hero-panel div {
    padding: 18px;
  }

  .pd4-hero-panel span,
  .pd4-card-head span {
    display: block;
    color: var(--pd4-muted);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
  }

  .pd4-hero-panel strong {
    display: block;
    margin-top: 6px;
    color: var(--pd4-text);
    font-size: 1.45rem;
  }

  .pd4-hero-panel small {
    color: var(--pd4-muted);
  }

  .pd4-primary-grid {
    display: grid;
    grid-template-columns: 1.15fr .85fr 1fr;
    gap: 18px;
  }

  .pd4-card {
    padding: 20px;
  }

  .pd4-card-head {
    margin-bottom: 16px;
  }

  .pd4-card-head strong {
    display: block;
    margin-top: 4px;
    color: var(--pd4-text);
    font-size: 1.25rem;
  }

  .pd4-market-tiles,
  .pd4-workflow-actions,
  .pd4-watch-list {
    display: grid;
    gap: 10px;
  }

  .pd4-market-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pd4-market-tiles button,
  .pd4-workflow-actions button,
  .pd4-watch-row {
    width: 100%;
    min-height: 92px;
    padding: 14px;
    border: 1px solid #e4eef0;
    border-radius: 16px;
    background: #fff;
    color: var(--pd4-text);
    text-align: left;
    box-shadow: none;
  }

  .pd4-market-tiles span,
  .pd4-market-tiles small,
  .pd4-workflow-actions small,
  .pd4-watch-row small {
    color: var(--pd4-muted);
  }

  .pd4-market-tiles strong {
    display: block;
    margin: 8px 0;
    color: var(--pd4-text);
    font-size: 1.55rem;
  }

  .pd4-workflow-actions b {
    display: block;
    color: var(--pd4-text);
    font-size: 1.05rem;
  }

  .pd4-watch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 66px;
  }

  .pd4-watch-row strong,
  .pd4-watch-row small {
    display: block;
  }

  .pd4-watch-row em {
    font-style: normal;
    font-weight: 900;
  }

  .pd4-downstream {
    display: grid;
    gap: 18px;
  }

  .pd4-downstream > section {
    border-radius: 22px !important;
    box-shadow: 0 10px 28px rgba(9, 52, 66, .06) !important;
  }
}

/* Product Design v5: mobile research app polish. Keep at EOF. */
:root {
  --pd5-bg: #f6fafb;
  --pd5-surface: #ffffff;
  --pd5-muted-surface: #f1f5f6;
  --pd5-text: #071724;
  --pd5-muted: #81909b;
  --pd5-line: #e5eef1;
  --pd5-brand: #0aa6a6;
  --pd5-brand-dark: #008c91;
  --pd5-up: #00a86b;
  --pd5-down: #f04452;
  --pd5-shadow: 0 12px 32px rgba(7, 35, 47, .08);
}

.up { color: var(--pd5-up) !important; }
.down { color: var(--pd5-down) !important; }

@media (max-width: 820px) {
  body {
    background: var(--pd5-bg) !important;
    color: var(--pd5-text) !important;
    overflow-x: hidden !important;
  }

  html,
  body,
  .app-shell,
  .workspace,
  .content-column,
  .module-panel {
    max-width: 100vw !important;
  }

  .app-shell,
  .workspace,
  .content-column,
  .module-panel {
    background: transparent !important;
  }

  .topbar,
  .sidebar,
  .market-strip,
  .module-toolbar,
  .disclaimer {
    display: none !important;
  }

  .workspace:not(.detail-page) {
    display: block !important;
    padding: 0 !important;
  }

  .module-panel {
    padding: 0 !important;
  }

  .pd5-home,
  .pd5-market-page {
    display: grid;
    gap: 14px;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100vw !important;
    padding: 18px 12px calc(var(--mobile-nav-safe, 112px) + 14px) !important;
    min-height: 100vh;
  }

  .pd5-home > *,
  .pd5-market-page > * {
    box-sizing: border-box !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .pd5-app-header,
  .pd5-market-top,
  .pd5-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .pd5-app-header span,
  .pd5-page-title span,
  .pd5-section-head span,
  .pd5-research-hero span,
  .pd5-ask-card span,
  .pd5-market-summary span {
    color: var(--pd5-muted);
    font-size: .76rem;
    font-weight: 800;
  }

  .pd5-app-header h1,
  .pd5-page-title h2 {
    margin: 2px 0 0;
    color: var(--pd5-text);
    font-size: 1.55rem;
    line-height: 1.1;
    letter-spacing: 0 !important;
  }

  .pd5-profile-pill,
  .pd5-icon-button,
  .pd5-section-head button,
  .pd5-market-summary button {
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid #cbe9e7;
    border-radius: 999px;
    background: #f4fffd;
    color: var(--pd5-brand-dark);
    font-size: .78rem;
    font-weight: 900;
  }

  .pd5-research-hero,
  .pd5-workflow,
  .pd5-ask-card,
  .pd5-market-portal,
  .pd5-watch-card,
  .pd5-report-card,
  .pd5-market-summary,
  .pd5-screener-strip,
  .pd5-list-section {
    border: 1px solid var(--pd5-line);
    border-radius: 18px;
    background: var(--pd5-surface);
    box-shadow: 0 8px 24px rgba(7, 35, 47, .05);
  }

  .pd5-research-hero {
    padding: 14px;
  }

  .pd5-search-box {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 48px;
    margin-bottom: 12px;
    padding: 0 14px;
    border: 0;
    border-radius: 14px;
    background: var(--pd5-muted-surface);
    color: #8b98a6;
    text-align: left;
  }

  .pd5-search-box span {
    position: relative;
    width: 18px;
    height: 18px;
    margin-right: 10px;
    border: 2px solid #a5b2bc;
    border-radius: 50%;
    flex: 0 0 auto;
  }

  .pd5-search-box span::after {
    content: "";
    position: absolute;
    right: -7px;
    bottom: -4px;
    width: 9px;
    height: 2px;
    border-radius: 2px;
    background: #a5b2bc;
    transform: rotate(45deg);
  }

  .pd5-search-box strong {
    min-width: 0;
    color: #7b8794;
    font-size: .92rem;
    font-weight: 800;
  }

  .pd5-feature-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
    padding: 14px 2px 10px;
  }

  .pd5-feature-card h2 {
    margin: 5px 0 4px;
    font-size: 1.35rem;
    color: var(--pd5-text);
  }

  .pd5-feature-card p,
  .pd5-ask-card p,
  .pd5-data-note,
  .pd5-market-summary p {
    margin: 0;
    color: var(--pd5-muted);
    font-size: .82rem;
    line-height: 1.55;
  }

  .pd5-feature-price {
    text-align: right;
  }

  .pd5-feature-price strong,
  .pd5-stock-price strong {
    display: block;
    color: var(--pd5-text);
    font-size: 1rem;
    font-weight: 950;
  }

  .pd5-feature-price em,
  .pd5-stock-price em,
  .pd5-compact-row em,
  .pd5-mini-results em {
    font-style: normal;
    font-weight: 950;
  }

  .pd5-status-strip {
    display: flex;
    gap: 8px;
    overflow: hidden;
    padding-top: 10px;
    border-top: 1px solid var(--pd5-line);
  }

  .pd5-status-strip span {
    min-width: 0;
    padding: 6px 8px;
    border-radius: 999px;
    background: #eef9f7;
    color: var(--pd5-brand-dark);
    white-space: nowrap;
  }

  .pd5-workflow,
  .pd5-ask-card,
  .pd5-market-portal,
  .pd5-watch-card,
  .pd5-report-card,
  .pd5-screener-strip,
  .pd5-list-section {
    padding: 14px;
  }

  .pd5-section-head {
    margin-bottom: 12px;
  }

  .pd5-section-head h3,
  .pd5-ask-card h3 {
    margin: 0;
    color: var(--pd5-text);
    font-size: 1.05rem;
  }

  .pd5-workflow-steps,
  .pd5-market-cards,
  .pd5-prompt-chips,
  .pd5-preset-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    max-width: 100%;
    min-width: 0;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .pd5-workflow-steps::-webkit-scrollbar,
  .pd5-market-cards::-webkit-scrollbar,
  .pd5-prompt-chips::-webkit-scrollbar,
  .pd5-preset-row::-webkit-scrollbar {
    display: none;
  }

  .pd5-workflow-steps button {
    min-width: 112px;
    padding: 12px;
    border: 1px solid var(--pd5-line);
    border-radius: 14px;
    background: #fff;
    text-align: left;
  }

  .pd5-workflow-steps i {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    margin-bottom: 8px;
    border-radius: 8px;
    background: var(--pd5-brand);
    color: #fff;
    font-style: normal;
    font-size: .78rem;
    font-weight: 950;
  }

  .pd5-workflow-steps strong,
  .pd5-market-cards strong {
    display: block;
    color: var(--pd5-text);
    font-size: .95rem;
  }

  .pd5-workflow-steps small,
  .pd5-market-cards small {
    display: block;
    margin-top: 4px;
    color: var(--pd5-muted);
    font-size: .76rem;
    line-height: 1.35;
  }

  .pd5-ask-card {
    display: grid;
    gap: 12px;
  }

  .pd5-prompt-chips button,
  .pd5-preset-row button {
    flex: 0 0 auto;
    max-width: min(260px, calc(100vw - 44px));
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #d7e7ea;
    border-radius: 999px;
    background: #fff;
    color: #415362;
    font-size: .78rem;
    font-weight: 850;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .pd5-data-note {
    margin: -4px 0 10px !important;
    padding: 9px 10px;
    border-radius: 12px;
    background: #fff8e8;
    color: #8a5b00 !important;
  }

  .pd5-market-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
  }

  .pd5-market-cards button {
    min-width: 0;
    min-height: 82px;
    padding: 10px;
    border: 1px solid var(--pd5-line);
    border-radius: 14px;
    background: #fbfefe;
    text-align: left;
  }

  .pd5-market-cards span {
    color: var(--pd5-brand-dark);
    font-size: .8rem;
    font-weight: 900;
  }

  .pd5-watch-list,
  .pd5-report-list,
  .pd5-ranking-list,
  .pd5-mini-results {
    display: grid;
  }

  .pd5-compact-row,
  .pd5-report-list button,
  .pd5-mini-results button {
    display: grid;
    align-items: center;
    width: 100%;
    min-height: 58px;
    border: 0;
    border-top: 1px solid var(--pd5-line);
    background: transparent;
    color: var(--pd5-text);
    text-align: left;
  }

  .pd5-screener-workbench .screener-workbench {
    margin: 0 !important;
    padding: 14px !important;
    border-radius: 18px !important;
    box-shadow: 0 8px 24px rgba(7, 35, 47, .05) !important;
  }

  .pd5-screener-workbench .screener-hero {
    display: none !important;
  }

  .pd5-screener-workbench .screener-result-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    max-height: 220px;
    overflow: auto;
  }

  .pd5-compact-row {
    grid-template-columns: minmax(0, 1fr) 72px 62px;
    gap: 10px;
  }

  .pd5-compact-row strong,
  .pd5-report-list strong {
    display: block;
    overflow: hidden;
    color: var(--pd5-text);
    font-size: .95rem;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .pd5-compact-row small,
  .pd5-report-list small {
    display: block;
    margin-top: 3px;
    color: var(--pd5-muted);
    font-size: .72rem;
  }

  .pd5-compact-row .mobile-sparkline {
    width: 72px;
    height: 32px;
  }

  .pd5-market-tabs {
    position: sticky;
    top: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    padding: 4px;
    border: 1px solid var(--pd5-line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(18px);
  }

  .pd5-market-tabs button {
    min-height: 38px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #71808e;
    font-weight: 950;
  }

  .pd5-market-tabs button.active {
    background: #e9faf7;
    color: var(--pd5-brand-dark);
  }

  .pd5-market-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 14px;
  }

  .pd5-market-summary h2,
  .pd5-market-summary h3 {
    margin: 4px 0;
    color: var(--pd5-text);
  }

  .pd5-stock-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 68px auto;
    grid-template-areas:
      "rank main spark price"
      "rank actions actions actions";
    gap: 8px 10px;
    align-items: center;
    padding: 13px 0;
    border-top: 1px solid var(--pd5-line);
    background: transparent;
  }

  .pd5-rank {
    grid-area: rank;
    color: #9aa6b2;
    font-weight: 950;
  }

  .pd5-stock-main {
    grid-area: main;
    min-width: 0;
  }

  .pd5-stock-main strong {
    display: block;
    overflow: hidden;
    color: var(--pd5-text);
    font-size: 1rem;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .pd5-stock-main small {
    display: block;
    overflow: hidden;
    margin-top: 4px;
    color: var(--pd5-muted);
    font-size: .74rem;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .pd5-stock-row .mobile-sparkline {
    grid-area: spark;
    width: 68px;
    height: 32px;
  }

  .pd5-stock-price {
    grid-area: price;
    min-width: 68px;
    text-align: right;
  }

  .pd5-row-actions {
    grid-area: actions;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
  }

  .pd5-row-actions button {
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid #d8e8eb;
    border-radius: 999px;
    background: #fff;
    color: var(--pd5-brand-dark);
    font-size: .74rem;
    font-weight: 900;
  }

  .pd5-mini-results button {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 42px;
  }

  .pd5-mini-results i {
    color: var(--pd5-muted);
    font-style: normal;
    font-weight: 950;
  }

  .mobile-nav {
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    min-height: 76px !important;
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom)) !important;
    border-top: 1px solid var(--pd5-line) !important;
    background: rgba(255, 255, 255, .96) !important;
    box-shadow: 0 -10px 28px rgba(7, 35, 47, .08) !important;
    backdrop-filter: blur(22px);
  }

  body.is-detail-page .mobile-nav {
    display: none !important;
  }

  .mobile-nav .mobile-tab-button,
  .mobile-nav .nav-button {
    min-width: 0 !important;
    min-height: 56px !important;
    border: 0 !important;
    border-radius: 14px !important;
    background: transparent !important;
    color: #81909b !important;
    box-shadow: none !important;
  }

  .mobile-nav .mobile-tab-button.active,
  .mobile-nav .nav-button.active {
    color: var(--pd5-brand) !important;
  }

  .mobile-detail-bar {
    border-top: 1px solid var(--pd5-line) !important;
    background: rgba(255, 255, 255, .96) !important;
    box-shadow: 0 -12px 28px rgba(7, 35, 47, .08) !important;
    backdrop-filter: blur(22px);
  }

  .stock-detail-page {
    background: var(--pd5-bg) !important;
    padding-bottom: 108px !important;
  }

  .detail-page-head,
  .detail-hero,
  .detail-kline-card,
  .detail-card,
  .research-workflow-card,
  .research-summary-card,
  .trade-plan-card {
    border: 1px solid var(--pd5-line) !important;
    border-radius: 18px !important;
    background: #fff !important;
    box-shadow: 0 8px 24px rgba(7, 35, 47, .05) !important;
  }

  .detail-hero {
    padding: 16px !important;
  }

  .detail-hero h2,
  .detail-card h3,
  .detail-kline-card h3,
  .research-workflow-card h3 {
    color: var(--pd5-text) !important;
    letter-spacing: 0 !important;
  }
}
