* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #0f1115;
  color: #f5f7fa;
}

.app {
  min-height: 100vh;
  padding: 20px;
}

.topbar {
  margin-bottom: 18px;
}

.topbar h1 {
  margin: 0;
  font-size: 28px;
}

.subtext {
  margin-top: 6px;
  color: #9aa4b2;
  font-size: 14px;
}

.content {
  display: grid;
  gap: 16px;
  max-width: 1100px;
}

.card {
  background: #171a21;
  border: 1px solid #262b36;
  border-radius: 12px;
  padding: 16px;
}

.card-watchlist {
  background: linear-gradient(180deg, #131922 0%, #0f141b 100%);
  border: 1px solid rgba(120, 139, 161, 0.16);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}

.card h2 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 18px;
}

.watchlist-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 6px;
}

.watchlist-table thead th {
  text-align: left;
  padding: 0 12px 10px 12px;
  color: #7f95aa;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border-bottom: 1px solid rgba(120, 139, 161, 0.16);
}

.watchlist-table tbody td {
  text-align: left;
  padding: 14px 12px;
  font-size: 13px;
  border-bottom: 1px solid rgba(120, 139, 161, 0.12);
  background: rgba(255, 255, 255, 0.02);
}

.watchlist-table tbody tr:last-child td {
  border-bottom: none;
}

.watchlist-table tbody tr td:first-child {
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

.watchlist-table tbody tr td:last-child {
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

.watchlist-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.04);
}

.watchlist-table td:nth-child(1) {
  font-weight: 800;
  font-size: 14px;
  color: #f5f7fa;
}

.watchlist-table td:nth-child(2) {
  color: #9fb2c7;
  font-weight: 700;
}

