:root {
  color-scheme: light;
  --bg: #f4f6f3;
  --panel: #ffffff;
  --panel-soft: #fbfaf6;
  --ink: #17202a;
  --muted: #64706f;
  --line: #dde2dc;
  --blue: #245e9c;
  --green: #00845f;
  --red: #d12b1f;
  --amber: #a66a15;
  --gold: #b38a3d;
  --hairline: #edf1ec;
  --shadow: 0 8px 24px rgba(23, 32, 42, 0.07);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    "Noto Sans SC", "PingFang SC", "Microsoft YaHei", Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid #9c3028;
  background: #b92f26;
  color: white;
  min-height: 36px;
  border-radius: 6px;
  padding: 0 14px;
  cursor: pointer;
}

a.secondary,
button.secondary,
.icon-button {
  background: white;
  color: var(--ink);
  border-color: var(--line);
}

a.secondary {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: inline-flex;
  min-height: 34px;
  padding: 0 12px;
  text-decoration: none;
}

input,
select {
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 36px;
  padding: 0 10px;
  background: white;
  color: var(--ink);
}

input::placeholder {
  color: #7d8580;
  font-size: 12px;
}

button:hover,
a.secondary:hover {
  filter: brightness(0.98);
}

button:focus-visible,
a.secondary:focus-visible,
input:focus,
select:focus {
  outline: 3px solid rgba(177, 47, 38, 0.16);
  outline-offset: 2px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  height: 72px;
  padding: 10px 16px;
  background: #fffdf8;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(185, 47, 38, 0.24);
  border-radius: 8px;
  background: linear-gradient(135deg, #cf382d 0%, #8e271f 100%);
  color: #ffffff;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.topbar h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
  font-weight: 850;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.market-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: 8px;
  flex: 1;
  max-width: 560px;
}

.market-chip {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #e5dccb;
  border-radius: 8px;
  background: #fffaf0;
}

.market-chip span {
  color: #83745f;
  font-size: 11px;
  line-height: 1.1;
}

.market-chip strong {
  color: #2f2920;
  font-size: 13px;
  line-height: 1.15;
}

.market-chip.live {
  border-color: rgba(177, 47, 38, 0.24);
  background: #fff4f1;
}

.toolbar,
.chart-tools,
.mini-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar .toolbar {
  justify-content: flex-end;
  gap: 8px;
}

.topbar .icon-button:not(.topbar-action) {
  background: #ffffff;
  color: #334155;
  border-color: #d9dee8;
}

.topbar .topbar-action {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 38px;
  border-radius: 8px;
  padding: 0 14px;
  border-color: #ded7ca;
  background: linear-gradient(180deg, #ffffff 0%, #fffaf3 100%);
  color: #352d24;
  font-weight: 750;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease,
    color 140ms ease;
}

.topbar-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--red);
  color: #ffffff;
  font-size: 10px;
  font-weight: 850;
  line-height: 16px;
  text-align: center;
}

.topbar-action:hover {
  transform: translateY(-1px);
  border-color: #cbb996;
  background: #ffffff;
  box-shadow: 0 9px 20px rgba(15, 23, 42, 0.1);
}

.topbar-action:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.topbar-action:focus-visible {
  outline: 3px solid rgba(177, 47, 38, 0.16);
  outline-offset: 2px;
}

.topbar-action-icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #fff4f1;
  color: #b92f26;
  font-size: 13px;
  line-height: 1;
  font-weight: 850;
}

#soundToggle .topbar-action-icon {
  background: #fff7df;
  color: #a66a15;
}

.topbar .refresh-action {
  border-color: #9c3028;
  background: linear-gradient(180deg, #cf382d 0%, #b92f26 100%);
  color: #ffffff;
  box-shadow: 0 9px 20px rgba(185, 47, 38, 0.22);
}

.topbar .refresh-action .topbar-action-icon {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.topbar .refresh-action:hover {
  border-color: #852720;
  background: linear-gradient(180deg, #bd3027 0%, #98281f 100%);
  box-shadow: 0 12px 26px rgba(185, 47, 38, 0.28);
}

.shell {
  display: grid;
  grid-template-columns: minmax(380px, 430px) minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  height: calc(100vh - 72px);
  min-height: 0;
  align-items: stretch;
  overflow: hidden;
}

.left-stack,
.main-stack {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  min-height: 0;
}

.left-stack {
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-gutter: stable;
}

.main-stack {
  height: 100%;
  overflow: hidden;
  align-content: stretch;
  grid-template-rows: minmax(0, 1fr);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.market-overview {
  background: linear-gradient(180deg, #fffdf8 0%, #ffffff 100%);
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border-radius: 8px;
}

.overview-grid article {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  background: #ffffff;
}

.overview-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.overview-grid strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.overview-grid strong.brief-hot {
  color: var(--red);
}

.learning-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.tool-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-color: #ded7ca;
  background: linear-gradient(180deg, #ffffff 0%, #fffaf3 100%);
  color: #352d24;
  font-weight: 750;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease,
    color 140ms ease;
}

.tool-button:hover {
  transform: translateY(-1px);
  border-color: #cbb996;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
}

.tool-button:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.tool-button:focus-visible,
.load-chart-button:focus-visible {
  outline: 3px solid rgba(177, 47, 38, 0.16);
  outline-offset: 2px;
}

.button-icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1;
  font-weight: 800;
}

.tool-button-backtest .button-icon {
  background: #fff4f1;
  color: #b92f26;
}

.tool-button-alerts .button-icon {
  background: #fff7df;
  color: #a66a15;
}

.tool-button-backtest:hover {
  border-color: #d9837d;
  color: #98281f;
}

.tool-button-alerts:hover {
  border-color: #f3c56b;
  color: #925f0e;
}

.load-chart-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  border-color: #9c3028;
  background: linear-gradient(180deg, #cf382d 0%, #b92f26 100%);
  color: #ffffff;
  font-weight: 750;
  box-shadow: 0 8px 18px rgba(185, 47, 38, 0.22);
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}

.load-chart-button .button-icon {
  width: 18px;
  height: 18px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.load-chart-button:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #bd3027 0%, #98281f 100%);
  box-shadow: 0 12px 26px rgba(185, 47, 38, 0.28);
}

.load-chart-button:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

.chart-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  background: #fffdf8;
}

.panel h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 850;
}

.panel-kicker {
  display: block;
  margin-top: 3px;
  color: #867666;
  font-size: 11px;
  font-weight: 650;
}

.watch-form,
.backtest-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
}

.watch-panel .watch-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: #fffdf8;
  border-bottom: 1px solid var(--line);
}

.watch-panel .watch-form button {
  grid-column: 1 / -1;
}

.watch-form button,
.backtest-form button {
  grid-column: auto;
}

.watch-form input {
  min-width: 0;
  background: #ffffff;
}

.watch-form input[name="symbol"] {
  grid-column: span 2;
  font-weight: 800;
}

.backtest-form {
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 18px 20px 20px;
  background: #fffdf8;
}

.backtest-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.backtest-field.span-2 {
  grid-column: 1;
}

.backtest-field span {
  color: #475569;
  font-size: 12px;
  font-weight: 750;
}

