





* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden; 
}

body {
  display: flex;
  flex-direction: column;
  
  background-color: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}


.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 8px 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}


.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.dot-connecting { background: var(--warn); }
.dot-off        { background: var(--down); }
.dot-on {
  background: var(--up);
  animation: dotPulse 2.6s ease-out infinite;
}
@keyframes dotPulse {
  0%   { box-shadow: 0 0 0 0 rgba(38, 166, 154, .5); }
  70%  { box-shadow: 0 0 0 5px rgba(38, 166, 154, 0); }
  100% { box-shadow: 0 0 0 0 rgba(38, 166, 154, 0); }
}



.topbar .auth { margin-left: auto; }


.auth { position: relative; }
.auth-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 6px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  transition: color .15s, background .15s;
}
.auth-btn:hover { color: var(--text); background: var(--panel-3); }
.auth-btn.signed-in {
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}
.auth-btn.signed-in:hover {
  color: var(--text);
  background: var(--panel-3);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.auth-icon { display: block; }
.auth-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 40;
  min-width: 210px;
  padding: 4px;
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop);
}
.auth-menu-mail {
  padding: 7px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  font-family: var(--font-num);
  font-size: 11px;
  color: var(--text-dim);
  word-break: break-all;
}
.auth-menu-item {
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.auth-menu-item:hover { background: var(--panel-3); }



.icon-btn {
  display: flex;
  align-items: center;
  padding: 4px 6px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s, background .15s;
}
.icon-btn:hover { color: var(--text); background: var(--panel-3); }
.icon-btn svg { display: block; }




.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--overlay);
  backdrop-filter: blur(2px);
}
.modal-panel {
  width: min(420px, 100%);
  max-height: min(78vh, 560px);
  display: flex;
  flex-direction: column;
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
}
.modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px 11px 14px;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
}
.modal-close {
  margin-left: auto;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: color .15s, background .15s;
}
.modal-close:hover { color: var(--text); background: var(--panel-3); }
.modal-body { padding: 14px; overflow: auto; }
.modal-note { margin: 0; font-size: 12px; color: var(--text-dim); }
.set-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 0 13px;
  border-bottom: 1px solid var(--border);
}
.set-label { font-size: 12px; color: var(--text); }
.switch {
  margin-left: auto;
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
}
.switch-btn {
  padding: 4px 12px;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: color .15s, background .15s;
}
.switch-btn:hover { color: var(--text); background: var(--panel-3); }
.switch-btn[aria-checked="true"] {
  color: var(--text);
  background: var(--panel-3);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}
.set-row + .modal-note { margin-top: 13px; }

body.modal-open { overflow: hidden; }

.search input {
  width: 100%;
  padding: 5px 2px 5px 23px;
  border: 0;
  border-bottom: 1px solid var(--border-strong);
  border-radius: 0;
  background-color: transparent;
  
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%237d8895' stroke-width='1.4'%3E%3Ccircle cx='7' cy='7' r='4.3'/%3E%3Cpath d='M10.3 10.3 14 14'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 2px center;
  background-size: 13px 13px;
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color .15s, background-color .15s;
}
.search input::placeholder { color: var(--muted); }
.search input:focus {
  border-bottom-color: var(--accent);
  background-color: var(--field-focus);
}


main {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden; 
}

body.boot main { visibility: hidden; }




.chart-pane {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: calc(var(--tblx, 500px) - 14px);
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 14px 0 10px 18px;
  overflow: hidden;
}


.chart-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 26px;
  margin: 0 18px 10px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.chart-symbol {
  font-family: var(--font-num);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--text);
  white-space: nowrap;
}
.tf-buttons { display: flex; gap: 2px; flex-wrap: wrap; }


.tf-head { position: relative; display: flex; align-items: center; }
.tf-current { display: none; }

.tf-btn {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-num);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  line-height: 1;
  padding: 5px 7px 4px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.tf-btn:hover { color: var(--text-dim); }