.watchlist-table td:nth-child(3),
.watchlist-table td:nth-child(4),
.watchlist-table td:nth-child(5) {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.positive {
  color: #22c55e;
}

.negative {
  color: #ef4444;
}

.flash-up {
  background: rgba(34, 197, 94, 0.18) !important;
  color: #22c55e;
  font-weight: 700;
  transition: background 0.4s ease;
}

.flash-down {
  background: rgba(239, 68, 68, 0.18) !important;
  color: #ef4444;
  font-weight: 700;
  transition: background 0.4s ease;
}

.callout-pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.callout-long {
  background: rgba(34, 197, 94, 0.18);
  color: #22c55e;
}

.callout-short {
  background: rgba(239, 68, 68, 0.18);
  color: #ef4444;
}

.callout-watch {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
}

.callout-range {
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
}

.callout-liquidity {
  background: rgba(168, 85, 247, 0.18);
  color: #c084fc;
}

.callout-neutral {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
}

.watchlist-row {
  transition: transform 0.16s ease;
}

.watchlist-row:hover {
  transform: translateY(-1px);
}

.signal-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.signal-box {
  background: linear-gradient(180deg, #10161f 0%, #0b1118 100%);
  border: 1px solid rgba(120, 139, 161, 0.14);
  border-radius: 12px;
  padding: 14px;
  display: grid;
  gap: 10px;
  min-height: 92px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.signal-box:hover {
  transform: translateY(-1px);
  border-color: rgba(96, 165, 250, 0.28);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
}

.signal-box strong {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7f95aa;
}

.signal-box span {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
}

.signal-box .callout-pill {
  justify-self: start;
  font-size: 12px;
  padding: 5px 10px;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.plan-box {
  background: linear-gradient(180deg, #10161f 0%, #0b1118 100%);
  border: 1px solid rgba(120, 139, 161, 0.14);
  border-radius: 12px;
  padding: 16px;
  display: grid;
  gap: 10px;
  min-height: 102px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.plan-box strong {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7f95aa;
}

.plan-box span {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.35;
  color: #f5f7fa;
  font-variant-numeric: tabular-nums;
}

.plan-box-wide {
  grid-column: 1 / -1;
  min-height: 120px;
}

.plan-box-wide span {
  font-size: 18px;
  line-height: 1.6;
  font-weight: 700;
  color: #d9e4ef;
}

.chart-hero {
  background: linear-gradient(180deg, #131922 0%, #0f141b 100%);
  border: 1px solid rgba(120, 139, 161, 0.16);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto minmax(360px, 420px);
  gap: 18px;
  align-items: center;
}

.hero-left {
  min-width: 0;
}

.hero-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8fb2ff;
  margin-bottom: 10px;
}

.hero-symbol-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.hero-symbol {
  font-size: 52px;
  line-height: 1;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
}

.hero-contract-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(90, 130, 200, 0.26);
  background: rgba(37, 99, 235, 0.12);
  color: #9ec5ff;
  font-size: 14px;
  font-weight: 700;
}

.hero-subtext {
  margin: 0;
  color: #c1cedd;
  font-size: 15px;
  line-height: 1.45;
  max-width: 520px;
}

.hero-price-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 220px;
}

.hero-price {
  font-size: clamp(54px, 5vw, 78px);
  line-height: 1;
  font-weight: 900;
  color: #ffffff;
  margin: 0;
}

.hero-change {
  margin-top: 8px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.hero-change.positive {
  color: #00ff9d;
}

.hero-change.negative {
  color: #ff4d6d;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 14px;
  min-width: 360px;
}

.overview-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(120, 139, 161, 0.14);
  border-radius: 16px;
  padding: 16px 14px;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.overview-box strong {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8fb2ff;
  margin-bottom: 10px;
}

.overview-box span {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.25;
}

@media (max-width: 1180px) {
  .hero-layout {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "left price"
      "boxes boxes";
    align-items: start;
  }

  .hero-left {
    grid-area: left;
  }

  .hero-price-block {
    grid-area: price;
    justify-self: end;
    align-items: flex-end;
    text-align: right;
  }

  .overview-grid {
    grid-area: boxes;
    min-width: 0;
  }
}

@media (max-width: 760px) {
  .hero-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "left"
      "price"
      "boxes";
  }

  .hero-price-block {
    justify-self: start;
    align-items: flex-start;
    text-align: left;
    min-width: 0;
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }

  .hero-symbol {
    font-size: 42px;
  }

  .hero-price {
    font-size: 56px;
  }
}

.overview-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(120, 139, 161, 0.12);
  border-radius: 12px;
  padding: 14px;
  display: grid;
  gap: 8px;
  min-height: 84px;
}

.overview-box strong {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7f95aa;
}

.overview-box span {
  font-size: 15px;
  font-weight: 800;
  color: #f5f7fa;
  line-height: 1.35;
}

.overview-box .callout-pill {
  justify-self: start;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.summary-box {
  background: linear-gradient(180deg, #10161f 0%, #0b1118 100%);
  border: 1px solid rgba(120, 139, 161, 0.14);
  border-radius: 12px;
  padding: 16px;
  display: grid;
  gap: 10px;
  min-height: 118px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.summary-box strong {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: #7f95aa;
  font-family: Arial, sans-serif;
}

.summary-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.summary-note {
  color: #95a2b3;
  font-size: 13px;
  line-height: 1.5;
}

.summary-long {
  background: rgba(34, 197, 94, 0.18);
  color: #22c55e;
}

.summary-short {
  background: rgba(239, 68, 68, 0.18);
  color: #ef4444;
}

.summary-watch {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
}

.summary-range {
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
}

.summary-liquidity {
  background: rgba(168, 85, 247, 0.18);
  color: #c084fc;
}

.summary-neutral {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
}

.topbar-home {
  display: grid;
  gap: 16px;
  margin-bottom: 20px;
}

.home-hero {
  background: linear-gradient(180deg, #131922 0%, #0f141b 100%);
  border: 1px solid rgba(120, 139, 161, 0.16);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.home-hero-left {
  max-width: 720px;
}

.home-title {
  margin: 0 0 8px 0;
  font-size: 40px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: #f5f7fa;
}

.home-subtext {
  margin: 0;
  color: #95a2b3;
  font-size: 15px;
  line-height: 1.6;
  max-width: 720px;
}

.home-hero-right {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mini-stat {
  min-width: 96px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(120, 139, 161, 0.12);
  border-radius: 12px;
  padding: 12px 14px;
  display: grid;
  gap: 6px;
}

.mini-stat-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7f95aa;
}

.mini-stat-value {
  font-size: 16px;
  font-weight: 800;
  color: #f5f7fa;
}

.watchlist-toolbar {
  background: #121821;
  border: 1px solid rgba(120, 139, 161, 0.14);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.toolbar-left {
  display: grid;
  gap: 4px;
}

.toolbar-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7f95aa;
}

.toolbar-note {
  font-size: 14px;
  color: #95a2b3;
}

.toolbar-hint {
  font-size: 12px;
  color: #6f8092;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.symbol-search {
  width: 260px;
  background: #0b1118;
  border: 1px solid rgba(120, 139, 161, 0.16);
  border-radius: 10px;
  padding: 12px 14px;
  color: #f5f7fa;
  font-size: 14px;
  outline: none;
}

.symbol-search:focus {
  border-color: rgba(96, 165, 250, 0.45);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.symbol-search::placeholder {
  color: #6f8092;
}

.add-symbol-btn {
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  color: #dbeafe;
  border: 1px solid rgba(96, 165, 250, 0.22);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  opacity: 1;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.add-symbol-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

.toolbar-note.is-error {
  color: #f87171;
}

.toolbar-note.is-success {
  color: #4ade80;
}

.actions-cell {
  width: 92px;
  text-align: right;
}

.watchlist-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}

.move-symbol-btn,
.remove-symbol-btn {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(120, 139, 161, 0.16);
  background: rgba(255, 255, 255, 0.03);
  color: #9fb2c7;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}

.move-symbol-btn:hover {
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  border-color: rgba(96, 165, 250, 0.24);
}

.remove-symbol-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.22);
}

.watchlist-empty {
  padding: 18px;
  border: 1px dashed rgba(120, 139, 161, 0.22);
  border-radius: 12px;
  color: #95a2b3;
  font-size: 14px;
}

.watchlist-row.dragging td {
  opacity: 0.42;
}

.watchlist-row.drop-before td {
  box-shadow: inset 0 2px 0 #60a5fa;
}

.watchlist-row.drop-after td {
  box-shadow: inset 0 -2px 0 #60a5fa;
}

@media (min-width: 901px) {
  .watchlist-row {
    cursor: grab;
  }

  .watchlist-row:active {
    cursor: grabbing;
  }

  .move-symbol-btn {
    display: none;
  }

  .remove-symbol-btn {
    opacity: 0.28;
  }

  .watchlist-row:hover .remove-symbol-btn {
    opacity: 1;
  }

  .watchlist-actions {
    justify-content: flex-end;
  }
}

@media (max-width: 900px) {
  .hero-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-price-block {
    text-align: left;
    min-width: 0;
  }

  .signal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .plan-grid {
    grid-template-columns: 1fr;
  }

  .overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-hero {
    flex-direction: column;
  }

  .home-hero-right {
    justify-content: flex-start;
  }

  .watchlist-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .toolbar-right {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .symbol-search {
    width: 100%;
  }

  .watchlist-row {
    cursor: pointer;
  }

  .watchlist-actions {
    gap: 4px;
  }

  .move-symbol-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .actions-cell {
    width: 110px;
  }
}

@media (max-width: 560px) {
  .chart-hero {
    padding: 14px;
  }

  .summary-strip {
    grid-template-columns: 1fr;
  }

  .hero-symbol {
    font-size: 28px;
  }

  .hero-price {
    font-size: 34px;
  }

  .summary-strip {
    grid-template-columns: 1fr;
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }

  .home-title {
    font-size: 32px;
  }

  .home-subtext {
    font-size: 14px;
  }

  .mini-stat {
    min-width: 88px;
  }

  .summary-strip {
    grid-template-columns: 1fr;
  }
}

/* ===== Stock-first expansion patch ===== */
.watchlist-name {
  color: #e8eef7;
  font-weight: 800;
  line-height: 1.25;
}

.watchlist-subline {
  color: #7f95aa;
  font-size: 12px;
  line-height: 1.35;
  margin-top: 3px;
}

.callout-buy {
  background: rgba(34, 197, 94, 0.18);
  color: #22c55e;
}

.callout-sell {
  background: rgba(239, 68, 68, 0.18);
  color: #ef4444;
}

.callout-wheel {
  background: rgba(20, 184, 166, 0.18);
  color: #2dd4bf;
}

.callout-options {
  background: rgba(168, 85, 247, 0.18);
  color: #c084fc;
}

.callout-risk,
.callout-avoid {
  background: rgba(248, 113, 113, 0.18);
  color: #f87171;
}

.summary-wheel {
  background: rgba(20, 184, 166, 0.18);
  color: #2dd4bf;
}

.summary-options {
  background: rgba(168, 85, 247, 0.18);
  color: #c084fc;
}

.summary-risk {
  background: rgba(248, 113, 113, 0.18);
  color: #f87171;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}

.section-title-row h2 {
  margin-bottom: 4px;
}

.section-subtext {
  margin: 0;
  color: #95a2b3;
  font-size: 14px;
  line-height: 1.5;
}

.hero-source-note {
  margin: 10px 0 0 0;
  color: #7f95aa;
  font-size: 13px;
  line-height: 1.4;
}

.back-row {
  margin-bottom: 16px;
  display: flex;
  justify-content: flex-start;
}

.back-link,
.quick-switch-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 14px;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.back-link:hover,
.quick-switch-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(96, 165, 250, 0.34);
  background: rgba(96, 165, 250, 0.10);
}

.quick-switch-chip.is-active {
  background: rgba(37, 99, 235, 0.22);
  border-color: rgba(96, 165, 250, 0.70);
  color: #ffffff;
}

.quick-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tradingview-card {
  overflow: hidden;
}

.tv-chart-wrap {
  width: 100%;
  height: 520px;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(120, 139, 161, 0.16);
  background: #131722;
}

.tv-chart-wrap iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.chart-note {
  color: #95a2b3;
  font-size: 13px;
  line-height: 1.5;
  margin: 10px 0 0 0;
}

.tiny-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.12);
  border: 1px solid rgba(96, 165, 250, 0.24);
  color: #93c5fd;
  font-size: 12px;
  font-weight: 800;
}

.main-plan-card {
  border-color: rgba(96, 165, 250, 0.26);
  background: linear-gradient(180deg, #142033 0%, #10161f 100%);
}

.main-plan-highlight {
  padding: 18px;
  border-radius: 14px;
  background: rgba(96, 165, 250, 0.10);
  border: 1px solid rgba(96, 165, 250, 0.22);
  color: #f5f7fa;
  font-size: 20px;
  line-height: 1.55;
  font-weight: 900;
}

.data-read-text {
  padding: 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(120, 139, 161, 0.14);
  color: #e8eef7;
  font-size: 17px;
  line-height: 1.6;
  font-weight: 800;
}

.detail-read-text {
  margin-top: 12px;
  color: #95a2b3;
  font-size: 14px;
  line-height: 1.7;
}

.scanner-card {
  background: linear-gradient(180deg, #131922 0%, #0f141b 100%);
  border: 1px solid rgba(120, 139, 161, 0.16);
  border-radius: 16px;
}

.scanner-categories {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.scanner-tab {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(120, 139, 161, 0.16);
  color: #cbd5e1;
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.scanner-tab:hover {
  transform: translateY(-1px);
  border-color: rgba(96, 165, 250, 0.30);
}

.scanner-tab.is-active {
  background: rgba(37, 99, 235, 0.22);
  border-color: rgba(96, 165, 250, 0.70);
  color: #ffffff;
}

.scan-results-placeholder,
.scan-meta {
  padding: 14px;
  border: 1px dashed rgba(120, 139, 161, 0.22);
  border-radius: 12px;
  color: #95a2b3;
  font-size: 14px;
}

.scan-meta {
  border-style: solid;
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 12px;
}

.scan-results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.scan-card {
  background: linear-gradient(180deg, #10161f 0%, #0b1118 100%);
  border: 1px solid rgba(120, 139, 161, 0.14);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.scan-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.scan-symbol {
  color: #f5f7fa;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.scan-name {
  margin-top: 4px;
  color: #95a2b3;
  font-size: 13px;
  line-height: 1.35;
}

.scan-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.scan-card-grid div {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(120, 139, 161, 0.12);
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 5px;
}

.scan-card-grid strong {
  color: #7f95aa;
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.scan-card-grid span {
  color: #f5f7fa;
  font-size: 13px;
  font-weight: 800;
}

.scan-plan {
  padding: 12px;
  border-radius: 12px;
  background: rgba(96, 165, 250, 0.10);
  border: 1px solid rgba(96, 165, 250, 0.18);
  color: #f5f7fa;
  font-size: 14px;
  line-height: 1.5;
}

.scan-read {
  color: #95a2b3;
  font-size: 13px;
  line-height: 1.55;
}

.scan-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.scan-open-btn,
.scan-add-btn {
  border: 1px solid rgba(120, 139, 161, 0.16);
  border-radius: 10px;
  padding: 10px 12px;
  color: #e8eef7;
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.scan-open-btn:hover,
.scan-add-btn:hover {
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.24);
}

.scan-add-btn:disabled,
#run-scan-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .tv-chart-wrap {
    height: 420px;
  }

  .scan-results-grid {
    grid-template-columns: 1fr;
  }

  .scan-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-title-row {
    flex-direction: column;
    align-items: stretch;
  }

  .main-plan-highlight {
    font-size: 17px;
  }
}

@media (max-width: 560px) {
  .tv-chart-wrap {
    height: 360px;
  }

  .scan-card-grid {
    grid-template-columns: 1fr;
  }

  .watchlist-table thead {
    display: none;
  }

  .watchlist-table,
  .watchlist-table tbody,
  .watchlist-table tr,
  .watchlist-table td {
    display: block;
    width: 100%;
  }

  .watchlist-table tbody td {
    text-align: left !important;
    padding: 9px 10px;
    border-bottom: none;
  }

  .watchlist-table tbody tr {
    display: block;
    border: 1px solid rgba(120, 139, 161, 0.14);
    border-radius: 14px;
    margin-bottom: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
  }

  .actions-cell {
    width: 100%;
  }

  .watchlist-actions {
    justify-content: flex-start;
  }
}

/* ===== Stock Patch 2: platform header, confirmations, news, clearer callouts ===== */

.platform-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 32%),
    #0f1115;
}

.platform-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 64px;
  padding: 0 24px;
  background: rgba(11, 17, 24, 0.88);
  border-bottom: 1px solid rgba(120, 139, 161, 0.16);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.platform-logo {
  color: #f5f7fa;
  font-size: 22px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.platform-logo:hover {
  color: #93c5fd;
}

.platform-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.icon-back {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(120, 139, 161, 0.16);
  color: #e8eef7;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.icon-back:hover {
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.34);
}

.top-quick-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  max-width: 64vw;
  padding-bottom: 2px;
}

.top-quick-switcher::-webkit-scrollbar {
  height: 0;
}

.top-switch-chip {
  color: #cbd5e1;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(120, 139, 161, 0.14);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.top-switch-chip:hover,
.top-switch-chip.is-active {
  color: #ffffff;
  background: rgba(37, 99, 235, 0.24);
  border-color: rgba(96, 165, 250, 0.60);
}

.chart-app {
  padding-top: 18px;
}

.callout-dip {
  background: rgba(250, 204, 21, 0.18);
  color: #fde047;
}

.callout-call {
  background: rgba(34, 197, 94, 0.18);
  color: #22c55e;
}

.callout-put {
  background: rgba(239, 68, 68, 0.18);
  color: #ef4444;
}

.confirmation-card {
  border-color: rgba(250, 204, 21, 0.22);
}

.confirmation-highlight {
  padding: 18px;
  border-radius: 14px;
  font-size: 18px;
  line-height: 1.55;
  font-weight: 900;
}

.confirmation-highlight.is-confirmed {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.24);
  color: #dcfce7;
}

.confirmation-highlight.is-waiting {
  background: rgba(250, 204, 21, 0.10);
  border: 1px solid rgba(250, 204, 21, 0.24);
  color: #fef9c3;
}

.confirmed-good {
  color: #4ade80 !important;
}

.confirmed-wait {
  color: #facc15 !important;
}

.chart-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.open-tv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.22);
  border: 1px solid rgba(96, 165, 250, 0.45);
  color: #dbeafe;
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
}

.open-tv-btn:hover {
  background: rgba(37, 99, 235, 0.34);
  border-color: rgba(147, 197, 253, 0.75);
}

.news-list {
  display: grid;
  gap: 10px;
}

.news-item {
  display: block;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(120, 139, 161, 0.14);
  text-decoration: none;
  color: #e8eef7;
}

.news-item:hover {
  background: rgba(96, 165, 250, 0.08);
  border-color: rgba(96, 165, 250, 0.26);
}

.news-headline {
  font-size: 15px;
  line-height: 1.45;
  font-weight: 900;
  color: #f5f7fa;
}

.news-meta {
  margin-top: 5px;
  color: #93c5fd;
  font-size: 12px;
  font-weight: 800;
}

.news-summary {
  margin-top: 8px;
  color: #95a2b3;
  font-size: 13px;
  line-height: 1.55;
}

@media (max-width: 900px) {
  .platform-bar {
    height: auto;
    min-height: 64px;
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 16px;
  }

  .platform-actions {
    width: 100%;
  }

  .top-quick-switcher {
    max-width: calc(100vw - 86px);
  }
}

@media (max-width: 560px) {
  .platform-logo {
    font-size: 20px;
  }

  .icon-back {
    width: 34px;
    height: 34px;
    font-size: 19px;
  }

  .top-switch-chip {
    font-size: 11px;
    padding: 7px 9px;
  }
}

/* ===== Stock Patch 3: search dropdown, cleaner scanner, chart add button ===== */

.symbol-search-wrap {
  position: relative;
  width: min(420px, 100%);
}

.symbol-suggestions {
  display: none;
  position: absolute;
  z-index: 80;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #0b1118;
  border: 1px solid rgba(120, 139, 161, 0.22);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.42);
}

.suggestion-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: #f5f7fa;
  padding: 12px 14px;
  display: grid;
  gap: 3px;
  text-align: left;
  cursor: pointer;
  border-bottom: 1px solid rgba(120, 139, 161, 0.10);
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover {
  background: rgba(96, 165, 250, 0.12);
}

.suggestion-item span {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.suggestion-item small {
  color: #95a2b3;
  font-size: 12px;
  line-height: 1.35;
}

.add-watchlist-btn {
  cursor: pointer;
}

.add-watchlist-btn.is-added,
.add-watchlist-btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .symbol-search-wrap {
    width: 100%;
  }
}

/* ===== Scanner card polish + watchlist popup ===== */

.scan-card-clickable {
  position: relative;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.scan-card-clickable:hover {
  transform: translateY(-2px);
  border-color: rgba(96, 165, 250, 0.45);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.10) 0%, rgba(11, 17, 24, 1) 100%);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
}

.scan-top-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.scan-save-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.35);
  background: rgba(37, 99, 235, 0.16);
  color: #dbeafe;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.scan-save-btn:hover {
  transform: scale(1.06);
  background: rgba(37, 99, 235, 0.34);
  border-color: rgba(147, 197, 253, 0.75);
}

.scan-save-btn.is-added {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(34, 197, 94, 0.45);
  color: #4ade80;
}

.scanner-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.62);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.scanner-modal-card {
  width: min(520px, 100%);
  background: #111827;
  border: 1px solid rgba(120, 139, 161, 0.22);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.46);
}

.scanner-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.scanner-modal-header h2 {
  margin: 0;
  font-size: 28px;
}

.scanner-modal-header p {
  margin: 6px 0 0 0;
  color: #95a2b3;
  line-height: 1.45;
}

.scanner-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(120, 139, 161, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: #f5f7fa;
  font-size: 22px;
  cursor: pointer;
}

.scanner-modal-options {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.scanner-modal-option {
  width: 100%;
  border: 1px solid rgba(120, 139, 161, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: #f5f7fa;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 900;
  cursor: pointer;
}

.scanner-modal-option:hover {
  border-color: rgba(96, 165, 250, 0.45);
  background: rgba(96, 165, 250, 0.10);
}

.scanner-modal-option small {
  color: #93c5fd;
  font-weight: 900;
}

.scanner-modal-new-row {
  display: flex;
  gap: 10px;
}

.scanner-modal-new-row .symbol-search {
  flex: 1;
}

/* ===== Scanner repair polish ===== */

.scan-card-clickable {
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.scan-card-clickable:hover {
  transform: translateY(-2px);
  border-color: rgba(96, 165, 250, 0.45);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.10) 0%, rgba(11, 17, 24, 1) 100%);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
}

.scan-top-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.scan-save-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.35);
  background: rgba(37, 99, 235, 0.16);
  color: #dbeafe;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.scan-save-btn:hover {
  transform: scale(1.06);
  background: rgba(37, 99, 235, 0.34);
  border-color: rgba(147, 197, 253, 0.75);
}

