﻿:root {
  color-scheme: dark;
  --bg: #050d16;
  --bg-2: #0b1720;
  --panel: rgba(20, 33, 42, 0.78);
  --panel-2: rgba(10, 19, 29, 0.88);
  --ink: #f8fbff;
  --muted: #98a5ad;
  --soft: #c5d1d8;
  --line: rgba(192, 211, 220, 0.18);
  --line-strong: rgba(151, 232, 162, 0.62);
  --accent: #97e8a2;
  --accent-2: #6dcf7e;
  --green: #97e8a2;
  --yellow: #d4b36b;
  --red: #ee6f6f;
  --blue: #7eb6d8;
  --purple: #9c8fe8;
  --shadow: rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 72% 14%, rgba(151, 232, 162, 0.1), transparent 34%),
    radial-gradient(circle at 48% 52%, rgba(40, 71, 78, 0.38), transparent 42%),
    linear-gradient(135deg, #050d16 0%, #09131d 44%, #15272c 100%);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}

.faq-body {
  background:
    linear-gradient(135deg, rgba(5, 13, 22, 0.78) 0%, rgba(9, 19, 29, 0.68) 48%, rgba(21, 39, 44, 0.76) 100%),
    url("/images/smartbg.png") center / cover no-repeat fixed;
}

.app-header {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 28px 44px;
  background: rgba(5, 13, 22, 0.72);
  color: var(--ink);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.18);
}

.app-header h1,
h1 {
  margin: 0;
  color: var(--ink);
  font-size: 32px;
  font-weight: 500;
  letter-spacing: 0;
}

.app-header h1::first-letter {
  color: var(--accent);
}

.app-header h1.faq-title::first-letter {
  color: var(--ink);
}

.faq-title span {
  color: var(--accent);
}

.brand-title span:nth-child(2) {
  color: var(--accent);
}

.app-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  color: var(--soft);
}

#currentUser {
  color: var(--ink);
  font-weight: 700;
}

main {
  width: min(1460px, calc(100vw - 32px));
  margin: 22px auto 44px;
}

.strategy-tabs,
.watchlist-tabs,
.toolbar,
.summary,
.alert-line,
.portfolio-performance,
.portfolio-editor,
.backtest-panel,
.backtest-info-panel,
.chart-panel,
.table-wrap,
.notes,
.faq-panel,
.login-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 24px 70px var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(14px);
}

.strategy-tabs {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
  padding: 14px;
  background: var(--panel);
}

.strategy-tabs-label {
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.watchlist-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  padding: 14px;
}

.portfolio-editor {
  margin-top: 16px;
  padding: 18px;
}

.portfolio-editor-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.portfolio-editor-header button {
  margin-left: 0;
}

.portfolio-editor-header #toggleAddTickersButton {
  margin-left: auto;
}

.portfolio-active-name {
  color: var(--soft);
  font-weight: 700;
}

.portfolio-ticker-rows {
  display: grid;
  gap: 12px;
}

.portfolio-ticker-rows[hidden] {
  display: none;
}

.portfolio-ticker-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(150px, 1fr) minmax(120px, 0.8fr) minmax(140px, 0.9fr) minmax(130px, 0.8fr) auto auto;
  gap: 10px;
  align-items: end;
}

.portfolio-ticker-chart {
  margin-top: 16px;
}

.portfolio-ticker-chart canvas {
  width: 100%;
}

.portfolio-ticker-field {
  display: grid;
  gap: 6px;
  color: var(--soft);
  font-weight: 700;
}

.portfolio-ticker-field span {
  font-size: 12px;
  line-height: 1.2;
}

.portfolio-ticker-field input {
  width: 100%;
}

.portfolio-holdings {
  margin-top: 16px;
}

.portfolio-holdings .portfolio-editor-header {
  align-items: baseline;
}

.holdings-section-label {
  margin-left: 12px;
  line-height: 1.25;
}

.portfolio-holdings .portfolio-active-name {
  line-height: 1.25;
}

.portfolio-profit-loss.gain {
  color: var(--accent);
  font-weight: 800;
}