.backtest-field input {
  width: 100%;
  min-height: 42px;
  border-radius: 8px;
  border-color: #ded7ca;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.backtest-field input:focus {
  outline: none;
  border-color: #b92f26;
  box-shadow: 0 0 0 3px rgba(185, 47, 38, 0.14);
}

.backtest-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  grid-column: 1;
  align-self: end;
  min-height: 42px;
  border-radius: 8px;
  border-color: #9c3028;
  background: linear-gradient(180deg, #cf382d 0%, #b92f26 100%);
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(185, 47, 38, 0.24);
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}

.backtest-submit .button-icon {
  width: 18px;
  height: 18px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.backtest-submit:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #bd3027 0%, #98281f 100%);
  box-shadow: 0 14px 28px rgba(185, 47, 38, 0.3);
}

.backtest-submit:active {
  transform: translateY(0);
  box-shadow: 0 5px 12px rgba(37, 99, 235, 0.22);
}

.watchlist,
.signals,
.alerts,
.source-status {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.watch-card,
.signal-card,
.alert-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  gap: 7px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(23, 32, 42, 0.04);
}

.watch-card header,
.signal-card header,
.alert-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stock-name {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  font-weight: 700;
}

.stock-name small,
.meta,
#lastUpdated {
  color: var(--muted);
  font-size: 12px;
}

.stock-name small {
  padding: 2px 6px;
  border-radius: 5px;
  background: #f4f1e9;
  color: #685d50;
  font-size: 11px;
  font-weight: 800;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 8px;
  color: var(--muted);
  font-size: 12px;
}

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

.metrics span {
  min-width: 0;
  padding: 6px 7px;
  border-radius: 6px;
  background: #f7f7f2;
  overflow-wrap: anywhere;
}

.metric-delta.up {
  color: var(--red);
  font-weight: 800;
}

.metric-delta.down {
  color: var(--green);
  font-weight: 800;
}

.metric-delta.flat {
  color: var(--muted);
}

.action-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.action-line strong {
  color: #111827;
  font-size: 16px;
}

.action-line span {
  color: var(--muted);
  font-size: 13px;
}

