:root {
  --bg: #0f1520;
  --panel: #182233;
  --line: #3a4e63;
  --text: #c8d4e2;
  --muted: #90a3ba;
  --green: #7dd4b2;
  --red: #e4a4ad;
  --yellow: #e8d3a1;
  --blue: #8cb8e6;
}

* { box-sizing: border-box; }

.app-loading {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  background: rgba(6, 10, 16, 0.5);
  backdrop-filter: blur(8px);
}

.app-loading.open {
  opacity: 1;
  pointer-events: auto;
}

.app-loading-card {
  width: min(380px, calc(100vw - 40px));
  border: 1px solid #35506e;
  border-radius: 12px;
  background: linear-gradient(180deg, #0f1824 0%, #0b121c 100%);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
  padding: 18px 16px;
  text-align: center;
}

.app-loading-spinner {
  margin: 0 auto 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid #2f425a;
  border-top-color: #35c3ff;
  animation: app-spin 0.9s linear infinite;
}

.app-loading-title {
  margin: 0;
  color: #c0ccda;
  font-size: 17px;
  font-weight: 700;
}

.app-loading-sub {
  margin: 7px 0 0;
  color: #9cb3d0;
  font-size: 12px;
}

@keyframes app-spin {
  to { transform: rotate(360deg); }
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 10, 16, 0.85);
  backdrop-filter: blur(12px);
  transition: opacity 0.25s ease;
}

.login-overlay.hidden {
  display: none;
}