/* ===== Watchlist folder polish ===== */

.modern-folder-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(120, 139, 161, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.watchlist-add-folder-btn {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.45);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.95), rgba(29, 78, 216, 0.95));
  color: #ffffff;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.22);
  transition: transform 140ms ease, filter 140ms ease, box-shadow 140ms ease;
}

.watchlist-add-folder-btn:hover {
  transform: translateY(-1px) scale(1.03);
  filter: brightness(1.08);
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.32);
}

.watchlist-folder {
  margin-top: 12px;
  border: 1px solid rgba(120, 139, 161, 0.14);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(16, 22, 31, 0.82), rgba(11, 17, 24, 0.82));
  overflow: hidden;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.watchlist-folder:hover {
  border-color: rgba(96, 165, 250, 0.26);
}

.watchlist-folder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(120, 139, 161, 0.10);
  background: rgba(255, 255, 255, 0.025);
}

.watchlist-folder-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.watchlist-folder-drag-handle {
  color: #64748b;
  font-size: 18px;
  font-weight: 900;
  cursor: grab;
  padding: 4px 7px;
  border-radius: 8px;
  user-select: none;
  letter-spacing: -0.18em;
}

.watchlist-folder-drag-handle:hover {
  color: #93c5fd;
  background: rgba(96, 165, 250, 0.10);
}

