:root {
  --bg: #f3f5f8;
  --panel: #ffffff;
  --text: #18202b;
  --muted: #6a7484;
  --line: #dde3eb;
  --accent: #1c5d99;
  --accent-dark: #133d63;
  --soft: #eaf2fb;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.bd-navbar {
  background: #142033;
  box-shadow: 0 10px 28px rgba(20, 32, 51, .18);
}

.hero-card {
  background: #142033;
  color: #fff;
  border-radius: 28px;
  min-height: 420px;
}

.eyebrow {
  color: #7da8d4;
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 700;
}

.badge-soft {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .2);
  padding: .55rem .75rem;
}

.join-panel {
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .16);
  backdrop-filter: blur(8px);
  border-radius: 24px;
  padding: 28px;
}

.panel, .info-card, .term-card, .admin-tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 10px 24px rgba(23, 40, 60, .05);
}

.info-card, .term-card {
  padding: 22px;
  height: 100%;
}

.info-card h3 {
  font-size: 1.08rem;
}

.info-card p, .term-card p {
  color: var(--muted);
  margin-bottom: 0;
}

.trade-topbar {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 12px;
  align-items: stretch;
}

.top-metric, .public-round {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px 16px;
  min-width: 130px;
}

.top-metric span {
  display: block;
  color: var(--muted);
  font-size: .78rem;
}

.top-metric strong {
  font-size: 1.2rem;
}

.company-list {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 0;
  overflow-y: auto;
}

.company-item {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 10px 12px;
  cursor: pointer;
  transition: .15s ease;
}

.company-item:hover, .company-item.active {
  border-color: var(--accent);
  background: var(--soft);
}

.company-item .ticker {
  font-weight: 800;
}

.company-item .meta {
  color: var(--muted);
  font-size: .78rem;
}

.company-item .price-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.price-badge, .code-pill {
  background: var(--soft);
  color: var(--accent-dark);
  border-radius: 999px;
  padding: 7px 12px;
  font-weight: 700;
}

.news-list {
  display: grid;
  gap: 10px;
  max-height: 650px;
  overflow: auto;
}

.news-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: #fff;
  margin-bottom: 8px;
}

.news-card p {
  color: var(--muted);
  font-size: .9rem;
  margin: 6px 0;
}

.news-card span {
  display: inline-block;
  background: #f0f3f7;
  color: #39485a;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: .75rem;
}