.login-card {
  width: min(340px, calc(100vw - 40px));
  padding: 28px 24px;
  background: linear-gradient(180deg, #0f1824 0%, #0b121c 100%);
  border: 1px solid #35506e;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.login-title {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 700;
  color: #cdd9e6;
}

.login-title b { color: #ff7f2a; }

.login-subtitle {
  margin: 0 0 20px;
  font-size: 13px;
  color: #9cb3d0;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-form input {
  padding: 12px 14px;
  font-size: 15px;
  border: 1px solid #2a313c;
  border-radius: 8px;
  background: #0d1117;
  color: var(--text);
  outline: none;
}

.login-form input:focus {
  border-color: #4aa8ff;
}

.login-form input::placeholder {
  color: #6b7a8f;
}

.login-error {
  margin: 0;
  font-size: 13px;
  color: var(--red);
}

.login-error.hidden {
  display: none;
}

.login-btn {
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, #ff7f2a 0%, #e66a1a 100%);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
}

.login-btn:hover {
  background: linear-gradient(180deg, #ff8f3d 0%, #f07a28 100%);
}

.user-badge {
  font-size: 13px;
  color: #9cb3d0;
  padding: 4px 10px;
  background: #1a2332;
  border-radius: 6px;
}

.user-badge.hidden,
.logout-btn.hidden {
  display: none;
}

.logout-btn {
  padding: 6px 12px;
  font-size: 13px;
  border: 1px solid #3a424f;
  background: transparent;
  color: #9cb3d0;
  border-radius: 6px;
  cursor: pointer;
}

.logout-btn:hover {
  background: #273447;
  color: #c0cbd8;
}

html,
body {
  margin: 0;
  background: radial-gradient(circle at top right, #151f2c 0%, #07090d 50%, #050609 100%);
  color: var(--text);
  font-family: "Segoe UI", Tahoma, sans-serif;
}

.topbar {
  height: 46px;
  display: grid;
  grid-template-columns: 160px 1fr 120px;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  border-bottom: 1px solid #3a424f;
  background: linear-gradient(180deg, #202a38 0%, #11161f 70%);
}

.logo {
  font-size: 30px;
  font-weight: 300;
  letter-spacing: 0.3px;
  color: #cdd9e6;
}

.logo b {
  color: #ff7f2a;
  font-weight: 700;
}

.menu {
  display: flex;
  gap: 4px;
  height: 100%;
  align-items: center;
}

.menu-item {
  border: 0;
  background: transparent;
  color: #d5deea;
  height: 34px;
  border-radius: 3px;
  padding: 0 12px;
  font-size: 14px;
  cursor: pointer;
}

.menu-item.active,
.menu-item:hover {
  background: #273447;
}

.suggest-btn {
  border: 1px solid #2c5e4f;
  background: #12392f;
}

.top-right {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}

.clock {
  font-weight: 700;
  color: #d0dfef;
  min-width: 84px;
  text-align: right;
}

.suggest-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 16px;
}

.suggest-modal.open {
  display: flex;
}

.suggest-modal-card {
  width: min(960px, 100%);
  max-height: 85vh;
  overflow: auto;
  border: 1px solid #334255;
  border-radius: 10px;
  background: linear-gradient(180deg, #101722 0%, #0d141d 100%);
  padding: 12px;
}

.suggest-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.suggest-modal-head h3 {
  margin: 0;
  font-size: 18px;
  color: #b4c2d3;
}

.suggest-close {
  width: 30px;
  height: 30px;
  border: 1px solid #415067;
  border-radius: 4px;
  background: #101926;
  color: #d4e2f6;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.suggest-meta {
  margin: 8px 0;
  color: #9bb0cb;
  font-size: 12px;
}

.suggest-search-wrap {
  margin-bottom: 8px;
}

.suggest-search-input {
  width: 100%;
  height: 30px;
  border-radius: 4px;
  border: 1px solid #33445a;
  background: #0b121c;
  color: #b6c3d2;
  padding: 0 8px;
  font-size: 12px;
}

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

.suggest-item {
  border: 1px solid #2f3d50;
  background: #111925;
  border-radius: 6px;
  padding: 8px;
}

.suggest-item-head {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}

.suggest-item-head b {
  font-size: 13px;
}

.suggest-item p {
  margin: 0;
  color: #9ab0cc;
  font-size: 11px;
  line-height: 1.4;
}

.suggest-fields {
  margin-top: 6px;
  color: #7fc5ff;
  font-size: 11px;
}

.suggest-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.suggest-btn-primary,
.suggest-btn-secondary {
  height: 30px;
  border-radius: 4px;
  border: 1px solid #3b4c63;
  padding: 0 10px;
  font-size: 12px;
  cursor: pointer;
}

.suggest-btn-primary {
  background: #0f8f4f;
  border-color: #0f8f4f;
  color: #e6ffee;
}

.suggest-btn-secondary {
  background: #121b29;
  color: #cfdef4;
}

.selected-suggest-list {
  margin-top: 8px;
  border-top: 1px solid #253244;
  padding-top: 8px;
  color: #9bb0cc;
  font-size: 12px;
}

.selected-pill {
  display: inline-block;
  margin: 2px 4px 2px 0;
  border: 1px solid #35506e;
  border-radius: 999px;
  padding: 2px 8px;
  color: #cfe4ff;
  background: #112031;
}

.insights-modal-card {
  width: min(1180px, 100%);
}

.super-scan-modal-card {
  width: min(1360px, 100%);
}

.backtest-scan-modal-card {
  width: min(1320px, 96vw);
  max-height: 90vh;
}

.backtest-scan-controls {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  margin: 6px 0 10px;
  flex-wrap: wrap;
}

.backtest-scan-controls label {
  display: grid;
  gap: 4px;
  color: #9db2cc;
  font-size: 12px;
}

.backtest-scan-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.backtest-highlight-card {
  border: 1px solid #304760;
  border-radius: 9px;
  background: #112033;
  padding: 8px 10px;
}

.backtest-highlight-card span {
  display: block;
  color: #9cb3cf;
  font-size: 12px;
}

.backtest-highlight-card b {
  display: block;
  margin-top: 3px;
  color: #c2cfdd;
  font-size: 16px;
}

.backtest-highlight-card small {
  display: block;
  margin-top: 4px;
  color: #99afc9;
  font-size: 12px;
}

.backtest-scan-table-wrap {
  max-height: 58vh;
}

.backtest-scan-table-wrap tbody tr {
  cursor: pointer;
}

.backtest-scan-table-wrap tbody tr:hover {
  background: rgba(30, 48, 73, 0.35);
}

.super-scan-content {
  min-height: 62vh;
}

.screener-modal-card {
  width: min(1100px, 100%);
}

.insight-symbol-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #2d4055;
  border-radius: 8px;
  background: linear-gradient(180deg, #0f1b2a 0%, #0c1521 100%);
  padding: 8px 10px;
  margin-bottom: 8px;
}

.insight-symbol-left {
  min-width: 0;
}

.insight-symbol-big {
  font-size: 20px;
  font-weight: 800;
  color: #c4d1df;
  line-height: 1;
}

.insight-name-big {
  margin-top: 4px;
  font-size: 13px;
  color: #9bb1cc;
}

.insight-symbol-right {
  text-align: right;
}

.insight-price-big {
  font-size: 30px;
  font-weight: 800;
  color: #c8d4e2;
  line-height: 1;
}

.insight-change-big {
  margin-top: 2px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.insight-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.insight-tab {
  border: 1px solid #3a4f68;
  border-radius: 999px;
  background: #111c2b;
  color: #cde2fb;
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  cursor: pointer;
}

.insight-tab.active {
  border-color: #2b79c2;
  background: #1a3351;
  color: #eaf3ff;
}

.insight-panel {
  border: 1px solid #2b3c50;
  border-radius: 8px;
  padding: 10px;
  background: #0f1825;
  min-height: 320px;
  max-height: 60vh;
  overflow: auto;
}

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

.insight-title-row h4 {
  margin: 0;
  font-size: 16px;
  color: #deebff;
}

.insight-mini-badge {
  border: 1px solid #35465e;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  color: #d7e7fc;
  background: #18273a;
}

.insight-mini-badge.positive {
  border-color: #1f6f4a;
  background: #11452f;
  color: #dcffe9;
}

.insight-mini-badge.negative {
  border-color: #7e2d2d;
  background: #532121;
  color: #ffdede;
}

.insight-desc {
  margin: 8px 0 10px;
  color: #a4b9d4;
  font-size: 12px;
  line-height: 1.45;
}

.insight-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.insight-kpi {
  border: 1px solid #2e4056;
  background: #132033;
  border-radius: 6px;
  padding: 8px;
}

.insight-kpi span {
  display: block;
  color: #8fa8c5;
  font-size: 11px;
}

.insight-kpi b {
  display: block;
  margin-top: 3px;
  font-size: 17px;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.insight-card {
  border: 1px solid #2a3b50;
  border-radius: 6px;
  padding: 8px;
  background: #111d2c;
}

.insight-card span {
  display: block;
  color: #8fa7c4;
  font-size: 11px;
}

.insight-card b {
  display: block;
  margin-top: 3px;
  font-size: 16px;
}

.insight-list {
  margin-top: 10px;
  border: 1px solid #2a3a4f;
  border-radius: 6px;
  overflow: hidden;
}

.insight-list-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-bottom: 1px solid #1f2d40;
  font-size: 12px;
}

.insight-list-row:last-child {
  border-bottom: 0;
}

.insight-empty {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8fa6c3;
  font-size: 14px;
}

.elite-scan-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.elite-explain {
  border: 1px solid #2f4359;
  border-radius: 8px;
  background: #0f1b2a;
  padding: 8px;
  margin-bottom: 8px;
}

.elite-explain h4 {
  margin: 0 0 4px;
  font-size: 14px;
  color: #e4efff;
}

.elite-explain p {
  margin: 0;
  color: #9bb2cf;
  font-size: 12px;
}

.elite-explain-grid {
  margin-top: 6px;
  margin-bottom: 6px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 4px 8px;
  font-size: 12px;
  color: #b8cbe3;
}

.elite-explain-note {
  color: #8ea8c8 !important;
}

.elite-filter-row {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.elite-filter-row label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: #9bb1cb;
}

.elite-input {
  height: 30px;
  min-width: 170px;
  border-radius: 6px;
  border: 1px solid #35506e;
  background: #0d1724;
  color: #d6e5fa;
  padding: 0 8px;
  font-size: 12px;
}

.elite-status {
  color: #a8bed8;
  font-size: 12px;
}

.elite-progress-wrap {
  margin-top: 8px;
  margin-bottom: 8px;
}

.elite-progress-bar {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  border: 1px solid #35506e;
  background: #0e1825;
  overflow: hidden;
}

.elite-progress-bar > div {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #00a0ff 0%, #1de38e 100%);
  transition: width 0.22s ease;
}

.elite-progress-text {
  margin-top: 4px;
  font-size: 12px;
  color: #95adca;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.elite-error {
  border: 1px solid #6d2f38;
  background: #4a1f25;
  color: #ffd8dd;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
  margin-bottom: 8px;
}

.elite-results-wrap {
  max-height: 42vh;
  overflow: auto;
  border: 1px solid #2b3c50;
  border-radius: 6px;
}

.elite-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.elite-table th {
  position: sticky;
  top: 0;
  background: #101a29;
  color: #a9bed8;
  border-bottom: 1px solid #2b3f59;
  text-align: left;
  padding: 6px;
}

.elite-table td {
  border-bottom: 1px solid #1f2d40;
  padding: 6px;
}

.elite-table tbody tr:hover {
  background: #17263b;
  cursor: pointer;
}

.elite-note {
  padding: 8px;
  font-size: 12px;
  color: #9ab1cc;
  border-top: 1px solid #233246;
}

.suggest-status {
  margin-left: auto;
  font-size: 10px;
  border-radius: 999px;
  padding: 1px 6px;
  border: 1px solid transparent;
}

.suggest-status.ready {
  color: #d4ffe6;
  background: #0f5a37;
  border-color: #19744a;
}

.suggest-status.partial {
  color: #ffeec2;
  background: #5e4a14;
  border-color: #7b6020;
}

.suggest-status.missing {
  color: #ffd9d9;
  background: #5a1f1f;
  border-color: #7a2b2b;
}

.layout {
  height: calc(100vh - 46px);
  padding: 6px;
  display: grid;
  grid-template-columns: 320px minmax(470px, 1fr) minmax(520px, 1.2fr);
  gap: 6px;
  min-height: 0;
}

.panel {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #161b23 0%, #11161d 100%);
  overflow: hidden;
  min-height: 0;
}

.panel-title {
  padding: 6px 10px;
  border-bottom: 1px solid #2a313b;
  font-size: 13px;
  color: #b5c3d8;
  background: #111720;
}

.count-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  font-size: 11px;
  border: 1px solid #2d4f6e;
  border-radius: 10px;
  color: #8fd1ff;
}

.left-panel {
  --quote-scrollbar-comp: 0px;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
}

.quote-head,
.quote-row {
  display: grid;
  grid-template-columns: 1fr 80px 76px;
  gap: 8px;
  padding: 4px 8px;
  align-items: center;
  font-size: 12px;
}

.quote-head {
  color: #9fb0c8;
  border-bottom: 1px solid #252d38;
  background: #101620;
  padding-right: calc(8px + var(--quote-scrollbar-comp));
}

.quote-sort-btn {
  justify-self: stretch;
  width: 100%;
  border: 0;
  background: transparent;
  color: #9fb0c8;
  border-radius: 2px;
  height: 22px;
  padding: 0;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-align: right;
  display: block;
}

.quote-sort-btn-left {
  text-align: left;
}

.quote-head > span {
  text-align: right;
}

.quote-list {
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.quote-search-wrap {
  padding: 6px;
  border-bottom: 1px solid #212a35;
  background: #0f151f;
}

.quote-search-input {
  width: 100%;
  height: 28px;
  border-radius: 4px;
  border: 1px solid #33445a;
  background: #0b121c;
  color: #b6c3d2;
  padding: 0 8px;
  font-size: 12px;
}

.quote-search-input::placeholder {
  color: #7f95b3;
}

.quote-empty {
  padding: 8px;
  color: #8ca1bc;
  font-size: 12px;
}

.quote-row {
  border-bottom: 1px solid #1f2733;
  cursor: pointer;
}

.quote-row > span {
  text-align: right;
}

.quote-row:hover,
.quote-row.active {
  background: #1a2331;
}

.quote-row .sym {
  font-weight: 700;
  color: #b4c2d3;
  text-align: left;
}

.pos { color: var(--green); }
.neg { color: var(--red); }

.center-wrap {
  display: grid;
  grid-template-rows: minmax(320px, 46%) minmax(260px, 54%);
  gap: 6px;
  min-height: 0;
}

.center-top {
  display: grid;
  grid-template-rows: auto auto;
  align-content: start;
  min-height: 0;
}

.instrument-bar {
  border-bottom: 1px solid #2a313b;
  padding: 7px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #10161f;
}

.instrument-bar .sym {
  font-size: 20px;
  font-weight: 800;
  margin-right: 8px;
}

.sym-name {
  color: #8fa2be;
  font-size: 13px;
}

.price-pack {
  display: flex;
  gap: 9px;
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.price {
  font-size: 28px;
  font-weight: 800;
  color: #c5d2e0;
}

.chg { font-weight: 700; }

.mini-action-btn {
  height: 28px;
  border: 1px solid #3b4f68;
  background: #122134;
  color: #d5e5fa;
  border-radius: 4px;
  padding: 0 8px;
  font-size: 12px;
  cursor: pointer;
}

#openTvAllModal {
  border-color: #8f5f32;
  background: linear-gradient(180deg, #3a2b1d 0%, #2c2117 100%);
  color: #ffd9b2;
}

#openTvAllModal:hover {
  border-color: #b9773c;
  background: linear-gradient(180deg, #4a3523 0%, #37281b 100%);
  color: #ffe4c7;
}

#openTvAllModal:focus-visible {
  outline: 2px solid #c88648;
  outline-offset: 1px;
}

.real-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  grid-auto-rows: minmax(74px, auto);
  align-content: start;
  gap: 8px;
  padding: 8px;
  overflow: hidden;
}

.metric-card {
  border: 1px solid #293545;
  background: #111a26;
  padding: 6px 8px;
  min-height: 74px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.metric-card span {
  display: block;
  color: #8da2be;
  font-size: 13px;
}

.metric-card b {
  display: block;
  margin-top: 2px;
  font-size: 18px;
  line-height: 1.15;
}

.metric-card b.pos {
  color: #20d889;
}

.metric-card b.neg {
  color: #ff6b74;
}

.metric-card b.warn {
  color: #ffd166;
}

.tv-all-search-wrap {
  padding: 6px 0;
  border-bottom: 1px solid #1f2a39;
}

.tv-all-summary {
  margin: 10px 0;
  border: 1px solid #2c425e;
  border-radius: 12px;
  background: linear-gradient(180deg, #0f1a28 0%, #0d1825 100%);
  padding: 12px;
}

.tv-modal-card {
  width: min(1280px, 96vw);
  max-height: 90vh;
  padding: 14px 14px 12px;
}

.tv-decision-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 4px 8px;
  color: #9eb3cf;
  border-bottom: 1px solid #1f2c40;
}

.tv-meta-left {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  min-width: 0;
}

.tv-meta-left strong {
  font-size: 21px;
  line-height: 1;
  font-weight: 600;
  color: #c2cfdd;
  letter-spacing: 0.1px;
}

.tv-meta-left span {
  font-size: 13px;
  line-height: 1.35;
  font-weight: 500;
  color: #b6c9e2;
}

.tv-meta-left em {
  font-style: normal;
  font-size: 12px;
  line-height: 1;
  font-weight: 500;
  color: #8ba3c2;
  padding: 3px 10px;
  border: 1px solid #2b425f;
  border-radius: 999px;
  background: #13263e;
}

.tv-meta-right {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-shrink: 0;
}

.tv-meta-right b {
  font-size: 18px;
  line-height: 1;
  font-weight: 600;
  color: #c9d5e3;
}

.tv-meta-right i {
  font-style: normal;
  font-size: 14px;
  line-height: 1;
  font-weight: 600;
}

.tv-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.tv-summary-title {
  color: #becbda;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.1px;
}

.tv-summary-pill {
  border: 1px solid #3b4f67;
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1px;
}

.tv-summary-pill.positive {
  border-color: #227c53;
  background: #114a31;
  color: #dcffe9;
}

.tv-summary-pill.negative {
  border-color: #8a3636;
  background: #542323;
  color: #ffe0e0;
}

.tv-summary-pill.neutral {
  border-color: #54657b;
  background: #1d2d40;
  color: #e1edff;
}

.tv-summary-grid {
  margin-top: 6px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.tv-summary-kpi {
  border: 1px solid #304760;
  border-radius: 10px;
  background: #122033;
  padding: 10px 10px 9px;
}

.tv-summary-kpi span {
  display: block;
  font-size: 13px;
  line-height: 1.2;
  color: #9ab2d0;
}

.tv-summary-kpi b {
  display: block;
  margin-top: 4px;
  font-size: 16px;
  line-height: 1.18;
  font-weight: 600;
  color: #c3d0de;
}

.tv-summary-reasons {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.tv-summary-list {
  border: 1px solid #2f445c;
  border-radius: 10px;
  background: #111e2e;
  padding: 10px 11px;
  font-size: 13px;
  line-height: 1.45;
}

.tv-summary-list h4 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
}

.tv-summary-list ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 3px;
}

.tv-summary-list li {
  margin: 0;
}

.tv-summary-note {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.35;
  color: #8ea5c3;
}

.tv-summary-note.strong {
  font-size: 14px;
  color: #dceaff;
  font-weight: 600;
}

.tv-section-title {
  margin: 14px 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: #b6c3d2;
  letter-spacing: 0.1px;
}

.tv-summary-block {
  margin-bottom: 6px;
}

.tv-summary-confirm {
  margin-top: 9px;
  font-size: 14px;
  color: #9db4d1;
  line-height: 1.4;
}

.tv-summary-footnote {
  margin-top: 10px;
  font-size: 13px;
  color: #8fa6c3;
  line-height: 1.35;
}

.tv-summary-alert {
  margin: 2px 0 0;
  font-size: 14px;
  color: #b9cde5;
  line-height: 1.4;
}

.decision-plan-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 10px;
}

.decision-backtest-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
}

.tv-summary-kpi small {
  display: block;
  margin-top: 7px;
  font-size: 13px;
  color: #9cb3cf;
  line-height: 1.4;
}

.tv-summary-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.tv-all-search-input {
  width: 100%;
  height: 26px;
  border-radius: 4px;
  border: 1px solid #33445a;
  background: #0b121c;
  color: #b6c3d2;
  padding: 0 8px;
  font-size: 12px;
}

.tv-all-wrap {
  max-height: 220px;
  overflow: auto;
  font-size: 11px;
}

.tv-all-wrap-modal {
  max-height: 58vh;
}

.tv-all-table {
  width: 100%;
  border-collapse: collapse;
}

.tv-all-table td {
  border-bottom: 1px solid #1d2734;
  padding: 4px 6px;
  vertical-align: top;
}

.tv-all-table td:first-child {
  width: 48%;
  color: #9cb3d1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.tv-all-empty {
  padding: 8px;
  color: #8ca1bc;
}

.center-bottom {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
}

.split-head {
  padding: 6px 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid #2a313b;
  background: #10161f;
}

.split-head h3 {
  margin: 0;
  font-size: 12px;
  color: #a8b8ce;
}

.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 8px;
  height: 100%;
  min-height: 0;
}

.mini-table {
  border: 1px solid #263142;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.mini-row {
  display: grid;
  grid-template-columns: 0.9fr 0.9fr 1fr 0.8fr;
  gap: 8px;
  padding: 4px 6px;
  border-bottom: 1px solid #1f2733;
  font-size: 12px;
  cursor: pointer;
}

.mini-row:hover {
  background: #1a2331;
}

.mini-row > span:nth-child(3) {
  color: #9ec0e2;
}

.mini-rich-head {
  display: grid;
  grid-template-columns: 0.9fr 0.9fr 1fr 0.8fr;
  gap: 8px;
  padding: 5px 6px;
  border-bottom: 1px solid #243145;
  background: #111b28;
}

.mini-col-btn {
  border: 0;
  background: transparent;
  color: #a6b9d3;
  font-size: 11px;
  text-align: left;
  padding: 0;
  cursor: pointer;
}

.mini-col-btn.active {
  color: #d8e8fb;
  font-weight: 700;
}

.mini-rich-body {
  height: 100%;
  min-height: 0;
  overflow: auto;
}

.screener-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  border-top: 1px solid #2b3340;
  border-bottom: 1px solid #2a313b;
  background: #10161f;
  gap: 8px;
}

.screener-head span {
  font-size: 12px;
  color: #a5b5c9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.screener-select {
  background: #0d131d;
  border: 1px solid #374251;
  color: #b6c3d3;
  font-size: 12px;
  border-radius: 4px;
  padding: 4px;
}

.screener-wrap {
  overflow: auto;
  min-height: 0;
}

.screener-head-modal {
  margin-top: 6px;
  border-top: 1px solid #2a313b;
}

.screener-wrap-modal {
  max-height: 62vh;
}

.screener-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.screener-table thead th {
  position: sticky;
  top: 0;
  background: #121a25;
  color: #9db0ca;
  border-bottom: 1px solid #2a313b;
  padding: 5px;
  text-align: left;
}

.screener-table td {
  border-bottom: 1px solid #1f2731;
  padding: 5px;
}

.screener-table tbody tr:hover {
  background: #1a2331;
  cursor: pointer;
}

.right-panel {
  display: grid;
  grid-template-rows: auto minmax(430px, 1fr) auto;
  min-height: 0;
}

.chart-head {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(360px, 520px);
  align-items: start;
  gap: 10px;
  padding: 7px 10px;
  border-bottom: 1px solid #2a313b;
  background: #101720;
}

.chart-left {
  min-width: 0;
  overflow: hidden;
}

.chart-right {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 10px;
  justify-items: end;
  align-content: start;
  min-width: 0;
  max-width: 100%;
}

.chart-head strong {
  font-size: 20px;
}

.updated {
  margin-left: 8px;
  font-size: 12px;
  color: #7f92ae;
}

.signal-pack {
  display: flex;
  gap: 6px;
  grid-column: 2;
  grid-row: 1;
  align-items: center;
}

.chart-icon-btn {
  height: 28px;
  min-width: 30px;
  border: 1px solid #3b4f68;
  background: #122134;
  color: #d5e5fa;
  border-radius: 4px;
  padding: 0 8px;
  font-size: 14px;
  cursor: pointer;
}

.chart-icon-btn:hover {
  border-color: #4f6f94;
  background: #17304c;
}

.chart-icon-btn.active {
  border-color: #2f86d9;
  background: #1e3f63;
}

.hover-info {
  margin-top: 5px;
  color: #9eb5d3;
  font-size: 15px;
  line-height: 1.24;
  white-space: pre-line;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  width: 100%;
  max-width: 100%;
  min-height: 128px;
  overflow: visible;
}

.toggle-pack {
  grid-column: 1 / -1;
  grid-row: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 8px;
  width: 100%;
}

.tf-pack {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: end;
  grid-column: 1;
  grid-row: 1;
}

.tf-pack label {
  font-size: 11px;
  color: #9fb4d2;
}

.tf-select {
  background: #0d131d;
  border: 1px solid #374251;
  color: #b6c3d3;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 12px;
}

.toggle-pack label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #a7bad5;
  border: 1px solid #314156;
  border-radius: 4px;
  padding: 4px 8px;
  background: #121a25;
  min-height: 30px;
}

.toggle-pack input {
  margin: 0;
}

.cross-pair-wrap {
  gap: 6px !important;
}

.cross-pair-select {
  height: 24px;
  padding: 1px 6px;
  font-size: 11px;
}

.pill {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 700;
}

.pill.positive {
  background: #0f8f4f;
  color: #dbffe8;
}

.pill.negative {
  background: #bf2a2a;
  color: #ffe3e3;
}

.pill.neutral {
  background: #344155;
  color: #e4edf9;
}

.chart {
  min-height: 300px;
  height: 100%;
}

.chart-stack {
  display: grid;
  grid-template-rows: minmax(280px, 1fr) auto;
  min-height: 0;
  height: 100%;
}

.chart-wrap {
  position: relative;
  min-height: 300px;
  height: 100%;
}

.subcharts {
  display: grid;
  gap: 6px;
  padding: 6px 8px 0;
  border-top: 1px solid #273140;
  background: #0f1722;
}

.subcharts.hidden {
  display: none;
}

.subchart-panel {
  position: relative;
  border: 1px solid #2a3a4d;
  background: #101822;
  height: 118px;
}

.subchart-panel.hidden {
  display: none;
}

.subchart {
  width: 100%;
  height: 100%;
}

.draw-toolbar-wrap {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 6;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.draw-toolbar-toggle {
  width: 32px;
  height: 32px;
  border: 1px solid #38506c;
  border-radius: 8px;
  background: #122134;
  color: #dceafb;
  font-size: 15px;
  cursor: pointer;
  padding: 0;
}

.draw-toolbar-toggle:hover {
  border-color: #4f6f94;
  background: #17304c;
}

.draw-toolbar-toggle.active {
  border-color: #2f86d9;
  background: #20456d;
  color: #eef7ff;
}

.draw-toolbar {
  display: grid;
  gap: 6px;
}

.draw-toolbar.collapsed {
  display: none;
}

.draw-tool-btn {
  width: 30px;
  height: 30px;
  border: 1px solid #38506c;
  border-radius: 6px;
  background: #122134;
  color: #dceafb;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
}

.draw-tool-btn:hover {
  border-color: #4f6f94;
  background: #17304c;
}

.draw-tool-btn.active {
  border-color: #2f86d9;
  background: #20456d;
  color: #eef7ff;
}

.draw-tool-btn.danger {
  border-color: #6f3d46;
  color: #ffd9df;
}

.right-panel:fullscreen,
.right-panel:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  background: #101720;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.right-panel:fullscreen .chart-stack,
.right-panel:-webkit-full-screen .chart-stack {
  height: 100%;
}

.draw-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 4;
  pointer-events: none;
}

.crosshair-tip {
  position: absolute;
  left: 10px;
  top: 10px;
  display: none;
  pointer-events: none;
  z-index: 5;
  max-width: 320px;
  border: 1px solid #304257;
  background: rgba(8, 13, 20, 0.92);
  color: #d6e4f7;
  font-size: 11px;
  line-height: 1.35;
  border-radius: 4px;
  padding: 5px 7px;
  white-space: pre-line;
  font-variant-numeric: tabular-nums;
  min-width: 210px;
}

.indicators {
  border-top: 1px solid #2b3340;
  display: grid;
  grid-template-columns: repeat(5, minmax(90px, 1fr));
  gap: 7px;
  padding: 8px;
}

.ind-box {
  border: 1px solid #293545;
  background: #111a26;
  padding: 7px;
}

.ind-box span {
  display: block;
  color: #8da2be;
  font-size: 11px;
}

.ind-box b {
  display: block;
  margin-top: 3px;
  font-size: 17px;
}

@media (max-width: 1080px) {
  .layout {
    grid-template-columns: 250px 1fr;
    height: auto;
  }

  .right-panel {
    grid-column: 1 / -1;
  }

  .chart {
    min-height: 280px;
  }
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .left-panel,
  .center-wrap,
  .right-panel {
    min-height: 420px;
  }

  .topbar {
    grid-template-columns: 1fr;
    height: auto;
    padding: 8px;
  }

  .menu {
    overflow-x: auto;
  }

  .chart-head {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .chart-right {
    min-width: 0;
    max-width: 100%;
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .tf-pack,
  .signal-pack,
  .toggle-pack {
    grid-column: auto;
    grid-row: auto;
    justify-self: start;
    width: 100%;
  }

  .toggle-pack {
    grid-template-columns: 1fr;
  }

  .tv-summary-reasons {
    grid-template-columns: 1fr;
  }

  .tv-decision-meta {
    align-items: flex-start;
    padding-top: 6px;
  }

  .tv-meta-right {
    width: 100%;
    justify-content: flex-start;
  }

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

  .decision-backtest-grid {
    grid-template-columns: 1fr;
  }

  .backtest-scan-highlights {
    grid-template-columns: 1fr;
  }

  .backtest-scan-controls {
    align-items: stretch;
  }

  .real-metrics {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}

.tools-modal-card {
  width: min(1540px, 95vw);
  max-height: 90vh;
}

.news-modal-card {
  width: min(1080px, 95vw);
  max-height: 90vh;
}

.tools-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0 10px;
}

.tools-tab {
  border: 1px solid #2f4d72;
  background: #111d30;
  color: #d7e4f7;
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 13px;
  cursor: pointer;
}

.tools-tab.active {
  border-color: #4ea2ff;
  background: #143259;
  color: #d1dbe7;
}

.tools-content {
  border: 1px solid #2b3b52;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(15, 26, 42, 0.95), rgba(10, 19, 31, 0.96));
  padding: 10px;
  min-height: 440px;
  max-height: 68vh;
  overflow: auto;
}

.tools-symbol-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 8px 10px;
  border: 1px solid #2c405b;
  border-radius: 8px;
  padding: 8px;
  background: #102238;
  margin-bottom: 10px;
}

.tools-symbol-left {
  display: grid;
  gap: 4px;
  min-width: 220px;
  flex: 1 1 320px;
}

.tools-symbol-left label {
  color: #95abca;
  font-size: 12px;
}

.tools-symbol-input {
  min-width: 180px;
}

.tools-headline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.tools-headline h4 {
  margin: 0;
  font-size: 24px;
  color: #e7f0ff;
}

.tools-note {
  margin: 0 0 8px;
  color: #a2b5cf;
  font-size: 14px;
}

.tools-pill {
  border: 1px solid #2d4f75;
  background: #122844;
  color: #d7e5fa;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
}

.tools-grid {
  display: grid;
  gap: 10px;
}

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

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

.tools-table-wrap {
  border: 1px solid #2a3e59;
  border-radius: 8px;
  overflow: hidden;
}

.tools-table {
  width: 100%;
  border-collapse: collapse;
}

.tools-table th,
.tools-table td {
  border-bottom: 1px solid #24384f;
  padding: 7px 9px;
  text-align: left;
  font-size: 13px;
}

.tools-table th {
  color: #98b1cf;
  background: #13243a;
}

.tools-table tbody tr:hover {
  background: rgba(35, 75, 121, 0.22);
}

.tools-table .clickable {
  cursor: pointer;
}

.impact-badge {
  border-radius: 999px;
  font-size: 11px;
  padding: 2px 8px;
  display: inline-block;
  border: 1px solid #2b4260;
  color: #d6e7ff;
}

.impact-badge.high {
  background: rgba(187, 43, 43, 0.24);
  border-color: #8c3131;
  color: #ffd3d3;
}

.impact-badge.medium {
  background: rgba(201, 141, 33, 0.2);
  border-color: #8f6b33;
  color: #ffe4b3;
}

.impact-badge.low {
  background: rgba(35, 124, 70, 0.2);
  border-color: #2f7048;
  color: #ccf6db;
}

.detector-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.detector-reason {
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 11px;
  border: 1px solid #2f4a6c;
  background: #142843;
  color: #d5e6ff;
}

.tools-heatmap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 6px;
}

.heatmap-cell {
  border: 1px solid #2c3e56;
  border-radius: 7px;
  padding: 7px;
  cursor: pointer;
}

.heatmap-cell:hover {
  border-color: #4f8bd4;
}

.heatmap-cell .symbol {
  font-size: 13px;
  color: #e7f0ff;
  font-weight: 700;
}

.heatmap-cell .sub {
  margin-top: 2px;
  font-size: 11px;
  color: #9db4d2;
}

.heatmap-cell .change {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 700;
}

.heatmap-cell.pos {
  background: linear-gradient(180deg, rgba(21, 72, 49, 0.36), rgba(12, 37, 27, 0.58));
}

.heatmap-cell.neg {
  background: linear-gradient(180deg, rgba(88, 31, 31, 0.35), rgba(43, 18, 18, 0.58));
}

.tools-links {
  display: grid;
  gap: 9px;
}

.news-item {
  border: 1px solid #2a3f5a;
  border-radius: 8px;
  background: #101e30;
  padding: 8px 10px;
}

.news-item a {
  color: #c3d0de;
  text-decoration: none;
}

.news-item a:hover {
  text-decoration: underline;
}

.news-meta {
  margin-top: 5px;
  color: #95aac7;
  font-size: 12px;
}

.tools-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.tools-input,
.tools-select {
  border: 1px solid #355171;
  background: #101f33;
  color: #e6f1ff;
  border-radius: 7px;
  padding: 6px 8px;
}

.tools-btn {
  border: 1px solid #325e8e;
  background: #14345a;
  color: #c8d4e2;
  border-radius: 7px;
  padding: 6px 11px;
  cursor: pointer;
}

.tools-btn.secondary {
  background: #13263f;
  border-color: #3b506e;
}

.tools-btn.danger {
  background: #3f1920;
  border-color: #7d3b46;
}

.watchlist-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid #2a3d57;
  border-radius: 8px;
  padding: 7px 10px;
  background: #0f1d2f;
}