.portfolio-profit-loss.loss {
  color: var(--red);
  font-weight: 800;
}

.portfolio-holdings tfoot td {
  background: rgba(5, 13, 22, 0.72);
  border-top: 3px solid rgba(192, 211, 220, 0.38);
  border-bottom: 0;
  font-weight: 800;
}

.tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.watchlist-delete-label {
  margin-left: auto;
  color: var(--soft);
  font-weight: 700;
}

#deleteWatchlistSelect {
  min-width: 150px;
}

button,
select,
.strategy-faq-link,
.header-link-button {
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
}

button {
  padding: 0 18px;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

button:hover,
.strategy-faq-link:hover,
.header-link-button:hover {
  background: rgba(151, 232, 162, 0.14);
  color: var(--ink);
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.watchlist-tab,
.strategy-tab {
  height: 38px;
  color: var(--soft);
  border-color: transparent;
  background: transparent;
}

.watchlist-tab.active,
.strategy-tab.active,
#saveButton,
#backtestAllButton,
.backtest-button {
  color: #061019;
  background: var(--accent);
  border-color: var(--accent);
}

.dashboard-tabs {
  align-items: flex-end;
  padding: 0 12px;
  border-radius: 8px 8px 0 0;
  border-bottom-color: rgba(192, 211, 220, 0.22);
  box-shadow: 0 16px 42px var(--shadow);
}

.dashboard-tabs .tab-row {
  align-items: flex-end;
  gap: 4px;
}

.dashboard-tabs .strategy-tab {
  position: relative;
  min-width: 170px;
  height: 52px;
  padding: 0 24px;
  border: 1px solid rgba(192, 211, 220, 0.16);
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  background: rgba(255, 255, 255, 0.08);
  color: var(--soft);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: none;
}

.dashboard-tabs .strategy-tab:hover {
  background: rgba(151, 232, 162, 0.12);
  color: var(--ink);
  transform: none;
}

.dashboard-tabs .strategy-tab.active {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(192, 211, 220, 0.22);
}

.dashboard-tabs .strategy-tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: var(--accent);
}

.market-watch-tabs {
  margin-top: 12px;
  border-radius: 8px;
}

.market-watch-tabs .strategy-tab {
  min-width: 145px;
}

.market-watch-content {
  margin-top: 16px;
  padding: 16px;
}

.market-watch-content-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.market-watch-content-header h2 {
  margin: 0;
  color: var(--accent);
  font-size: 20px;
}

.market-watch-content-header span {
  color: var(--soft);
  font-weight: 700;
}

.market-news-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.market-news-table th:nth-child(1),
.market-news-table td:nth-child(1) {
  width: 42%;
}

.market-news-table th:nth-child(2),
.market-news-table td:nth-child(2) {
  width: 18%;
}

.market-news-table th:nth-child(3),
.market-news-table td:nth-child(3) {
  width: 40%;
}

.market-news-row {
  cursor: pointer;
}

.market-cci-chart-wrap {
  width: 100%;
  min-height: 260px;
  overflow: hidden;
  border: 1px solid rgba(192, 211, 220, 0.22);
  background: rgba(4, 18, 25, 0.45);
}

.market-cci-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin-bottom: 10px;
  color: var(--soft);
  font-size: 13px;
  font-weight: 700;
}

.market-cci-definition {
  max-width: 1000px;
  margin: 0 0 14px;
  color: var(--soft);
  line-height: 1.55;
}

.buffett-current-reading {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: baseline;
  gap: 8px 14px;
  margin: 0 0 14px;
  color: var(--soft);
}

.buffett-current-reading strong {
  color: var(--accent);
  font-size: 30px;
}

.buffett-current-reading small {
  color: var(--soft);
  font-weight: 700;
}

.buffett-chart-wrap {
  min-height: 320px;
}

.greed-gauge-wrap {
  position: relative;
  width: min(100%, 620px);
  margin: 2px auto 22px;
}

.greed-gauge-wrap canvas {
  display: block;
  width: 100%;
}