.tf-btn.active { color: var(--text); border-bottom-color: var(--accent); }

.chart-status {
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.chart-zoom {
  color: var(--muted);
  font-family: var(--font-num);
  font-size: 11px;
  white-space: nowrap;
}
.chart-zoom:not(:empty) {
  color: var(--text-dim);
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

.grid-picker { position: relative; display: flex; }
.grid-btn {
  display: flex;
  align-items: center;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.grid-btn:hover { color: var(--text); background: var(--panel-3); }
.grid-btn.open { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.grid-icon { display: block; fill: none; stroke: currentColor; stroke-width: 1.3; }
.grid-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 3px;
  padding: 5px;
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop);
}
.grid-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.grid-item:hover { color: var(--text); background: var(--panel-3); }
.grid-item.active { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.grid-item svg { fill: none; stroke: currentColor; stroke-width: 1.2; }




.chart-grid {
  position: relative; 
  flex: 1 1 auto;
  min-height: 0;
}



.chart-split {
  position: absolute;
  z-index: 8;
  touch-action: none;
  color: var(--text-dim); 
}
.chart-split::before { 
  content: "";
  position: absolute;
  background: rgba(166, 177, 192, 0.18);
}
.split-v { cursor: col-resize; }
.split-h { cursor: row-resize; }
.split-v::before { top: 0; bottom: 0; left: 50%; width: 1px; }
.split-h::before { left: 0; right: 0; top: 50%; height: 1px; }
.chart-split::after { 
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 3px;
  background-color: var(--panel-2);
  box-shadow: 0 0 0 1px var(--border);
}
.split-v::after {
  width: 8px;
  height: 30px;
  background-image: radial-gradient(circle at 4px 5px, currentColor 0 1.4px, transparent 1.6px);
  background-size: 8px 10px;
}
.split-h::after {
  width: 30px;
  height: 8px;
  background-image: radial-gradient(circle at 5px 4px, currentColor 0 1.4px, transparent 1.6px);
  background-size: 10px 8px;
}
.chart-split:hover, .chart-split.dragging {
  color: var(--accent);
  background: var(--accent-soft);
}
.chart-split:hover::before, .chart-split.dragging::before { background: var(--accent); }
.chart-split:hover::after, .chart-split.dragging::after { background-color: var(--panel-3); }

body.col-resizing, body.col-resizing * { cursor: col-resize !important; }
body.row-resizing, body.row-resizing * { cursor: row-resize !important; }
body.col-resizing, body.row-resizing { user-select: none; }

.chart-grid[data-layout="1"] .chart-tf { display: none; }



.chart-cell.off { visibility: hidden; }
.chart-cell.solo { z-index: 2; }


.chart-max {
  position: absolute;
  right: 6px;
  top: 4px;
  z-index: 7;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(11, 14, 19, 0.86);
  color: var(--muted);
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.chart-max svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
}
.chart-max:hover { color: var(--accent); border-color: var(--accent-line); background: var(--panel-3); }



.chart-cell {
  position: absolute;
  overflow: hidden;
}
.chart-cell.active::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  --tick: 12px;
  background-image:
    linear-gradient(var(--accent) 0 0), linear-gradient(var(--accent) 0 0),
    linear-gradient(var(--accent) 0 0), linear-gradient(var(--accent) 0 0),
    linear-gradient(var(--accent) 0 0), linear-gradient(var(--accent) 0 0),
    linear-gradient(var(--accent) 0 0), linear-gradient(var(--accent) 0 0);
  background-repeat: no-repeat;
  background-size:
    var(--tick) 1px, 1px var(--tick), var(--tick) 1px, 1px var(--tick),
    var(--tick) 1px, 1px var(--tick), var(--tick) 1px, 1px var(--tick);
  background-position:
    0 0, 0 0, 100% 0, 100% 0,
    0 100%, 0 100%, 100% 100%, 100% 100%;
  opacity: .7;
}

.chart-grid[data-layout="1"] .chart-cell.active::before,
.chart-grid[data-max="1"] .chart-cell.active::before { content: none; }

.chart-cell.loading::after {
  content: "загрузка";
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 9, 12, 0.6);
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  pointer-events: none;
}
.chart-tf {
  position: absolute;
  left: 6px;
  top: 5px;
  z-index: 5;
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  background: rgba(11, 14, 19, 0.7);
  color: var(--muted);
  font-family: var(--font-num);
  font-size: 10px;
  font-weight: 600;
  pointer-events: none;
}
.chart-cell.active .chart-tf { color: var(--accent); }




.chart-mark {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-family: var(--font-num);
  font-size: 40px;
  font-weight: 600;
  letter-spacing: 0.14em;
  white-space: nowrap;
  color: rgba(233, 238, 246, 0.045);
  user-select: none;
}

.chart-box {
  position: relative; 
  width: 100%;
  height: 100%;
  overflow: hidden;   
}


.ruler-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
}
.ruler-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.ruler-area {
  fill: rgba(157, 192, 255, 0.07);
  stroke: rgba(157, 192, 255, 0.18);
  stroke-width: 1;
}
.ruler-main {
  stroke: rgba(157, 192, 255, 0.6);
  stroke-width: 1.4;
  stroke-dasharray: 4 5;
}
.ruler-dot { fill: rgba(157, 192, 255, 0.85); stroke: var(--bg); stroke-width: 1; }
.ruler-label {
  position: absolute;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
  text-align: center;
  font-family: var(--font-num);
  backdrop-filter: blur(5px);
  box-shadow: var(--shadow-pop);
}
.ruler-label.left { transform: translateX(-100%); }