.watchlist-row strong {
  color: #eff6ff;
}

.watchlist-sub {
  color: #9fb3ce;
  font-size: 12px;
}

.seasonality-bars {
  display: grid;
  gap: 6px;
}

.seasonality-bar-row {
  display: grid;
  grid-template-columns: 80px 1fr 90px;
  align-items: center;
  gap: 8px;
}

.seasonality-bar-track {
  height: 8px;
  border-radius: 999px;
  background: #17283d;
  position: relative;
  overflow: hidden;
}

.seasonality-bar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
}

.seasonality-bar-fill.pos {
  background: #20cd82;
}

.seasonality-bar-fill.neg {
  background: #ff5c5c;
}

.export-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.export-card {
  border: 1px solid #2a3f5a;
  border-radius: 8px;
  background: #102237;
  padding: 10px;
}

.export-card h5 {
  margin: 0 0 6px;
  font-size: 15px;
  color: #e9f1ff;
}

.export-card p {
  margin: 0 0 10px;
  color: #9bb2ce;
  font-size: 12px;
}

.portfolio-modal-card {
  width: min(1320px, 96vw);
  max-height: 90vh;
}

.portfolio-form-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 8px;
  align-items: end;
  margin-bottom: 10px;
}

.portfolio-form-row label {
  display: grid;
  gap: 4px;
  color: #9db2cf;
  font-size: 12px;
}