.watchlist-folder-drag-handle:active {
  cursor: grabbing;
}

.watchlist-folder-toggle {
  border: 0;
  background: transparent;
  color: #f5f7fa;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  min-width: 0;
}

.watchlist-folder-toggle:hover .watchlist-folder-title {
  color: #93c5fd;
}

.folder-caret {
  color: #93c5fd;
  font-size: 14px;
  width: 16px;
  display: inline-flex;
  justify-content: center;
}

.watchlist-folder-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watchlist-folder-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.delete-watchlist-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(239, 68, 68, 0.22);
  background: rgba(239, 68, 68, 0.08);
  color: #fca5a5;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.76;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, opacity 140ms ease;
}

.delete-watchlist-btn:hover {
  transform: scale(1.05);
  opacity: 1;
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.42);
}

.watchlist-folder.folder-dragging {
  opacity: 0.52;
}

.watchlist-folder.folder-drop-before {
  box-shadow: 0 -3px 0 #60a5fa;
}

.watchlist-folder.folder-drop-after {
  box-shadow: 0 3px 0 #60a5fa;
}

.create-watchlist-card {
  max-width: 520px;
}

.single-create-row {
  margin-top: 8px;
}

@media (max-width: 700px) {
  .modern-folder-toolbar {
    align-items: flex-start;
  }

  .watchlist-create-row,
  .single-create-row {
    flex-direction: column;
  }

  .watchlist-add-folder-btn {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
  }
}

/* ===== Watchlist folder drag repair ===== */

.watchlist-folder-header {
  cursor: grab;
}

.watchlist-folder-header:active {
  cursor: grabbing;
}

.watchlist-folder-main,
.watchlist-folder-toggle,
.watchlist-folder-drag-handle {
  cursor: grab;
}

.watchlist-folder.folder-dragging {
  opacity: 0.45;
  transform: scale(0.995);
}

.watchlist-folder.folder-drop-before {
  box-shadow: 0 -3px 0 #60a5fa;
  border-color: rgba(96, 165, 250, 0.55);
}

.watchlist-folder.folder-drop-after {
  box-shadow: 0 3px 0 #60a5fa;
  border-color: rgba(96, 165, 250, 0.55);
}

/* ===== True watchlist folder drag polish ===== */

.watchlist-folder-header {
  cursor: grab !important;
  user-select: none;
}

.watchlist-folder-header:active {
  cursor: grabbing !important;
}

.watchlist-folder-toggle,
.delete-watchlist-btn {
  cursor: pointer !important;
}

.watchlist-folder-drag-handle {
  color: #64748b;
  font-size: 18px;
  font-weight: 900;
  padding: 4px 7px;
  border-radius: 8px;
  user-select: none;
  letter-spacing: -0.18em;
  cursor: grab;
}

.watchlist-folder-header:hover .watchlist-folder-drag-handle {
  color: #93c5fd;
  background: rgba(96, 165, 250, 0.10);
}

