/* Layout: terminalas — viršuje du grafikai, apačioje tikerių lentelė, dešinėje impulsų juosta */
:root {
  color-scheme: dark;
  --bg: #0e1117;
  --panel: #141922;
  --panel-2: #1a202b;
  --line: #232b38;
  --line-2: #324052;
  --fg: #d9dee8;
  --muted: #7d8799;
  --accent: #f0b429;
  --accent-text: #f0b429;
  --accent-ink: #1b1403;
  --grid: rgba(125,135,153,.07);
  --up: #22c07a;
  --down: #f2475b;
  --up-soft: rgba(34,192,122,.14);
  --down-soft: rgba(242,71,91,.14);
  --sel: rgba(240,180,41,.10);
  --ui: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
}
/* šviesi tema */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f6f9;
  --panel: #ffffff;
  --panel-2: #eceff4;
  --line: #dfe3ea;
  --line-2: #c6ccd8;
  --fg: #1d2433;
  --muted: #667085;
  --accent: #e2a012;
  --accent-text: #9a6500;
  --accent-ink: #1b1403;
  --up: #0f9d62;
  --down: #d92d46;
  --up-soft: rgba(15,157,98,.13);
  --down-soft: rgba(217,45,70,.12);
  --sel: rgba(226,160,18,.14);
  --grid: rgba(60,72,96,.09);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 13px/1.4 var(--ui); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.app { display: grid; grid-template-rows: auto 1fr; height: 100%; }