.portfolio-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}

.portfolio-summary-grid .tv-summary-kpi {
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.portfolio-summary-grid .tv-summary-kpi.portfolio-tone-flat {
  border-color: #304760;
  background: #122033;
}

.portfolio-summary-grid .tv-summary-kpi.portfolio-tone-profit {
  border-color: #355c4b;
  background: linear-gradient(180deg, rgba(26, 61, 47, 0.28), rgba(18, 37, 30, 0.22));
}

.portfolio-summary-grid .tv-summary-kpi.portfolio-tone-loss {
  border-color: #66424a;
  background: linear-gradient(180deg, rgba(74, 33, 42, 0.28), rgba(36, 21, 26, 0.22));
}

.portfolio-summary-grid .tv-summary-kpi.portfolio-tone-profit b {
  color: #9ed9bc;
}

.portfolio-summary-grid .tv-summary-kpi.portfolio-tone-loss b {
  color: #e2a7b0;
}

.portfolio-history {
  margin-top: 10px;
  border: 1px solid #2c405b;
  border-radius: 8px;
  background: #102237;
  padding: 8px;
  color: #9eb5d2;
  font-size: 12px;
  display: grid;
  gap: 6px;
  max-height: 140px;
  overflow: auto;
}

.portfolio-history strong {
  color: #dbe9ff;
}

.portfolio-note {
  margin-top: 4px;
  font-size: 11px;
  color: #8ea6c4;
}

.portfolio-alert-modal {
  z-index: 85;
}

.portfolio-alert-card {
  width: min(700px, 94vw);
  max-height: 82vh;
}

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

.portfolio-alert-item {
  border: 1px solid #35516f;
  border-radius: 8px;
  background: #12263d;
  padding: 8px 10px;
}

.portfolio-alert-item.stop {
  border-color: #8b3c47;
  background: #311d26;
}

.portfolio-alert-item.take {
  border-color: #2e7b56;
  background: #173427;
}

.portfolio-alert-item b {
  display: block;
  color: #e9f3ff;
  font-size: 15px;
}

.portfolio-alert-item span {
  display: block;
  margin-top: 4px;
  color: #a9bfd9;
  font-size: 12px;
}

.news-toast-host {
  position: fixed;
  right: 16px;
  bottom: 14px;
  z-index: 92;
  display: grid;
  gap: 10px;
  width: min(420px, calc(100vw - 24px));
}

.news-toast {
  border: 1px solid #2e4a67;
  border-radius: 10px;
  background: rgba(13, 26, 42, 0.96);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.45);
  padding: 10px 12px 11px;
  color: #d8e6fa;
  cursor: pointer;
  animation: news-toast-in 260ms ease-out;
}