.watchlist-folder.folder-dragging {
  opacity: 0.42;
  transform: scale(0.995);
  border-color: rgba(96, 165, 250, 0.55);
}

.watchlist-folder.folder-drop-before {
  box-shadow: 0 -4px 0 #60a5fa;
  border-color: rgba(96, 165, 250, 0.65);
}

.watchlist-folder.folder-drop-after {
  box-shadow: 0 4px 0 #60a5fa;
  border-color: rgba(96, 165, 250, 0.65);
}

/* ===== TradeHub logo size polish ===== */

.home-platform-logo,
.platform-logo {
  font-size: 30px !important;
  font-weight: 950 !important;
  letter-spacing: -0.045em !important;
}

.home-platform-bar,
.platform-bar {
  min-height: 70px !important;
}

@media (max-width: 700px) {

  .home-platform-logo,
  .platform-logo {
    font-size: 24px !important;
  }

  .home-platform-bar,
  .platform-bar {
    min-height: 64px !important;
  }
}

/* ===== Button consistency polish ===== */

/* Make Watchlist create-folder + match scanner + button */
.watchlist-add-folder-btn {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(96, 165, 250, 0.35) !important;
  background: rgba(37, 99, 235, 0.16) !important;
  color: #dbeafe !important;
  font-size: 22px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: none !important;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease !important;
}

.watchlist-add-folder-btn:hover {
  transform: scale(1.06) !important;
  background: rgba(37, 99, 235, 0.34) !important;
  border-color: rgba(147, 197, 253, 0.75) !important;
}

/* Make watchlist-folder delete x match subtle symbol-row x */
.delete-watchlist-btn {
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  min-height: 30px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(120, 139, 161, 0.10) !important;
  background: rgba(255, 255, 255, 0.025) !important;
  color: rgba(148, 163, 184, 0.55) !important;
  font-size: 17px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  opacity: 1 !important;
  box-shadow: none !important;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease, transform 140ms ease !important;
}

.delete-watchlist-btn:hover {
  transform: none !important;
  background: rgba(239, 68, 68, 0.08) !important;
  border-color: rgba(239, 68, 68, 0.22) !important;
  color: rgba(252, 165, 165, 0.90) !important;
}

/* Keep row-level x subtle and matching */
.remove-symbol-btn {
  border-radius: 10px !important;
  border: 1px solid rgba(120, 139, 161, 0.10) !important;
  background: rgba(255, 255, 255, 0.025) !important;
  color: rgba(148, 163, 184, 0.55) !important;
}

.remove-symbol-btn:hover {
  background: rgba(239, 68, 68, 0.08) !important;
  border-color: rgba(239, 68, 68, 0.22) !important;
  color: rgba(252, 165, 165, 0.90) !important;
}

/* ===== Homepage layout final polish ===== */

/* Better 100% zoom layout */
.home-main {
  max-width: 1240px !important;
}

/* Make homepage sections full width instead of squeezed */
.home-dashboard-grid {
  grid-template-columns: 1fr !important;
}

.home-left-column,
.home-right-column {
  width: 100% !important;
}

.important-news-card {
  position: static !important;
}

/* Search bar wider and more platform-like */
.home-search-area {
  width: min(720px, 62vw) !important;
}

.home-search-area .symbol-search {
  height: 42px !important;
}

.home-search-area .add-symbol-btn {
  height: 42px !important;
  min-width: 86px !important;
}

/* Cleaner scanner timestamp */
#scanner-updated-mini {
  font-size: 12px !important;
  color: rgba(147, 197, 253, 0.72) !important;
  font-weight: 800 !important;
}

/* Important news should be compact and scrollable */
.important-news-card {
  margin-bottom: 24px;
}

.home-news-list {
  max-height: 340px !important;
  overflow-y: auto !important;
}

/* Search dropdown row + quick add */
.suggestion-item {
  position: relative !important;
  padding: 10px 48px 10px 12px !important;
  border-radius: 12px !important;
  cursor: pointer !important;
}

.suggestion-plus-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.35);
  background: rgba(37, 99, 235, 0.16);
  color: #dbeafe;
  font-size: 18px;
  font-weight: 950;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.suggestion-plus-btn:hover {
  background: rgba(37, 99, 235, 0.32);
  border-color: rgba(147, 197, 253, 0.70);
}

@media (max-width: 900px) {
  .home-search-area {
    width: min(620px, 58vw) !important;
  }
}

@media (max-width: 700px) {
  .home-search-area {
    width: 100% !important;
  }
}

/* ===== Top menu + market tape + expanded news polish ===== */

.home-menu-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.home-menu-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(120, 139, 161, 0.18);
  background: rgba(255, 255, 255, 0.045);
  color: #dbeafe;
  font-size: 20px;
  font-weight: 950;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.home-menu-btn:hover {
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.38);
}

.home-menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 220px;
  display: none;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid rgba(120, 139, 161, 0.20);
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.42);
  z-index: 100;
}

.home-menu-dropdown.is-open {
  display: grid;
  gap: 4px;
}

.home-menu-dropdown a,
.home-menu-dropdown button {
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #e5edf7;
  text-align: left;
  text-decoration: none;
  padding: 11px 12px;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.home-menu-dropdown a:hover,
.home-menu-dropdown button:hover {
  background: rgba(96, 165, 250, 0.12);
  color: #93c5fd;
}

.home-menu-dropdown .menu-muted {
  color: #7f8ea3;
  cursor: default;
}

.home-menu-dropdown .menu-muted:hover {
  background: transparent;
  color: #7f8ea3;
}

.market-tape {
  border-bottom: 1px solid rgba(120, 139, 161, 0.12);
  background: rgba(2, 6, 23, 0.72);
  overflow: hidden;
  height: 34px;
  display: flex;
  align-items: center;
}

.market-tape-track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  animation: tradehubTapeScroll 80s linear infinite;
}

.market-tape:hover .market-tape-track {
  animation-play-state: paused;
}

.market-tape-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 18px;
  color: #9fb2c7;
  font-size: 12px;
  font-weight: 800;
}

.market-tape-item strong {
  color: #f8fafc;
  font-weight: 950;
}

.tape-positive {
  color: #00e676;
}

.tape-negative {
  color: #ff3b4f;
}

.tape-news span:last-child {
  max-width: 520px;
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes tradehubTapeScroll {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

/* Full-width homepage layout */
.home-main {
  max-width: 1240px !important;
}

.home-dashboard-grid {
  grid-template-columns: 1fr !important;
}

.home-left-column,
.home-right-column {
  width: 100% !important;
}

.important-news-card {
  position: static !important;
}

/* News expanded at bottom */
.home-news-list {
  max-height: none !important;
  overflow: visible !important;
  padding-right: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px !important;
}

@media (max-width: 900px) {
  .home-news-list {
    grid-template-columns: 1fr;
  }

  .market-tape-item {
    padding: 0 14px;
  }

  .tape-news span:last-child {
    max-width: 320px;
  }
}

@media (max-width: 700px) {
  .home-platform-bar {
    gap: 10px !important;
  }

  .home-search-area {
    order: 3;
  }

  .home-menu-wrap {
    position: absolute;
    right: 14px;
    top: 14px;
  }

  .market-tape {
    height: 32px;
  }
}

/* ===== Homepage anchor + ticker tape polish ===== */

/* Prevent menu links from hiding the section title behind sticky header */
#watchlist-section,
#scanner-section,
#news-section {
  scroll-margin-top: 126px;
}

/* Make ticker tape more visible and more platform-like */
.market-tape {
  height: 38px !important;
  background:
    linear-gradient(90deg, rgba(37, 99, 235, 0.14), transparent 18%, transparent 82%, rgba(37, 99, 235, 0.14)),
    rgba(2, 6, 23, 0.86) !important;
  border-top: 1px solid rgba(96, 165, 250, 0.10) !important;
  border-bottom: 1px solid rgba(96, 165, 250, 0.16) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.market-tape-track {
  animation-duration: 95s !important;
}

.market-tape-item {
  font-size: 12.5px !important;
  color: #b7c7da !important;
  padding: 0 20px !important;
}

.market-tape-item strong {
  color: #ffffff !important;
  letter-spacing: 0.02em;
}

.tape-positive {
  color: #00e676 !important;
}

.tape-negative {
  color: #ff4d5e !important;
}

.tape-news::before {
  content: "NEWS";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.16);
  color: #93c5fd;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.08em;
}

@media (max-width: 700px) {

  #watchlist-section,
  #scanner-section,
  #news-section {
    scroll-margin-top: 150px;
  }

  .market-tape {
    height: 34px !important;
  }
}