.greed-current-reading {
  position: absolute;
  left: 50%;
  bottom: 4%;
  display: grid;
  justify-items: center;
  transform: translateX(-50%);
}

.greed-current-reading strong {
  color: var(--ink);
  font-size: clamp(34px, 6vw, 54px);
  line-height: 1;
}

.greed-current-reading span {
  margin-top: 5px;
  color: var(--soft);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

.market-cci-legend .buffett-trend-key,
.market-cci-legend .buffett-estimate-key,
.market-cci-legend .buffett-plus-two-key,
.market-cci-legend .buffett-plus-one-key,
.market-cci-legend .buffett-minus-one-key,
.market-cci-legend .buffett-minus-two-key {
  height: 0;
  background: transparent;
  border-top: 2px dashed #aebdc5;
}

.market-cci-legend .buffett-estimate-key {
  border-color: #5dade2;
}

.market-cci-legend .buffett-plus-two-key {
  border-color: #ff4d6d;
}

.market-cci-legend .buffett-plus-one-key {
  border-color: #ff9f43;
}

.market-cci-legend .buffett-minus-one-key {
  border-color: #8fd694;
}

.market-cci-legend .buffett-minus-two-key {
  border-color: #4fa47a;
}

.market-cci-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.market-cci-legend i {
  width: 20px;
  height: 3px;
}

.market-cci-legend .average-line-key {
  height: 0;
  border-top: 2px dashed #f4c95d;
  background: transparent;
}

.market-cci-legend small {
  margin-left: auto;
  color: var(--soft);
}

.market-cci-chart-wrap canvas {
  display: block;
  width: 100%;
  cursor: crosshair;
}

.market-cci-table-wrap {
  max-height: 430px;
  margin-top: 16px;
  overflow: auto;
}

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

.market-cci-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.market-cci-table th,
.market-cci-table td {
  width: 25%;
}

[data-market-watch-panel="cpi-ppi"] .market-cci-table th,
[data-market-watch-panel="cpi-ppi"] .market-cci-table td {
  width: 20%;
}

@media (max-width: 640px) {
  .market-watch-content {
    padding: 10px;
  }

  .market-watch-content-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .market-cci-table {
    min-width: 520px;
  }
}

.watchlist-tab.loading {
  cursor: progress;
  opacity: 0.85;
}

.strategy-faq-link,
.header-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  text-decoration: none;
  white-space: nowrap;
}

.strategy-faq-link {
  margin-left: auto;
}

.toolbar {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 14px 16px;
  margin-top: 16px;
  padding: 18px;
}

label {
  color: var(--soft);
  font-weight: 700;
}

textarea,
input,
select {
  border: 1px solid rgba(192, 211, 220, 0.22);
  border-radius: 12px;
  background: rgba(5, 13, 22, 0.62);
  color: var(--ink);
  font: inherit;
  outline: none;
}

textarea {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  resize: vertical;
}

textarea:focus,
input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(151, 232, 162, 0.12);
}

textarea::placeholder,
input::placeholder {
  color: rgba(197, 209, 216, 0.55);
}

.control-row {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

#openStockScreenButton {
  margin-left: auto;
}

.toggle,
.chart-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--soft);
  font-weight: 600;
}

.select-label {
  margin-left: 8px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  margin-top: 16px;
  overflow: hidden;
}

.summary div {
  padding: 18px;
  border-right: 1px solid rgba(192, 211, 220, 0.13);
}

.summary div:last-child {
  border-right: 0;
}

.summary strong {
  display: block;
  color: var(--accent);
  font-size: 30px;
  font-weight: 500;
}

.summary span {
  color: var(--muted);
}

.alert-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 16px 18px;
}

.alert-section-toggle {
  margin-left: auto;
}

.alert-section-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.alert-section-body[hidden] {
  display: none;
}