.score-item, .score-row, .mover {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.score-item:last-child, .score-row:last-child, .mover:last-child {
  border-bottom: 0;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: .78rem;
  background: #edf0f4;
}

.status-running { background: #e8f6ee; color: #176a3b; }
.status-waiting { background: #eef4ff; color: #1b56a2; }
.status-paused { background: #fff4d9; color: #9c6500; }
.status-finished { background: #f0eef8; color: #563d7c; }

.player-pill {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
}

.switch-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 12px 12px 38px;
  background: #fff;
}

.result-number {
  font-size: 3.2rem;
  line-height: 1;
  font-weight: 800;
  color: var(--accent-dark);
}

.strategy-box, .nomination {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #f8fafc;
  padding: 14px;
}

.nomination span, .nomination em {
  display: block;
  color: var(--muted);
  font-style: normal;
  font-size: .86rem;
}

.nomination strong {
  font-size: 1.15rem;
}

.admin-tile {
  display: block;
  padding: 26px;
  color: var(--text);
  text-decoration: none;
  height: 100%;
}

.admin-tile span, .admin-tile em {
  display: block;
  color: var(--muted);
  font-style: normal;
}

.admin-tile strong {
  font-size: 3rem;
  color: var(--accent-dark);
}

.mobile-tabs {
  display: flex;
  overflow-x: auto;
  gap: 8px;
}

.tab-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 13px;
  white-space: nowrap;
}

.tab-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

@media (max-width: 991px) {
  .trade-topbar {
    grid-template-columns: 1fr 1fr;
  }
  .pane {
    display: none;
  }
  .pane.active {
    display: block;
  }
}

@media (min-width: 992px) {
  .pane {
    display: block !important;
  }
}

@media (max-width: 576px) {
  .trade-topbar {
    grid-template-columns: 1fr;
  }
  .hero-card {
    border-radius: 20px;
  }
}

.hint-box {
  border: 1px dashed rgba(80, 100, 130, .35);
  border-radius: 14px;
  padding: .85rem 1rem;
  background: rgba(248, 250, 252, .8);
  color: #475569;
  font-size: .92rem;
}
.btn.active {
  box-shadow: inset 0 0 0 2px rgba(15, 23, 42, .18);
}
.strategy-box, .nomination {
  border-radius: 14px;
  background: rgba(15, 23, 42, .04);
  padding: .9rem 1rem;
}

/* Trading chart area */
.chart-toolbar {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 12px;
}

.candle-chart {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}

.candle-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.chart-caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .2rem .75rem;
  padding: .55rem .65rem 0;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: .9rem;
}

.chart-grid {
  stroke: #e5eaf0;
  stroke-width: 1;
}

.chart-average {
  fill: none;
  stroke-width: 1.7;
  pointer-events: none;
}
.chart-average.sma3 { stroke: #2c68a4; }
.chart-average.sma5 { stroke: #a46526; }

.chart-axis, .chart-round, .chart-volume-label {
  fill: #6a7484;
  font-size: 11px;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.chart-round {
  text-anchor: middle;
}

.candle .wick {
  stroke-width: 1.3;
  stroke-linecap: round;
}

.candle .body {
  stroke-width: 1.2;
}

.candle-up .wick,
.candle-up .body {
  stroke: #177245;
}

.candle-up .body {
  fill: #e2f4ea;
}

.candle-down .wick,
.candle-down .body {
  stroke: #a3333d;
}

.candle-down .body {
  fill: #f8e3e6;
}

.volume-bar {
  fill: #d8e1eb;
  opacity: .9;
}

.company-item {
  text-align: left;
  width: 100%;
}

/* Revised trading workspace */
.trade-topbar {
  grid-template-columns: minmax(220px, 1.4fr) repeat(5, minmax(104px, auto));
}

.trade-title-block {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px 16px;
}

.round-progress {
  height: 7px;
  background: #e9eef5;
  border-radius: 999px;
  overflow: hidden;
}

.round-progress > div {
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width .45s ease;
}

.top-metric small {
  display: block;
  font-size: .76rem;
  color: var(--muted);
  margin-top: 2px;
}

.chart-panel {
  position: relative;
}

.candle-live .wick,
.candle-live .body {
  stroke-dasharray: 4 3;
  animation: candlePulse 1.2s ease-in-out infinite;
}

.candle-live .body {
  fill-opacity: .9;
}

.live-dot {
  fill: #1c5d99;
  stroke: #fff;
  stroke-width: 2;
  animation: liveDotPulse 1.2s ease-in-out infinite;
}

.live-price {
  white-space: nowrap;
}

@keyframes candlePulse {
  0%, 100% { opacity: .72; }
  50% { opacity: 1; }
}

@keyframes liveDotPulse {
  0%, 100% { r: 4; opacity: .72; }
  50% { r: 6; opacity: 1; }
}

.micro-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: .74rem;
  margin-top: 4px;
}

.trade-card {
  position: sticky;
  top: 82px;
}

.quick-order-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.order-estimate {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 11px;
  color: #405064;
  font-weight: 600;
}

.briefing-list,
.briefing-movers {
  display: grid;
  gap: 8px;
}

.briefing-card {
  border: 1px solid #e3e9f2;
  background: #fbfdff;
  border-radius: 14px;
  padding: 10px 11px;
}

.briefing-card p {
  color: var(--muted);
  margin: 5px 0;
  font-size: .86rem;
}

.briefing-card span {
  display: inline-flex;
  border-radius: 999px;
  background: #edf3fb;
  color: #36526d;
  padding: 3px 8px;
  font-size: .74rem;
}

.briefing-mover {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 8px 10px;
}

.briefing-mover span {
  color: var(--muted);
  font-size: .82rem;
}

.briefing-mover em {
  font-style: normal;
  font-weight: 700;
}

.capital-chart {
  width: 100%;
  padding: 11px 13px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.capital-chart svg {
  display: block;
  width: 100%;
  height: 130px;
}

.capital-caption, .capital-range {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .3rem 1rem;
}
.capital-caption {
  font-weight: 600;
}
.capital-range {
  font-size: .78rem;
  color: var(--muted);
}
.capital-line {
  fill: none;
  stroke: #1c5d99;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.capital-chart circle {
  fill: #1c5d99;
  stroke: #fff;
  stroke-width: 2;
}

.capital-grid {
  stroke: #dfe6ef;
  stroke-width: 1;
}

.compact-scroll {
  max-height: 310px;
  overflow: auto;
}

@media (max-width: 1200px) {
  .trade-topbar {
    grid-template-columns: 1fr repeat(3, minmax(108px, auto));
  }
}

@media (max-width: 991px) {
  .trade-topbar {
    grid-template-columns: 1fr 1fr;
  }
  .trade-card {
    position: static;
  }
}

@media (max-width: 576px) {
  .trade-topbar {
    grid-template-columns: 1fr;
  }
  .quick-order-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.waiting-hero {
  background: #fff;
}

.waiting-status {
  display: inline-flex;
  border: 1px solid #d8e3ef;
  background: #f7faff;
  color: #405064;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: .9rem;
}

/* Trading workspace validation fix */
.trade-topbar {
  grid-template-columns: minmax(230px, 1.45fr) repeat(7, minmax(104px, auto));
}
.metric-cash {
  border-color: rgba(25, 135, 84, .35);
  background: #fff;
}
.metric-cash strong {
  color: #137044;
}
.market-state-panel {
  background: #fff;
}
.market-index {
  border-radius: 999px;
  padding: 7px 11px;
  background: #f4f7fb;
  border: 1px solid var(--line);
  font-weight: 800;
  white-space: nowrap;
}
.market-hint {
  border: 1px dashed #cbd7e6;
  background: #f8fbff;
  border-radius: 13px;
  padding: 9px 10px;
  color: #48576a;
  font-size: .86rem;
}
.market-sectors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.market-sectors > div,
.market-leaders > div,
.compact-news-item,
.cash-breakdown {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 13px;
}
.market-sectors > div {
  padding: 8px 9px;
}
.market-sectors span {
  display: block;
  color: var(--muted);
  font-size: .74rem;
}
.market-sectors strong {
  display: block;
  font-size: .84rem;
}
.market-leaders {
  display: grid;
  gap: 6px;
}
.market-leaders h3 {
  font-size: .78rem;
  margin: 4px 0 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.market-leaders > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  font-size: .86rem;
}
.compact-news-list {
  display: grid;
  gap: 7px;
}
.compact-news-item {
  padding: 9px 10px;
}
.compact-news-item strong {
  display: block;
  font-size: .86rem;
  line-height: 1.2;
}
.compact-news-item span {
  display: inline-flex;
  margin-top: 5px;
  border-radius: 999px;
  background: #eef4fb;
  color: #36526d;
  padding: 2px 7px;
  font-size: .72rem;
}
.cash-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr));
  gap: 1px;
  background: var(--line);
  overflow: hidden;
}
.cash-breakdown > div {
  padding: .7rem .8rem;
  background: #fff;
}
.cash-breakdown dt {
  font-size: .78rem;
  font-weight: 500;
  color: var(--muted);
}
.cash-breakdown dd {
  margin: .2rem 0 0;
  font-size: 1.03rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 1400px) {
  .trade-topbar {
    grid-template-columns: minmax(220px, 1fr) repeat(4, minmax(104px, auto));
  }
}
@media (max-width: 991px) {
  .trade-topbar {
    grid-template-columns: 1fr 1fr;
  }
  .market-sectors {
    grid-template-columns: 1fr;
  }
}

/* Three-screen trading cockpit */
.workspace-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  position: sticky;
  top: 72px;
  z-index: 12;
  padding: 8px;
  background: rgba(243, 245, 248, .92);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(221, 227, 235, .85);
  border-radius: 20px;
  box-shadow: 0 12px 28px rgba(23, 40, 60, .06);
}

.workspace-tab {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 16px;
  padding: 12px 14px;
  text-align: left;
  transition: .15s ease;
}

.workspace-tab span,
.workspace-tab small {
  display: block;
}

.workspace-tab span {
  font-weight: 800;
}

.workspace-tab small {
  color: var(--muted);
  font-size: .78rem;
  margin-top: 2px;
}

.workspace-tab:hover,
.workspace-tab.active {
  border-color: var(--accent);
  background: #fff;
  color: var(--accent-dark);
}

.workspace-tab.active {
  box-shadow: inset 0 0 0 2px rgba(28, 93, 153, .12);
}

.workspace-section {
  display: none;
}

.workspace-section.active {
  display: block;
}

.company-panel {
  display: flex;
  flex-direction: column;
}
.company-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
}
.company-filters .btn {
  flex: 1 0 auto;
  --bs-btn-padding-y: .2rem;
  --bs-btn-padding-x: .4rem;
  --bs-btn-font-size: .78rem;
}
.terminal-list {
  max-height: min(48vh, 30rem);
}
@media (min-width: 992px) {
  #market-pane {
    position: relative;
  }
  .company-panel {
    position: absolute;
    top: 0;
    left: calc(var(--bs-gutter-x) * .5);
    right: calc(var(--bs-gutter-x) * .5);
    max-height: 100%;
  }
  .terminal-list {
    max-height: none;
  }
}
@media (max-width: 575px) {
  .cash-breakdown {
    grid-template-columns: 1fr;
  }
  .cash-breakdown > div:not([hidden]) {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: .5rem;
    padding: .5rem .7rem;
  }
  .cash-breakdown dd {
    margin: 0;
  }
}

