:root {
  color-scheme: dark;
  --page: #0e1113;
  --surface: #151a1c;
  --line: #30393b;
  --text: #edf2ed;
  --muted: #a6b4b1;
  --accent: #d2f084;
  --selected: #252f22;
  font-family: "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--text); }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.top { min-height: 62px; display: flex; align-items: center; gap: 30px; padding: 10px clamp(14px, 2.8vw, 48px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; font-size: 1.25rem; letter-spacing: -.035em; margin: 0; }
.search, .quiet, .favorite { background: transparent; border: 1px solid var(--line); border-radius: 5px; padding: 8px 11px; }
.search { display: flex; align-items: center; gap: 10px; min-width: 230px; background: var(--surface); color: var(--muted); text-align: left; }
.search-icon { width: 12px; height: 12px; border: 1.5px solid currentColor; border-radius: 50%; position: relative; margin-right: 3px; }
.search-icon::after { content: ""; position: absolute; right: -4px; bottom: -2px; width: 5px; height: 1.5px; background: currentColor; transform: rotate(45deg); }
kbd { margin-left: auto; color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: 0 5px; }
.zone, .market, .column-labels, #chart-title, #intervals, .feed { font-variant-numeric: tabular-nums; }
.zone { margin-left: auto; color: var(--muted); white-space: nowrap; font-size: .875rem; }
main { max-width: 1920px; margin: auto; padding: 14px clamp(10px, 2vw, 32px) 22px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) clamp(235px, 22vw, 320px); align-items: stretch; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.panel { background: var(--surface); min-width: 0; }
.instrument, .toolbar, .dialog-head, .watch-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; }
.instrument { min-height: 69px; }
.identity { display: flex; align-items: center; gap: 11px; min-width: 0; text-align: left; border: 0; border-radius: 5px; background: transparent; padding: 4px 8px 4px 4px; }
.identity strong { display: block; font-size: 1.15rem; line-height: 1.05; }
.identity small { display: block; color: var(--muted); margin-top: 4px; font-size: .85rem; }
.chevron { width: 7px; height: 7px; border-bottom: 1px solid var(--muted); border-right: 1px solid var(--muted); transform: rotate(45deg); margin: 0 2px 3px 5px; }
.badge, .tile { position: relative; display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; background: #29312f; color: #d4e2dd; font-weight: 700; font-size: .77rem; }
.tile { width: 28px; height: 28px; }
.badge img, .tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #29312f; }
.favorite { min-width: 38px; font-size: 1.25rem; line-height: 1; }
.favorite[aria-pressed=true] { color: var(--accent); }
.toolbar { border-block: 1px solid var(--line); padding-block: 6px; }
.segments { display: flex; flex-wrap: wrap; gap: 3px; }
.segments button { border: 0; background: transparent; border-radius: 4px; padding: 7px 9px; color: var(--muted); font-size: .875rem; }
.segments button[aria-pressed=true] { background: var(--selected); color: var(--accent); }
button:hover, .segments button:hover { background-color: #293335; }
.quiet { font-size: .875rem; }
#chart { height: max(440px, calc(100dvh - 255px)); position: relative; background: #101416; }
.chart-status { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; padding: 20px; color: var(--muted); }
.feed { padding: 9px 13px; color: var(--muted); font-size: .875rem; border-top: 1px solid var(--line); }
.tradingview-widget-copyright { padding: 3px 12px; font-size: .8rem; color: var(--muted); }
.tradingview-widget-copyright a { color: var(--accent); }
.sidebar { border-left: 1px solid var(--line); }
.watch-header { min-height: 69px; }
h2 { margin: 0; font-size: 1rem; }
#add { font-size: 1.25rem; padding: 4px 10px; }
.sidebar .segments { padding: 0 11px 9px; }
.column-labels { display: flex; justify-content: space-between; padding: 8px 12px; border-block: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
#watchlist { max-height: max(410px, calc(100dvh - 217px)); overflow: auto; }
.asset-row { width: 100%; display: flex; align-items: center; gap: 9px; text-align: left; background: transparent; border: 0; border-bottom: 1px solid #252e30; box-shadow: inset 2px 0 transparent; padding: 8px 12px; min-height: 47px; }
.asset-row:focus-visible { outline-offset: -3px; }
.asset-row[aria-current=true] { background: var(--selected); box-shadow: inset 2px 0 var(--accent); }
.asset-label { display: grid; gap: 2px; min-width: 0; flex: 1; }
.asset-label strong { font-size: .9rem; letter-spacing: .025em; }
.asset-label small, .market { color: var(--muted); font-size: .78rem; }
.asset-label small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.market { text-transform: uppercase; }
.empty { padding: 12px 16px; color: var(--muted); }
dialog { width: min(510px, calc(100% - 24px)); padding: 0; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 7px; }
dialog::backdrop { background: #080b0ccc; }
dialog input { display: block; width: calc(100% - 28px); margin: 0 14px 9px; padding: 11px; border: 1px solid var(--line); border-radius: 5px; background: var(--page); color: var(--text); }
#search-filters { padding: 0 12px 8px; border-bottom: 1px solid var(--line); }
#results { max-height: min(55vh, 440px); overflow: auto; }
.chart-panel:fullscreen { display: flex; flex-direction: column; }
.chart-panel:fullscreen #chart { flex: 1; height: auto; min-height: 0; }
@media (max-width: 720px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { border-left: 0; border-top: 1px solid var(--line); }
  .zone { display: none; }
  .top { justify-content: space-between; gap: 10px; }
  .search { min-width: 0; }
  .search kbd { display: none; }
  #chart { height: clamp(390px, 62dvh, 620px); }
  #watchlist { max-height: none; }
}
@media (max-width: 400px) {
  .toolbar { flex-wrap: wrap; }
  .instrument, .toolbar { padding-inline: 8px; }
  .segments button { padding-inline: 7px; }
}