/* Header */
header {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--panel);
}
.brand { font-weight: 700; letter-spacing: .02em; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.brand b { background: var(--accent); color: var(--accent-ink); border-radius: 4px; padding: 1px 6px; font-size: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { background: transparent; border: 0; padding: 5px 12px; cursor: pointer; color: var(--muted); font-weight: 600; }
.seg button:hover:not(.on) { color: var(--fg); background: var(--panel-2); }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.field { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.field input {
  width: 76px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px;
  padding: 5px 7px; font-family: var(--mono); font-size: 12px;
}
.field input[type=search] { width: 150px; font-family: var(--ui); }
.field input:hover, .field select:hover, .preset select:hover { border-color: var(--line-2); }
.field select, .preset select {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px; padding: 5px 7px; font-size: 12px; color: var(--fg); cursor: pointer;
}
.field.grow { flex: 1 1 100px; max-width: 240px; order: 6; }
.field.grow input[type=search] { width: 100%; }
.filters { display: contents; }               /* kompiuteryje filtrai eina toje pačioje eilutėje */
.preset { display: inline-flex; align-items: center; gap: 4px; }
.preset select { max-width: 125px; }
.iconbtn {
  min-width: 28px; height: 28px; padding: 0 6px; display: inline-grid; place-items: center; cursor: pointer;
  background: none; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: 14px; line-height: 1;
}
.iconbtn:hover:not(:disabled) { color: var(--fg); border-color: var(--line-2); background: var(--panel-2); }
.iconbtn:disabled { opacity: .35; cursor: default; }
.iconbtn.txt { padding: 0 10px; font-size: 12px; font-weight: 600; }
#filtBtn { display: none; order: 7; }
#helpBtn, #themeBtn, .langseg { order: 9; }
.langseg button { padding: 3px 8px; font-size: 11px; }
.field input:focus { border-color: var(--accent); }
/* perjungikliai (switch) vietoj standartinių varnelių */
.field input[type=checkbox], .imp-set .field input[type=checkbox] {
  -webkit-appearance: none; appearance: none; flex: none;
  width: 30px; height: 18px; padding: 0; margin: 0; border-radius: 999px; cursor: pointer; position: relative;
  background: var(--panel-2); border: 1px solid var(--line-2); transition: background .15s, border-color .15s;
}
.field input[type=checkbox]::before {
  content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--muted); transition: transform .15s, background .15s;
}
.field input[type=checkbox]:checked { background: var(--accent); border-color: var(--accent); }
.field input[type=checkbox]:checked::before { transform: translateX(12px); background: var(--accent-ink); }
.field:has(input[type=checkbox]) { cursor: pointer; user-select: none; }
@media (prefers-reduced-motion: reduce) { .field input[type=checkbox], .field input[type=checkbox]::before { transition: none; } }
/* biržų seansai antraštės viduryje */
.sessions { order: 4; margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; font-size: 12px; }
.sess { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-2); white-space: nowrap; cursor: default; }
.sess b { font-weight: 600; }
.sess .cd { color: var(--muted); font-family: var(--mono); font-size: 11px; }
.sess.open { border-color: var(--up-soft); }
.sess.open .dot { background: var(--up); box-shadow: 0 0 0 3px var(--up-soft); }
.sess.soon .dot { background: var(--accent); box-shadow: 0 0 0 3px var(--sel); }
.status { order: 8; margin-left: 0; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot.live { background: var(--up); box-shadow: 0 0 0 3px var(--up-soft); }
.dot.rest { background: var(--accent); }
.dot.err { background: var(--down); }

/* Main grid */
main {
  display: grid; min-height: 0;
  grid-template-columns: minmax(0,1fr) 300px;
  grid-template-rows: minmax(280px, 46%) minmax(0,1fr);
  gap: 1px; background: var(--line);
}
.charts { grid-column: 1; grid-row: 1; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 1px; background: var(--line); min-height: 0; }
.chartbox { background: var(--bg); display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: 0; min-width: 0; overflow: hidden; }
.charts[data-n="3"] .vol24 { display: none; }       /* trijuose languose antraštei trūksta vietos */
.chart-head { display: flex; align-items: center; gap: 10px; padding: 5px 12px; border-bottom: 1px solid var(--line); }
.chart-head .sym { font-weight: 700; background: none; border: 0; padding: 0; cursor: copy; }
.chart-head .sym:hover { color: var(--accent-text); }
.chart-head .sym.copied { color: var(--up); }
.chart-head .ext { color: var(--muted); text-decoration: none; font-size: 12px; }
.chart-head .ext:hover { color: var(--accent-text); }
.chart-head select {
  font-family: var(--mono); font-size: 11px; color: var(--accent-text); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 4px; cursor: pointer;
}
.chart-head .meta .vol24 { margin-right: 12px; font-family: var(--ui); font-size: 11px; }
.chart-head .meta .vol24 b { font-family: var(--mono); font-weight: 500; color: var(--fg); }
.chart-head { min-width: 0; }
.chart-head .meta { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chart-head .pbtn { flex: none; min-width: 22px; height: 22px; padding: 0 4px; font-size: 14px; line-height: 1; border-radius: 5px; }
.chart-head .pbtn[hidden] { display: none; }
.chart-head .meta { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-left: auto; white-space: nowrap; }
/* langų dydžio slankikliai */
.charts, .chartbox, aside { position: relative; }
.split { position: absolute; z-index: 6; touch-action: none; outline: none; }
.split::after { content: ""; position: absolute; background: var(--accent); border-radius: 2px; opacity: 0; transition: opacity .12s; }
.split:hover::after, .split:focus-visible::after, .split.active::after { opacity: .75; }
.split-h { left: 0; right: 0; bottom: -4px; height: 9px; cursor: row-resize; }
.split-h::after { left: 0; right: 0; top: 3px; height: 3px; }
.split-v, .split-c { top: 0; bottom: 0; left: -4px; width: 9px; cursor: col-resize; }
.split-v::after, .split-c::after { top: 0; bottom: 0; left: 3px; width: 3px; }
body.resizing { user-select: none; }
body.resizing iframe, body.resizing canvas { pointer-events: none; }
@media (max-width: 900px) { .split { display: none; } }
.chart-body { display: grid; grid-template-columns: 34px minmax(0,1fr); grid-template-rows: minmax(0,1fr); min-height: 0; min-width: 0; }
.chart { min-height: 0; min-width: 0; position: relative; }
.chart canvas.draw, .ov-chart canvas.draw { position: absolute; left: 0; top: 0; z-index: 3; }
.tools { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-right: 1px solid var(--line); background: var(--panel); }
.tools button { width: 26px; height: 26px; display: grid; place-items: center; padding: 0; background: none; border: 0; border-radius: 5px; color: var(--muted); cursor: pointer; }
.tools button:hover { color: var(--fg); background: var(--panel-2); }
.tools button.on { color: var(--accent-ink); background: var(--accent); }
.tools svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.tools .sep { width: 18px; height: 1px; background: var(--line); margin: 4px 0; }
.chart .msg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; pointer-events: none; text-align: center; padding: 0 12px; }
.chart .msg .retry { pointer-events: auto; margin-top: 8px; padding: 5px 12px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--fg); cursor: pointer; }
.chart .msg .retry:hover { border-color: var(--accent); }

.tablebox { grid-column: 1; grid-row: 2; background: var(--bg); display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; min-height: 0; }
.tablescroll { overflow: auto; min-height: 0; }
/* filtrų juosta — tiesiai virš tikerių sąrašo */
.tablebar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 7px 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
.tablebar { gap: 8px 10px; }
.tablebar .seg button { padding: 5px 10px; }
.tablebar .field { gap: 4px; }
.tablebar .field input[type=number] { width: 56px; }
#fShow { width: 132px; }
.tablebar .field.grow input[type=search] { width: 100%; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
thead th {
  position: sticky; top: 0; z-index: 1; background: var(--panel);
  text-align: left; font-weight: 600; font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); padding: 8px 9px; border-bottom: 1px solid var(--line); white-space: nowrap; cursor: pointer; user-select: none;
}
thead th.num, td.num { text-align: right; }
thead th.sorted { color: var(--accent-text); }
/* stulpelių tempimas */
thead th:not(.fixed) { cursor: grab; }
thead th.col-drag { opacity: .35; }
thead th.drop-before { box-shadow: inset 3px 0 0 var(--accent); }
thead th.drop-after { box-shadow: inset -3px 0 0 var(--accent); }
body.col-dragging { user-select: none; cursor: grabbing; }
body.col-dragging thead th { cursor: grabbing; }
.col-ghost {
  position: fixed; z-index: 80; pointer-events: none; padding: 5px 10px; background: var(--panel-2);
  border: 1px solid var(--accent); border-radius: 6px; color: var(--accent-text); font-size: 11px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; box-shadow: 0 6px 20px rgba(0,0,0,.35);
}
.linkbtn { background: none; border: 0; padding: 0; margin-left: 10px; color: var(--accent-text); font-size: 11px; cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }
thead th .arr { font-size: 10px; margin-left: 3px; }
tbody td { padding: 7px 9px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody td.num { font-family: var(--mono); font-size: 12px; }
tbody tr { cursor: pointer; scroll-margin-top: 36px; scroll-margin-bottom: 32px; }
tbody tr:hover { background: var(--panel); }
tbody tr.sel { background: var(--sel); box-shadow: inset 2px 0 0 var(--accent); }
td.sym { font-weight: 600; }
.star { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 15px; line-height: 1; padding: 0 2px; }
.star.on { color: var(--accent-text); }
.up { color: var(--up); } .down { color: var(--down); }
.vol-hi { color: var(--accent-text); }
.dim { color: var(--muted); }
.tag { font-size: 9px; font-weight: 700; letter-spacing: .04em; padding: 1px 4px; border-radius: 3px; margin-left: 6px; vertical-align: 1px; }
.tag.new { background: var(--accent); color: var(--accent-ink); }
.tag.hi { background: var(--up-soft); color: var(--up); }
.tag.lo { background: var(--down-soft); color: var(--down); }
.rng { display: inline-block; position: relative; vertical-align: middle; width: 56px; height: 6px; border-radius: 3px; background: var(--panel-2); border: 1px solid var(--line-2); }
.rng i { position: absolute; top: -4px; width: 3px; height: 12px; margin-left: -1.5px; border-radius: 2px; background: var(--fg); }
.rng.hi i { background: var(--up); }
.rng.lo i { background: var(--down); }
.foot { position: sticky; bottom: 0; background: var(--panel); color: var(--muted); font-size: 11px; padding: 6px 12px; border-top: 1px solid var(--line); }
.empty { padding: 28px 16px; color: var(--muted); text-align: center; }

/* Impulses */
aside { grid-column: 2; grid-row: 1 / span 2; background: var(--bg); display: grid; grid-template-rows: auto auto auto 1fr; min-height: 0; }
.aside-head .cnt { color: var(--fg); letter-spacing: 0; font-weight: 500; margin-left: 4px; }
.imp-filter { padding: 0 12px 8px; border-bottom: 1px solid var(--line); }
.aside-head { border-bottom: 0; padding-bottom: 6px; }
.imp-filter .seg { display: flex; }
.imp-filter .seg button { flex: 1; padding: 4px 6px; font-size: 12px; }
.aside-head { padding: 9px 12px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.aside-head h2 { margin: 0; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.aside-head button { background: none; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: 11px; padding: 2px 8px; cursor: pointer; }
.aside-head button:hover { color: var(--fg); border-color: var(--line-2); background: var(--panel-2); }
.imp-set { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.imp-set .field input { width: 100%; }
.imp-set .field { flex-direction: column; align-items: stretch; gap: 3px; }
.imp-set .field.row { flex-direction: row-reverse; justify-content: space-between; align-items: center; grid-column: span 2; gap: 12px; color: var(--fg); padding: 2px 0; }
.imp-list { overflow: auto; min-height: 0; }
.imp {
  display: grid; grid-template-columns: 46px 1fr auto 28px; gap: 8px; align-items: center;
  padding: 7px 12px; border-bottom: 1px solid var(--line); cursor: pointer; font-variant-numeric: tabular-nums;
}
.imp:hover { background: var(--panel); }
.imp .t { font-family: var(--mono); font-size: 11px; color: var(--muted); line-height: 1.15; }
.imp .t small { display: block; font-size: 9px; opacity: .8; }
.imp .s { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.imp .p { font-family: var(--mono); font-size: 12px; text-align: right; }
.imp .w { font-family: var(--mono); font-size: 11px; color: var(--muted); text-align: right; }
.imp.new { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: var(--sel); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .imp.new { animation: none; } }

/* vaizdai: apžvalga (9 grafikai) ir išsamus (main) */
.app[data-view="overview"] > main { display: none; }
.app[data-view="detail"] > .overview { display: none; }
.brand[role="link"] { cursor: pointer; }
.brand[role="link"]:hover span { color: var(--accent-text); }
.viewseg button { padding: 4px 12px; }

.overview { display: grid; grid-template-columns: minmax(0, 1fr) 400px; grid-template-rows: minmax(0, 1fr); gap: 1px; background: var(--line); min-height: 0; }
.ov-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; padding: 6px 12px; background: var(--panel); border-top: 1px solid var(--line); }
.ov-pager:empty { display: none; }
.ov-pager button { min-width: 30px; height: 28px; padding: 0 8px; background: none; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); cursor: pointer; font-variant-numeric: tabular-nums; }
.ov-pager button:hover:not(:disabled):not(.on) { color: var(--fg); background: var(--panel-2); border-color: var(--line-2); }
.ov-pager button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.ov-pager button:disabled { opacity: .35; cursor: default; }
.ov-pager .gap { color: var(--muted); padding: 0 2px; }
.ov-pager .range { margin-left: 12px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.ov-main { background: var(--bg); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-width: 0; min-height: 0; }
.ov-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 7px 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
.ov-bar .seg button { padding: 4px 10px; }
.ov-bar .field input[type=number] { width: 60px; }
.ov-grid .ov-empty { grid-column: 1 / -1; grid-row: 1 / -1; align-self: center; background: var(--bg); }
.ov-grid { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); grid-template-rows: repeat(var(--rows, 3), minmax(0, 1fr)); gap: 1px; background: var(--line); min-height: 0; }
.ov-cell { background: var(--bg); display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; min-height: 0; overflow: hidden; }
.ov-head { display: flex; align-items: center; gap: 8px; padding: 4px 10px; border-bottom: 1px solid var(--line); font-size: 12px; min-width: 0; }
.ov-sym { background: none; border: 0; padding: 0; font-weight: 700; color: var(--fg); cursor: pointer; }
.ov-sym:hover { color: var(--accent-text); text-decoration: underline; }
.ov-px { margin-left: auto; font-family: var(--mono); color: var(--muted); white-space: nowrap; }
.ov-chg { font-family: var(--mono); white-space: nowrap; }
.ov-fav { background: none; border: 0; padding: 0 2px; cursor: pointer; color: var(--muted); font-size: 14px; line-height: 1; }
.ov-fav.on { color: var(--accent-text); }
.ov-chart { position: relative; min-width: 0; min-height: 0; }
.ov-chart .msg { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; color: var(--muted); font-size: 12px; pointer-events: none; text-align: center; padding: 0 12px; }
.ov-chart .msg:empty { display: none; }
/* brėžimo įrankiai apžvalgos langelyje: horizontali juosta viršuje kairėje, rodoma užvedus pelę */
.ov-tools { position: absolute; left: 4px; top: 4px; z-index: 4; display: flex; flex-direction: row; align-items: center; gap: 1px; padding: 2px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--panel); box-shadow: 0 2px 8px rgba(0,0,0,.3); opacity: 0; pointer-events: none; transition: opacity .12s; }
.ov-cell:hover .ov-tools, .ov-tools:focus-within { opacity: 1; pointer-events: auto; }
.ov-tools button { width: 24px; height: 24px; }
.ov-tools .sep { width: 1px; height: 16px; margin: 0 3px; }
@media (hover: none) { .ov-tools { opacity: .85; pointer-events: auto; } }
.ov-chart .msg .retry { pointer-events: auto; margin-top: 8px; padding: 5px 12px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--fg); cursor: pointer; }
.ov-side { background: var(--bg); display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 3fr) minmax(0, 2fr); min-height: 0; min-width: 0; gap: 1px; background: var(--line); overflow: hidden; }
.ov-tickers { background: var(--bg); display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); min-height: 0; min-width: 0; }
.ov-imps { min-width: 0; }
.ov-imps { background: var(--bg); display: flex; flex-direction: column; min-height: 0; }
.ov-imps .imp-list { flex: 1; }
.ov-imps .imp-filter { padding-top: 0; }
.ov-imp-set { overflow: auto; max-height: 45%; flex: none; }
.ov-imp-set[hidden] { display: none; }
.head-btns { display: inline-flex; align-items: center; gap: 6px; }
#ovSound, #ovImpCfg { min-width: 28px; height: 24px; padding: 0 5px; border-radius: 4px; }
#ovSound svg, #ovImpCfg svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#ovImpCfg[aria-pressed="true"] { color: var(--accent-text); border-color: var(--accent); }
#ovSound .s-on, #ovSound.on .s-off { display: none; }
#ovSound.on .s-on { display: block; }
#ovSound.on { color: var(--accent-text); border-color: var(--accent); }
.ov-sidehead { padding: 8px 12px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; background: var(--panel); }
.ov-sidehead h2 { margin: 0; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.ov-sidehead input { flex: 1; min-width: 0; background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px; padding: 5px 7px; font-size: 12px; }
.ov-sidehead input:focus { border-color: var(--accent); }
.ov-list { overflow: auto; min-height: 0; }
.ov-listhead { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: 26px minmax(0, 1fr) 82px 84px; background: var(--panel); border-bottom: 1px solid var(--line); }
.ov-th { background: none; border: 0; padding: 7px 5px; font-size: 10px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); cursor: pointer; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: none; }
.ov-th:first-child { text-align: center; padding: 7px 0; font-size: 12px; letter-spacing: 0; }
.ov-th:nth-child(2) { text-align: left; padding-left: 2px; }
.ov-th:hover { color: var(--fg); }
.ov-th.sorted { color: var(--accent-text); }
.ov-th i { font-style: normal; font-size: 9px; margin-left: 3px; }
.ov-row .f { text-align: center; color: var(--muted); font-size: 14px; line-height: 1; cursor: pointer; padding: 4px 0; }
.ov-row .f:hover { color: var(--accent-text); }
.ov-row .f.on { color: var(--accent-text); }
.ov-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) 82px 84px; gap: 0; align-items: center; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 7px 0; cursor: pointer; font-variant-numeric: tabular-nums; }
.ov-row:hover { background: var(--panel); }
.ov-row.in { box-shadow: inset 2px 0 0 var(--accent); }
.ov-row .s { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.ov-row .v, .ov-row .c { font-family: var(--mono); font-size: 12px; text-align: right; padding-right: 8px; }
.ov-row .v { color: var(--muted); }
/* ---------- Tankiai: limitinių orderių sienos (ov-side skirtukas) ---------- */
.ov-tickers { position: relative; }
.ov-tabs button { padding: 4px 10px; font-size: 12px; }
.ov-sidehead .dens-ctl { display: none; margin-left: auto; align-items: center; gap: 6px; }
.dens-ctl .seg button { padding: 3px 9px; font-size: 12px; }
.dens-ctl .seg button.on { background: var(--accent); color: var(--accent-ink); }
.dens-ctl .iconbtn { min-width: 28px; height: 26px; padding: 0 5px; }
.dens-ctl .iconbtn svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.dens-ctl .iconbtn[aria-pressed="true"] { color: var(--accent-text); border-color: var(--accent); background: var(--panel-2); }
.ov-tickers[data-tab="dens"] .dens-ctl { display: inline-flex; }
.ov-tickers[data-tab="dens"] #ovSearch, .ov-tickers[data-tab="dens"] .ov-list { display: none; }
.ov-tickers[data-tab="list"] .dens { display: none; }
.dens { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 0; }
.dens-bar { grid-row: 1; display: flex; align-items: center; gap: 8px; padding: 5px 12px; border-bottom: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 11px; }
.dens-bar .seg button { padding: 2px 9px; font-size: 12px; }
.dens-links { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.dens-links text { font: 9px var(--mono); fill: var(--muted); }
.dens-map { grid-row: 2; grid-column: 1; position: relative; overflow: auto; min-height: 0; background: var(--bg); }
.dens-half { position: relative; }
.dens-half.ask { background: rgba(242,71,91,.06); }
.dens-half.bid { background: rgba(34,192,122,.05); }
.dens-grid { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--line); pointer-events: none; }
.dens-grid span { position: absolute; right: 4px; top: -7px; font-size: 10px; color: var(--muted); font-family: var(--mono); background: transparent; }
.dens-wrap { position: absolute; left: 0; right: 30px; top: 0; bottom: 0; }
.dens-lanes { display: flex; position: sticky; z-index: 2; top: 0; padding-right: 30px; background: var(--panel); border-block: 1px solid var(--line); }
.dens-lanes span { flex: 1; text-align: center; padding: 5px 0; font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.dw { position: absolute; height: 22px; display: flex; align-items: center; gap: 5px; padding: 0 6px 0 3px; min-width: 0; background: var(--panel-2); border: 1px solid var(--line-2); border-left-width: 3px; border-radius: 5px; color: var(--fg); font-size: 11px; font-weight: 600; cursor: pointer; white-space: nowrap; overflow: hidden; font-variant-numeric: tabular-nums; }
.dw.bid { border-left-color: var(--up); }
.dw.ask { border-left-color: var(--down); }
.dw:hover { border-color: var(--accent); background: var(--panel); z-index: 3; }
.dw b { overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.dw span { color: var(--fg); font-family: var(--mono); font-weight: 500; }
.dw small { color: var(--muted); font-size: 10px; margin-left: auto; }
.dw .mk, .dens-tip .mk { flex: none; width: 15px; height: 15px; border-radius: 4px; display: grid; place-items: center; font-style: normal; font-size: 9px; font-weight: 700; color: #fff; }
.dw .mk.F, .dens-tip .mk.F { background: #c26a12; }
.dw .mk.S, .dens-tip .mk.S { background: #2a6fd6; }
.dens-tip .dt-head { justify-content: flex-start; align-items: center; gap: 7px; padding: 0 0 6px; margin-bottom: 4px; border-bottom: 1px solid var(--line); font-size: 13px; }
.dens-tip .dt-head small { margin-left: auto; color: var(--muted); font-size: 11px; }
.dens-msg { grid-row: 2; grid-column: 1; z-index: 3; align-self: center; justify-self: center; max-width: calc(100% - 28px); text-align: center; padding: 8px 12px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.4; pointer-events: none; }
.dens-msg:empty { display: none; }
.dens-foot { grid-row: 3; padding: 5px 12px; border-top: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 11px; line-height: 1.35; }
.dens-foot.err { color: var(--down); }
.dens-tip { position: fixed; z-index: 90; display: none; min-width: 170px; padding: 8px 12px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.4); font-size: 12px; pointer-events: none; }
.dens-tip div { display: flex; justify-content: space-between; gap: 18px; padding: 1px 0; }
.dens-tip div span:first-child { color: var(--muted); }
.dens-tip div span:last-child { font-family: var(--mono); }
.dens-tip .up { color: var(--up); } .dens-tip .down { color: var(--down); }
.dens-cfg { position: absolute; inset: 0 0 auto 0; bottom: 0; z-index: 5; overflow: auto; background: var(--panel); padding: 10px 14px 14px; display: none; }
.dens.cfg-open .dens-cfg { display: block; }
.dc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.dc-head b { font-size: 13px; }
.dc-head button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 16px; }
.dc-head button:hover { color: var(--fg); }
.dc-label { display: block; margin: 8px 0 4px; font-size: 12px; font-weight: 600; }
.dc-sec { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 8px; }
.dens-cfg input[type=number], .dens-cfg input[list] { background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; font-size: 12px; color: var(--fg); min-width: 0; }
.dens-cfg input[type=number] { width: 100%; text-align: right; font-family: var(--mono); }
.dens-cfg input:focus { border-color: var(--accent); }
.dc-add { display: flex; gap: 6px; }
.dc-add input { flex: 1; }
.dc-add button { background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; color: var(--fg); padding: 0 10px; cursor: pointer; }
.dc-add button:hover { border-color: var(--accent); }
.dc-coin { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.dc-coin b { width: 56px; flex: none; }
.dc-coin button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 2px 4px; }
.dc-coin button:hover { color: var(--down); }
.dc-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dc-two label { font-size: 11px; color: var(--muted); display: grid; gap: 3px; }
.dc-range { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 10px; margin-top: 8px; font-size: 12px; font-weight: 600; }
.dc-range output { background: var(--panel-2); border-radius: 999px; padding: 1px 10px; font-family: var(--mono); font-weight: 500; }
.dc-range input { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); }
.dens-cfg .field.row { flex-direction: row-reverse; justify-content: space-between; color: var(--fg); font-size: 12px; font-weight: 600; padding: 6px 0; }
@media (max-width: 900px) {
  .overview { grid-template-columns: 1fr; grid-template-rows: none; }
  .ov-grid { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-rows: 240px; }
  .ov-side { grid-template-rows: auto auto; max-height: none; }
  .ov-tickers { max-height: 55vh; }
  .ov-imps { max-height: 45vh; }
}

/* signalai: iššokantys pranešimai ir žymos */
#toasts { position: fixed; right: 14px; bottom: 14px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: min(320px, calc(100vw - 28px)); }
.toast {
  background: var(--panel); color: var(--fg); border: 1px solid var(--line-2); border-left: 4px solid #b073ff; border-radius: 8px;
  padding: 10px 14px; box-shadow: 0 6px 24px rgba(0,0,0,.35); cursor: pointer; font-size: 13px; line-height: 1.4; animation: toastIn .2s ease-out;
}
.toast small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }
.tag.bell { background: rgba(176,115,255,.18); color: #b073ff; font-size: 10px; letter-spacing: 0; padding: 0 3px; }
.imp.alert { box-shadow: inset 3px 0 0 #b073ff; }

/* klavišų pagalbos langas */
dialog { background: var(--panel); color: var(--fg); border: 1px solid var(--line-2); border-radius: 10px; padding: 18px 22px; width: min(420px, calc(100% - 32px)); }
dialog::backdrop { background: rgba(0,0,0,.5); }
dialog h2 { margin: 0 0 12px; font-size: 15px; }
dialog dl { display: grid; grid-template-columns: auto 1fr; gap: 7px 18px; margin: 0 0 16px; }
dialog dt { white-space: nowrap; }
dialog dd { margin: 0; color: var(--muted); }
kbd { font: 11px var(--mono); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 1px 5px; background: var(--panel-2); }
dialog form button { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 6px; padding: 6px 16px; font-weight: 600; cursor: pointer; }

@media (pointer: coarse) {
  .tools { padding: 4px 0; }
  .tools button { width: 32px; height: 32px; }
  .chart-body { grid-template-columns: 38px minmax(0,1fr); }
  .seg button, .iconbtn { min-height: 34px; }
}

/* planšetė ir telefonas */
@media (max-width: 900px) {
  .app { height: auto; }
  header { padding: 8px 12px; gap: 8px 10px; }
  .brand span, .brand { font-size: 14px; }
  .field.grow { order: 2; flex: 1 1 100%; max-width: none; }
  .status { margin-left: auto; order: 3; }
  #helpBtn, #themeBtn, .langseg { order: 4; }
  .sessions { order: 5; flex-basis: 100%; margin: 0; justify-content: flex-start; gap: 6px; }
  .sess { padding: 3px 8px; gap: 5px; }
  .sess .lbl { display: none; }                  /* telefone lieka tik žalias / pilkas taškas ir laikas */
  #filtBtn { display: inline-grid; order: 1; }
  .filters { display: none; flex-basis: 100%; order: 10; flex-wrap: wrap; gap: 10px 14px; padding-top: 8px; border-top: 1px solid var(--line); }
  .filters.open { display: flex; }
  .filters .preset { flex-basis: 100%; }
  .filters .preset select { flex: 1; max-width: none; }
  main { grid-template-columns: 1fr; grid-template-rows: auto auto auto; }
  .charts { grid-auto-flow: row; grid-template-columns: 1fr; grid-row: 1; }
  .chartbox { height: 300px; }
  .chart-head { flex-wrap: wrap; row-gap: 2px; }
  .tablebox { grid-row: 2; max-height: 70vh; }
  aside { grid-column: 1; grid-row: 3; max-height: 60vh; }
}
@media (max-width: 640px) {
  .hm { display: none; }                       /* telefone slepiam mažiau svarbius stulpelius */
  thead th, tbody td { padding: 8px 8px; }
  thead th { font-size: 10px; letter-spacing: .03em; }
  .chart-head .meta .vol24 { display: none; }
  .foot { font-size: 10px; }
}
@media (max-width: 480px) {
  #stTxt { display: none; }                      /* siaurame ekrane lieka tik ryšio taškas — kad antraštė tilptų į vieną eilutę */
  .sessions { gap: 4px; }
  .sess { padding: 3px 6px; gap: 4px; font-size: 11px; }
  .sess .cd { font-size: 10px; }
  .langseg button { padding: 3px 6px; }
  thead th, tbody td { padding: 8px 5px; }
  thead th { font-size: 9px; letter-spacing: 0; white-space: normal; line-height: 1.15; vertical-align: bottom; }
  tbody td.num { font-size: 11px; }
  .tag { margin-left: 3px; padding: 1px 3px; font-size: 8px; }
  .star { font-size: 14px; }
}