.ohlc-scroll {
  max-height: 210px;
}

#trade-workspace .trade-card,
#trade-workspace #company-card,
#news-market-workspace .panel,
#portfolio-workspace .panel,
.workspace-section {
  scroll-margin-top: 150px;
}

@media (max-width: 991px) {
  .workspace-tabs {
    top: 64px;
    grid-template-columns: 1fr;
  }

  .workspace-tab {
    padding: 10px 12px;
  }

  .pane,
  .pane.active {
    display: block !important;
  }
}

@media (max-width: 576px) {
  .workspace-tabs {
    position: static;
  }
}


/* Admin password and readable settings */
.admin-logout-link {
  color: rgba(255, 255, 255, .72) !important;
  text-decoration: none;
}
.admin-logout-link:hover {
  color: #fff !important;
}
.admin-login-card {
  margin-top: 8vh;
}
.admin-settings-table td:first-child {
  width: 280px;
  white-space: nowrap;
}
.config-pre {
  max-height: 420px;
  overflow: auto;
  margin: 0;
  padding: 10px 12px;
  background: #f6f8fa;
  border: 1px solid var(--line);
  border-radius: 12px;
  white-space: pre-wrap;
}

/* Three-screen trading cockpit refinements */
.terminal-grid {
  align-items: stretch;
}
.market-state-full .compact-news-list,
.news-list {
  max-height: min(50vh, 560px);
  overflow: auto;
}
.market-state-full .market-leaders {
  grid-template-columns: 1fr;
}
.portfolio-scroll,
.orders-scroll {
  max-height: min(58vh, 620px);
}
#scoreboard-list {
  max-height: min(62vh, 680px);
  overflow: auto;
}
.workspace-section {
  min-height: 50vh;
}
.workspace-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 1200px) {
  .workspace-tabs {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 768px) {
  .admin-settings-table td:first-child {
    width: auto;
    white-space: normal;
  }
}

/* Unified scrolling status + tabs block */
.trade-sticky-shell {
  position: sticky;
  top: 72px;
  z-index: 12;
  padding: 10px;
  background: rgba(243, 245, 248, .96);
  border: 1px solid rgba(221, 227, 235, .9);
  border-radius: 22px;
  box-shadow: 0 12px 28px rgba(23, 40, 60, .06);
}
.trade-sticky-shell .workspace-tabs {
  position: static;
  top: auto;
  z-index: auto;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.workspace-tab:hover,
.workspace-tab.active {
  background: #fff;
  border-color: var(--accent);
  color: var(--accent-dark);
}
.metric-cash {
  background: #fff;
}
@media (max-width: 768px) {
  .trade-sticky-shell {
    position: static;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }
}

/* Minimal landing and instructions */
.home-hero-minimal {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: clamp(28px, 5vw, 58px);
  box-shadow: 0 12px 30px rgba(23, 40, 60, .05);
}
.home-join-card {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 26px;
}
.home-chip {
  display: inline-flex;
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 999px;
  padding: 7px 11px;
  color: #405064;
  font-size: .9rem;
}
.step-label {
  display: inline-flex;
  color: var(--accent-dark);
  background: var(--soft);
  border-radius: 999px;
  padding: 4px 9px;
  font-weight: 800;
  font-size: .78rem;
  margin-bottom: 10px;
}
.instructions-hero {
  background: #fff;
}
.instruction-goal {
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 20px;
  padding: 20px;
}
.instruction-goal span,
.memo-box span,
.instruction-grid span {
  display: block;
  color: var(--muted);
  font-size: .86rem;
}
.instruction-goal strong {
  display: block;
  font-size: 1.35rem;
  line-height: 1.2;
}
.instruction-list {
  display: grid;
  gap: 10px;
  padding-left: 1.2rem;
}
.instruction-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.instruction-grid > div,
.memo-box {
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 16px;
  padding: 13px;
}
.memo-box strong {
  display: block;
  color: var(--accent-dark);
}
@media (max-width: 768px) {
  .instruction-grid {
    grid-template-columns: 1fr;
  }
}

/* Trade screen scroll behavior fix */
.trade-sticky-shell,
.trade-card,
.workspace-tabs {
  position: static !important;
  top: auto !important;
}
.trade-sticky-shell {
  z-index: 1;
  margin-bottom: 14px;
}
.trade-topbar {
  align-items: stretch;
}
.top-metric {
  padding: 10px 12px;
  min-width: 104px;
}
.top-metric strong {
  font-size: 1.05rem;
}
.trade-title-block {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px 12px;
}
.briefing-list {
  max-height: min(34vh, 360px);
  overflow: auto;
  padding-right: 4px;
}
.news-list {
  max-height: min(44vh, 520px);
}

/* Public screen dashboard */
.public-dashboard {
  height: calc(100vh - 124px);
  min-height: 640px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}
.public-dashboard-head {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(620px, 1.5fr);
  gap: 12px;
  align-items: stretch;
}
.public-dashboard-head h1 {
  margin: 0;
  font-size: clamp(1.55rem, 2.2vw, 2.35rem);
  font-weight: 800;
}
.public-status-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.public-stat,
.public-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 10px 24px rgba(23, 40, 60, .045);
}
.public-stat {
  padding: 11px 12px;
}
.public-stat span,
.public-card-title span {
  display: block;
  color: var(--muted);
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
}
.public-stat strong {
  display: block;
  font-size: 1.2rem;
  line-height: 1.2;
}
.public-dashboard-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(360px, 1.1fr) minmax(420px, 1.25fr);
  grid-template-rows: minmax(0, 1.05fr) minmax(0, .9fr);
  gap: 12px;
}
.public-card {
  min-height: 0;
  padding: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.public-card-title {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  margin-bottom: 12px;
}
.public-card-title h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
}
.public-card-title em {
  font-style: normal;
  color: var(--muted);
  font-size: .85rem;
}
.public-score-list,
.public-mover-list,
.public-nominations {
  display: grid;
  gap: 8px;
  overflow: auto;
  min-height: 0;
}
.public-score-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 14px;
  padding: 10px;
}
.public-score-row > span {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--accent-dark);
  font-weight: 800;
}
.public-score-row strong,
.public-score-row em,
.public-mover-row strong,
.public-mover-row em {
  font-style: normal;
  line-height: 1.15;
}
.public-score-row small,
.public-mover-row small {
  display: block;
  color: var(--muted);
  font-weight: 500;
  margin-top: 3px;
}
.public-news-window {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.public-news-track {
  display: grid;
  gap: 10px;
}
.public-news-track.is-animated {
  animation: publicNewsScroll 38s linear infinite;
}
.public-news-window:hover .public-news-track {
  animation-play-state: paused;
}
.public-news-item {
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 16px;
  padding: 12px;
}
.public-news-item p {
  color: var(--muted);
  margin: 6px 0;
  font-size: .94rem;
}
.public-news-item span {
  display: inline-flex;
  border-radius: 999px;
  background: #edf3fb;
  color: #36526d;
  padding: 3px 8px;
  font-size: .75rem;
}
.public-movers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  min-height: 0;
}
.public-movers-grid h3 {
  font-size: .95rem;
  margin-bottom: 8px;
}
.public-mover-row,
.public-nomination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 14px;
  padding: 10px;
}
.public-summary-card p {
  color: #405064;
  font-size: 1rem;
  line-height: 1.45;
}
.public-nominations {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.public-nomination {
  display: block;
}
.public-nomination span,
.public-nomination em {
  display: block;
  color: var(--muted);
  font-style: normal;
  font-size: .82rem;
}
.public-empty {
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #f8fafc;
}
@keyframes publicNewsScroll {
  from { transform: translateY(0); }
  to { transform: translateY(-50%); }
}
@media (max-width: 1200px) {
  .public-dashboard {
    height: auto;
    min-height: 0;
    overflow: visible;
  }
  .public-dashboard-head,
  .public-dashboard-grid {
    grid-template-columns: 1fr;
  }
  .public-dashboard-grid {
    grid-template-rows: auto;
  }
  .public-status-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .public-news-window {
    max-height: 420px;
    overflow: auto;
  }
}
@media (max-width: 768px) {
  .public-status-grid,
  .public-movers-grid,
  .public-nominations {
    grid-template-columns: 1fr;
  }
}
.public-body {
  overflow: hidden;
}
.public-main {
  padding: 14px;
}
.public-body .public-dashboard {
  height: calc(100vh - 28px);
  min-height: 0;
}
.public-title-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px 18px;
  box-shadow: 0 10px 24px rgba(23, 40, 60, .045);
}
@media (max-width: 1200px) {
  .public-body {
    overflow: auto;
  }
}
@media (max-width: 1200px) {
  .public-body .public-dashboard {
    height: auto;
    min-height: 0;
  }
}