.badge {
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.critical {
  color: var(--red);
}

.warning {
  color: #3b2603;
}

.positive {
  color: var(--red);
}

.neutral,
.muted {
  color: #344054;
}

.badge.critical {
  background: #fff4f1;
  border: 1px solid #f0b0aa;
}

.badge.warning {
  background: #fff4d6;
  border: 1px solid #fedf89;
}

.badge.positive {
  background: #fff4f1;
  border: 1px solid #f0b0aa;
}

.badge.neutral,
.badge.muted {
  background: #eef2f6;
  border: 1px solid #d9dee8;
}

.signal-card.critical {
  border-color: rgba(209, 43, 31, 0.5);
  border-left: 4px solid var(--red);
  background: var(--panel);
}

.signal-card.warning {
  border-color: rgba(183, 121, 31, 0.5);
  background: var(--panel);
}

.signal-card.positive {
  border-color: rgba(209, 43, 31, 0.45);
  border-left: 4px solid var(--red);
  background: var(--panel);
}

.alert-card.critical,
.alert-card.warning,
.alert-card.positive {
  background: var(--panel);
}

.source-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.source-grid strong {
  color: var(--ink);
}

.source-updated {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 0 14px 10px;
  color: var(--muted);
  font-size: 13px;
}

.source-updated strong {
  color: #65706b;
  font-weight: 650;
  text-align: right;
  white-space: nowrap;
}

.source-grid .positive {
  color: var(--green);
  background: transparent;
}

.source-grid .critical {
  color: var(--red);
  background: transparent;
}

.source-grid .neutral {
  color: var(--muted);
  background: transparent;
}

.source-note,
.source-error {
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
}

.source-note {
  background: #f0faf5;
  color: #05704f;
}

.source-error {
  background: #fff8eb;
  border: 1px solid #fed7aa;
  color: #8f241d;
  overflow-wrap: anywhere;
}

.alert-card.read {
  opacity: 0.62;
}

.alerts-modal-panel {
  width: min(530px, 100%);
  grid-template-rows: auto minmax(0, 1fr);
}

.alert-title-icon {
  background: #fff4d6;
  color: #b7791f;
}

.modal-actions {
  gap: 8px;
}

.compact-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  border-radius: 8px;
  padding: 0 11px;
  border-color: #cfd8e6;
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
  color: #27364a;
  font-size: 13px;
  font-weight: 750;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.compact-action:hover {
  border-color: #9fb4d0;
  background: #ffffff;
}

.danger-action {
  color: #b42318;
}

.modal-alerts {
  gap: 6px;
  padding: 10px;
  overflow: auto;
}

.modal-alerts .alert-card {
  gap: 5px;
  padding: 8px 10px;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.modal-alerts .alert-card header {
  align-items: center;
  gap: 10px;
}

.alert-line {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.modal-alerts .stock-name {
  flex: 0 0 auto;
  gap: 6px;
}

.alert-reason {
  min-width: 0;
  color: #b42318;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-foot {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
  flex-wrap: wrap;
}

.alert-foot button {
  margin-left: auto;
  min-height: 30px;
  padding: 0 10px;
}

.alert-read-status {
  margin-left: auto;
  color: #475569;
  font-weight: 700;
}

#chart {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 0;
  color: var(--muted);
  font-size: 12px;
  flex-wrap: wrap;
}

.chart-legend strong {
  color: var(--ink);
  font-size: 13px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-item::before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.legend-item.up {
  color: var(--red);
}

.legend-item.down {
  color: var(--green);
}

.legend-item.ma5 {
  color: #245e9c;
}

.legend-item.ma20 {
  color: var(--gold);
}

.kline-chart {
  width: 100%;
  height: auto;
  min-height: 0;
}

.chart-error {
  display: grid;
  min-height: 0;
  height: 100%;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.backtest-status {
  min-height: 0;
  padding: 0 20px 20px;
  background: #fffdf8;
}

.backtest-status:empty {
  display: none;
}

.backtest-result {
  margin: 0;
  display: grid;
  gap: 14px;
  padding: 16px 20px 20px;
  max-height: none;
  overflow: auto;
  color: #1f2937;
  background: #fffdf8;
  font-size: 13px;
  min-height: 0;
}

.backtest-result:empty::before {
  content: "回测结果会显示在这里";
  color: var(--muted);
}

.backtest-state {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px dashed #cfd8e6;
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
}

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

.backtest-state.error {
  border-color: #fed7aa;
  background: #fff8eb;
  color: #7a4b00;
}

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

.backtest-metric-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #dce3ee;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.backtest-metric-card span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.backtest-metric-card strong {
  color: #111827;
  font-size: 18px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.backtest-result-section {
  display: grid;
  gap: 10px;
}

.backtest-result-section h3 {
  margin: 0;
  color: #334155;
  font-size: 13px;
}

.backtest-detail-list {
  display: grid;
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid #dce3ee;
  border-radius: 8px;
  background: #dce3ee;
}

.backtest-detail-list div {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1fr);
  gap: 12px;
  padding: 9px 11px;
  background: #ffffff;
}

.backtest-detail-list dt,
.backtest-detail-list dd {
  margin: 0;
  min-width: 0;
}

.backtest-detail-list dt {
  color: #64748b;
  font-weight: 700;
}

.backtest-detail-list dd {
  color: #111827;
  overflow-wrap: anywhere;
}

.backtest-table-wrap {
  overflow-x: auto;
  border: 1px solid #dce3ee;
  border-radius: 8px;
  background: #ffffff;
}

.backtest-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

.backtest-table th,
.backtest-table td {
  padding: 9px 11px;
  border-bottom: 1px solid #e5eaf2;
  text-align: left;
}

.backtest-table th {
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
  background: #f8fafc;
}

.backtest-table tr:last-child td {
  border-bottom: 0;
}

.backtest-raw {
  border: 1px solid #dce3ee;
  border-radius: 8px;
  background: #ffffff;
}

.backtest-raw summary {
  cursor: pointer;
  padding: 10px 12px;
  color: #475569;
  font-weight: 750;
}

.backtest-raw pre {
  margin: 0;
  padding: 12px;
  overflow: auto;
  border-top: 1px solid #e5eaf2;
  color: #334155;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  padding: 24px;
}

.modal.open {
  display: grid;
  place-items: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(2px);
}

.modal-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: min(960px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

.backtest-modal-panel {
  width: min(520px, 100%);
  grid-template-rows: auto auto auto;
}

.backtest-result-panel {
  width: min(1080px, 100%);
  height: min(820px, calc(100vh - 48px));
  grid-template-rows: auto minmax(0, 1fr);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: #fffdf8;
}

.modal-head h2 {
  margin: 0;
  font-size: 17px;
}

.modal-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.modal-title-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #fff4f1;
  color: #b92f26;
  font-weight: 850;
}

.modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  border-radius: 8px;
  border-color: #ded7ca;
  background: linear-gradient(180deg, #ffffff 0%, #fffaf3 100%);
  color: #352d24;
  font-weight: 750;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.modal-close:hover {
  border-color: #cbb996;
  background: #ffffff;
}

.alerts-modal-panel {
  width: min(530px, 100%);
  grid-template-rows: auto minmax(0, 1fr);
}

.modal-close.compact-action {
  min-height: 34px;
  padding: 0 11px;
  font-size: 13px;
}

.modal-alerts {
  overflow: auto;
}

body.modal-open {
  overflow: hidden;
}

@media (min-width: 1440px) {
  .shell {
    grid-template-columns: 420px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
  }
}

@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 360px minmax(0, 1fr);
  }

  .market-strip {
    max-width: 460px;
  }
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  .topbar {
    height: auto;
    align-items: stretch;
    flex-wrap: wrap;
  }

  .brand-lockup {
    flex: 1 1 auto;
  }

  .market-strip {
    order: 3;
    flex: 1 1 100%;
    max-width: none;
  }

  .topbar .toolbar {
    flex: 0 0 auto;
  }

  .shell {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .main-stack {
    order: 1;
    height: auto;
  }

  .left-stack {
    order: 2;
    overflow: visible;
    padding-right: 0;
  }

  .chart-panel {
    height: auto;
  }

  #chart {
    height: auto;
  }

}

@media (max-width: 640px) {
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    padding: 10px;
  }

  .topbar .toolbar {
    width: auto;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .market-strip {
    grid-template-columns: 1fr;
  }

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

  .toolbar:not(.topbar .toolbar),
  .chart-tools {
    width: 100%;
  }

  .toolbar:not(.topbar .toolbar) button,
  .chart-tools button,
  .chart-tools select {
    flex: 1;
  }

  .watch-form,
  .metrics {
    grid-template-columns: 1fr;
  }

  .backtest-form {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .backtest-field.span-2,
  .backtest-submit {
    grid-column: 1;
  }

  .backtest-summary,
  .backtest-detail-list div {
    grid-template-columns: 1fr;
  }

  .watch-panel .watch-form,
  .watch-card .metrics {
    grid-template-columns: 1fr;
  }

  .watch-form input[name="symbol"] {
    grid-column: 1;
  }

  .modal {
    padding: 10px;
  }

  .modal-panel {
    max-height: calc(100vh - 20px);
  }

  .modal-head {
    align-items: stretch;
    flex-direction: column;
  }

  .kline-chart,
  .chart-error {
    height: 420px;
    min-height: 360px;
  }

  .shell {
    padding: 10px;
  }
}

/* Integrated trading terminal skin: one surface, divided by rules. */
body {
  background: #f7f8f6;
}

button,
a.secondary,
button.secondary,
.icon-button,
.compact-action,
.modal-close,
.load-chart-button,
.backtest-submit {
  border-color: #d7ddd7;
  background: transparent;
  color: #26312f;
  box-shadow: none;
  font-weight: 760;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease;
}

button:hover,
a.secondary:hover,
button.secondary:hover,
.icon-button:hover,
.compact-action:hover,
.modal-close:hover,
.load-chart-button:hover,
.backtest-submit:hover {
  transform: none;
  border-color: #c2cac3;
  background: #f1f4f1;
  box-shadow: none;
  filter: none;
}

.topbar {
  height: 68px;
  padding: 0 16px;
  background: #fbfcfa;
  border-bottom: 1px solid #d9ded8;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-color: #d9ded8;
  border-radius: 7px;
  background: #ffffff;
  color: #b92f26;
  box-shadow: inset 0 0 0 1px rgba(185, 47, 38, 0.08);
}

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

.topbar p {
  margin-top: 2px;
}

.market-strip {
  align-self: stretch;
  gap: 0;
  max-width: 600px;
}

.market-chip {
  align-content: center;
  padding: 0 14px;
  border: 0;
  border-left: 1px solid #e1e5df;
  border-radius: 0;
  background: transparent;
}

.market-chip.live {
  border-color: #e1e5df;
  background: transparent;
}

.market-chip span {
  color: #7a8580;
}

.market-chip strong {
  color: #1f2927;
}

.topbar .toolbar {
  align-self: stretch;
  gap: 0;
  flex-wrap: nowrap;
  border-left: 1px solid #e1e5df;
}

.topbar .topbar-action,
.topbar .refresh-action {
  align-self: stretch;
  min-height: 0;
  border: 0;
  border-right: 1px solid #e1e5df;
  border-radius: 0;
  background: transparent;
  color: #2f3937;
  box-shadow: none;
}

.topbar .refresh-action {
  color: #b92f26;
}

.topbar-action-icon,
#soundToggle .topbar-action-icon,
.topbar .refresh-action .topbar-action-icon {
  width: 18px;
  height: 18px;
  background: transparent;
  color: currentColor;
}

.shell {
  grid-template-columns: minmax(390px, 430px) minmax(0, 1fr);
  gap: 0;
  padding: 0;
  height: calc(100vh - 68px);
  background: #ffffff;
}

.left-stack,
.main-stack {
  gap: 0;
}

.left-stack {
  padding-right: 0;
  border-right: 1px solid #d9ded8;
}

.panel,
.learning-tools,
.market-overview {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #ffffff;
}

.left-stack > .panel,
.left-stack > .learning-tools,
.left-stack > .market-overview {
  border-bottom: 1px solid #d9ded8;
}

.chart-panel {
  border: 0;
}

.panel-head {
  min-height: 46px;
  padding: 10px 14px;
  background: #fbfcfa;
  border-bottom: 1px solid #d9ded8;
}

.panel h2 {
  font-size: 14px;
  letter-spacing: 0;
}

.panel-kicker {
  color: #7a8580;
}

.overview-grid {
  gap: 0;
  border-radius: 0;
}

.overview-grid article {
  padding: 11px 14px;
  border-right: 1px solid #e1e5df;
  background: #ffffff;
}

.overview-grid article:last-child {
  border-right: 0;
}

.overview-grid strong {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.learning-tools {
  gap: 0;
  padding: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tool-button {
  min-height: 42px;
  border: 0;
  border-right: 1px solid #e1e5df;
  border-radius: 0;
  background: transparent;
  color: #26312f;
  gap: 5px;
  font-size: 12px;
  line-height: 1;
  box-shadow: none;
  white-space: nowrap;
}

.tool-button:last-child {
  border-right: 0;
}

.button-icon,
.tool-button-backtest .button-icon,
.tool-button-alerts .button-icon,
.load-chart-button .button-icon,
.backtest-submit .button-icon {
  background: transparent;
  color: currentColor;
  width: 16px;
  height: 16px;
  font-size: 11px;
}

.watch-panel .watch-form,
.watch-form,
.backtest-form {
  gap: 0;
  padding: 0;
  background: #ffffff;
}

.watch-panel .watch-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.watch-form input[name="symbol"],
.watch-form input[name="name"] {
  grid-column: span 2;
}

.watch-panel .watch-form button {
  grid-column: auto;
}

.watch-form input,
.watch-form button {
  min-height: 40px;
  border: 0;
  border-right: 1px solid #e1e5df;
  border-bottom: 1px solid #e1e5df;
  border-radius: 0;
  background: #ffffff;
  font-size: 13px;
}

.watch-form input::placeholder {
  font-size: 11px;
}

.watch-form input:nth-child(3n),
.watch-form button {
  border-right: 0;
}

.watch-form input:nth-child(3n) {
  border-right: 1px solid #e1e5df;
}

.watch-form input:nth-child(2),
.watch-form input:nth-child(6),
.watch-form button {
  border-right: 0;
}

.watch-form button {
  color: #b92f26;
}

.watchlist,
.signals,
.alerts,
.source-status {
  gap: 0;
  padding: 0;
}

.watchlist {
  margin-top: -1px;
}

.watch-card,
.signal-card,
.alert-card {
  gap: 8px;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid #e1e5df;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
}

.watch-card:hover,
.signal-card:hover,
.alert-card:hover {
  background: #fbfcfa;
}

.watch-card header,
.signal-card header,
.alert-card header {
  align-items: flex-start;
}

.stock-name {
  font-weight: 820;
}

.stock-name small {
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #7a8580;
  font-weight: 760;
}

.mini-actions {
  gap: 0;
}

.mini-actions a.secondary,
.mini-actions button.secondary,
.compact-action {
  min-height: 30px;
  border-radius: 0;
  border-color: #e1e5df;
  background: transparent;
}

.mini-actions a.secondary + button.secondary,
.mini-actions button.secondary + button.secondary,
.compact-action + .compact-action {
  border-left: 0;
}

.metrics {
  gap: 0;
  border-top: 1px solid #eef1ec;
  border-left: 1px solid #eef1ec;
  color: #65706b;
}

.metrics span {
  padding: 7px 8px;
  border-right: 1px solid #eef1ec;
  border-bottom: 1px solid #eef1ec;
  border-radius: 0;
  background: transparent;
  font-variant-numeric: tabular-nums;
}

.badge {
  border-radius: 4px;
  background: transparent;
  font-size: 11px;
}

.badge.critical,
.badge.positive,
.badge.warning,
.badge.neutral,
.badge.muted {
  background: transparent;
}

.signal-card.critical,
.signal-card.warning,
.signal-card.positive {
  border-left-width: 3px;
  background: #ffffff;
}

.source-grid {
  padding: 12px 14px 0;
}

.source-note,
.source-error {
  margin: 10px 14px 0;
  border-radius: 4px;
}

#chart {
  background: #ffffff;
}

.chart-legend {
  padding: 10px 14px;
  border-bottom: 1px solid #e1e5df;
  background: #fbfcfa;
}

.kline-chart {
  background: #ffffff;
}

.modal-panel {
  border-color: #d9ded8;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(23, 32, 42, 0.18);
}

.modal-head,
.backtest-form,
.backtest-status,
.backtest-result {
  background: #fbfcfa;
}

@media (min-width: 1440px) {
  .shell {
    gap: 0;
    padding: 0;
  }
}

@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 370px minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .topbar {
    padding: 0 12px;
  }

  .market-strip {
    align-self: auto;
    border-top: 1px solid #e1e5df;
  }

  .market-chip {
    min-height: 44px;
  }

  .topbar .toolbar {
    border-left: 0;
  }

  .shell {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .left-stack {
    border-right: 0;
    border-top: 1px solid #d9ded8;
  }
}

@media (max-width: 640px) {
  .market-strip,
  .overview-grid,
  .learning-tools {
    grid-template-columns: 1fr;
  }

  .market-chip,
  .overview-grid article,
  .tool-button {
    border-right: 0;
    border-bottom: 1px solid #e1e5df;
  }

  .watch-form input,
  .watch-form input:nth-child(3n) {
    border-right: 0;
  }
}

.left-stack {
  scrollbar-width: thin;
  scrollbar-color: #aeb8b1 transparent;
}

.left-stack::-webkit-scrollbar {
  width: 3px;
}

.left-stack::-webkit-scrollbar-track {
  background: transparent;
}

.left-stack::-webkit-scrollbar-thumb {
  background: #aeb8b1;
  border-radius: 0;
}

.topbar {
  gap: 18px;
}

.market-strip {
  gap: 14px;
}

.market-chip,
.market-chip.live {
  border: 0;
  padding: 0;
}

.topbar .toolbar {
  gap: 6px;
  border-left: 0;
}

.topbar .topbar-action,
.topbar .refresh-action {
  border: 1px solid transparent;
  border-radius: 0;
  padding: 0 10px;
}

.topbar .topbar-action:hover,
.topbar .refresh-action:hover {
  border-color: #d7ddd7;
}

.topbar .refresh-action:hover {
  background: #f7f8f6;
  color: #9c3028;
  box-shadow: none;
}

.settings-menu {
  position: relative;
  display: flex;
  align-self: stretch;
}

.settings-dropdown {
  position: absolute;
  top: calc(100% + 1px);
  right: 0;
  z-index: 40;
  min-width: 116px;
  border: 1px solid #d7ddd7;
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.1);
}

.settings-option {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  border-radius: 0;
  background: #ffffff;
  color: #26312f;
  font-size: 14px;
  box-shadow: none;
  white-space: nowrap;
}

.settings-option:last-child {
  border-bottom: 0;
}

.settings-option:hover {
  background: #f7f8f6;
}

.drag-handle {
  color: #9aa49e;
  cursor: grab;
  font-size: 13px;
  line-height: 1;
  user-select: none;
}

.watch-card {
  cursor: grab;
}

.watch-card:active,
.watch-card.dragging {
  cursor: grabbing;
}

.watch-card.dragging {
  opacity: 0.58;
}

.watch-card.drag-over {
  background: #f7f8f6;
  box-shadow: inset 3px 0 0 #b92f26;
}

.watch-more-button {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-bottom: 1px solid #e1e5df;
  border-radius: 0;
  background: transparent;
  color: #65706b;
  box-shadow: none;
}

.watch-more-button:hover {
  background: #f7f8f6;
  color: #26312f;
}

.brand-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.signal-ticker-region {
  display: grid;
  place-items: center;
  border-bottom: 1px solid #d9ded8;
  background: #fffdf8;
}

.signal-ticker-region[hidden] {
  display: none;
}

.signal-ticker {
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(860px, 100%);
  min-height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #26312f;
  box-shadow: none;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.2;
  overflow: hidden;
  text-align: center;
}

.signal-ticker.is-rolling {
  animation: signal-ticker-up 260ms ease-out;
}

.signal-ticker-label {
  color: #9c3028;
  font-weight: 850;
}

.signal-ticker-main {
  font-weight: 760;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signal-ticker-meta {
  color: #65706b;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signal-ticker:hover .signal-ticker-main,
.signal-ticker:hover .signal-ticker-meta {
  text-decoration: underline;
  text-underline-offset: 3px;
}

@keyframes signal-ticker-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.signal-detail-panel {
  width: min(560px, 100%);
  grid-template-rows: auto minmax(0, 1fr);
}

.signal-detail {
  display: grid;
  gap: 0;
  padding: 0;
  background: #ffffff;
}

.signal-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #e1e5df;
}

.signal-detail-head div {
  display: grid;
  gap: 2px;
}

.signal-detail-head strong {
  color: #17202a;
  font-size: 17px;
}

.signal-detail-head span:not(.badge) {
  color: #65706b;
  font-size: 12px;
}

.signal-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-left: 1px solid #eef1ec;
  border-top: 1px solid #eef1ec;
}

.signal-detail-grid div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px 10px;
  border-right: 1px solid #eef1ec;
  border-bottom: 1px solid #eef1ec;
}

.signal-detail-grid dt,
.signal-detail-grid dd {
  margin: 0;
  min-width: 0;
}

.signal-detail-grid dt {
  color: #65706b;
  font-size: 12px;
}

.signal-detail-grid dd {
  color: #17202a;
  font-size: 14px;
  font-weight: 760;
  overflow-wrap: anywhere;
}

.signal-detail-grid dd.up {
  color: var(--red);
}

.signal-detail-grid dd.down {
  color: var(--green);
}

body:has(.signal-ticker-region:not([hidden])) .shell {
  height: calc(100vh - 68px - 35px);
}

.left-stack {
  border-right-color: var(--hairline);
}

.left-stack > .panel,
.left-stack > .learning-tools,
.left-stack > .market-overview {
  border-bottom-color: var(--hairline);
}

.left-stack > .watch-panel {
  border-bottom: 0;
  padding: 8px 10px 10px;
}

.panel-head,
.watch-form input,
.watch-form button,
.watch-card,
.source-grid,
.source-note,
.source-error {
  border-color: var(--hairline);
}

.watchlist .watch-card:last-of-type {
  border-bottom-color: var(--hairline);
}

.watch-more-button {
  min-height: 32px;
  border-bottom-color: var(--hairline);
  color: #b92f26;
  font-size: 14px;
  font-weight: 760;
}

.watch-more-button:hover {
  background: transparent;
  color: #9c3028;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.chart-panel .panel-head,
.chart-legend {
  border-bottom-color: var(--hairline);
}

.watch-form input,
.watch-form button {
  border-bottom-color: var(--hairline);
}

.watch-form input:nth-last-child(-n + 4),
.watch-form button {
  border-bottom-width: 1px;
}

.watch-panel .panel-head {
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--hairline);
  border-bottom: 0;
  background: #ffffff;
}

.watch-panel .watch-form {
  border: 1px solid var(--hairline);
  margin-top: -1px;
}

.watch-panel .watchlist {
  margin-top: 8px;
}

.overview-grid strong,
.action-line strong,
.backtest-metric-card strong,
.modal-head h2,
.signal-detail-head strong,
.analysis-header h1 span,
.analysis-band h2,
.analysis-grid h2,
.analysis-metrics dd {
  font-size: 14px;
}

.analysis-page {
  background: #f7f8f6;
  color: #17202a;
  height: auto;
  min-height: 100%;
  overflow: auto;
}

.analysis-shell {
  align-content: start;
  margin: 0 auto;
  display: grid;
  gap: 0;
  max-width: 1120px;
  min-height: 0;
  padding: 8px;
}

.analysis-shell > * + * {
  margin-top: 0;
}

.analysis-shell > .analysis-band:not(:first-child),
.analysis-shell > .analysis-grid article {
  border-top: 0;
}

.analysis-header,
.analysis-band,
.analysis-grid article {
  background: #ffffff;
  border: 1px solid #e8ede7;
  border-radius: 0;
}

.analysis-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
}

.analysis-back {
  color: #65706b;
  display: inline-block;
  font-size: 13px;
  margin-bottom: 2px;
  text-decoration: none;
}

.analysis-header h1 {
  font-size: 22px;
  line-height: 1.1;
  margin: 0;
}

.analysis-header h1 span {
  color: #66737f;
  font-size: 15px;
  font-weight: 600;
}

.analysis-header p,
.analysis-band p,
.analysis-plan p,
.analysis-band li,
.analysis-columns li {
  color: #4d5a66;
  font-size: 14px;
  line-height: 1.58;
}

.analysis-header p {
  margin: 2px 0 0;
}

.analysis-score {
  align-items: center;
  border-radius: 0;
  color: #ffffff;
  display: grid;
  align-self: center;
  grid-template-columns: auto auto;
  gap: 6px;
  height: 52px;
  justify-items: center;
  min-width: 92px;
  padding: 4px 9px;
}

.analysis-score.positive {
  background: #147d64;
}

.analysis-score.neutral {
  background: #536579;
}

.analysis-score.cautious {
  background: #a0443d;
}

.analysis-score span {
  font-size: 25px;
  font-weight: 800;
  line-height: 1;
}

.analysis-score small {
  font-size: 10px;
  text-transform: uppercase;
}

.analysis-band {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 0;
  min-height: 0;
  padding: 12px 14px;
}

.analysis-band p {
  margin: 0;
}

.analysis-band.muted {
  align-items: flex-start;
}

.analysis-band h2,
.analysis-grid h2 {
  font-size: 15px;
  margin: 0 0 8px;
}

.analysis-actions a {
  background: transparent;
  border: 1px solid #d9ded8;
  border-radius: 0;
  color: #26312f;
  display: inline-block;
  padding: 6px 10px;
  text-decoration: none;
}

.analysis-grid {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0;
}

.analysis-grid article + article {
  border-left: 0;
}

.analysis-grid article {
  padding: 12px 14px;
}

.analysis-metrics {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  border-left: 1px solid #e6ebe5;
  border-top: 1px solid #e6ebe5;
}

.analysis-metrics div {
  background: transparent;
  border: 0;
  border-bottom: 1px solid #e6ebe5;
  border-right: 1px solid #e6ebe5;
  border-radius: 0;
  padding: 8px 10px;
}

.analysis-metrics dt {
  color: #687684;
  font-size: 12px;
}

.analysis-metrics dd {
  font-size: 15px;
  font-weight: 700;
  margin: 2px 0 0;
  font-variant-numeric: tabular-nums;
}

.analysis-plan {
  display: grid;
  gap: 7px;
}

.analysis-plan p {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin: 0;
  padding-bottom: 7px;
  border-bottom: 1px solid #e6ebe5;
}

.analysis-plan p:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.analysis-plan strong {
  color: #17202a;
  display: inline-flex;
  justify-content: center;
  margin-right: 0;
  min-width: 42px;
}

.analysis-plan .plan-tag {
  border: 1px solid #d7ddd7;
  color: #26312f;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
  padding: 3px 6px;
}

.analysis-plan .plan-tag.entry {
  border-color: #d9b4af;
  color: #9c3028;
}

.analysis-plan .plan-tag.exit,
.analysis-plan .plan-tag.risk {
  border-color: #d2b09d;
  color: #965a1c;
}

.analysis-plan .plan-tag.position {
  border-color: #b9d7ca;
  color: #147d64;
}

.analysis-plan span {
  color: #1f2927;
  font-weight: 400;
}

.analysis-plan .plan-value {
  color: #9c3028;
  font-weight: 850;
  padding: 0 2px;
}

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

.analysis-columns h3 {
  color: #26312f;
  font-size: 13px;
  margin: 0 0 8px;
}

.analysis-columns ul,
.analysis-band ul {
  margin: 0;
  padding-left: 16px;
}

.analysis-columns li,
.analysis-band li {
  margin: 0 0 5px;
  line-height: 1.58;
}

@media (max-width: 760px) {
  .analysis-shell {
    padding: 8px;
  }

  .analysis-header,
  .analysis-band {
    align-items: stretch;
    flex-direction: column;
  }

  .analysis-score {
    height: auto;
    min-width: 0;
  }

  .analysis-grid,
  .analysis-columns {
    grid-template-columns: 1fr;
  }

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

.overview-grid strong,
.action-line strong,
.backtest-metric-card strong,
.modal-head h2,
.signal-detail-head strong,
.analysis-header h1 span,
.analysis-metrics dd {
  font-size: 14px;
}

.topbar .topbar-action,
.tool-button,
.mini-actions a.secondary,
.mini-actions button.secondary,
.load-chart-button,
.chart-tools select {
  font-size: 14px;
}

.chart-tools select,
.chart-tools button {
  border-radius: 0;
}

.alerts-modal-panel {
  width: min(660px, 100%);
}

.modal-alerts {
  gap: 6px;
  padding: 10px;
  background: #fbfcfa;
}

.modal-alerts .meta {
  display: grid;
  align-items: center;
  justify-items: center;
  min-height: 120px;
  padding: 0 12px;
  text-align: center;
}

.modal-alerts .alert-card {
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  border-radius: 0;
  box-shadow: none;
}

.modal-alerts .alert-card header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.alert-card-actions {
  display: grid;
  grid-template-columns: repeat(2, 64px);
  gap: 8px;
  justify-items: stretch;
  min-width: 136px;
  white-space: nowrap;
}

.modal-alerts .badge,
.modal-alerts .alert-read-status,
.modal-alerts .alert-card-actions .compact-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid #d7ddd7;
  border-radius: 0;
  font-size: 14px;
  font-weight: 760;
}

.modal-alerts .badge.critical {
  border-color: #f0b0aa;
}

.modal-alerts .alert-read-status {
  color: #26312f;
  background: #ffffff;
}

.modal-alerts .alert-foot {
  gap: 14px;
  margin-top: 6px;
  padding-right: 0;
}

.backtest-modal-panel {
  width: min(560px, 100%);
}

.backtest-modal-panel .backtest-form {
  gap: 12px;
  padding: 16px 18px 18px;
}

.backtest-modal-panel .backtest-field {
  gap: 6px;
}

.backtest-modal-panel .backtest-field span {
  color: #4d5a66;
  font-size: 13px;
  line-height: 1.2;
}

.backtest-modal-panel .backtest-field input {
  min-height: 38px;
  border-radius: 0;
  font-size: 14px;
  line-height: 1.2;
  padding: 0 10px;
}

.backtest-modal-panel .backtest-submit {
  min-height: 40px;
  border-radius: 0;
  font-size: 14px;
  box-shadow: none;
}

.paper-modal-panel {
  width: min(960px, 100%);
  height: min(760px, calc(100vh - 48px));
  grid-template-rows: auto minmax(0, 1fr);
}

.paper-trading {
  display: grid;
  align-content: start;
  gap: 0;
  overflow: auto;
  background: #ffffff;
}

.paper-auto-status {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--hairline);
  color: #65706b;
  font-size: 13px;
}