.ruler-pct {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.ruler-pct.pos { color: var(--up); }
.ruler-pct.neg { color: var(--down); }
.ruler-row { display: flex; gap: 6px; align-items: baseline; justify-content: center; }
.ruler-sub { color: var(--text-dim); font-size: 10px; margin-top: 2px; }




.splitter {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--tblx, 500px) - 5px);
  width: 10px;
  cursor: col-resize;
  touch-action: none;
  z-index: 20;
}
.splitter::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
  background: var(--border-strong);
  transition: background .15s, width .15s;
}

.splitter::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 30px;
  border-radius: 3px;
  background-color: var(--panel-2);
  box-shadow: 0 0 0 1px var(--border);
  background-image: radial-gradient(circle at 4px 5px, var(--muted) 0 1.4px, transparent 1.6px);
  background-size: 8px 10px;
}
.splitter:hover::before,
.splitter.dragging::before { background: var(--accent); width: 2px; }
.splitter:hover::after,
.splitter.dragging::after {
  background-color: var(--panel-3);
  background-image: radial-gradient(circle at 4px 5px, var(--accent) 0 1.4px, transparent 1.6px);
}
body.resizing, body.resizing * { cursor: col-resize !important; user-select: none !important; }




.table-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 10px;
  background: var(--panel);
  border-bottom: 1px solid var(--border-strong);
}


.search { display: flex; align-items: center; flex: 0 3 180px; min-width: 90px; max-width: 180px; }
.search input { flex: 1 1 auto; min-width: 0; }

