:root {
  color-scheme: dark;
  --bg: #111111;
  --surface: #1e1e1e;
  --control: #282828;
  --hover: #3a3a3a;
  --ink: #dddddd;
  --muted: #929292;
  --faint: #808080;
  --line: #333333;
  --blue: #82caff;
  --tint: #263b4c;
  --selected-border: #447494;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 14px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); }
main { width: 100%; margin: auto; padding: 16px 12px 24px; }
.top { display: flex; justify-content: flex-end; align-items: center; margin-bottom: 12px; }
h1 { font-size: 25px; font-weight: 650; letter-spacing: -.8px; margin: 0 0 5px; }
.connection { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.connection #clock { margin-left: 14px; color: var(--muted); }
.top-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 12px 20px; }
.settings-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--control); color: var(--muted); font-size: 12px; }
.settings-button svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.settings-button:hover, .settings-close:hover { background: var(--hover); color: var(--ink); }
html { scrollbar-gutter: stable; }
html:has(body.chart-open) { scrollbar-gutter: auto; }
body.settings-open, body.chart-open { overflow: hidden; }
.settings-dialog { width: min(600px, calc(100% - 32px)); max-width: none; max-height: calc(100dvh - 32px); margin: auto; padding: 0; border: 1px solid var(--line); border-top: 3px solid var(--blue); border-radius: 10px; background: var(--surface); color: var(--ink); box-shadow: 0 24px 80px #080d1680; overflow: auto; overscroll-behavior: contain; }
.settings-dialog::backdrop { background: #080d16b3; }
.settings-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.settings-heading h2 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: 0; }
.settings-heading p, .settings-hint { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.settings-close { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 6px; background: var(--control); color: var(--muted); font-size: 23px; line-height: 1; }
.settings-section { padding: 20px; }
.settings-section h3 { margin: 0; font-size: 14px; font-weight: 600; }
.exchange-settings { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.exchange-fields { display: grid; gap: 12px; margin-top: 16px; }
#telegram-chat-form { display:grid; grid-template-columns:1fr auto; gap:8px; margin-top:16px; align-items:center; }
#telegram-chat-form > label { grid-column:1 / -1; color:var(--muted); font-size:12px; }
#telegram-chat-id { min-width:0; min-height:38px; padding:8px 10px; border:1px solid var(--line); border-radius:6px; background:var(--control); color:var(--ink); font:inherit; }
#telegram-chat-save { min-height:38px; padding:8px 12px; border:1px solid var(--line); border-radius:6px; background:var(--control); color:var(--ink); cursor:pointer; }
#telegram-chat-save:disabled { opacity:.55; cursor:default; }
#telegram-chat-id:focus-visible,#telegram-chat-save:focus-visible { outline:2px solid var(--blue); outline-offset:2px; }
.exchange-fields > label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.exchange-fields input:not([type=checkbox]), .exchange-fields select { width: 100%; min-width: 0; min-height: 38px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--control); color: var(--ink); font: inherit; }
.exchange-fields input::placeholder { color: var(--faint); }
.exchange-fields > .exchange-proxy-toggle { display: flex; align-items: center; gap: 8px; }
.exchange-proxy-toggle input { accent-color: var(--blue); }
.exchange-fields input:disabled, .exchange-fields select:disabled, .exchange-actions button:disabled { opacity: .55; cursor: default; }
.exchange-fields input:focus-visible, .exchange-fields select:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.exchange-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 16px; }
.chart-trade-status { flex: 0 0 auto; padding: 4px 12px 7px; color: var(--muted); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.chart-trade-status.save-error, #exchange-status.save-error { color: var(--theme-warning, #e7bf79); }
.settings-dialog .value-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.settings-dialog .range { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); }
.settings-dialog .range input { width: 100%; }
.settings-dialog #reset-filters { margin-top: 10px; padding-left: 0; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.dot.live { background: #72c6ab; }
.mono, .numeric, .score-number { font-family: 'Cascadia Code', Consolas, monospace; font-variant-numeric: tabular-nums; }
.toolbar { display: flex; justify-content: flex-end; gap: 20px; align-items: center; margin-bottom: 12px; }
.toolbar-actions { display: flex; align-items: center; gap: 8px; }
.add-symbol { min-height: 36px; padding: 0 12px; border: 1px solid var(--selected-border); border-radius: 7px; background: var(--tint); color: var(--blue); font-size: 12px; white-space: nowrap; }
.symbol-picker { margin-top: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.picker-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.picker-heading label { font-size: 12px; font-weight: 600; }
#favorite-search { width: min(100%, 420px); padding: 10px 12px; border: 1px solid var(--selected-border); border-radius: 6px; background: var(--control); color: var(--ink); font-size: 12px; }
#favorite-search::placeholder { color: var(--faint); }
#picker-hint { margin: 8px 0 10px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.favorite-results { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,280px),1fr)); gap: 4px 12px; }
.favorite-results button { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; min-height: 44px; padding: 8px; border: 1px solid transparent; border-radius: 5px; background: var(--control); color: var(--ink); text-align: left; }
.favorite-results strong { font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.favorite-results span { color: var(--blue); font-size: 11px; text-align: right; }
.favorite-results button:disabled { opacity: .6; cursor: wait; }
.picker-empty { color: var(--muted); font-size: 12px; padding: 8px 0; }
#favorite-status { text-align: right; overflow-wrap: anywhere; }
#favorite-status.favorite-error { color: var(--theme-warning, #e7bf79); }
button, input { font: inherit; }
button { cursor: pointer; }
.search { position: relative; }
.search input { width: 244px; padding: 10px 14px 10px 33px; border: 1px solid var(--theme-line, #354255); border-radius: 7px; background: var(--control); color: var(--ink); font-size: 12px; }
.search input::placeholder, .range input::placeholder { color: var(--faint); }
.search-glyph { position: absolute; left: 12px; top: 6px; font-size: 23px; color: var(--muted); pointer-events: none; }
.sync-line { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 11px; color: var(--muted); gap: 12px; }
.sync-line:not(:has(#sync:not(:empty), #favorite-status:not(:empty))) { display: none; }
.save-error { color: var(--theme-warning, #e7bf79); }
.table-wrap { container-type: inline-size; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: auto; }
.table-wrap > table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 900px; font-size: 12px; white-space: nowrap; }
.table-wrap > table > thead { position: sticky; top: 0; z-index: 1; }
th { background: var(--control); height: 45px; text-align: left; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .2px; padding: 0 16px; }
#rows > tr > td { padding: 0 16px; height: 56px; border-bottom: 1px solid var(--line); }
th:first-child, #rows > tr > td:first-child { padding-left: 24px; }
th:last-child, #rows > tr > td:last-child { padding-right: 24px; }
th button { border: 0; background: none; color: inherit; padding: 12px 0; font-size: inherit; font-weight: inherit; text-align: inherit; white-space: nowrap; }
th[aria-sort=descending], th[aria-sort=ascending] { color: var(--blue); }
.sort { display: inline-block; min-width: 9px; margin-left: 4px; }
.numeric { text-align: right; }
.numeric button { width: 100%; text-align: right; }
#rows > tr:last-child > td { border-bottom: 0; }
.symbol { font-weight: 650; font-size: 13px; letter-spacing: .1px; }
.symbol-sub { display: block; font-size: 10px; font-weight: 400; color: var(--faint); margin-top: 5px; }
.strength-cell { min-width: 190px; }
.score-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 7px; }
.score-number { font-weight: 600; color: var(--blue); font-size: 12px; }
.trend { font-size: 10px; color: var(--muted); }
.trend.rising, .delta.plus { color: var(--blue); }
.meter { width: 144px; height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.meter-fill { height: 100%; transform-origin: left; background: #7199dc; border-radius: 2px; transition: transform .2s ease-out; }
.delta.minus, .secondary { color: var(--muted); }
.stale td { color: var(--faint); }
.spark { width: 106px; height: 30px; display: block; color: #8193ac; }
.spark.rising { color: #7fa4e5; }
.chart-head { text-align: left; }
#rows > tr > td.empty { text-align: center; color: var(--muted); height: 250px; font-family: 'Segoe UI', sans-serif; }
.error, .chart-feedback { padding: 10px 14px; font-size: 12px; background: var(--theme-yellow-bg, #2b241b); color: var(--theme-warning, #e7bf79); border: 1px solid var(--theme-warning-line, #5b4930); border-radius: 7px; margin-bottom: 10px; overflow-wrap: anywhere; }
button:active { transform: translateY(1px); }
button:focus-visible, input:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.loading-bar { display: inline-block; background: var(--hover); border-radius: 4px; width: 75px; height: 11px; }
.updated-row { animation: flash .6s ease-out; }
@keyframes flash { from { background: var(--tint); } to { background: transparent; } }
.symbol-line { display: flex; align-items: center; gap: 8px; }
.copy-symbol, .zoom-symbol { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 5px; background: transparent; color: var(--faint); flex-shrink: 0; }
.copy-symbol svg, .zoom-symbol svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.zoom-symbol { color: var(--blue); }
.zoom-symbol:active, .chart-close:active { transform: scale(.97); }
.zoom-symbol:focus-visible, .chart-dialog button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.copy-symbol.copied { color: var(--theme-positive, #83d5b0); }
.favorite-symbol { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; border: 0; border-radius: 5px; background: transparent; color: var(--muted); }
.favorite-symbol svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; fill: none; }
.favorite-symbol[aria-pressed=true] { color: var(--blue); }
.favorite-symbol[aria-pressed=true] svg { fill: currentColor; }
.favorite-symbol:disabled { cursor: wait; opacity: .6; }
.favorite-row { background: var(--tint); }
.copy-symbol:disabled { cursor: wait; }
.value-filters { display: flex; align-items: flex-end; gap: 18px; margin-top: 20px; }
.value-filters fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.value-filters legend { font-size: 11px; color: var(--muted); font-weight: 550; margin-bottom: 7px; padding: 0; }
.range { display: flex; align-items: center; gap: 9px; }
.range > span { color: var(--faint); font-size: 11px; }
.range input { width: 132px; min-width: 0; padding: 9px 10px; border: 1px solid var(--theme-line, #354255); border-radius: 6px; background: var(--control); color: var(--ink); font-family: Consolas, monospace; font-size: 12px; }
.range input::placeholder { font-family: 'Segoe UI', sans-serif; }
.reset-filters { height: 34px; border: 0; background: transparent; color: var(--muted); font-size: 11px; padding: 0 6px; border-radius: 5px; }
.telegram-settings { border-top: 1px solid var(--line); }
.telegram-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 12px; }
.telegram-toggle, #telegram-timeframes label { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; cursor: pointer; font-size: 12px; }
.telegram-toggle { font-weight: 600; }
.telegram-settings input[type="checkbox"] { accent-color: var(--blue); width: 15px; height: 15px; margin: 0; cursor: inherit; }
#telegram-timeframes { display: flex; flex-wrap: wrap; gap: 3px 14px; border: 0; margin: 0; padding: 0; min-width: 0; width: 100%; }
#telegram-timeframes legend { padding: 0; margin-bottom: 4px; color: var(--muted); font-size: 11px; }
#telegram-timeframes label { color: var(--muted); }
#telegram-timeframes label:has(input:checked) { color: var(--ink); }
#telegram-status { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.telegram-hint { margin: 4px 0 0; color: var(--faint); font-size: 11px; line-height: 1.5; }
.telegram-paused #telegram-timeframes { opacity: .65; }
.telegram-issue #telegram-status { color: var(--theme-warning, #e7bf79); }
.telegram-settings[aria-busy=true] label { opacity: .6; cursor: wait; }
.telegram-settings label:has(input:disabled) { cursor: default; }
.height-badge { display: inline-block; min-width: 70px; text-align: right; padding: 6px 9px; border-radius: 5px; font-size: 11px; }
.height-badge.red { color: var(--theme-negative, #f09ca7); background: var(--theme-negative-bg, #39252c); }
.height-badge.yellow { color: var(--theme-yellow, #dfbe6c); background: var(--theme-yellow-bg, #352f20); }
.height-badge.green { color: var(--theme-positive, #83d5b0); background: var(--theme-positive-bg, #1e352e); }
.chart-dialog { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; border-color: var(--line); border-radius: 0; outline: none; background: var(--theme-chart-bg, #131923); color: var(--ink); overflow: hidden; overscroll-behavior: contain; }
.chart-dialog[open] { display: flex; }
.chart-dialog::backdrop { background: var(--bg); }
.chart-panel { display: flex; flex-direction: column; width: 100%; height: 100%; min-width: 0; min-height: 0; padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(0px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); white-space: normal; }
.chart-toolbar { display: flex; align-items: center; flex-shrink: 0; gap: 10px 16px; font-size: 11px; margin-bottom: 10px; }
.chart-toolbar strong { min-width: 0; overflow-wrap: anywhere; font-weight: 600; color: var(--ink); font-size: 12px; }
.symbol-combobox { position:relative; min-width:0; width:100%; }
.symbol-combobox .symbol-picker-input { box-sizing:border-box; min-width:0; width:100%; background:var(--theme-control, #2a2a2a); border:1px solid var(--theme-line, #555); color:var(--theme-ink, #eee); padding:10px; font:700 16px Consolas,"Courier New",monospace; text-transform:uppercase; border-radius:4px; }
.symbol-combobox .symbol-picker-input:focus { border-color:#3b82f6; outline:2px solid #3b82f6; outline-offset:1px; background:var(--theme-line, #333); }
.symbol-combobox .symbol-picker-input:disabled { opacity:.4; }
.symbol-picker-list { position:absolute; top:100%; left:0; right:0; background:var(--theme-surface, #252525); color:var(--theme-ink, #ddd); border:1px solid var(--theme-line, #444); border-radius:4px; max-height:250px; overflow-y:auto; overscroll-behavior:contain; z-index:20; margin:5px 0 0; padding:0; list-style:none; box-shadow:0 4px 12px #08080880; font:13px Consolas,"Courier New",monospace; }
.symbol-picker-list li { padding:8px 12px; cursor:pointer; border-bottom:1px solid var(--theme-line, #333); }
.symbol-picker-list li.active { background:#3b82f6; color:#f7f7f7; }
.symbol-picker-list .no-results { color:var(--theme-muted, #aaa); cursor:default; }
.symbol-picker-list[hidden] { display:none; }
.chart-symbol-picker { width:200px; max-width:calc(100% - 110px); flex-shrink:1; }
.chart-symbol-picker .symbol-picker-input { min-height:36px; padding:7px 10px; font-size:14px; }
:is(.chart-trade-button,.chart-manual-close-button) { display:grid; place-items:center; flex-shrink:0; width:36px; height:36px; padding:0; border:1px solid var(--theme-line, #344156); border-radius:5px; background:var(--control); color:var(--ink); cursor:pointer; }
:is(.chart-trade-button,.chart-manual-close-button):hover { background:var(--hover); }
.chart-controls { margin-left: auto; display: flex; flex-shrink: 0; gap: 6px; }
.chart-controls button, .chart-options button { background: var(--control); color: var(--theme-muted, #afbdd0); border: 1px solid var(--theme-line, #344156); border-radius: 5px; min-height: 30px; padding: 0 10px; font-size: 11px; }
.chart-controls button { height: 30px; min-width: 28px; }
.chart-controls .chart-close { width: 36px; height: 36px; padding: 0; font-size: 24px; line-height: 1; }
.chart-options { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.chart-timeframes, .chart-indicator-controls { display: flex; gap: 4px; flex-wrap: wrap; }
.chart-options button[aria-pressed=true] { background: var(--theme-tint, #2c4366); color: var(--theme-ink, #edf3fc); border-color: #6284b5; }
.price-chart { position: relative; flex: 1; height: 0; width: 100%; min-width: 0; min-height: 0; border: 1px solid var(--line); background: var(--theme-chart-bg, #131923); }
.chart-workspace { position:relative; display:flex; flex:1; min-width:0; min-height:0; overflow:hidden; }
.chart-workspace > .chart-trade-status { position:absolute; z-index:3; bottom:8px; left:8px; right:8px; max-height:calc(100% - 16px); overflow:auto; padding:6px 10px; border:1px solid var(--line); border-radius:5px; background:var(--control); }
.chart-workspace .price-chart { height:100%; width:0; }
/* Keep the library's pane resize handles below sibling chart editors. */
.price-chart > .tv-lightweight-charts { isolation:isolate; }
.chart-grid { display:grid; flex:1; min-width:0; min-height:0; grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr); gap:6px; }
.chart-grid[data-count="2"], .chart-grid[data-count="4"] { grid-template-columns:repeat(2,minmax(0,1fr)); }
.chart-grid[data-count="4"] { grid-template-rows:repeat(2,minmax(0,1fr)); }
.chart-tile { position:relative; display:flex; flex-direction:column; min-width:0; min-height:0; overflow:hidden; }
.chart-tile .chart-feedback { position:absolute; z-index:2; top:28px; left:8px; right:8px; margin:0; max-height:calc(100% - 36px); overflow:auto; }
.chart-grid[data-count="1"] .chart-feedback { top:8px; }
.chart-workspace .chart-tile .price-chart { width:100%; height:0; }
.chart-tile-label { flex:none; padding:4px 6px; color:var(--muted); font:600 11px/1.4 Consolas,monospace; }
.chart-grid[data-count="1"] .chart-tile-label { display:none; }
.chart-layouts { display:flex; gap:3px; }
.chart-options .chart-layouts button { min-width:30px; font-variant-numeric:tabular-nums; }
.chart-layouts button:disabled { opacity:.35; cursor:not-allowed; }
.chart-layouts button:hover:not(:disabled) { border-color:var(--blue); }
.chart-mobile .chart-layouts button { flex:1; min-width:44px; min-height:44px; }
.chart-watchlist { display:flex; flex-direction:column; flex:none; min-width:0; background:var(--surface); color:var(--ink); font:12px/1.4 Consolas,"Courier New",monospace; overflow:hidden; }
.watchlist-heading { display:flex; justify-content:space-between; align-items:center; padding:6px 10px; border-bottom:1px solid var(--line); }
.watchlist-heading strong { font-size:13px; }
.watchlist-heading { gap:6px; }
.chart-dialog .watchlist-source { flex:1; min-width:0; width:0; min-height:28px; padding:3px 5px; font:inherit; font-size:12px; color:var(--ink); background:var(--control); border:1px solid var(--line); border-radius:4px; }
.watchlist-source:focus-visible { outline:2px solid var(--blue); outline-offset:1px; }
.chart-dialog .watchlist-heading button { width:28px; min-height:28px; padding:0; font-size:22px; background:var(--control); color:var(--muted); border:1px solid var(--theme-line, #444); border-radius:4px; }
.watchlist-scroll { flex:1; min-height:0; overflow:auto; }
.chart-watchlist table { width:100%; border-collapse:collapse; white-space:nowrap; font-variant-numeric:tabular-nums; }
.chart-watchlist th { position:sticky; top:0; background:var(--surface); color:var(--muted); font-size:10px; font-weight:400; padding:9px 7px; text-align:right; border-bottom:1px solid var(--line); }
.chart-watchlist th:first-child,.chart-watchlist td:first-child { text-align:left; }
.chart-watchlist td { padding:0 7px; height:32px; text-align:right; border-bottom:1px solid var(--line); }
.chart-watchlist button { font:inherit; }
.chart-dialog .chart-watchlist td button { display:block; width:100%; min-height:32px; padding:7px 0; text-align:left; background:transparent; border:0; color:var(--blue); cursor:pointer; }
.chart-watchlist tr.selected { background:var(--theme-positive-bg, #24584e); }
.chart-watchlist tbody tr:hover { background:var(--hover); }
.chart-watchlist .watchlist-volatility { color:var(--ink); }
.chart-watchlist [data-tone],.chart-watchlist .watchlist-volatility { background-color:var(--surface); }
.chart-watchlist [data-tone=low] { color:#d9a39e; }
.chart-watchlist [data-tone=high] { color:#a3c9b0; }
.chart-watchlist .stale { color:var(--muted); }
.chart-watchlist .positive { color:var(--theme-positive, #00cf85); }
.chart-watchlist .negative { color:var(--theme-negative, #ff365c); }
.chart-watchlist .watchlist-side { display:block; font-size:10px; line-height:1.2; }
.watchlist-status { margin:0; padding:10px; color:var(--muted); font-size:11px; }
.watchlist-resize { flex:none; width:6px; background:var(--theme-line, #333d4b); cursor:col-resize; touch-action:none; }
.watchlist-resize:hover,.watchlist-resize:focus-visible { background:#65758a; outline:0; }
.chart-controls .chart-watchlist-toggle { display:inline-flex; align-items:center; justify-content:center; width:36px; height:36px; padding:0; }
.chart-watchlist-toggle[aria-expanded=true] { color:var(--blue); border-color:var(--selected-border); }
.chart-funding { position:absolute; inset:0; z-index:5; pointer-events:none; overflow:hidden; font:11px/1.4 Consolas,"Courier New",monospace; }
.chart-funding-line { position:absolute; top:0; width:0; border-left:1px dashed currentColor; opacity:.7; }
.chart-funding-label { position:absolute; top:6px; max-width:calc(100% - 12px); padding:4px 6px; border:1px solid currentColor; border-radius:3px; background:var(--theme-control, #202733); white-space:nowrap; font-variant-numeric:tabular-nums; }
.chart-funding[data-tone=income] .chart-funding-label { background:var(--theme-positive-bg, #20332c); }
.chart-funding[data-tone=payment] .chart-funding-label { background:var(--theme-negative-bg, #38272e); }
.chart-information .blue { color:var(--blue); }
@media(max-width:600px) {
  .chart-watchlist { position:absolute; right:0; top:0; bottom:0; max-width:calc(100% - 24px); z-index:8; border:1px solid var(--theme-line, #444); box-shadow:-8px 0 20px #1118; }
  .watchlist-resize { display:none; }
}
.chart-trade-actions { position:absolute; inset:0; pointer-events:none; z-index:6; overflow:hidden; }
.chart-ob-label { position:absolute; top:6px; left:8px; z-index:2; max-width:calc(100% - 100px); padding:2px 4px; background:var(--control); color:var(--muted); font:10px/1.4 'Segoe UI',sans-serif; pointer-events:none; }
.chart-take-edit,.chart-takes-toggle { display:none; position:absolute; z-index:7; padding:4px 8px; border:1px solid var(--line); border-radius:4px; background:var(--control); color:var(--ink); font:12px/1.4 'Segoe UI',sans-serif; cursor:pointer; }
.chart-mobile :is(.chart-take-edit,.chart-takes-toggle) { display:block; min-height:44px; min-width:56px; }
.chart-mobile .chart-take-edit { box-sizing:border-box; display:flex; align-items:center; justify-content:center; gap:3px; width:40px; height:24px; min-width:40px; min-height:24px; padding:0; font-size:10px; touch-action:manipulation; }
.chart-mobile .chart-take-edit svg { width:12px; height:12px; }
.chart-mobile .chart-take-edit::before { content:''; position:absolute; inset:-10px -2px; }
.chart-mobile .chart-takes-toggle { min-width:44px; min-height:28px; padding:3px 6px; font-size:11px; touch-action:manipulation; }
.chart-mobile .chart-takes-toggle::before { content:''; position:absolute; inset:-8px 0; }
.chart-takes-toggle { top:28px; }
.chart-hedge-editor { right:auto; width:min(320px,calc(100% - 16px)); box-sizing:border-box; }
.chart-hedge-presets { display:flex; gap:4px; }
.chart-hedge-presets button[aria-pressed=true] { border-color:var(--blue); color:var(--blue); }
.chart-hedge-editor .chart-hedge-outcome { color:var(--ink); }
.hedge-picking { cursor:crosshair; }
:is(.chart-take-edit,.chart-takes-toggle):disabled { opacity:.45; cursor:default; }
:is(.chart-take-edit,.chart-takes-toggle):hover { background:var(--hover); }
.chart-take-editor { position:absolute; z-index:9; left:8px; right:8px; bottom:8px; display:grid; gap:10px; max-height:calc(100% - 16px); overflow:auto; padding:14px; border:1px solid var(--line); border-radius:8px; background:var(--control); color:var(--ink); font:14px/1.4 'Segoe UI',sans-serif; box-shadow:0 6px 24px #10182040; }
.chart-take-editor-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.chart-take-editor label { display:grid; gap:4px; }
.chart-take-editor :is(input,select,button) { box-sizing:border-box; min-width:0; width:100%; min-height:44px; font:16px/1.4 'Segoe UI',sans-serif; color:var(--ink); background:var(--control); border:1px solid var(--line); border-radius:4px; padding:8px; }
.chart-take-editor-heading button { width:44px; padding:0; font-size:24px; }
.chart-take-editor button[type=submit] { color:var(--blue); border-color:var(--blue); cursor:pointer; }
.chart-take-editor button:disabled { opacity:.45; cursor:default; }
.chart-take-editor p { margin:0; font-size:12px; color:var(--muted); overflow-wrap:anywhere; }
.chart-take-editor p.save-error { color:var(--theme-warning, #e7bf79); }
:is(.chart-take-editor input,.chart-take-editor select,.chart-take-editor button,.chart-take-edit,.chart-takes-toggle):focus-visible { outline:2px solid var(--blue); outline-offset:2px; }
:is(.chart-take-editor,.chart-take-edit,.chart-takes-toggle,.chart-ob-label)[hidden] { display:none; }
@media (max-height:500px) and (orientation:landscape) { .chart-take-editor { left:auto; width:min(320px,calc(100% - 16px)); gap:5px; padding:8px; } }
.chart-position-badge { position:absolute; display:flex; align-items:center; gap:4px; border:1px solid currentColor; border-radius:4px; pointer-events:auto; }
.chart-position-badge[hidden] { display:none; }
.chart-position-label { min-width:0; padding:4px 7px; border:0; background:transparent; color:inherit; font:11px/1.4 'Segoe UI',sans-serif; text-align:left; overflow-wrap:anywhere; cursor:pointer; }
.chart-position-label:hover { background:var(--hover); }
.chart-position-label:focus-visible { outline:2px solid var(--blue); outline-offset:-2px; }
.chart-position-badge .chart-trade-action { position:relative; flex-shrink:0; margin-right:5px; }
.chart-mobile .chart-position-badge .chart-trade-action { width:32px; height:32px; margin-right:4px; }
.chart-mobile .chart-position-label { position:relative; min-height:28px; }
.chart-mobile .chart-position-label::before { content:''; position:absolute; inset:-8px 0; }
.chart-mobile .chart-position-badge.is-expanded .chart-position-label { min-height:44px; }
.chart-mobile .chart-position-badge.is-expanded { z-index:1; }
.position-take { display:inline-flex; align-items:center; justify-content:flex-end; gap:6px; white-space:nowrap; }
.position-take-lock { display:inline-grid; place-items:center; width:28px; min-height:28px; padding:5px; border:1px solid var(--line); border-radius:6px; background:var(--control); color:var(--muted); transition:background-color 160ms ease-out,color 160ms ease-out,border-color 160ms ease-out; }
.position-take-lock svg { width:15px; height:15px; }
.position-take-lock:hover { color:var(--ink); border-color:var(--muted); background:var(--hover); }
.position-take-lock.is-locked { color:oklch(82% .12 85); background:oklch(27% .025 85); border-color:oklch(46% .055 85); }
.position-take-lock.is-locked:hover { background:oklch(33% .035 85); border-color:oklch(65% .085 85); }
.position-take-lock:focus-visible { outline:2px solid var(--blue); outline-offset:2px; }
.position-take-lock:active:not(:disabled) { background:var(--hover); }
.position-take-lock:disabled { opacity:.45; cursor:default; }
.take-drag-ready,.take-dragging { cursor:ns-resize !important; }
.take-dragging { user-select:none; }
@media(pointer:coarse) { .position-take-lock { width:44px; min-height:44px; } }
@media(prefers-reduced-motion:reduce) { .position-take-lock { transition:none; } }
.chart-trade-action { position:absolute; width:16px; height:16px; padding:0; display:grid; place-items:center; border:1px solid currentColor; border-radius:3px; font:13px/1 'Segoe UI',sans-serif; pointer-events:auto; cursor:pointer; }
.chart-trade-action:hover { filter:brightness(1.3); }
.chart-trade-action svg { display:block; width:14px; height:14px; fill:none; stroke:currentColor; stroke-width:1.4; stroke-linecap:round; }
.theme-segmented { display:flex; gap:2px; padding:3px; border:1px solid var(--theme-line); border-radius:6px; background:var(--control); }
.settings-dialog .theme-segmented button { border:0; border-radius:3px; padding:7px 10px; color:var(--muted); background:transparent; cursor:pointer; }
.settings-dialog .theme-segmented button[aria-pressed=true] { color:var(--ink); background:var(--theme-panel, var(--bg)); box-shadow:0 1px 3px #10182022; }
.chart-trade-action:focus-visible { outline:2px solid var(--blue); outline-offset:2px; }
.chart-trade-action:disabled { opacity:.45; cursor:default; }
.chart-dialog .chart-trade-action { min-height:16px; }
.chart-trade-action::before { content:''; position:absolute; inset:-4px; }
@media(pointer:coarse) { .chart-trade-action::before { inset:-8px; } }
.trade-dialog { position:fixed; inset:0 auto auto 0; width:min(340px,calc(100vw - 16px)); max-width:none; max-height:calc(100dvh - 16px); margin:auto; padding:0; border:1px solid var(--line); border-top:3px solid var(--blue); border-radius:10px; background:var(--surface); color:var(--ink); box-shadow:0 16px 64px #080c1480; font:12px/1.4 Consolas,"Courier New",monospace; overflow:auto; overscroll-behavior:contain; }
.trade-dialog[open]:not([style*="left"]) { inset:0; }
.trade-dialog::backdrop { background:#080c1426; }
.chart-floating-window { position:fixed; }
.settings-dialog.chart-floating-window { inset:110px 16px auto auto; margin:0; }
.trade-dialog button,.trade-dialog input { font:inherit; }
.trade-dialog button { border:1px solid var(--theme-line, #41464e); border-radius:4px; color:inherit; background:var(--control); cursor:pointer; }
.trade-dialog button:hover:not(:disabled) { background:var(--hover); }
.trade-dialog button:disabled { opacity:.4; cursor:default; }
.trade-dialog button:focus-visible,.trade-dialog input:focus-visible { outline:2px solid var(--theme-blue, #82caff); outline-offset:2px; }
.ticket-heading { display:flex; align-items:center; gap:8px; padding:8px 12px; border-bottom:1px solid var(--theme-line, #343941); cursor:grab; touch-action:none; user-select:none; }
.ticket-heading h2 { margin:0; font-size:14px; font-weight:700; }
.ticket-heading button { display:grid; place-items:center; width:28px; height:28px; padding:0; background:transparent; }
.ticket-heading [data-leverage] { margin-left:auto; color:var(--theme-muted, #a6afbd); font-size:11px; }
.ticket-heading [data-close] { border:0; font-size:22px; }
.ticket-dragging,.ticket-dragging .ticket-heading { cursor:grabbing; }
.ticket-body { padding:10px 12px 12px; }
.ticket-segmented { display:flex; gap:2px; padding:2px; border:1px solid var(--theme-line, #41464e); border-radius:4px; margin-bottom:8px; }
.ticket-segmented button { flex:1; padding:4px; border:0; background:transparent; color:var(--theme-muted, #a6afbd); }
.ticket-segmented button.active { background:var(--theme-tint, #3b4e61); color:var(--theme-ink, #edf2f8); font-weight:700; }
.ticket-field { display:flex; flex-direction:column; gap:4px; color:var(--theme-muted, #a6afbd); font-size:11px; }
.ticket-field input { width:100%; min-width:0; box-sizing:border-box; padding:6px 8px; border:1px solid var(--theme-line, #41464e); border-radius:4px; background:var(--theme-control, #282b30); color:var(--theme-ink, #edf2f8); }
.ticket-presets { display:flex; gap:4px; margin:6px 0 8px; }
.ticket-presets button { flex:1; min-width:0; padding:3px 0; font-size:11px; }
.ticket-presets button.active { color:var(--theme-ink, #f3f6fc); background:#3478ed; border-color:#3478ed; }
.ticket-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; margin-top:8px; }
.ticket-calculation { display:flex; justify-content:space-between; margin:8px 0; color:var(--theme-muted, #a6afbd); font-size:11px; }
.ticket-actions { display:flex; gap:6px; }
.ticket-actions button { flex:1; padding:9px 6px; border:0; font:700 13px Arial,sans-serif; color:var(--theme-ink, #f3f6fc); }
.ticket-actions [data-side=LONG] { background:#0cbf7a; }
.ticket-actions [data-side=SHORT] { background:#f33d65; }
.ticket-actions [data-side=LONG]:hover:not(:disabled) { background:#0aaa6c; }
.ticket-actions [data-side=SHORT]:hover:not(:disabled) { background:#d93259; }
.ticket-cancel { width:100%; padding:5px; margin-top:6px; color:var(--theme-muted, #a6afbd) !important; background:transparent !important; font-size:11px !important; }
.ticket-hedge { margin-top:10px; padding-top:8px; border-top:1px solid var(--theme-line, #343941); }
.ticket-hedge .ticket-actions { margin-top:8px; }
.ticket-virtual-hedge { width:100%; margin-top:8px; min-height:32px; }
.ticket-entry-field { margin-bottom:8px; }
.ticket-sizing { display:flex; align-items:center; gap:6px; }
.ticket-sizing input { width:64px; flex:0 0 64px; }
.ticket-sizing .ticket-presets { flex:1; min-width:0; margin:0; }
.ticket-sizing .ticket-presets button { min-height:30px; }
.ticket-actions [data-add-side=LONG] { background:#0b9e63; }
.ticket-actions [data-add-side=SHORT] { background:#c93042; }
.ticket-actions [data-add-side=LONG]:hover:not(:disabled) { background:#0cb674; }
.ticket-actions [data-add-side=SHORT]:hover:not(:disabled) { background:#e43b52; }
.ticket-actions [data-hedge] { background:#654b7f; font-size:11px; }
.ticket-actions [data-equalize] { background:#42758f; font-size:11px; }
.ticket-actions [data-hedge]:hover:not(:disabled) { background:#765b91; }
.ticket-actions [data-equalize]:hover:not(:disabled) { background:#5085a0; }
.ticket-notice { margin:6px 0 0; color:var(--theme-muted, #a6afbd); font-size:11px; overflow-wrap:anywhere; }
.ticket-error { color:#f58b93; }
.ticket-retry { margin-top:8px; padding:5px 8px; }
.trade-dialog [hidden] { display:none !important; }
@media(pointer:coarse) { .trade-dialog button { min-height:36px; }.ticket-actions button { min-height:44px; } }
.alert-lines { position: absolute; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
.alert-line-badge { position: absolute; top: 0; left: 8px; display: flex; border: 1px solid var(--theme-warning-line, #766447); border-radius: 4px; background: var(--surface); pointer-events: auto; }
.alert-line-badge button { border: 0; background: transparent; color: var(--theme-warning, #d8b47a); font: inherit; font-size: 11px; min-height: 26px; padding: 2px 8px; }
.alert-line-badge button:hover, .alert-remove:hover { background: var(--hover); }
.alert-drag-ready .alert-line-badge button:first-child { cursor: ns-resize; }
.alert-dragging, .alert-dragging .alert-line-badge button:first-child { cursor: grabbing; user-select: none; }
.alert-chart-notice { position: absolute; top: 8px; left: 8px; max-width: calc(100% - 100px); padding: 8px 10px; border: 1px solid var(--theme-warning-line, #766447); border-radius: 4px; background: var(--surface); color: var(--theme-warning, #d8b47a); font-size: 12px; white-space: normal; }
.alert-line-badge .alert-remove { border-left: 1px solid var(--theme-warning-line, #766447); font-size: 18px; padding: 0 7px; }
.alert-line-icon { display:none; }
.chart-mobile .alert-line-text,.chart-mobile .alert-line-badge .alert-remove { display:none; }
.chart-mobile .alert-line-icon { display:block; }
.chart-mobile .alert-line-badge button { position:relative; display:grid; place-items:center; min-width:28px; min-height:28px; padding:0; }
.chart-mobile .alert-line-badge button::before { content:''; position:absolute; inset:-8px; }
.alert-dialog { width: min(480px, calc(100% - 32px)); }
.channel-form { padding:20px; }
.channel-form .settings-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.channel-form h2 { margin:0; font-size:16px; }
.channel-dialog { border-top:1px solid var(--line); }
.alert-form { display: grid; gap: 16px; }
.alert-level-fields { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 16px; }
.alert-field { display: grid; gap: 8px; color: var(--muted); font-size: 12px; }
.alert-field input, .alert-field select { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--control); color: var(--ink); font: inherit; }
.alert-check { display: flex; align-items: center; gap: 9px; white-space: normal; font-size: 12px; }
.alert-check input { accent-color: var(--blue); }
.alert-form .settings-hint { margin: 0; white-space: normal; }
.alert-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
[data-alert-status] { margin: 0; color: var(--muted); font-size: 12px; white-space: normal; }
[data-alert-status]:empty { display: none; }
[data-alert-status].alert-error { color: var(--theme-warning, #e7bf79); }
.alert-existing { border-top: 1px solid var(--line); }
.alert-existing ul { padding: 0; margin: 12px 0 0; list-style: none; }
.alert-existing li { display: flex; gap: 6px; align-items: center; padding: 4px 0; }
.alert-list-edit { flex: 1; text-align: left; overflow-wrap: anywhere; }
.alert-list-edit, .alert-existing .alert-remove { border: 1px solid var(--line); border-radius: 5px; background: var(--control); color: var(--ink); min-height: 36px; padding: 6px 10px; font-size: 12px; }
.alert-existing .alert-remove { font-size: 20px; }
.alert-dialog button:disabled, .alert-dialog input:disabled, .alert-dialog select:disabled { opacity: .6; cursor: wait; }
@media (pointer: coarse) { .alert-line-badge button, .alert-existing button { min-height: 44px; min-width: 44px; } }
.price-ruler { position: absolute; top: 0; z-index: 5; overflow: hidden; cursor: crosshair; user-select: none; touch-action: none; --ruler-color: #81b2f3; --ruler-fill: #4585ff20; }
.price-ruler[hidden] { display: none; }
.price-ruler[data-direction=up] { --ruler-color: var(--theme-positive, #83d5b0); --ruler-fill: #08998126; }
.price-ruler[data-direction=down] { --ruler-color: var(--theme-negative, #f09ca7); --ruler-fill: #f2364526; }
.price-ruler-drawing { position: absolute; inset: 0; pointer-events: none; color: var(--ruler-color); }
.price-ruler-drawing[hidden] { display: none; }
.price-ruler-drawing rect { fill: var(--ruler-fill); stroke: currentColor; stroke-width: 1; }
.price-ruler-drawing path { fill: none; stroke: currentColor; stroke-width: 1; }
.price-ruler-drawing circle { fill: currentColor; }
.price-ruler-label { position: absolute; top: 0; left: 0; display: grid; gap: 3px; max-width: calc(100% - 12px); padding: 8px 11px; border: 1px solid var(--ruler-color); border-radius: 5px; background: var(--theme-control, #1c2635); color: var(--ruler-color); pointer-events: none; box-shadow: 0 3px 12px #090e1959; font-variant-numeric: tabular-nums; }
.price-ruler-label strong { font-size: 14px; font-weight: 600; line-height: 1.2; }
.price-ruler-label span { font-size: 11px; line-height: 1.3; color: var(--theme-muted, #c0ccdc); overflow-wrap: anywhere; }
.price-chart td { height: auto; border: 0; }
.price-chart .tv-lightweight-charts td[colspan="3"] { height: 4px; }
@media (hover: hover) and (pointer: fine) {
  #rows > tr:hover { background: var(--theme-control, #1b2533); }
  .copy-symbol:hover, .zoom-symbol:hover, .reset-filters:hover { background: var(--tint); color: var(--blue); }
  .favorite-symbol:hover:not(:disabled) { background: var(--hover); color: var(--blue); }
  .add-symbol:hover, .favorite-results button:hover:not(:disabled) { background: var(--hover); border-color: var(--selected-border); }
  .chart-controls button:hover, .chart-options button:hover { background: var(--theme-hover, #29374a); color: var(--theme-ink, #edf3fc); border-color: #6284b5; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 900px) {
  main { padding: 12px; }
  .connection #clock { display: none; }
  .search input { width: 190px; }
  .toolbar { flex-wrap: wrap; }
  .toolbar-actions { margin-left: auto; }
  th, #rows > tr > td { padding: 0 12px; }
  th:first-child, #rows > tr > td:first-child { padding-left: 16px; }
  .range input { width: 118px; }
  .value-filters { gap: 15px; }
}
@media (max-width: 540px) {
  main { padding: 12px 8px; }
  h1 { font-size: 22px; }
  .connection { font-size: 10px; }
  .top-actions { width: 100%; gap: 10px 12px; }
  .settings-dialog { width: calc(100% - 24px); max-height: calc(100dvh - 24px); }
  .settings-heading, .settings-section { padding: 20px; }
  .settings-dialog .value-filters { grid-template-columns: 1fr; gap: 16px; }
  .alert-level-fields { grid-template-columns: 1fr; }
  .toolbar { gap: 10px; align-items: stretch; flex-direction: column; }
  .toolbar-actions { margin-left: 0; }
  .toolbar-actions .search { flex: 1; min-width: 0; }
  .add-symbol { padding: 0 10px; }
  .symbol-picker { padding: 12px; }
  .favorite-results { grid-template-columns: 1fr; }
  .sync-line { flex-wrap: wrap; padding: 10px 0; gap: 6px; }
  #favorite-status { text-align: left; }
  .search input { width: 100%; }
  .sync-line { font-size: 10px; }
  .value-filters { display: grid; grid-template-columns: 1fr; gap: 12px; }
  .range input { width: 100%; }
  .range { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); }
  .reset-filters { justify-self: start; height: 26px; }
  .chart-panel { padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(0px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
  .chart-toolbar { gap: 8px; }
  .chart-symbol { min-height: 44px; }
  .chart-options { gap: 8px; }
  .chart-options button { padding: 0 8px; min-height: 34px; }
}
@media (pointer: coarse) {
  .favorite-symbol, .copy-symbol, .zoom-symbol, .chart-dialog button, .add-symbol, #close-picker, .settings-button, .settings-close, .settings-dialog .reset-filters, .settings-dialog .telegram-toggle, .settings-dialog #telegram-timeframes label { min-height: 44px; }
  .settings-close { min-width: 44px; }
  .favorite-symbol, .copy-symbol, .zoom-symbol, .chart-controls .chart-close { min-width: 44px; }
}

/* Shared terminal controls inside charts, including charts opened from the screener. */
.chart-controls button,.chart-options button,:is(.chart-trade-button,.chart-manual-close-button) { background:var(--theme-control, #292929); color:var(--theme-muted, #aaa); border-color:var(--theme-line, #444); border-radius:4px; font-family:Consolas,"Courier New",monospace; transition:background-color 150ms,color 150ms; }
.chart-controls button:hover:not(:disabled),.chart-options button:hover:not(:disabled),:is(.chart-trade-button,.chart-manual-close-button):hover:not(:disabled) { background:var(--theme-hover, #3a3a3a); color:var(--theme-ink, #eee); }
.chart-options button[aria-pressed=true] { background:var(--theme-tint, #3b4e61); border-color:#65788b; color:var(--theme-ink, #eee); }
.chart-controls button:focus-visible,.chart-options button:focus-visible,:is(.chart-trade-button,.chart-manual-close-button):focus-visible { outline:2px solid var(--theme-blue, #82caff); outline-offset:2px; }
.chart-controls button:disabled,.chart-options button:disabled,:is(.chart-trade-button,.chart-manual-close-button):disabled { opacity:.4; cursor:default; }
.ticket-actions [data-side=LONG] { background:linear-gradient(180deg,#0cbf7a,#0b9e63); }
.ticket-actions [data-side=SHORT] { background:linear-gradient(180deg,#f33d65,#c93042); }
.ticket-actions [data-side=LONG]:hover:not(:disabled) { background:linear-gradient(180deg,#16d88f,#0cb674); }
.ticket-actions [data-side=SHORT]:hover:not(:disabled) { background:linear-gradient(180deg,#ff5278,#e43b52); }
.ticket-actions button:active:not(:disabled) { transform:translateY(1px); }
@media(prefers-reduced-motion:reduce) { .chart-controls button,.chart-options button,:is(.chart-trade-button,.chart-manual-close-button),.ticket-actions button { transition:none; transform:none; } }

/* Shared terminal controls for settings, account forms and chart windows. */
.settings-dialog { font:13px/1.5 Consolas,"Courier New",monospace; }
.settings-dialog button { font-family:inherit; cursor:pointer; border-radius:4px; }
.settings-dialog input:not([type=checkbox]),.settings-dialog select { border-color:var(--theme-line, #444); border-radius:4px; }
.settings-dialog .settings-close,.settings-dialog .add-symbol,.settings-dialog .settings-button,.settings-dialog .reset-filters { background:var(--control); color:var(--ink); border:1px solid var(--theme-line, #444); padding:7px 10px; }
.settings-dialog button:hover:not(:disabled) { background:var(--hover); }
.alert-dialog [data-alert-save] { background:oklch(54% .16 250); color:oklch(98% .008 250); border:1px solid oklch(65% .15 250); min-height:40px; padding:9px 18px; font-weight:700; }
.alert-dialog [data-alert-save]:hover:not(:disabled) { background:oklch(52% .17 250); }
.alert-dialog [data-alert-save]:focus-visible { outline:2px solid var(--blue); outline-offset:3px; }
.alert-dialog [data-alert-save]:active:not(:disabled) { background:oklch(46% .16 250); }
.alert-dialog [data-alert-save]:disabled { opacity:.55; cursor:wait; }
.settings-dialog .settings-close { padding:0; }
.settings-dialog .settings-section + .settings-section { border-top:1px solid var(--line); }
.settings-dialog .exchange-settings { border-bottom:0; }
.settings-dialog .settings-section h3 { color:var(--blue); }
.settings-dialog #reset-filters { padding-left:10px; }
.alert-sound-settings { display:grid; grid-template-columns:1fr 1fr; align-items:center; gap:16px; padding-top:14px; border-top:1px solid var(--line); }
.alert-sound-stop { position:fixed; bottom:20px; right:20px; z-index:100; border:1px solid #a88c41; border-radius:6px; background:var(--surface); color:var(--theme-yellow, #ffcc00); padding:10px 16px; font:13px Consolas,"Courier New",monospace; cursor:pointer; box-shadow:0 8px 32px #1118; }
.chart-info-button { display:inline-flex; flex-shrink:0; align-items:center; justify-content:center; width:36px; height:36px; padding:0; background:var(--control); color:var(--theme-muted, #aaa); border:1px solid var(--theme-line, #444); border-radius:4px; cursor:pointer; }
.chart-info-button:hover { background:var(--hover); color:var(--ink); }
.chart-info-button svg { flex-shrink:0; }
.chart-info-button[aria-expanded=true] { color:var(--blue); border-color:var(--selected-border); }
.chart-information { position:absolute; width:min(300px,calc(100vw - 16px)); max-height:calc(100dvh - 16px); overflow:auto; background:var(--surface); color:var(--ink); border:1px solid var(--theme-line, #444); border-top:3px solid var(--blue); border-radius:10px; box-shadow:0 12px 40px #1118; font:12px/1.5 Consolas,"Courier New",monospace; }
.chart-information[data-window=balance] { border-top-color:#00a878; }
.chart-information[data-window=trades] { width:min(440px,calc(100vw - 16px)); }
.chart-trades-table { width:100%; border-collapse:collapse; font-variant-numeric:tabular-nums; }
.chart-trades-table caption { padding:10px 12px; text-align:left; color:var(--muted); }
.chart-trades-table th,.chart-trades-table td { padding:8px 12px; border-bottom:1px solid var(--line); text-align:right; white-space:nowrap; }
.chart-trades-table th { font-size:11px; font-weight:400; color:var(--muted); }
.chart-trades-table th:first-child,.chart-trades-table td:first-child { text-align:left; }
.chart-information[data-stale=true] tbody { opacity:.55; }
.information-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 12px; border-bottom:1px solid var(--line); cursor:grab; user-select:none; touch-action:none; }
.information-heading:active { cursor:grabbing; }
.information-heading h2 { margin:0; font-size:14px; }
.chart-dialog .information-heading button { width:28px; min-height:28px; padding:0; font-size:21px; }
.chart-information dl { display:grid; grid-template-columns:1fr auto; align-items:baseline; gap:10px 12px; padding:14px 12px; margin:0; }
.chart-information dt { color:var(--muted); }
.chart-information dd { margin:0; text-align:right; font-variant-numeric:tabular-nums; }
.chart-information .positive { color:var(--theme-positive, #00cf85); }.chart-information .negative { color:var(--theme-negative, #ff365c); }
.information-status { padding:0 12px 12px; margin:0; color:var(--theme-warning, #d8b47a); font-size:11px; }
.chart-information[data-stale=true] dd { opacity:.55; }
.information-heading:focus-visible,.alert-sound-stop:focus-visible { outline:2px solid var(--blue); outline-offset:2px; }
@media(max-width:480px) { .settings-heading,.settings-section { padding:16px; }.alert-level-fields { gap:12px; }.alert-sound-settings { grid-template-columns:1fr; gap:12px; } }
@media(pointer:coarse) { .chart-info-button { width:44px; }.chart-dialog .information-heading button { min-width:40px; min-height:40px; } }
.chart-account-selector { min-width:110px; max-width:200px; height:34px; padding:4px 8px; border:1px solid var(--line); border-radius:4px; color:var(--ink); background:var(--control); font:12px 'Segoe UI',sans-serif; }
.watchlist-wallet { display:block; color:var(--muted); font-size:10px; font-weight:400; white-space:normal; overflow-wrap:anywhere; }
.chart-dialog.chart-mobile .chart-toolbar { flex-wrap:wrap; }
.chart-dialog.chart-mobile .chart-account-selector { order:10; flex:1 0 100%; max-width:100%; min-height:36px; }