.paper-auto-status strong {
  color: #17202a;
  font-size: 14px;
}

.paper-auto-status strong.up {
  color: var(--red);
}

.paper-auto-status small {
  min-width: 0;
  color: #7a8580;
  font-size: 12px;
}

.paper-auto-status em {
  grid-column: 1 / -1;
  color: var(--red);
  font-size: 12px;
  font-style: normal;
}

.paper-settings {
  display: grid;
  grid-template-columns: repeat(4, minmax(88px, 1fr)) auto;
  align-items: stretch;
  gap: 0;
  border-bottom: 1px solid var(--hairline);
}

.paper-settings label {
  display: grid;
  grid-template-columns: auto minmax(54px, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 36px;
  padding: 0 10px;
  border-right: 1px solid var(--hairline);
}

.paper-settings label span {
  color: #65706b;
  font-size: 12px;
  line-height: 1.2;
}

.paper-settings input {
  width: 100%;
  height: 34px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #17202a;
  font-size: 14px;
  font-weight: 760;
  outline: none;
}

.paper-settings input:focus {
  box-shadow: inset 0 -1px 0 var(--red);
}

.paper-settings button {
  height: 100%;
  min-height: 36px;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
  white-space: nowrap;
}

.paper-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-bottom: 1px solid var(--hairline);
}