.search-btn {
  display: none;
  align-items: center;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.search-btn:hover { color: var(--text); background: var(--panel-3); }
.search-btn.open { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }





.table-bar.search-min .search { flex: 0 0 auto; min-width: 0; max-width: none; }
.table-bar.search-min .search-btn { display: flex; }
.table-bar.search-min .search input { display: none; }
.table-bar.compact .exch-label,
.table-bar.compact .exch-caret { display: none; }

.table-bar.search-min.search-open .exch-picker,
.table-bar.search-min.search-open .bar-btn { display: none; }
.table-bar.search-min.search-open .search { flex: 1 1 auto; }
.table-bar.search-min.search-open .search input {
  display: block;
  padding-left: 2px;
  background-image: none;   
}

.exch-picker { position: relative; display: flex; flex: 0 0 auto; min-width: 0; }
.exch-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 11px;
  letter-spacing: .02em;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.exch-btn:hover { color: var(--text); background: var(--panel-3); }
.exch-btn.open { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.bar-icon { display: block; flex: 0 0 auto; }
.exch-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exch-caret { transition: transform .15s; }
.exch-btn.open .exch-caret { transform: rotate(180deg); }



.exch-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 40;
  display: flex;
  flex-direction: column;
  min-width: 148px;
  padding: 3px;
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop);
}
.exch-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 4px 7px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 11px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: color .15s, background .15s;
}
.exch-item:hover { color: var(--text); background: var(--panel-3); }
.exch-item.active { color: var(--text); }
.exch-item.active::after { content: "✓"; margin-left: auto; padding-left: 12px; color: var(--accent); }


.bar-btn {
  display: flex;
  align-items: center;
  margin-left: auto;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.bar-btn:hover { color: var(--text); background: var(--panel-3); }
.bar-btn:disabled { opacity: .45; cursor: default; background: transparent; }


.bar-toggle {
  display: flex;
  align-items: center;
  padding: 3px 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.bar-toggle:hover { color: var(--text); background: var(--panel-3); border-color: var(--border); }
.table-bar.collapsed .bar-toggle svg { transform: rotate(180deg); }
.table-bar.collapsed .exch-picker,
.table-bar.collapsed .search,
.table-bar.collapsed .bar-btn { display: none; }

.table-bar.collapsed { height: 20px; padding: 0 8px; }
.table-bar.collapsed .bar-toggle { margin-left: auto; }


.table-pane {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--tblx, 500px);
  right: var(--rail-w, 28px); 
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--panel);
  



  z-index: 8;
}



.table-rail {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: var(--rail-w, 28px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
  background: var(--panel);
  border-left: 1px solid var(--border);
  z-index: 9;
}
.rail-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color .12s, background .12s;
}
.rail-btn:hover { color: var(--text); background: var(--panel-3); }
.rail-btn:disabled { opacity: .45; cursor: default; background: transparent; }

.rail-btn svg { display: block; transition: transform .15s; }
main.table-off #rail-hide-btn svg { transform: rotate(180deg); }




main.table-off .table-pane,
main.table-off .splitter { display: none; }
main.table-off .chart-pane {
  width: auto;
  right: var(--rail-w, 28px);
  padding-right: 18px;
}

.scroll {
  flex: 1 1 auto;
  min-height: 0;
  

  overflow-y: auto;
  overflow-x: hidden;
}



.table-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  background: var(--panel);
  border-top: 1px solid var(--border-strong);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.table-foot b {
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--text-dim);
  margin-right: .35em;
}
.table-foot .foot-sort { margin-left: auto; }



.row-spacer {
  pointer-events: none;
}
.row-spacer td {
  padding: 0;
  border: 0;
  background: none;
}
.table-wrap { width: max-content; }

table {
  

  width: auto;
  table-layout: fixed;
  border-collapse: collapse;
}

#tickers th,
#tickers td {
  overflow: hidden;
  text-overflow: ellipsis;
}

thead th {
  position: sticky;
  top: 0; 
  background: var(--panel);
  padding: 9px 9px 8px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  border-bottom: 1px solid var(--border-strong);
  z-index: 3;
  white-space: nowrap;
}


#tickers thead th { text-align: center; }
#tickers thead th[data-col="pair"] { text-align: left; }

#tickers thead th[data-col="mark"] { padding: 0; vertical-align: middle; }



#tickers thead th { overflow: visible; }


#tickers thead th::after {
  content: "";
  position: absolute;
  top: 32%;
  bottom: 32%;
  right: 0;
  width: 1px;
  background: var(--border);
}