@keyframes news-toast-in {
  from {
    opacity: 0;
    transform: translate(20px, 20px);
  }
  to {
    opacity: 1;
    transform: translate(0, 0);
  }
}

.news-toast-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.news-toast-kicker {
  font-size: 12px;
  color: #8fb6e6;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.news-toast-close {
  border: 1px solid #3e5c7c;
  background: #12273f;
  color: #d8e6fa;
  border-radius: 6px;
  width: 22px;
  height: 22px;
  line-height: 20px;
  padding: 0;
  cursor: pointer;
}

.news-toast-title {
  color: #eaf2ff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  display: block;
  margin-bottom: 4px;
}

.news-toast-title:hover {
  text-decoration: underline;
}

.news-toast-title.disabled,
.news-toast-link.disabled {
  opacity: 0.55;
  pointer-events: none;
}

.news-toast-meta {
  font-size: 12px;
  color: #9fb3ce;
}

.news-toast-extra {
  margin-top: 4px;
  font-size: 12px;
  color: #7dc39a;
}

.news-toast-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.news-toast-link,
.news-toast-all {
  border: 1px solid #3a5878;
  background: #142a44;
  color: #d9e8fb;
  border-radius: 7px;
  font-size: 12px;
  text-decoration: none;
  padding: 5px 10px;
  cursor: pointer;
}