.paper-summary article {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  border-right: 1px solid var(--hairline);
}

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

.paper-summary span,
.paper-section h3,
.paper-row span,
.paper-snapshots span {
  color: #65706b;
  font-size: 13px;
}

.paper-summary strong {
  color: #17202a;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.paper-summary .up,
.paper-row .up {
  color: var(--red);
}

.paper-summary .down,
.paper-row .down {
  color: var(--green);
}

.paper-section {
  display: grid;
  gap: 0;
  border-bottom: 1px solid var(--hairline);
}

.paper-section h3 {
  margin: 0;
  padding: 10px 12px;
  color: #17202a;
  font-weight: 850;
  border-bottom: 1px solid var(--hairline);
}

.paper-table {
  display: grid;
}

.paper-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.3fr) repeat(4, minmax(90px, 1fr));
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  border-bottom: 1px solid var(--hairline);
}

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

.paper-row strong {
  color: #17202a;
  font-size: 14px;
}

.paper-row small {
  color: #7a8580;
  font-size: 12px;
}

.paper-empty {
  padding: 14px 12px;
  color: #65706b;
  font-size: 14px;
}

.paper-snapshots {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.paper-snapshots div {
  display: grid;
  gap: 4px;
  padding: 9px 12px;
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.paper-snapshots strong {
  color: #17202a;
  font-size: 14px;
}

.paper-snapshots small {
  color: #65706b;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.paper-snapshots small.up {
  color: var(--red);
}

.paper-snapshots small.down {
  color: var(--green);
}

.hot-sectors-panel {
  width: min(980px, 100%);
  height: min(760px, calc(100vh - 48px));
  grid-template-rows: auto minmax(0, 1fr);
}

.late-session-panel {
  width: min(1180px, 100%);
  height: min(760px, calc(100vh - 48px));
  grid-template-rows: auto minmax(0, 1fr);
}

.trades-panel {
  width: min(1080px, 100%);
  height: min(720px, calc(100vh - 48px));
  grid-template-rows: auto minmax(0, 1fr);
}

.confirm-panel {
  width: min(430px, 100%);
  grid-template-rows: auto auto;
}

.confirm-body {
  display: grid;
  gap: 16px;
  padding: 18px 20px 20px;
  background: #ffffff;
}

.confirm-body p {
  margin: 0;
  color: #26312f;
  font-size: 14px;
  line-height: 1.7;
}

.confirm-actions {
  justify-content: flex-end;
  gap: 8px;
}

.trade-records {
  overflow: auto;
  background: #ffffff;
}

.trade-record-table {
  display: grid;
}

.trade-record {
  display: grid;
  grid-template-columns: minmax(160px, 1.4fr) 58px 72px 72px 92px 72px 82px 92px;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--hairline);
  color: #26312f;
  font-size: 13px;
}

.trade-record.is-unread {
  background: #fffdf8;
}

.trade-record div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.trade-record strong {
  color: #17202a;
  font-size: 14px;
}

.trade-record span,
.trade-record small {
  color: #65706b;
  font-size: 12px;
}

.trade-record .up {
  color: var(--red);
}

.trade-record .down {
  color: var(--green);
}

.trade-read-button {
  min-height: 30px;
  border-radius: 0;
  font-size: 12px;
  white-space: nowrap;
}

.hot-sectors {
  display: grid;
  align-content: start;
  overflow: auto;
  background: #ffffff;
}

.hot-sector {
  display: grid;
  border-bottom: 1px solid var(--hairline);
}

.hot-sector header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--hairline);
}