#tickers thead th[data-col="mark"]::after { display: none; }



th.num, td.num { text-align: center; }


th.sortable { cursor: pointer; user-select: none; transition: color .15s; }
th.sortable:hover { color: var(--text); }


th.sorted { color: var(--text); }
th.sorted::after { background: var(--accent-line); }




.col-resizer {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 12px;
  cursor: col-resize;
  touch-action: none;
  user-select: none;
  z-index: 6;
}




.col-guide {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  margin-left: -1px;
  background: var(--accent);
  pointer-events: none;
  z-index: 21;
}
.col-guide b {
  position: absolute;
  top: 34px;
  left: 6px;
  padding: 3px 5px;
  border-radius: var(--radius-sm);
  background: var(--panel-3);
  box-shadow: 0 0 0 1px var(--border-strong);
  color: var(--text);
  font: 600 10px/1 var(--font-num);
  letter-spacing: .02em;
  white-space: nowrap;
}

.col-resizer::after {
  content: "";
  position: absolute;
  top: 12%;
  bottom: 12%;
  right: 0;
  width: 2px;
  border-radius: 1px;
  background: transparent;
  transition: background .12s;
}
.col-resizer:hover::after,
.col-resizer.dragging::after { background: var(--accent); }





td.mark { padding: 0; text-align: center; }
.mark-btn {
  box-sizing: border-box;
  display: inline-block;
  width: 8px;
  height: 14px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s, background .12s, border-color .12s;
}
tbody tr:hover .mark-btn { opacity: 1; }
.mark-btn:hover { border-color: var(--text-dim); background: var(--panel-3); }
.mark-btn.on { opacity: 1; }

.mark-btn.mark-green { border-color: var(--mark-green); background: var(--mark-green); }
.mark-btn.mark-red { border-color: var(--mark-red); background: var(--mark-red); }
.mark-btn.mark-blue { border-color: var(--mark-blue); background: var(--mark-blue); }


.mark-btn.mark-head {
  opacity: 1;
  pointer-events: none;
}


.mark-menu {
  position: fixed;
  z-index: 65;
  min-width: 150px;
  padding: 4px;
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop);
}
.mark-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.mark-item:hover { background: var(--panel-3); color: var(--text); }
.mark-item.active { color: var(--text); }
.mark-item i {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: currentColor;
}
.mark-item[data-mark="green"] i { background: var(--mark-green); }
.mark-item[data-mark="red"] i { background: var(--mark-red); }
.mark-item[data-mark="blue"] i { background: var(--mark-blue); }
.mark-item[data-mark="none"] i { background: transparent; box-shadow: inset 0 0 0 1px var(--border-strong); }
.mark-item.active::after { content: "✓"; margin-left: auto; color: var(--accent); }
body.resizing-cols, body.resizing-cols * { cursor: col-resize !important; user-select: none !important; }



#tickers thead th.col-dragging { opacity: .4; }
body.moving-col, body.moving-col * { cursor: grabbing !important; user-select: none !important; }
.col-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 70;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  background: var(--panel-3);
  box-shadow: 0 0 0 1px var(--border-strong);
  color: var(--text);
  font: 600 10px/1 var(--font-num);
  text-transform: uppercase;
  letter-spacing: .08em;
  pointer-events: none;
  white-space: nowrap;
}

tbody td {
  height: var(--row-h);
  padding: 0 9px;
  border-bottom: 1px solid rgba(28, 34, 43, .7);
  font-family: var(--font-num);
  font-size: 12px;
  white-space: nowrap;
}
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--row-hover); }

tbody tr.active {
  background: var(--accent-soft);
  box-shadow: inset 2px 0 0 var(--accent);
}
tbody tr:last-child td { border-bottom: none; }

.pair-main {
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .01em;
  line-height: 1.25;
  color: var(--text);
}
.pair-sub { display: none; } 


.up   { color: var(--up); }
.down { color: var(--down); }
.vol { color: var(--text); }        