.sell-condition-builder {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.sell-condition-builder select {
  min-width: 150px;
}

.condition-control-faded {
  opacity: 0.45;
}

.alert-line strong {
  color: var(--ink);
}

.alert-line span:not(.strategy-tabs-label) {
  color: var(--muted);
}

.portfolio-performance {
  margin-top: 16px;
  padding: 16px 18px;
}

.portfolio-performance-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.portfolio-performance strong {
  color: var(--ink);
}

.portfolio-performance-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.portfolio-performance-controls label {
  color: var(--soft);
  font-weight: 700;
}

.portfolio-performance-controls select {
  min-width: 150px;
}

.portfolio-range-buttons {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.portfolio-range-buttons button {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.portfolio-range-buttons button.active {
  border-color: var(--accent);
  color: var(--accent);
}

#portfolioChart {
  display: block;
  width: 100%;
  height: 320px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(8, 18, 28, 0.54);
  cursor: crosshair;
}

.portfolio-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.portfolio-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.portfolio-legend i {
  width: 18px;
  height: 3px;
  border-radius: 999px;
}

#portfolioStatus {
  margin: 10px 0 0;
  color: var(--muted);
}

.notification-bell {
  position: relative;
  width: 42px;
  padding: 0;
  font-size: 19px;
  line-height: 1;
}

.notification-bell.has-notifications {
  color: #061019;
  background: var(--accent);
  border-color: var(--accent);
}

.notification-count {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 2px solid #101923;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}

.notifications-panel {
  padding: 18px;
}

.notifications-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.notifications-actions button {
  height: 36px;
  padding: 0 12px;
}

.notifications-table {
  min-width: 760px;
}

#backtestAllButton {
  margin-left: auto;
}

.backtest-panel,
.backtest-info-panel,
.chart-panel,
.stock-screener-panel,
.notes,
.faq-panel {
  margin-top: 16px;
  padding: 22px;
}

.notes {
  position: relative;
  padding-right: 128px;
}

.backtest-panel-header,
.chart-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.chart-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.chart-header-actions label {
  color: var(--soft);
  font-weight: 700;
}

#chartSaveWatchlistSelect {
  min-width: 150px;
}

.backtest-panel-header h2,
.chart-header h2,
.notes h2,
.faq-panel h2 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  font-weight: 500;
}

.backtest-panel-header h2::after,
.chart-header h2::after,
.notes h2::after,
.faq-panel h2::after {
  content: "";
  display: block;
  width: 36px;
  height: 2px;
  margin-top: 10px;
  border-radius: 999px;
  background: var(--accent);
}

.trading-rules-header {
  margin-bottom: 12px;
}

#toggleTradingRulesButton {
  position: absolute;
  top: 22px;
  right: 22px;
  height: 30px;
  padding: 0 12px;
  font-size: 13px;
}

.backtest-panel-header p,
.chart-header p,
.notes p,
.faq-panel p,
.backtest-info-copy {
  color: var(--muted);
  line-height: 1.58;
}

.backtest-panel-actions,
.chart-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.chart-controls {
  align-items: center;
  justify-content: flex-start;
  margin: 12px 0 14px;
}

.screener-status {
  color: var(--muted);
  font-size: 13px;
  margin: 10px 0 12px;
}

.screener-header-actions .screener-status {
  margin: 6px 0 0;
}

.stock-screener-panel .chart-header {
  margin-bottom: 6px;
}

.screener-header-actions {
  margin-top: 28px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 8, 13, 0.72);
  backdrop-filter: blur(10px);
}

.modal-backdrop[hidden] {
  display: none;
}

.profile-modal-panel {
  width: min(430px, 100%);
  padding: 28px;
  border: 1px solid rgba(151, 232, 162, 0.24);
  border-radius: 8px;
  background: rgba(12, 24, 32, 0.96);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.profile-modal-panel h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 28px;
  font-weight: 600;
}

.profile-modal-panel p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.5;
}

.profile-modal-panel .auth-form {
  gap: 10px;
}

.modal-inline-field {
  display: grid;
  grid-template-columns: max-content 1fr;
  align-items: center;
  gap: 10px;
}