.company-heading, .chart-toolbar, .chart-controls, .quote-controls,
.portfolio-actions, .position-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem .8rem;
}
.chart-toolbar { justify-content: space-between; }
.chart-controls .form-check-inline { margin-right: 0; }
.quote-controls { gap: .55rem; }
.quote-value { color: var(--muted); font-size: .78rem; }
.quote-value strong { color: var(--accent-dark); font-size: 1.02rem; }
.company-row { position: relative; min-width: 0; }
.company-row .company-item { display: block; }
.company-row .company-item > div:first-child { padding-right: 2.25rem; }
.info-button {
  display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem;
  padding: 0; border: 1px solid #aebed0; border-radius: 50%; background: #fff;
  color: var(--accent-dark); font: 700 .98rem Georgia, serif;
}
.info-button:hover, .info-button:focus-visible { color: #fff; background: var(--accent); }
.company-row .info-button { position: absolute; right: .55rem; top: .42rem; }
.analysis-metrics {
  display: flex; flex-wrap: wrap; gap: .35rem 1.45rem; margin: 0 0 1rem;
  padding: .65rem .8rem; border: 1px solid var(--line); border-radius: .7rem;
}
.analysis-metrics dt, .issuer-signals small {
  color: var(--muted); font-size: .76rem; font-weight: 500;
}
.analysis-metrics dd { margin: 0; font-weight: 650; }
.issuer-factors { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .7rem; }
.issuer-factors section { min-width: 0; border-left: 3px solid #abcbbd; padding-left: .7rem; }
.issuer-factors section + section { border-color: #d8bf93; }
.issuer-factors h3, .signal-heading { font-size: .92rem; font-weight: 700; margin-bottom: .4rem; }
.issuer-factors ul { margin: 0; padding-left: 1rem; font-size: .86rem; color: #425162; }
.signal-heading { margin-top: 1rem; }
.issuer-signals { display: grid; gap: .45rem; list-style: none; margin: 0; padding: 0; }
.issuer-signals li { background: #f5f8fb; padding: .6rem .75rem; border-radius: .6rem; }
.issuer-signals strong { display: block; font-size: .9rem; }
.issuer-signals p { font-size: .86rem; margin: .2rem 0 0; }
.trade-dialog {
  width: min(36rem, calc(100% - 1.5rem)); max-width: none; max-height: 90vh; max-height: 90dvh;
  margin: auto; padding: 0; border: 1px solid var(--line); border-radius: 1.05rem; color: var(--text);
  background: #fff; box-shadow: 0 1rem 3rem #14203340;
}
.trade-dialog[open] { display: flex; flex-direction: column; }
.trade-dialog::backdrop { background: rgb(14 29 46 / 62%); }
.trade-dialog-head {
  flex: none; display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.2rem; gap: 1rem; border-bottom: 1px solid var(--line);
}
.trade-dialog-head .btn-close { padding: .6rem; }
.trade-dialog-body { overflow-y: auto; overscroll-behavior: contain; padding: 1rem 1.2rem; }
.news-market-grid {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(20rem, 1fr);
  align-items: start; gap: 1rem;
}
.market-sidebar, .portfolio-grid { display: grid; align-content: start; gap: 1rem; min-width: 0; }
#news-pane { container-type: inline-size; }
#news-pane .news-list { max-height: none; overflow: visible; }
#news-pane .news-card { margin: 0; }
.pregame-archive { border-top: 1px solid var(--line); padding-top: .8rem; }
.pregame-archive summary { color: var(--accent-dark); font-weight: 600; font-size: .9rem; }
@container (min-width: 48rem) {
  #news-list, #briefing-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
.portfolio-overview {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start; gap: .9rem;
}
#portfolio-pane, #orders-pane { min-width: 0; }
.portfolio-actions { justify-content: flex-end; }
.position-actions { justify-content: flex-end; gap: .35rem; }
.holdings-table td, .holdings-table th { padding: .6rem .4rem; }
@media (max-width: 991px) {
  .news-market-grid, .portfolio-overview { grid-template-columns: 1fr; }
}
@media (max-width: 639px) {
  .issuer-factors { grid-template-columns: 1fr; }
  .company-row .info-button { width: 2rem; height: 2rem; }
  .portfolio-actions { width: 100%; justify-content: space-between; }
  .holdings-table, .holdings-table tbody { display: block; }
  .holdings-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .holdings-table tbody tr {
    display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .45rem .7rem;
    padding: .65rem .75rem; border: 1px solid var(--line); border-radius: .65rem; margin: .45rem 0;
  }
  .holdings-table td { padding: 0; border: 0; }
  .holdings-table td[data-label] { text-align: left !important; }
  .holdings-table td::before {
    display: block; content: attr(data-label); color: var(--muted); font-size: .73rem;
  }
  .holdings-table td:last-child, .holdings-table td[colspan] { grid-column: 1/-1; }
  .holdings-table td:last-child::before { display: none; }
  .position-actions { justify-content: flex-start; margin-top: .3rem; }
  .portfolio-scroll { max-height: none; }
}