/* ===== TradeHub Dashboard Usability v1 CSS START ===== */
.home-portfolio-head h2,
.card.card-watchlist h2,
.scanner-card h2,
.important-news-card h2 {
  font-size: 22px !important;
  line-height: 1.1 !important;
  letter-spacing: -0.03em !important;
}

.tradehub-load-meta {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  color: #93c5fd !important;
  font-weight: 900 !important;
}

.tradehub-load-more-wrap,
.tradehub-news-load-more-row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.tradehub-load-more-btn {
  min-height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.52);
  background: rgba(37, 99, 235, 0.20);
  color: #dbeafe;
  padding: 0 18px;
  font-weight: 950;
  cursor: pointer;
  font-family: inherit;
}

.tradehub-load-more-btn:hover {
  border-color: rgba(147, 197, 253, 0.85);
  background: rgba(37, 99, 235, 0.32);
  transform: translateY(-1px);
}

.market-tape-link {
  text-decoration: none !important;
  color: inherit !important;
}

.market-tape-link:hover {
  background: rgba(96, 165, 250, 0.10);
}

.home-news-list .tradehub-news-load-more-row {
  display: flex !important;
}
/* ===== TradeHub Dashboard Usability v1 CSS END ===== */

/* ===== TradeHub Scanner Quality v1 CSS START ===== */
.tradehub-scanner-filters {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 14px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(2, 6, 23, 0.22);
}

.tradehub-scanner-filter {
  display: grid;
  gap: 6px;
  min-width: 170px;
}

.tradehub-scanner-filter span {
  color: #93c5fd;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 950;
}

.tradehub-scanner-filter select {
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.20);
  background: rgba(15, 23, 42, 0.82);
  color: #f8fafc;
  padding: 0 12px;
  font-weight: 850;
  outline: none;
}

.tradehub-scanner-filter-note {
  color: #9bb2cf;
  font-size: 12px;
  line-height: 1.35;
  max-width: 360px;
  padding-bottom: 5px;
}

.tradehub-confidence-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 10px 0 0;
  flex-wrap: wrap;
}

.tradehub-confidence-pill,
.tradehub-watch-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
  border: 1px solid rgba(148, 163, 184, 0.20);
  background: rgba(148, 163, 184, 0.10);
  color: #cbd5e1;
}

.tradehub-confidence-pill.confidence-a {
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.12);
}

.tradehub-confidence-pill.confidence-b {
  color: #bfdbfe;
  border-color: rgba(96, 165, 250, 0.38);
  background: rgba(37, 99, 235, 0.14);
}

.tradehub-confidence-pill.confidence-watch,
.tradehub-watch-only {
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.32);
  background: rgba(245, 158, 11, 0.12);
}

@media (max-width: 760px) {
  .tradehub-scanner-filter {
    width: 100%;
  }
  .tradehub-scanner-filter-note {
    max-width: none;
  }
}
/* ===== TradeHub Scanner Quality v1 CSS END ===== */

/* ===== TradeHub Scanner Clarity v2 CSS START ===== */
.tradehub-confidence-row,
.tradehub-confidence-pill,
.tradehub-watch-only {
  display: none !important;
}

.scan-card-grid-simple {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tradehub-scanner-filter-note {
  color: #9bb2cf;
  font-size: 12px;
  line-height: 1.35;
  max-width: 420px;
  padding-bottom: 5px;
}

@media (max-width: 760px) {
  .scan-card-grid-simple {
    grid-template-columns: 1fr;
  }
}
/* ===== TradeHub Scanner Clarity v2 CSS END ===== */


/* Phase 3Z.1 missed-polish cleanup */
.watchlist-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.watchlist-title-row h2 {
  margin: 0;
}
.watchlist-header-add-btn {
  margin-left: auto;
  flex: 0 0 auto;
}
.card-watchlist .modern-folder-toolbar .watchlist-add-folder-btn {
  display: none !important;
}
a.scanner-next-link,
.scan-card a.scanner-next-link,
.scanner-next-link {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 34px;
  padding: 8px 14px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(96, 165, 250, .65) !important;
  background: rgba(37, 99, 235, .16) !important;
  color: #dbeafe !important;
  text-decoration: none !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .30);
}
a.scanner-next-link:hover,
.scan-card a.scanner-next-link:hover,
.scanner-next-link:hover {
  border-color: rgba(147, 197, 253, .95) !important;
  background: rgba(37, 99, 235, .28) !important;
  color: #ffffff !important;
}


/* === Phase 4I mobile hosted cleanup v1 === */

/* Keep the menu above chart sticky price pills and browser-overlap issues */
.mobile-menu,
.menu-panel,
.menu-drawer,
.nav-drawer,
.side-menu,
.drawer,
.dropdown-menu,
.tradehub-menu,
#mobileMenu,
#menuPanel,
#navDrawer {
  z-index: 99999 !important;
}

.sticky-price,
.floating-price,
.price-sticky,
.price-pill-floating,
.chart-price-pill,
.mini-price-pill,
[class*="sticky"][class*="price"],
[class*="floating"][class*="price"] {
  z-index: 1500 !important;
}

body.menu-open .sticky-price,
body.menu-open .floating-price,
body.menu-open .price-sticky,
body.menu-open .price-pill-floating,
body.menu-open .chart-price-pill,
body.menu-open .mini-price-pill,
body.menu-open [class*="sticky"][class*="price"],
body.menu-open [class*="floating"][class*="price"] {
  z-index: 1 !important;
  pointer-events: none !important;
}

/* Calendar modal status cards should not crowd or misalign long statuses */
.calendar-modal .stat-card,
.calendar-modal .data-card,
.calendar-modal .modal-card,
.event-modal .stat-card,
.event-modal .data-card,
.event-modal .modal-card,
#eventModal .stat-card,
#eventModal .data-card,
#eventModal .modal-card {
  align-items: flex-start !important;
  justify-content: flex-start !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
}

.calendar-modal .stat-card *,
.calendar-modal .data-card *,
.event-modal .stat-card *,
.event-modal .data-card *,
#eventModal .stat-card *,
#eventModal .data-card * {
  max-width: 100% !important;
  overflow-wrap: anywhere !important;
}