.hot-sector header div {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.hot-sector header div:last-child {
  justify-content: end;
}

.hot-sector header span,
.hot-stock-row span,
.hot-stock-row small {
  color: #65706b;
  font-size: 12px;
}

.hot-sector header strong,
.hot-stock-row strong {
  color: #17202a;
  font-size: 14px;
}

.hot-sector .up,
.hot-stock-row .up {
  color: var(--red);
}

.hot-sector .down,
.hot-stock-row .down {
  color: var(--green);
}

.hot-stock-table {
  display: grid;
}

.hot-stock-row {
  display: grid;
  grid-template-columns: 28px minmax(150px, 1fr) 80px 80px 70px;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  border-radius: 0;
  background: transparent;
  text-align: left;
}

.hot-stock-row:last-child {
  border-bottom: 0;
}

.hot-stock-row:hover {
  background: #fafbf8;
}

.late-session {
  display: grid;
  align-content: start;
  overflow: auto;
  background: #ffffff;
}

.late-session-phase {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 12px;
  border-bottom: 1px solid var(--hairline);
  background: #fbfcfa;
}

.late-session-phase strong {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid #d7ddd7;
  color: #26312f;
  font-size: 14px;
}

.late-session-phase span {
  color: #65706b;
  font-size: 12px;
}

.late-session-phase.intraday_preview strong {
  border-color: #d8c096;
  color: #8b5e12;
}

.late-session-phase.late_session strong {
  border-color: #dca7a0;
  color: #b92f26;
}

.late-session-phase.closing_auction strong {
  border-color: #b8c8dd;
  color: #245e9c;
}

.late-session-phase.after_close strong {
  border-color: #b9d7ca;
  color: #00845f;
}

.late-session-summary {
  display: grid;
  grid-template-columns: 1.1fr 0.8fr 1.8fr;
  border-bottom: 1px solid var(--hairline);
}

.late-session-summary div {
  display: grid;
  gap: 3px;
  padding: 9px 12px;
  border-right: 1px solid var(--hairline);
}

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

.late-session-summary span,
.late-session-row span,
.late-session-row small {
  color: #65706b;
  font-size: 12px;
}

.late-session-summary strong,
.late-session-row strong {
  color: #17202a;
  font-size: 14px;
}

.late-session-table {
  display: grid;
}

.late-session-row {
  display: grid;
  grid-template-columns: 30px minmax(150px, 1fr) 58px 72px 72px 70px 96px 70px 64px minmax(210px, 1.4fr);
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--hairline);
}