.modal-inline-field label {
  margin: 0;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.screener-controls {
  display: grid;
  grid-template-columns: repeat(4, max-content minmax(130px, 1fr));
  align-items: center;
  gap: 10px 12px;
  margin: 14px 0 6px;
  padding: 12px;
  border: 1px solid rgba(151, 232, 162, 0.22);
  border-radius: 8px;
  background: rgba(5, 16, 24, 0.45);
}

.screener-controls[hidden] {
  display: none;
}

.screener-controls label {
  color: var(--soft);
  font-weight: 700;
  font-size: 13px;
}

.screener-controls select {
  min-width: 130px;
}

#screenerIndex {
  min-height: 124px;
}

.chart-controls input,
.chart-controls select {
  height: 38px;
  padding: 0 10px;
}

.chart-controls button.active {
  border-color: var(--accent);
  background: rgba(151, 232, 162, 0.16);
  color: var(--ink);
}

.chart-controls span,
.legend,
.subtext,
.backtest-result {
  color: var(--muted);
  font-size: 13px;
}

#stockChart {
  display: block;
  width: 100%;
  height: 540px;
  border: 1px solid rgba(192, 211, 220, 0.18);
  border-radius: 24px;
  background: #060e16;
  cursor: crosshair;
  touch-action: none;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
}

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

.legend i {
  display: inline-block;
  width: 22px;
  height: 3px;
  border-radius: 999px;
}

.candle-key {
  height: 12px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--green) 0 45%, transparent 45% 55%, var(--red) 55% 100%);
}

.sma20-line,
.sma200-line,
.volume-bar {
  background: var(--green);
}

.close-line,
.macd-line,
.bollinger-middle-line,
.cci-line,
.rsi-line {
  background: var(--blue);
}

.sma50-line,
.sma100-line,
.bollinger-upper-line,
.bollinger-lower-line {
  background: var(--yellow);
}

.macd-signal-line {
  background: var(--purple);
}

.macd-histogram-bar {
  height: 10px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--green) 0 48%, transparent 48% 52%, var(--red) 52% 100%);
}

.macd-zero-line,
.avg-volume-line,
.cci-threshold-line,
.rsi-threshold-line {
  background: repeating-linear-gradient(90deg, var(--muted) 0 6px, transparent 6px 10px);
}

.table-wrap,
.backtest-table-wrap {
  overflow-x: auto;
}

.table-wrap {
  margin-top: 16px;
}

table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
}

.backtest-table-wrap table {
  min-width: 980px;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(192, 211, 220, 0.13);
  text-align: left;
  vertical-align: middle;
}

th {
  background: rgba(5, 13, 22, 0.72);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: help;
}

tbody tr:hover {
  background: rgba(151, 232, 162, 0.07);
}

.ticker,
.ticker-button {
  font-weight: 800;
}