.news-toast-all:hover,
.news-toast-link:hover {
  border-color: #4e6f95;
  background: #1a3555;
}

/* Global pastel pass */
body {
  background: radial-gradient(circle at top right, #1b2435 0%, #101721 55%, #0d121a 100%);
}

.topbar {
  border-bottom-color: #4d6278;
  background: linear-gradient(180deg, #2a3648 0%, #1a2432 75%);
}

.panel {
  border-color: #3b4f64;
  background: linear-gradient(180deg, #1a2535 0%, #141f2d 100%);
}

.panel-title,
.instrument-bar,
.split-head,
.chart-head,
.quote-head,
.quote-search-wrap,
.screener-head,
.subcharts {
  border-color: #3b4f64;
  background: #162233;
}

.metric-card,
.ind-box,
.mini-table,
.mini-rich-head,
.tv-summary-kpi,
.tv-summary-list,
.tools-content,
.suggest-modal-card,
.tv-all-summary,
.tools-symbol-bar,
.watchlist-row,
.export-card,
.portfolio-history,
.portfolio-alert-item,
.subchart-panel,
.insight-panel,
.insight-symbol-strip {
  border-color: #445a72;
  background: #1a283a;
}

.quote-row:hover,
.quote-row.active,
.mini-row:hover,
.tools-table tbody tr:hover,
.screener-table tbody tr:hover {
  background: #1d2d41;
}

.quote-search-input,
.suggest-search-input,
.tv-all-search-input,
.tools-input,
.tf-select,
.screener-select {
  border-color: #4b627c;
  background: #132033;
  color: #c8d4e2;
}

.tools-btn,
.mini-action-btn,
.suggest-btn-secondary,
.suggest-close,
.logout-btn,
.quote-sort-btn,
.news-toast-link,
.news-toast-all,
.news-toast-close {
  border-color: #506884;
  background: #1a2a3f;
  color: #c6d3e1;
}

.tools-btn.secondary {
  background: #1b2d44;
  border-color: #5b7190;
}

.tools-btn.danger {
  background: #3e2630;
  border-color: #80525d;
}

.news-toast {
  border-color: #506887;
  background: rgba(24, 39, 59, 0.96);
  color: #c6d4e5;
}

.news-toast-title {
  color: #cdd8e7;
}

.pill.positive {
  background: #2f6b58;
  color: #cfeee0;
}

.pill.negative {
  background: #6b3f48;
  color: #f0d7dc;
}

.pill.neutral {
  background: #44556c;
  color: #d0d9e6;
}

@media (max-width: 900px) {
  .tools-grid.two,
  .tools-grid.three {
    grid-template-columns: 1fr;
  }

  .tools-symbol-bar {
    align-items: stretch;
  }

  .seasonality-bar-row {
    grid-template-columns: 66px 1fr 72px;
  }

  .portfolio-form-row {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

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