.late-rank {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid #d7ddd7;
  color: #65706b;
  font-size: 12px;
  font-weight: 760;
}

.late-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.late-score {
  color: #b92f26;
  font-variant-numeric: tabular-nums;
}

.late-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.late-reasons em {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 6px;
  border: 1px solid #d7ddd7;
  color: #26312f;
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}

.late-reasons em.risk {
  border-color: #f0b0aa;
  color: #b92f26;
}

.late-session-empty {
  display: grid;
  place-items: center;
  min-height: 160px;
  text-align: center;
}

/* TradingView-inspired left rail refinement. */
.left-stack {
  --left-ink: #131722;
  --left-muted: #787b86;
  --left-soft: #f8f9fd;
  --left-line: #e0e3eb;
  color: var(--left-ink);
  line-height: 1.35;
}

.left-stack .market-overview {
  background: #ffffff;
}

.left-stack .overview-grid article {
  min-height: 58px;
  padding: 9px 12px;
  border-right-color: var(--left-line);
}

.left-stack .overview-grid span {
  color: var(--left-muted);
  font-size: 12px;
  font-weight: 600;
}

.left-stack .overview-grid strong {
  margin-top: 4px;
  color: var(--left-ink);
  font-size: 16px;
  font-weight: 650;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.left-stack .overview-grid strong.brief-hot {
  color: #d12b1f;
}

.left-stack .learning-tools {
  border-bottom-color: var(--left-line);
}

.left-stack .tool-button {
  min-height: 38px;
  border-right-color: var(--left-line);
  color: var(--left-ink);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
}

.left-stack .tool-button:hover {
  background: var(--left-soft);
}

.left-stack .tool-button .button-icon {
  color: var(--left-muted);
  font-size: 12px;
}

.left-stack .watch-panel {
  padding: 8px 10px 10px;
}

.left-stack .watch-panel .panel-head {
  min-height: 40px;
  padding: 8px 10px;
  border-color: var(--left-line);
}

.left-stack .panel h2 {
  color: var(--left-ink);
  font-size: 16px;
  font-weight: 700;
}

.left-stack .panel-kicker {
  color: var(--left-muted);
  font-size: 12px;
  font-weight: 600;
}

.left-stack .watch-panel .watch-form {
  border-color: var(--left-line);
}

.left-stack .watch-form input,
.left-stack .watch-form button {
  min-height: 36px;
  border-color: var(--left-line);
  color: var(--left-ink);
  font-size: 12px;
  font-weight: 500;
}

.left-stack .watch-form input::placeholder {
  color: var(--left-muted);
  font-size: 12px;
  font-weight: 500;
}

.left-stack .watch-form button {
  color: #d12b1f;
  font-size: 13px;
  font-weight: 700;
}

.left-stack .watchlist {
  margin-top: 8px;
}

.left-stack .watch-card {
  padding: 12px 14px;
  border-bottom-color: var(--left-line);
}

.left-stack .watch-card header {
  align-items: center;
  gap: 10px;
}

.left-stack .stock-name {
  gap: 7px;
  color: var(--left-ink);
  font-size: 16px;
  font-weight: 680;
  line-height: 1.2;
}

.left-stack .stock-name small {
  color: var(--left-muted);
  font-size: 12px;
  font-weight: 600;
}

.left-stack .drag-handle {
  color: #b2b5be;
  font-size: 12px;
}

.left-stack .mini-actions a.secondary,
.left-stack .mini-actions button.secondary {
  min-height: 30px;
  padding: 0 12px;
  border-color: var(--left-line);
  color: var(--left-ink);
  font-size: 13px;
  font-weight: 650;
}

.left-stack .mini-actions a.secondary:hover,
.left-stack .mini-actions button.secondary:hover {
  background: var(--left-soft);
}

.left-stack .watch-card .metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 8px;
  border-top: 1px solid var(--left-line);
  border-left: 1px solid var(--left-line);
  color: var(--left-muted);
  font-size: 12px;
}