.ticker-button,
.header-info-button {
  height: auto;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ticker-button:hover,
.header-info-button:hover {
  color: var(--ink);
  background: transparent;
  transform: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 11px;
  border: 1px solid rgba(192, 211, 220, 0.14);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.pill.breakout,
.pill.pullback,
.pill.uptrend {
  color: #061019;
  background: var(--accent);
}

.pill.wait,
.pill.weak,
.pill.mixed {
  color: #2f260f;
  background: #e7d198;
}

.pill.downtrend {
  color: #fff;
  background: var(--red);
}

.pill.support-strong {
  color: #047857;
  background: #68fa05;
}

.num {
  font-variant-numeric: tabular-nums;
}

.empty {
  padding: 34px;
  color: var(--muted);
  text-align: center;
}

.error,
.backtest-table-wrap .error,
.login-message {
  color: var(--red);
  font-weight: 800;
}

.list-user-role-editor {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
}

.list-user-role-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.user-role-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(0, 217, 169, 0.35);
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.user-role-checkbox input {
  accent-color: var(--accent);
}

.save-user-roles-button {
  min-height: 30px;
  padding: 0 10px;
  white-space: nowrap;
}

.backtest-button {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.backtest-result {
  min-width: 170px;
  margin-top: 6px;
  line-height: 1.35;
}

.backtest-result strong {
  color: var(--ink);
}

.notes ul,
.backtest-info-copy ul,
.faq-panel ul {
  margin: 8px 0 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.58;
}

.notes h3,
.backtest-info-copy h3 {
  margin: 16px 0 8px;
  color: var(--ink);
  font-size: 15px;
}

.signal-rules {
  display: grid;
  gap: 8px;
  margin: 0;
  color: var(--muted);
}

.signal-rules dt {
  color: var(--accent);
  font-weight: 800;
}

.signal-rules dd {
  margin: -4px 0 4px;
  line-height: 1.48;
}

.faq-panel details {
  border-top: 1px solid rgba(192, 211, 220, 0.13);
  padding: 12px 0;
}

.faq-panel details:first-of-type {
  border-top: 0;
}

.faq-panel summary {
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(5, 13, 22, 0.72) 0%, rgba(9, 19, 29, 0.62) 48%, rgba(21, 39, 44, 0.72) 100%),
    url("/images/blurrybg.png") center / cover no-repeat fixed;
}

.profile-body {
  background:
    linear-gradient(135deg, rgba(5, 13, 22, 0.72) 0%, rgba(9, 19, 29, 0.62) 48%, rgba(21, 39, 44, 0.72) 100%),
    url("/images/smartbg.png") center / cover no-repeat fixed;
}

.delete-user-body {
  background:
    linear-gradient(135deg, rgba(35, 15, 5, 0.66) 0%, rgba(62, 25, 8, 0.58) 48%, rgba(20, 12, 8, 0.72) 100%),
    url("/images/orangesmartbg.png") center / cover no-repeat fixed;
}

.login-shell {
  width: min(420px, calc(100vw - 32px));
  margin: 0;
}

.wide-shell {
  width: min(720px, calc(100vw - 32px));
}

.login-panel {
  padding: 26px;
}

.login-panel h1 {
  color: var(--ink);
  font-size: 28px;
}

.login-panel p {
  margin: 6px 0 18px;
  color: var(--muted);
}

.form-heading-spacer {
  height: 28px;
}

.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.checkbox-line input {
  width: 16px;
  height: 16px;
}

.login-panel form {
  display: grid;
  gap: 10px;
}

.login-panel input {
  height: 44px;
  padding: 0 12px;
}

.profile-field {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}

.profile-field span,
.user-row span {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.profile-field strong,
.user-row strong {
  color: var(--ink);
}

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

.user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid rgba(192, 211, 220, 0.13);
  border-radius: 14px;
  background: rgba(5, 13, 22, 0.44);
}

.user-row div {
  display: grid;
  gap: 3px;
}

.user-row button:not(:disabled) {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.login-message.success {
  color: var(--green);
}

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

.login-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

@media (max-width: 760px) {
  .app-header {
    display: block;
    padding: 20px;
  }

  .status-strip {
    justify-content: flex-start;
    margin-top: 14px;
  }

  main {
    width: calc(100vw - 20px);
  }

  .strategy-tabs,
  .watchlist-tabs,
  .portfolio-ticker-row,
  .backtest-panel-header,
  .chart-header {
    align-items: stretch;
    flex-direction: column;
  }

  .portfolio-ticker-row {
    display: flex;
  }

  .strategy-faq-link,
  #backtestAllButton {
    margin-left: 0;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .control-row {
    grid-column: 1;
  }

  #openStockScreenButton {
    margin-left: 0;
  }

  .screener-controls {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 520px) {
  .summary {
    grid-template-columns: 1fr;
  }

  .summary div {
    border-right: 0;
  }

  .profile-field,
  .user-row {
    grid-template-columns: 1fr;
  }
}

.brand-accent {
  color: var(--accent);
}


.brand-title {
  display: grid;
  gap: 2px;
}

.brand-title span {
  display: block;
}

.tip-page {
  width: min(1260px, calc(100vw - 28px));
  margin: 22px auto 46px;
}

.tip-header,
.tip-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
}

.tip-header h1,
.tip-panel h2 {
  margin: 0;
}

.tip-header h1 {
  font-size: 28px;
}

.tip-header p,
.tip-panel p {
  margin: 4px 0 0;
  color: var(--muted);
}

.tip-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: flex-start;
  gap: 10px;
  margin-top: 10px;
}

.tip-page .tip-tabs {
  margin: 14px 0;
}

.tip-panel {
  padding: 16px;
}

.tip-panel[hidden] {
  display: none;
}

.tip-page .service-toolbar,
.tip-page .employee-form,
.tip-page .role-checkboxes {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}

.tip-page .service-toolbar {
  margin: 14px 0;
}

.date-scroll-field {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.date-scroll-field button {
  height: 36px;
  padding: 0 12px;
}

#lockTipTallyButton.tip-lock-active {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

#lockTipTallyButton.tip-lock-active:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}

.tip-page .field {
  display: grid;
  gap: 5px;
  min-width: 150px;
}

.tip-page .field input,
.tip-page .field select {
  width: 100%;
}

.tip-page input {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--ink);
  background: rgba(5, 13, 22, 0.38);
  font: inherit;
}

.tip-page input[type="number"] {
  text-align: right;
}

.tip-page input[readonly] {
  color: var(--soft);
  background: rgba(192, 211, 220, 0.08);
}

.tip-page input.mismatch {
  color: #ff1f1f;
  border-color: #ff1f1f;
  box-shadow: 0 0 0 1px rgba(255, 31, 31, 0.45);
}

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

.tip-page .section-head h2 {
  font-size: 20px;
}

.tip-page .role-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.tip-table-wrap {
  overflow-x: auto;
}

.tip-table,
.employee-table,
.category-sales-table,
.results-table {
  width: 100%;
  min-width: 940px;
}

.tip-table select,
.tip-table input,
.category-sales-table input {
  width: 100%;
}

.tip-table th,
.employee-table th,
.category-sales-table th,
.results-table th {
  cursor: default;
}

.results-table th:nth-child(3),
.results-table td:nth-child(3) {
  text-align: right;
}

.tip-table .name-col {
  min-width: 190px;
}

.tip-table .money-col {
  min-width: 120px;
}

.muted-cell {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.category-sales-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.category-sales-table th:not(:first-child),
.category-sales-table td:not(:first-child) {
  text-align: right;
}

.category-sales-table input {
  min-width: 110px;
}

.total-row td {
  font-weight: 800;
}

.result-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.report-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin: 14px 0 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 13, 22, 0.32);
}

