:root {
  color-scheme: dark;
  font: 16px/1.55 system-ui, -apple-system, sans-serif;
  color: #e5edf7;
  background: #0a111c;
  --panel: #0d1928;
  --border: #23374c;
  --muted: #a1b6c9;
  --accent: #55d0d6;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
.frame { width: min(1800px, calc(100% - 48px)); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--border); background: #0d1624; }
.site-header .frame { display: flex; align-items: center; justify-content: space-between; min-height: 52px; gap: 1rem; }
.site-header a { text-decoration: none; }
.brand { color: inherit; font-size: 1.45rem; font-weight: 780; }
.brand span { color: var(--accent); }
main { padding-block: 16px 28px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 12px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.4rem, 2.4vw, 1.75rem); }
h2 { font-size: 1.1rem; }
#symbol-form { width: min(370px, 100%); }
#symbol-form label { display: block; margin-bottom: 4px; font-size: .875rem; color: var(--muted); }
.search { display: flex; gap: 6px; }
input, button { padding: .5rem .75rem; border: 1px solid #34516a; border-radius: 6px; color: inherit; background: #112235; font: inherit; }
input { flex: 1; min-width: 0; }
input::placeholder { color: var(--muted); }
button { cursor: pointer; white-space: nowrap; font-size: .875rem; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: .55; cursor: default; }
button[aria-pressed="true"], .search button { border-color: var(--accent); background: #16434f; color: #bcf9fa; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
#search-message { font-size: .875rem; color: #ffbf96; }
#search-message:empty { display: none; }
.panel { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--panel); }
.panel-head { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.intervals { display: flex; gap: 5px; flex-wrap: wrap; }
.chart-actions { margin-left: auto; display: flex; gap: 5px; }
.price-readout { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px; padding: 8px 16px; min-height: 42px; font-size: .875rem; }
.price-readout time, .price-readout span { color: var(--muted); }
.price-readout b, .rsi-readout strong { font-variant-numeric: tabular-nums; color: #e5edf7; }
.plot { position: relative; }
#chart { height: clamp(420px, calc(100dvh - 255px), 860px); }
.rsi-readout { position: absolute; left: 12px; z-index: 2; top: var(--rsi-top); pointer-events: none; background: #0d1928ee; padding: 3px 6px; border-radius: 4px; color: var(--muted); font-size: .875rem; }
.rsi-readout strong { margin-right: .5rem; }
#rsi-value { color: #bb9cf5; }
#sma-value { color: #f4cf68; }
.panel-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem 1rem; padding: 10px 16px; font-size: .875rem; color: var(--muted); border-top: 1px solid var(--border); }
.panel-foot a { color: inherit; }
.analysis-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(290px, 21%); align-items: start; gap: 12px; }
.watchlist { min-width: 0; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); overflow: hidden; }
.watchlist-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 11px 10px; }
.watchlist-head h2 { font-size: 1rem; }
.watchlist-head button { padding: .38rem .45rem; }
.watchlist-scroll { max-height: max(250px, calc(100dvh - 235px)); overflow-y: auto; }
.watchlist-table { border-collapse: collapse; width: 100%; table-layout: fixed; font-size: .875rem; font-variant-numeric: tabular-nums; }
.watchlist-table th { position: sticky; top: 0; color: var(--muted); font-weight: 500; background: #112033; }
.watchlist-table th, .watchlist-table td { text-align: right; padding: 7px 5px; border-top: 1px solid var(--border); }
.watchlist-table th:first-child, .watchlist-table td:first-child { width: 40%; text-align: left; padding-left: 10px; }
.watchlist-table th:last-child, .watchlist-table td:last-child { width: 34px; padding-left: 0; }
.watchlist-table .watch-open { display: block; width: 100%; text-align: left; padding: 3px 4px; white-space: normal; line-height: 1.25; border: 0; background: transparent; }
.watch-open strong, .watch-open span { display: block; }
.watch-open span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--muted); margin-top: 3px; }
.watchlist-table tr[data-current="true"] { box-shadow: inset 3px 0 var(--accent); background: #143342; }
.watchlist-table tbody tr { cursor: pointer; }
.watchlist-table tbody tr:hover { background: #15283b; }
.watchlist-table tr[data-current="true"]:hover { background: #183b4a; }
.watch-remove { padding: 2px 6px; background: transparent; color: var(--muted); }
.watch-up { color: #56dbc5; }
.watch-down { color: #ff98a2; }
#watch-status { margin: 8px 10px; color: var(--muted); font-size: .875rem; }
#watch-status:empty { display: none; }
@media (max-width: 900px) {
  .analysis-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 650px) {
  .frame { width: calc(100% - 24px); }
  main { padding-top: 18px; }
  .page-head { display: grid; gap: 12px; }
  .panel-head { gap: 9px; padding-inline: 10px; }
  h2 { flex-basis: 100%; }
  .intervals button { padding-inline: .45rem; }
  .chart-actions { margin-left: 0; }
  .price-readout { padding-inline: 10px; }
  #chart { min-height: 410px; }
}