/* Cleaner mobile home sections */
@media (max-width: 760px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .page,
  .page-shell,
  .app-shell,
  .content,
  main {
    max-width: 100% !important;
  }

  /* Make the main mobile toolbar more consistent across pages */
  .topbar,
  .app-header,
  .site-header,
  .main-header,
  .tradehub-header,
  .toolbar,
  header[role="banner"] {
    z-index: 5000 !important;
  }

  .topbar input,
  .app-header input,
  .site-header input,
  .main-header input,
  .tradehub-header input,
  .toolbar input,
  header[role="banner"] input {
    min-width: 0 !important;
  }

  /* Center mobile Portfolio header area on Home */
  .portfolio-section,
  .portfolio-card,
  .portfolio-summary,
  #portfolioSection,
  #portfolioCard,
  [id*="portfolio"],
  [class*="portfolio"] {
    text-align: center;
  }

  .portfolio-section .section-header,
  .portfolio-card .section-header,
  .portfolio-summary .section-header,
  #portfolioSection .section-header,
  #portfolioCard .section-header,
  [id*="portfolio"] .section-header,
  [class*="portfolio"] .section-header {
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    gap: 12px !important;
    flex-wrap: wrap !important;
  }

  .portfolio-section h2,
  .portfolio-card h2,
  .portfolio-summary h2,
  #portfolioSection h2,
  #portfolioCard h2,
  [id*="portfolio"] h2,
  [class*="portfolio"] h2 {
    text-align: center !important;
    width: 100%;
  }

  /* Keep calendar status card readable on mobile */
  .calendar-modal .stat-card,
  .calendar-modal .data-card,
  .event-modal .stat-card,
  .event-modal .data-card,
  #eventModal .stat-card,
  #eventModal .data-card {
    min-width: 0 !important;
  }
}


/* === Phase 4J mobile shell rollback v2 === */

/* Force-disable the v1 injected mobile shell if a cached page still tries to show it. */
#tradehub-mobile-shell {
  display: none !important;
}

.tmh-hidden-original-header {
  display: revert !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Keep the original toolbar as the single mobile toolbar. */
@media (max-width: 760px) {
  html,
  body {
    overflow-x: hidden !important;
    max-width: 100% !important;
  }

  header,
  .hdr,
  .topbar,
  .app-header,
  .site-header,
  .tradehub-header,
  .toolbar,
  .main-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 9000 !important;
    background: rgba(8, 12, 22, 0.96) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  header input,
  .hdr input,
  .topbar input,
  .app-header input,
  .site-header input,
  .tradehub-header input,
  .toolbar input,
  .main-header input {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  header button,
  .hdr button,
  .topbar button,
  .app-header button,
  .site-header button,
  .tradehub-header button,
  .toolbar button,
  .main-header button {
    flex-shrink: 0 !important;
  }

  .mobile-menu,
  .menu-panel,
  .menu-drawer,
  .nav-drawer,
  .side-menu,
  .drawer,
  .dropdown-menu,
  .tradehub-menu,
  #mobileMenu,
  #menuPanel,
  #navDrawer {
    z-index: 99999 !important;
  }

  body.menu-open .sticky-price,
  body.menu-open .floating-price,
  body.menu-open .price-sticky,
  body.menu-open .price-pill-floating,
  body.menu-open .chart-price-pill,
  body.menu-open .mini-price-pill,
  body.menu-open [class*="sticky"][class*="price"],
  body.menu-open [class*="floating"][class*="price"],
  body.nav-open .sticky-price,
  body.nav-open .floating-price,
  body.nav-open .price-sticky,
  body.nav-open .price-pill-floating,
  body.nav-open .chart-price-pill,
  body.nav-open .mini-price-pill,
  body.nav-open [class*="sticky"][class*="price"],
  body.nav-open [class*="floating"][class*="price"] {
    z-index: 1 !important;
    pointer-events: none !important;
    opacity: 0.25 !important;
  }

  .chart-hero,
  .asset-hero,
  .hero-card,
  .symbol-hero,
  .ticker-hero {
    position: relative !important;
  }

  .chart-hero .price-card,
  .chart-hero .quote-card,
  .chart-hero .hero-price,
  .asset-hero .price-card,
  .asset-hero .quote-card,
  .asset-hero .hero-price,
  .symbol-hero .price-card,
  .symbol-hero .quote-card,
  .symbol-hero .hero-price,
  .ticker-hero .price-card,
  .ticker-hero .quote-card,
  .ticker-hero .hero-price {
    align-self: flex-start !important;
    margin-top: 0 !important;
  }

  .portfolio-overview,
  .portfolio-summary,
  .portfolio-card,
  #portfolioSummary,
  #portfolioCard,
  #portfolioSection {
    text-align: center !important;
  }

  .portfolio-overview .section-header,
  .portfolio-summary .section-header,
  .portfolio-card .section-header,
  #portfolioSummary .section-header,
  #portfolioCard .section-header,
  #portfolioSection .section-header {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    text-align: center !important;
  }

  .portfolio-overview h2,
  .portfolio-summary h2,
  .portfolio-card h2,
  #portfolioSummary h2,
  #portfolioCard h2,
  #portfolioSection h2 {
    text-align: center !important;
    width: 100% !important;
  }

  .calendar-modal .stat-card,
  .calendar-modal .data-card,
  .event-modal .stat-card,
  .event-modal .data-card,
  #eventModal .stat-card,
  #eventModal .data-card {
    align-items: flex-start !important;
    justify-content: flex-start !important;
    min-width: 0 !important;
    overflow-wrap: anywhere !important;
  }
}

/* === TradeHub Phase 4K mobile layout v1 === */

/*
  Purpose:
  - Use only the original page toolbar.
  - Make mobile toolbar spacing consistent across Home, Chart, Options, Portfolio, News, Calendar.
  - Keep toolbar sticky while scrolling.
  - Keep menu dropdown above the sticky chart price pill.
  - Keep chart hero price toward the top/right instead of dropping to the bottom.
  - Center the Home Portfolio header area on mobile.
*/