tbody td.num { color: var(--text-dim); }
tbody td.num.vol { color: var(--text); }
tbody td.num.up { color: var(--up); }
tbody td.num.down { color: var(--down); }


td.num.future { color: var(--muted); }

@media (max-width: 980px) {
  
  main {
    position: static;
    display: flex;
    flex-direction: column;
    overflow: visible;
    padding: 0 18px 14px;
  }
  .chart-pane {
    position: static;
    width: auto;
    flex: 0 0 42vh;
    padding: 14px 0 0;
  }
  .chart-head { margin-right: 0; }
  .splitter { display: none; }
  
  .table-rail { display: none; }
  
  main.table-off .table-pane { display: flex; }
  main.table-off .chart-pane { width: auto; padding-right: 0; }
  .table-pane {
    position: static;
    width: auto;
    flex: 1 1 auto;
    min-height: 0;
    overflow: visible;
    background: transparent;
  }
  .table-foot { display: none; }
}



.sheet-grip {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 24px;      
  align-items: center;
  justify-content: center;
  cursor: ns-resize;
  touch-action: none;   
  background: transparent;
}
.sheet-grip span {
  width: 64px;
  height: 5px;
  border-radius: 3px;
  background: var(--muted);
  opacity: .8;
}
.sheet-grip:hover span, .sheet-grip:active span { background: var(--text-dim); opacity: 1; }





.chart-box { touch-action: none; }


body.axis-dragging { cursor: ns-resize; user-select: none; }




@media (max-width: 720px) {
  
  .topbar {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 6px 12px;
  }
  .topbar .auth { margin-left: auto; }
  .search { max-width: none; margin-left: 0; }
  .search input { width: 100%; }

  main {
    position: relative;
    display: block;
    overflow: hidden;
    padding: 0;
    
    --rail-h: 54px;
  }

  
  .chart-pane {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: var(--rail-h);
    width: auto;
    padding: 0;
  }
  .chart-head { margin: 0; padding: 8px 10px 0; }
  .splitter { display: none; }
  
  .grid-picker { display: none; }

  
  .table-pane {
    position: absolute;
    left: 0;
    right: 0;
    bottom: var(--rail-h);
    top: auto;
    height: var(--sheet-h, 60%);
    width: auto;
    min-width: 0;
    padding-top: 24px;   
    overflow: hidden;
    background: var(--panel);
    border-top: 1px solid var(--border-strong);
    border-radius: 10px 10px 0 0;
    box-shadow: var(--shadow-sheet);
    z-index: 12;         
  }
  .table-foot { display: none; }
  
  .scroll { overscroll-behavior: contain; }
  
  .sheet-grip { display: flex; }

  
  .table-rail {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: var(--rail-h);
    padding: 0;
    gap: 10px;
    border-left: 0;
    border-top: 1px solid var(--border);
    z-index: 13;
  }
  .rail-btn { width: 42px; height: 42px; }
  .rail-btn svg { width: 22px; height: 22px; }
  
  #rail-hide-btn svg { transform: rotate(90deg); }
  main.table-off #rail-hide-btn svg { transform: rotate(270deg); }

  
  main.table-off .table-pane { display: none; }
  main.table-off .chart-pane { right: 0; bottom: var(--rail-h); padding-right: 0; }

  
  .tf-current {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--panel-2);
    color: var(--text);
    font-family: var(--font-num);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
  }
  
  .tf-current::after {
    content: "";
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--muted);
    transition: transform .15s;
  }
  .tf-current[aria-expanded="true"]::after { transform: rotate(180deg); }
  .tf-buttons { display: none; }
  .tf-buttons.open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 40;
    min-width: 112px;
    padding: 6px;
    background: var(--panel-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-float);
  }
  .tf-buttons.open .tf-btn { display: inline-flex; justify-content: flex-start; }
  .tf-btn { padding: 9px 12px; font-size: 14px; }
}