.report-controls .field {
  min-width: 170px;
}

.report-controls button {
  min-height: 36px;
}

.report-status {
  min-height: 20px;
  color: var(--muted);
}

.report-status.error {
  color: var(--red);
}

.report-table {
  margin-bottom: 20px;
}

.tip-page .employee-form {
  margin: 14px 0 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 13, 22, 0.32);
}

.tip-page .employee-form .field {
  min-width: 240px;
  flex: 1 1 260px;
}

.tip-page .role-checkboxes {
  align-items: center;
  flex: 2 1 460px;
}

.role-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-weight: 600;
}

.role-checkbox input {
  width: 16px;
  height: 16px;
}

.role-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.employee-role-editor {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 520px;
}

.employee-name-editor {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 8px;
  min-width: 300px;
}

.employee-name-editor input {
  width: 100%;
}

.inactive-employee-row {
  opacity: 0.48;
  background: rgba(192, 211, 220, 0.08);
}

.inactive-employee-row td {
  color: var(--muted);
}

.inactive-employee-row .employee-active-control {
  opacity: 1;
}

.role-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(192, 211, 220, 0.12);
  font-size: 12px;
  font-weight: 700;
}

#saveTipTallyButton {
  color: #061019;
  background: var(--accent);
  border-color: var(--accent);
}

.save-status {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-weight: 700;
}

.save-status.error {
  color: var(--red);
}

.delete-employee-button {
  color: var(--red);
  border-color: rgba(238, 111, 111, 0.62);
}

.delete-employee-button:hover {
  color: #fff;
  background: rgba(238, 111, 111, 0.18);
}

#employeeMessage {
  min-height: 20px;
  color: var(--muted);
}

#employeeMessage.error {
  color: var(--red);
}

@media (max-width: 980px) {
  .tip-page .role-row,
  .result-breakdown-grid {
    grid-template-columns: 1fr;
  }
}