@media (max-width: 760px) {
  html,
  body {
    overflow-x: hidden !important;
    max-width: 100% !important;
  }

  /* One original toolbar only. */
  #tradehub-mobile-shell,
  .tmh-hidden-original-header {
    display: none !important;
  }

  .home-platform-bar,
  .topbar,
  header:has(.chart-top-search-wrap),
  header:has(.chart-menu-wrap),
  header:has(.home-search-area),
  header:has(.search-area),
  header:has(.top-search-wrap) {
    position: sticky !important;
    top: 0 !important;
    z-index: 9500 !important;
    width: 100% !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 48px !important;
    grid-template-rows: auto auto !important;
    align-items: center !important;
    column-gap: 10px !important;
    row-gap: 10px !important;
    padding: 14px 16px !important;
    background: rgba(8, 12, 22, 0.97) !important;
    border-bottom: 1px solid rgba(59, 130, 246, 0.16) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
  }

  .home-platform-logo,
  .topbar .logo,
  .topbar .brand,
  header .platform-logo,
  header .chart-platform-logo {
    grid-column: 1 !important;
    grid-row: 1 !important;
    justify-self: start !important;
    align-self: center !important;
    max-width: 100% !important;
    margin: 0 !important;
    font-size: clamp(24px, 7vw, 32px) !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  .home-menu-wrap,
  .chart-menu-wrap,
  .topbar .menu-wrap,
  header .menu-wrap {
    grid-column: 2 !important;
    grid-row: 1 !important;
    justify-self: end !important;
    align-self: center !important;
    position: relative !important;
    width: 48px !important;
    height: 48px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    flex: 0 0 48px !important;
  }

  .home-menu-btn,
  .chart-menu-btn,
  .menu-btn,
  #home-menu-btn,
  #chart-menu-btn,
  #menu-btn {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    border-radius: 999px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 0 0 44px !important;
  }

  .home-search-area,
  .chart-top-search-wrap,
  .topbar .top-search-wrap,
  .topbar .search-area,
  header .search-area,
  header .top-search-wrap {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 10px !important;
    order: initial !important;
    flex: none !important;
  }

  .symbol-search-wrap,
  .topbar .search-wrap,
  header .search-wrap {
    min-width: 0 !important;
    width: 100% !important;
    max-width: none !important;
  }

  .symbol-search,
  .chart-top-search,
  .top-search,
  .search-input,
  #symbol-search,
  #chart-top-search,
  #top-search,
  #global-search,
  #toolbar-search {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 44px !important;
    min-height: 44px !important;
    border-radius: 999px !important;
    font-size: 16px !important;
    padding: 0 16px !important;
    margin: 0 !important;
  }

  .home-search-area .add-symbol-btn,
  .chart-top-search-btn,
  .topbar .search-btn,
  .topbar .btn-primary,
  #search-symbol-btn,
  #add-symbol-btn,
  #chart-top-search-btn,
  #top-search-btn,
  #global-search-btn,
  #toolbar-search-btn {
    width: auto !important;
    min-width: 88px !important;
    max-width: 112px !important;
    height: 44px !important;
    min-height: 44px !important;
    border-radius: 999px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 16px !important;
    margin: 0 !important;
    font-size: 13px !important;
    white-space: nowrap !important;
    flex: 0 0 auto !important;
  }

  /* Undo older mobile rules that made Home search full-width/stacked. */
  .home-search-area {
    flex-direction: unset !important;
    align-items: center !important;
  }

  .home-search-area .add-symbol-btn {
    width: auto !important;
  }

  /* Dropdown menus above sticky/floating price. */
  .home-menu-dropdown,
  .chart-menu-dropdown,
  .menu-dropdown,
  #home-menu-dropdown,
  #chart-menu-dropdown,
  #menu-dropdown {
    position: absolute !important;
    top: calc(100% + 10px) !important;
    right: 0 !important;
    left: auto !important;
    z-index: 100000 !important;
    min-width: 210px !important;
    max-width: min(82vw, 260px) !important;
  }

  .home-menu-dropdown.is-open,
  .chart-menu-dropdown.is-open,
  .menu-dropdown.is-open,
  #home-menu-dropdown.is-open,
  #chart-menu-dropdown.is-open,
  #menu-dropdown.is-open {
    z-index: 100000 !important;
  }

  .chart-sticky-price,
  #chart-sticky-price {
    z-index: 2500 !important;
    pointer-events: none !important;
  }

  body:has(.chart-menu-dropdown.is-open) .chart-sticky-price,
  body:has(#chart-menu-dropdown.is-open) #chart-sticky-price,
  body:has(.menu-dropdown.is-open) .chart-sticky-price,
  body:has(#menu-dropdown.is-open) #chart-sticky-price {
    opacity: 0.18 !important;
    z-index: 1 !important;
  }

  /* Chart hero: keep price in the top/right blank area instead of dropping below buttons. */
  .chart-hero {
    position: relative !important;
    overflow: visible !important;
  }

  .chart-hero .hero-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(118px, 142px) !important;
    grid-template-areas: "left price" !important;
    gap: 12px !important;
    align-items: start !important;
  }

  .chart-hero .hero-left {
    grid-area: left !important;
    min-width: 0 !important;
  }

  .chart-hero .hero-price-block {
    grid-area: price !important;
    justify-self: end !important;
    align-self: start !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 142px !important;
    margin: 0 !important;
    padding: 14px 12px !important;
    text-align: right !important;
    align-items: flex-end !important;
  }

  .chart-hero .hero-price {
    font-size: clamp(30px, 8vw, 44px) !important;
    line-height: 0.95 !important;
    letter-spacing: -0.04em !important;
    white-space: nowrap !important;
  }

  .chart-hero .hero-change {
    font-size: clamp(13px, 3.6vw, 17px) !important;
    line-height: 1.1 !important;
    white-space: normal !important;
  }

  .chart-hero .hero-symbol {
    font-size: clamp(42px, 13vw, 64px) !important;
    line-height: 0.95 !important;
    letter-spacing: -0.05em !important;
    word-break: keep-all !important;
  }

  .chart-hero .hero-action-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .chart-hero .hero-action-row .btn,
  .chart-hero .hero-action-row button,
  .chart-hero .hero-action-row a {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Home Portfolio section alignment. */
  #portfolio-section,
  .home-portfolio-card {
    text-align: center !important;
  }

  .home-portfolio-head {
    align-items: center !important;
    justify-content: center !important;
    flex-direction: column !important;
    text-align: center !important;
    gap: 12px !important;
  }

  .home-portfolio-head h2 {
    width: 100% !important;
    text-align: center !important;
  }

  .home-portfolio-actions {
    width: 100% !important;
    justify-content: center !important;
    align-items: center !important;
    flex-wrap: wrap !important;
  }

  .home-portfolio-status {
    width: 100% !important;
    text-align: center !important;
  }

  /* Calendar modal/card status alignment. */
  .calendar-event-modal,
  .event-modal,
  #eventModal {
    max-width: calc(100vw - 28px) !important;
  }

  .detail-card,
  .stat-card,
  .data-card,
  .event-detail-card,
  .calendar-detail-card {
    min-width: 0 !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }

  .detail-card strong,
  .stat-card strong,
  .data-card strong,
  .event-detail-card strong,
  .calendar-detail-card strong,
  .detail-card span,
  .stat-card span,
  .data-card span,
  .event-detail-card span,
  .calendar-detail-card span {
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
    white-space: normal !important;
  }
}

@media (max-width: 420px) {
  .home-platform-bar,
  .topbar,
  header:has(.chart-top-search-wrap),
  header:has(.chart-menu-wrap),
  header:has(.home-search-area),
  header:has(.search-area),
  header:has(.top-search-wrap) {
    padding-left: 12px !important;
    padding-right: 12px !important;
    grid-template-columns: minmax(0, 1fr) 44px !important;
  }

  .home-search-area,
  .chart-top-search-wrap,
  .topbar .top-search-wrap,
  .topbar .search-area,
  header .search-area,
  header .top-search-wrap {
    gap: 8px !important;
  }

  .home-search-area .add-symbol-btn,
  .chart-top-search-btn,
  .topbar .search-btn,
  .topbar .btn-primary,
  #search-symbol-btn,
  #add-symbol-btn,
  #chart-top-search-btn,
  #top-search-btn,
  #global-search-btn,
  #toolbar-search-btn {
    min-width: 78px !important;
    max-width: 94px !important;
    padding: 0 12px !important;
    font-size: 12px !important;
  }

  .chart-hero .hero-layout {
    grid-template-columns: minmax(0, 1fr) minmax(104px, 126px) !important;
    gap: 8px !important;
  }

  .chart-hero .hero-price-block {
    max-width: 126px !important;
    padding: 12px 10px !important;
  }

  .chart-hero .hero-symbol {
    font-size: clamp(38px, 12vw, 54px) !important;
  }
}