.left-stack .watch-card .metrics span {
  min-height: 30px;
  padding: 7px 9px;
  border-right: 1px solid var(--left-line);
  border-bottom: 1px solid var(--left-line);
  border-radius: 0;
  background: #ffffff;
  line-height: 1.25;
}

.left-stack .watch-more-button {
  color: #d12b1f;
  font-size: 13px;
  font-weight: 650;
}

.left-stack .source-panel .panel-head {
  min-height: 40px;
  padding: 8px 10px;
}

.left-stack .source-grid,
.left-stack .source-updated {
  color: var(--left-muted);
  font-size: 12px;
}

.left-stack .source-grid {
  gap: 8px 12px;
  padding: 12px 12px 0;
}

.left-stack .source-updated {
  padding: 0 12px 10px;
}

.left-stack .source-grid strong,
.left-stack .source-updated strong {
  color: var(--left-ink);
  font-size: 13px;
  font-weight: 650;
}

.left-stack .source-note,
.left-stack .source-error {
  margin: 10px 12px 0;
  font-size: 12px;
}

@media (max-width: 760px) {
  body {
    overflow: auto;
    background: #f7f8f6;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    height: auto;
    padding: 10px 12px 0;
    background: rgba(255, 253, 248, 0.97);
  }

  .brand-lockup {
    min-width: 0;
  }

  .brand-copy {
    min-width: 0;
  }

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

  .topbar p {
    font-size: 13px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .market-strip {
    display: none;
  }

  .topbar .toolbar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    width: calc(100% + 24px);
    margin: 2px -12px 0;
    border-top: 1px solid var(--line);
    background: #ffffff;
  }

  .topbar .topbar-action {
    min-height: 42px;
    padding: 0 4px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #26312f;
    font-size: 13px;
    font-weight: 750;
  }

  .topbar .topbar-action:hover {
    transform: none;
    box-shadow: none;
  }

  .topbar .refresh-action,
  .topbar .refresh-action:hover {
    background: transparent;
    color: var(--red);
    box-shadow: none;
  }

  .topbar-action-icon,
  .topbar .refresh-action .topbar-action-icon {
    width: 18px;
    height: 18px;
    background: transparent;
    color: currentColor;
    font-size: 13px;
  }

  .topbar-badge {
    top: 5px;
    right: 18%;
  }

  .settings-menu {
    min-width: 0;
  }

  .settings-dropdown {
    right: 0;
  }

  .signal-ticker-region {
    position: sticky;
    top: 94px;
    z-index: 19;
  }

  body:has(.signal-ticker-region:not([hidden])) .shell,
  .shell {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: auto;
    min-height: 0;
    overflow: visible;
    padding: 8px;
  }

  .main-stack {
    order: 1;
    display: block;
    height: auto;
    overflow: visible;
  }

  .left-stack {
    order: 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: visible;
    padding-right: 0;
    border-right: 0;
  }

  .panel,
  .learning-tools {
    border-radius: 0;
    box-shadow: none;
  }

  .chart-panel {
    display: block;
    height: auto;
    overflow: visible;
  }

  .chart-panel .panel-head {
    align-items: stretch;
    gap: 12px;
    padding: 12px;
  }

  .chart-panel .panel-head h2 {
    font-size: 17px;
  }

  .chart-tools {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(86px, 0.9fr) minmax(86px, 0.9fr);
    gap: 8px;
    width: 100%;
  }

  .chart-tools select,
  .chart-tools button,
  .load-chart-button {
    min-width: 0;
    min-height: 40px;
    padding: 0 8px;
    font-size: 14px;
  }

  #chart {
    height: auto;
    min-height: 0;
  }

  .kline-chart,
  .chart-error {
    height: 330px;
    min-height: 300px;
  }

  .chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 10px 12px;
    font-size: 13px;
  }

  .market-overview {
    order: 1;
  }

  .left-stack .overview-grid,
  .overview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-radius: 0;
  }

  .left-stack .overview-grid article,
  .overview-grid article {
    min-height: 68px;
    padding: 12px 10px;
    border-right: 1px solid var(--line);
  }

  .left-stack .overview-grid article:last-child,
  .overview-grid article:last-child {
    border-right: 0;
  }

  .left-stack .overview-grid span,
  .overview-grid span {
    font-size: 12px;
  }

  .left-stack .overview-grid strong,
  .overview-grid strong {
    font-size: 22px;
  }

  .learning-tools {
    order: 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding: 0;
    border-bottom: 0;
  }

  .left-stack .tool-button,
  .tool-button {
    min-height: 48px;
    border: 0;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: #ffffff;
    box-shadow: none;
    font-size: 14px;
  }

  .left-stack .tool-button:nth-child(2n),
  .tool-button:nth-child(2n) {
    border-right: 0;
  }

  .watch-panel {
    order: 3;
  }

  .source-panel {
    order: 4;
  }

  .left-stack .watch-panel,
  .watch-panel {
    padding: 0;
  }

  .left-stack .watch-panel .panel-head,
  .watch-panel .panel-head,
  .left-stack .source-panel .panel-head,
  .source-panel .panel-head {
    min-height: 48px;
    padding: 12px;
    border: 0;
    border-bottom: 1px solid var(--line);
  }

  .left-stack .panel h2,
  .panel h2 {
    font-size: 17px;
  }

  .left-stack .panel-kicker,
  .panel-kicker {
    font-size: 12px;
  }

  .left-stack .watch-panel .watch-form,
  .watch-panel .watch-form,
  .watch-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 0;
    padding: 12px;
    border: 0;
    border-bottom: 1px solid var(--line);
  }

  .left-stack .watch-form input,
  .left-stack .watch-form button,
  .watch-form input,
  .watch-form button {
    min-height: 42px;
    font-size: 14px;
  }

  .left-stack .watchlist,
  .watchlist {
    margin-top: 0;
  }
}
