@font-face {
  font-family: "JetBrains Mono Slashed";
  src: url("/fonts/JetBrainsMonoSlashed-ExtraLight.woff2") format("woff2");
  font-style: normal;
  font-weight: 200;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono Slashed";
  src: url("/fonts/JetBrainsMonoSlashed-Light.woff2") format("woff2");
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono Slashed";
  src: url("/fonts/JetBrainsMonoSlashed-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono Slashed";
  src: url("/fonts/JetBrainsMonoSlashed-SemiBold.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono Slashed";
  src: url("/fonts/JetBrainsMonoSlashed-Bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono Slashed";
  src: url("/fonts/JetBrainsMonoSlashed-ExtraBold.woff2") format("woff2");
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --background: #101012;
  --panel: #151517;
  --panel-soft: #1a1a1d;
  --toolbar: #121214;
  --button: #25252a;
  --border: #2d2e33;
  --grid: #25262b;
  --text: #c8c9cf;
  --text-strong: #ececf0;
  --muted: #85868e;
  --green: #00c875;
  --red: #f0445c;
  --toolbar-height: 42px;
  font-family: "JetBrains Mono Slashed", "JetBrains Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--background);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input { font: inherit; }
button { color: inherit; }

.toolbar {
  height: var(--toolbar-height);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  background: linear-gradient(180deg, #131315 0%, #101012 100%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .012), 0 4px 14px rgba(0, 0, 0, .12);
  user-select: none;
}

.brand {
  width: 112px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #eeeeF2;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.105em;
  text-decoration: none;
  cursor: pointer;
}
.brand:hover { color: #fff; }
.brand:focus-visible { outline: 1px solid #555; outline-offset: -3px; }
.brand-mark {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  display: block;
}

.tool-group { display: flex; gap: 2px; }

.tool,
.icon-button,
.rail-button {
  min-width: 34px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid #2d2d2d;
  border-radius: 2px;
  background: var(--button);
  color: #a7a7a7;
  font-size: 11px;
  cursor: pointer;
}

.tool:hover,
.icon-button:hover,
.rail-button:hover { color: #ddd; background: #2c2c2c; }
.rail-button:disabled {
  color: #4e4e52;
  background: transparent;
  cursor: default;
  opacity: .5;
}
.tool.active { color: #ededed; background: #303030; border-color: #3a3a3a; }

.interval-group {
  height: 32px;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid #292a2e;
  border-radius: 4px;
  background: #171719;
  box-shadow: inset 0 1px rgba(255, 255, 255, .018);
}
.interval-group .tool {
  min-width: 38px;
  height: 26px;
  padding: 0 8px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #777980;
  font-size: 10px;
  font-weight: 600;
  transition: color .12s ease, background .12s ease, box-shadow .12s ease;
}
.interval-group .tool:hover { background: #202024; color: #c7c7ca; }
.interval-group .tool.active {
  color: #f0edef;
  background: #343034;
  box-shadow: inset 0 0 0 1px #443b40, inset 0 2px #8b545d;
}

.toolbar-divider {
  width: 1px;
  height: 20px;
  margin: 0 3px;
  background: linear-gradient(180deg, transparent, #34353a 25%, #34353a 75%, transparent);
}

.ranking-standard {
  height: 32px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border: 1px solid #292a2e;
  border-radius: 4px;
  background: #171719;
  color: #a8a8ad;
  box-shadow: inset 0 1px rgba(255, 255, 255, .018);
}

.ranking-standard-icon {
  width: 14px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: #aaa9ad;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 2px rgba(210, 205, 215, .08));
}

.ranking-standard-period {
  display: flex;
  align-items: baseline;
  font-size: 10px;
  line-height: 1;
  letter-spacing: .015em;
  white-space: nowrap;
}

.ranking-standard-period strong {
  color: #dedee2;
  font-weight: 700;
}

.ranking-standard-period span {
  color: #8d898e;
  font-weight: 600;
}

.ranking-auto-state {
  min-width: 28px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  margin-left: 3px;
  padding: 0 4px;
  border: 1px solid rgba(0, 200, 117, .22);
  border-radius: 3px;
  background: rgba(0, 200, 117, .07);
  color: #44cf8d;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1;
}

.ranking-standard.auto-hold .ranking-auto-state {
  border-color: rgba(233, 185, 50, .24);
  background: rgba(233, 185, 50, .08);
  color: #d8ad39;
}

.ranking-standard.auto-sync .ranking-auto-state {
  border-color: rgba(117, 153, 207, .25);
  background: rgba(117, 153, 207, .08);
  color: #8fadd8;
}

.toolbar-spacer { flex: 1 1 auto; }

.connection-dot {
  position: relative;
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  margin-right: 3px;
  border-radius: 50%;
  background: #555;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .025);
}
.connection-dot.connected {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(0, 200, 117, .07), 0 0 8px rgba(0, 200, 117, .24);
}
.connection-dot.error {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(240, 68, 92, .07), 0 0 8px rgba(240, 68, 92, .2);
}

.search-shell {
  width: min(340px, calc(100vw - 32px));
  position: fixed;
  top: 6px;
  left: 50%;
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -8px) scale(.985);
  transform-origin: top center;
  transition: opacity .12s ease, transform .12s ease, visibility 0s linear .12s;
}

.search-shell.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
  transition: opacity .12s ease, transform .12s ease;
}

.search-box {
  width: 100%;
  height: 32px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  border: 1px solid #3a3b40;
  border-radius: 3px;
  background: rgba(25, 25, 28, .985);
  color: #777;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .38);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #c6c6c6;
  font-size: 11px;
  text-transform: uppercase;
}

.search-shell:focus-within .search-box {
  border-color: #484950;
  background: #1d1d20;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .025), 0 4px 14px rgba(0, 0, 0, .22);
}

.search-suggestions {
  width: 100%;
  max-height: 344px;
  position: absolute;
  top: 37px;
  left: 0;
  overflow: auto;
  border: 1px solid #323338;
  border-radius: 3px;
  background: rgba(20, 20, 22, .985);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .48);
  user-select: none;
}

.search-suggestions[hidden] { display: none; }

.search-suggestion {
  width: 100%;
  height: 42px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 0;
  border-bottom: 1px solid #27282c;
  background: transparent;
  color: #b9bac0;
  text-align: left;
  cursor: pointer;
}

.search-suggestion:last-child { border-bottom: 0; }
.search-suggestion:hover,
.search-suggestion.active {
  background: #25262a;
  color: #f0f0f3;
}

.search-suggestion-icon {
  width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: #25262a;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .13);
  color: #bfc0c5;
  font-size: 8px;
  font-weight: 700;
}

.search-suggestion-icon img {
  width: 13px;
  height: 13px;
  display: block;
  border-radius: 50%;
  object-fit: contain;
}

.search-suggestion-icon > span { display: none; }
.search-suggestion-icon.fallback img { display: none; }
.search-suggestion-icon.fallback > span { display: block; }
.search-suggestion-symbol { min-width: 0; }
.search-suggestion-symbol strong {
  display: block;
  overflow: hidden;
  color: inherit;
  font-size: 11px;
  text-overflow: ellipsis;
}
.search-suggestion-symbol small,
.search-suggestion-volume {
  color: #707179;
  font-size: 8px;
  font-weight: 400;
}
.search-suggestion-volume { color: #94959c; }
.search-suggestion-status {
  padding: 13px 11px;
  color: #777880;
  font-size: 9px;
  letter-spacing: .03em;
}

.icon-button { min-width: 30px; padding: 0; font-size: 16px; }

.workspace {
  height: calc(100vh - var(--toolbar-height));
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px 38px;
}

.chart-grid {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  background: var(--border);
  gap: 1px;
}

.chart-card {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 34px minmax(0, 1fr);
  background: var(--panel);
  overflow: hidden;
}

.chart-card.expanded {
  position: fixed;
  inset: calc(var(--toolbar-height) + 6px) 44px 6px 6px;
  z-index: 31;
  grid-template-rows: 38px minmax(0, 1fr);
  border: 1px solid #373737;
  box-shadow: 0 14px 50px rgba(0, 0, 0, .62);
}

.chart-card.coin-preview .chart-pin-button { display: none; }
.coin-row.preview-loading { opacity: .48; }

.chart-card.active { box-shadow: inset 0 0 0 1px #666; }
.chart-card.active .chart-header { background: #1b1b1e; }
.chart-card.chart-loading .chart-canvas-wrap { opacity: .38; }
.chart-card.chart-loading .chart-canvas-wrap::after {
  content: "Loading chart…";
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  color: #8a8a8a;
  font-size: 10px;
}

.chart-card.history-loading .chart-canvas-wrap::before {
  content: "LOADING HISTORY";
  position: absolute;
  top: 7px;
  left: 9px;
  z-index: 4;
  padding: 3px 5px;
  border: 1px solid #303030;
  background: rgba(20, 20, 20, .88);
  color: #777;
  font-size: 7px;
  letter-spacing: .08em;
  pointer-events: none;
}

.wall-status {
  position: absolute;
  top: 7px;
  right: 58px;
  z-index: 5;
  padding: 3px 6px;
  border: 1px solid #343434;
  border-radius: 2px;
  background: rgba(20, 20, 20, .88);
  color: #8a8a8a;
  font-size: 8px;
  letter-spacing: .04em;
  pointer-events: none;
}
.wall-status.live { border-color: #31503a; color: #9aaa9d; }
.wall-status.error { border-color: #5a3030; color: #b77a7a; }

.chart-header {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  border-bottom: 1px solid #292a2e;
  white-space: nowrap;
  overflow: hidden;
  font-size: 10px;
  color: #96979f;
}

.chart-header[title] { cursor: default; }

.chart-metrics {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 3px;
  overflow: hidden;
}

.chart-token-icon {
  width: 15px;
  height: 15px;
  display: block;
  position: relative;
  flex: 0 0 15px;
  margin-right: -5px;
  box-sizing: border-box;
  padding: 1px;
  border-radius: 50%;
  overflow: hidden;
  background: #202126;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .14), 0 1px 3px rgba(0, 0, 0, .3);
}

.chart-token-icon img {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: block;
  border-radius: 50%;
  object-fit: contain;
  object-position: center;
  image-rendering: auto;
}

.chart-token-icon > span {
  width: 100%;
  height: 100%;
  display: none;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #d9dade, #8c8e95);
  color: #202125;
  font-size: 8px;
  font-weight: 800;
}

.chart-token-icon.fallback img { display: none; }
.chart-token-icon.fallback > span { display: grid; }

.chart-symbol {
  color: #eeeef2;
  font-size: 13px;
  font-weight: 650;
}

.exchange-code { color: #85868e; margin-left: -6px; }
.chart-activity-alert {
  width: 20px;
  height: 24px;
  display: grid;
  place-items: center;
  flex: 0 0 20px;
  margin: 0 14px 0 auto;
  border: 1px solid transparent;
  border-radius: 2px;
  background: rgba(235, 184, 47, .08);
  color: #e9b932;
  cursor: help;
}

.chart-activity-alert svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 3px rgba(235, 184, 47, .16));
}

.chart-activity-alert:hover {
  border-color: rgba(243, 197, 75, .18);
  background: rgba(235, 184, 47, .13);
  color: #f3c54b;
}

.chart-metric-chip {
  height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px;
  border-radius: 2px;
  color: #a4a5ad;
  background: transparent;
  white-space: nowrap;
}

.chart-metric-chip svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-metric-chip .chart-metric-lightning {
  width: 12px;
  height: 14px;
  stroke-width: 1.5;
}

.chart-metric-chip b {
  color: #c6c7cd;
  font-size: 10px;
  font-weight: 550;
}

.chart-metric-chip.chip-up {
  color: #83d7ae;
  background: rgba(0, 200, 117, .12);
}
.chart-metric-chip.chip-up b { color: #75dba8; }
.chart-metric-chip.chip-down {
  color: #d998a2;
  background: rgba(240, 68, 92, .13);
}
.chart-metric-chip.chip-down b { color: #e4a2ac; }
.chart-metric-chip.chip-warm {
  color: #d5b491;
  background: rgba(183, 111, 66, .11);
}
.chart-metric-chip.chip-warm b { color: #d9b99a; }
.chart-metric-chip.chip-hot {
  color: #d99da5;
  background: rgba(175, 67, 74, .18);
}
.chart-metric-chip.chip-hot b { color: #e0adb4; }

.chart-controls {
  margin-left: auto;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.chart-activity-alert + .chart-controls { margin-left: 0; }

.chart-window-button,
.chart-pin-button,
.chart-back-button {
  width: 26px;
  min-width: 26px;
  height: 24px;
  padding: 0;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: #777;
  cursor: pointer;
}

.chart-back-button { display: none; }

.chart-window-button:hover,
.chart-pin-button:hover,
.chart-pin-button.pinned {
  border-color: #363636;
  background: #242424;
  color: #d0d0d0;
}

.chart-window-button svg,
.chart-pin-button svg { width: 13px; height: 13px; }
.chart-window-button .collapse-icon { display: none; }
.chart-card.expanded .chart-window-button .expand-icon { display: none; }
.chart-card.expanded .chart-window-button .collapse-icon { display: block; }

.chart-canvas-wrap { min-width: 0; min-height: 0; position: relative; }
.tv-chart { position: absolute; inset: 0; }
.mobile-price-scale-handle { display: none; }

.chart-drawing-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}
.chart-drawing-overlay.capturing {
  pointer-events: none;
}
.chart-drawing-overlay.hidden { visibility: hidden; }
.chart-drawing-shape {
  stroke: #b8b8b8;
  stroke-width: 1;
  fill: rgba(184, 184, 184, .07);
  shape-rendering: geometricPrecision;
}
.chart-drawing-hit-target {
  stroke: transparent;
  stroke-width: 12;
  fill: none;
  pointer-events: stroke;
  cursor: grab;
}
.chart-drawing-hit-target:hover + .chart-drawing-shape {
  stroke: #ededed;
  stroke-width: 1.35;
}
.chart-drawing-anchor {
  fill: #d2d2d2;
  stroke: #171717;
  stroke-width: .5;
  pointer-events: none;
  shape-rendering: crispEdges;
}
.chart-drawing-overlay.dragging .chart-drawing-hit-target { cursor: grabbing; }
line.chart-drawing-shape { fill: none; }
.chart-drawing-shape.preview {
  stroke: #d0d0d0;
  stroke-dasharray: 5 4;
  opacity: .82;
}
.chart-drawing-measure-area {
  stroke-width: 1;
  stroke-dasharray: 4 4;
}
.chart-drawing-measure-line {
  fill: none;
  stroke-width: 1.15;
}
.chart-drawing-measure-area.positive { fill: rgba(0, 200, 117, .08); stroke: rgba(36, 218, 143, .7); }
.chart-drawing-measure-line.positive { stroke: #2bd792; }
.chart-drawing-measure-area.negative { fill: rgba(240, 68, 92, .08); stroke: rgba(255, 91, 113, .72); }
.chart-drawing-measure-line.negative { stroke: #ff6178; }
.chart-drawing-measure-area.neutral { fill: rgba(190, 190, 196, .06); stroke: rgba(198, 198, 204, .58); }
.chart-drawing-measure-line.neutral { stroke: #c8c8ce; }
.chart-drawing-measure-area.preview,
.chart-drawing-measure-line.preview { opacity: .72; }
.chart-drawing-measure-label {
  fill: rgba(22, 22, 25, .96);
  stroke-width: 1;
  pointer-events: none;
}
.chart-drawing-measure-label.positive { stroke: rgba(43, 215, 146, .58); }
.chart-drawing-measure-label.negative { stroke: rgba(255, 97, 120, .6); }
.chart-drawing-measure-label.neutral { stroke: rgba(200, 200, 206, .42); }
.chart-drawing-measure-label[data-drawing-id] { pointer-events: all; cursor: grab; }
.chart-drawing-measure-text {
  fill: #d8d8dd;
  font-family: "JetBrains Mono Slashed", "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .01em;
  pointer-events: none;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, .22);
  stroke-width: .4;
}

.drawing-dock {
  position: absolute;
  top: 50%;
  left: 0;
  z-index: 8;
  display: none;
  align-items: center;
  transform: translateY(-50%);
  pointer-events: none;
}
.chart-card.expanded .drawing-dock { display: flex; }
.chart-card:not(.expanded) .chart-drawing-overlay { display: none; }
.drawing-toolbar {
  width: 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 5px 4px;
  border: 1px solid #363636;
  border-left: 0;
  border-radius: 0 5px 5px 0;
  background: rgba(17, 17, 17, .94);
  box-shadow: 5px 6px 22px rgba(0, 0, 0, .42);
  backdrop-filter: blur(8px);
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 150ms ease, opacity 120ms ease;
}
.drawing-dock.open .drawing-toolbar {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}
.drawing-dock-toggle {
  position: absolute;
  left: 0;
  top: 50%;
  width: 25px;
  height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0;
  border: 1px solid #363636;
  border-left: 0;
  border-radius: 0 5px 5px 0;
  background: rgba(19, 19, 19, .92);
  color: #858585;
  box-shadow: 4px 3px 14px rgba(0, 0, 0, .28);
  transform: translateY(-50%);
  pointer-events: auto;
  cursor: pointer;
  transition: left 150ms ease, color 120ms ease, background 120ms ease;
}
.drawing-dock.open .drawing-dock-toggle { left: 42px; color: #b6b6b6; }
.drawing-dock.tool-active:not(.open) .drawing-dock-toggle {
  border-color: #5c4b2d;
  background: #29241b;
  color: #efad42;
}
.drawing-dock-toggle svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.drawing-dock-toggle .dock-chevron { width: 11px; height: 11px; transition: transform 150ms ease; }
.drawing-dock.open .dock-chevron { transform: rotate(180deg); }
.drawing-tool {
  position: relative;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: #909090;
  cursor: pointer;
}
.drawing-tool svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.drawing-tool::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 9px);
  top: 50%;
  z-index: 2;
  padding: 5px 7px;
  border: 1px solid #3a3a3a;
  border-radius: 3px;
  background: #171717;
  color: #aaa;
  font-size: 8px;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-3px, -50%);
  pointer-events: none;
  transition: opacity 100ms ease, transform 100ms ease;
}
.drawing-tool:hover::after { opacity: 1; transform: translate(0, -50%); }
.drawing-tool:hover,
.drawing-tool.active {
  border-color: #4d4433;
  background: #29251e;
  color: #f0b454;
}
.drawing-tool:disabled {
  opacity: .28;
  cursor: default;
}
.drawing-tool:disabled:hover {
  border-color: transparent;
  background: transparent;
  color: #909090;
}
.drawing-tool:disabled::after { display: none; }
.drawing-divider { width: 22px; height: 1px; margin: 3px 0; background: #343434; }
.drawing-active .mobile-price-scale-handle { pointer-events: none; }
.drawing-active,
.drawing-active .tv-chart,
.drawing-active .tv-chart canvas { cursor: crosshair !important; }
.drawing-active { touch-action: none; }

.side-panel {
  min-width: 0;
  min-height: 0;
  border-left: 1px solid var(--border);
  background: var(--panel);
}

.coins-panel { height: 100%; min-height: 0; overflow: hidden; }

.mobile-coin-search { display: none; }

.panel-title {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 11px;
  color: #dedfe4;
  font-size: 12px;
  font-weight: 600;
}

.coin-list-title {
  justify-content: flex-start;
  gap: 6px;
}

.coin-list-title svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: #a6a7ae;
  stroke-width: 1.15;
  stroke-linecap: round;
}

.coin-list-title .muted { margin-left: -3px; }

.muted { color: #7e7f87; font-size: 9px; font-weight: 500; letter-spacing: 0.05em; }

.density-map {
  position: relative;
  height: calc(100% - 36px);
  margin: 0 9px 8px;
  border: 1px solid #292929;
  background: #151515;
  overflow: hidden;
}

.density-map canvas {
  position: absolute;
  inset: 22px 0 0;
  width: 100%;
  height: calc(100% - 22px);
}

.depth-metrics {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #242424;
  color: #666;
  background: #171717;
  font-size: 9px;
  letter-spacing: .035em;
}

.density-empty {
  position: absolute;
  inset: 22px 0 0;
  z-index: 3;
  display: grid;
  place-content: center;
  color: #555;
  font-size: 11px;
  text-align: center;
  pointer-events: none;
}
.density-empty.hidden { display: none; }

.depth-status.connected { color: var(--green); }
.depth-status.error { color: var(--red); }

.coin-header,
.coin-row {
  display: grid;
  grid-template-columns: minmax(56px, 1fr) 48px 45px 43px 50px 46px;
  align-items: center;
  gap: 3px;
  padding: 0 8px;
}

.coin-header {
  height: 38px;
  border-top: 1px solid #242424;
  border-bottom: 1px solid #292929;
  color: #7f8089;
  font-size: 8px;
  line-height: 1.2;
}

.coin-sort-button {
  position: relative;
  min-width: 0;
  height: 100%;
  padding: 0 9px 0 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  text-align: left;
  cursor: pointer;
}
.coin-sort-button:not(:first-child) { text-align: right; }
.coin-sort-button:hover,
.coin-sort-button.active { color: #c0c1c7; }
.coin-sort-button.active::after {
  position: absolute;
  top: 50%;
  right: 0;
  color: #888;
  font-size: 7px;
  transform: translateY(-50%);
}
.coin-sort-button.active.asc::after { content: "▲"; }
.coin-sort-button.active.desc::after { content: "▼"; }
.coin-ticker-header {
  height: 100%;
  display: flex;
  align-items: center;
  min-width: 0;
}
.coin-ticker-header .coin-sort-button {
  width: auto;
  flex: 0 1 auto;
  padding-right: 9px;
}
.coin-btc-priority {
  height: 28px;
  min-width: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 0 0 auto;
  padding: 0 3px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: #5f6066;
  cursor: pointer;
}
.coin-btc-priority svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.coin-btc-priority span {
  color: inherit;
  font-size: 7px;
  font-weight: 700;
  line-height: 1;
}
.coin-btc-priority:hover { color: #a7a8ad; }
.coin-btc-priority.enabled {
  border-color: rgba(233, 185, 50, .13);
  background: rgba(233, 185, 50, .035);
  color: #9d853f;
}
.coin-btc-priority.enabled.has-alerts {
  border-color: rgba(243, 197, 75, .26);
  background: rgba(233, 185, 50, .09);
  color: #f0c13f;
  filter: drop-shadow(0 0 3px rgba(235, 184, 47, .12));
}
.coin-row > span:not(:first-child) { text-align: right; }

.coin-list { height: calc(100% - 74px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: #333 transparent; }
.coin-row {
  height: 24px;
  border-bottom: 1px solid #232323;
  color: #afb0b8;
  font-size: 10px;
  cursor: pointer;
}
.coin-row:hover { background: #202024; }
.coin-row.active { background: #2a2a30; box-shadow: inset 2px 0 #a2a3aa; }
.coin-row:focus-visible { outline: 1px solid #666; outline-offset: -1px; }
.coin-symbol {
  display: flex;
  align-items: center;
  min-width: 0;
  color: #dddde2;
  overflow: hidden;
}
.coin-symbol-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.coin-activity-alert {
  width: 14px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 14px;
  margin-left: 5px;
  color: #e9b932;
  cursor: help;
  filter: drop-shadow(0 0 3px rgba(235, 184, 47, .14));
}
.coin-activity-alert svg {
  width: 11px;
  height: 11px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.coin-activity-alert:hover { color: #f3c54b; }
.coin-activity-alert.scenario-opposite-btc {
  filter: drop-shadow(0 0 4px rgba(235, 184, 47, .26));
}
.coin-row.loaded .coin-symbol::after {
  content: "";
  width: 4px;
  height: 4px;
  margin: auto 0 auto auto;
  border-radius: 50%;
  background: #555;
}
.coin-row.pinned .coin-symbol::after { background: #aaa; }
.positive { color: var(--green) !important; }
.negative { color: var(--red) !important; }

.right-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 3px;
  border-left: 1px solid var(--border);
  background: #121214;
  box-shadow: inset 1px 0 rgba(255, 255, 255, .012);
}

.window-backdrop {
  position: fixed;
  inset: var(--toolbar-height) 0 0;
  z-index: 30;
  display: none;
  width: auto;
  height: auto;
  padding: 0;
  border: 0;
  background: rgba(5, 5, 5, .76);
  cursor: default;
}

body.chart-expanded .window-backdrop { display: block; }

.rail-button {
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: #5f6066;
  transition: color .12s ease, background .12s ease, border-color .12s ease;
}
.rail-button svg {
  grid-area: 1 / 1;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.rail-button:hover {
  color: #bfc0c5;
  border-color: #292a2e;
  background: #1c1c1f;
}
.rail-button.active {
  color: #ececef;
  border-color: #303137;
  background: #222327;
  box-shadow: inset 2px 0 #c9cacf;
}
.rail-spacer { flex: 1 1 auto; }
.rail-fullscreen { margin-bottom: 1px; }
.rail-collapse-icon { display: none; }
.rail-fullscreen.active .rail-expand-icon { display: none; }
.rail-fullscreen.active .rail-collapse-icon { display: block; }

.loading-overlay {
  position: fixed;
  inset: var(--toolbar-height) 0 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(17,17,17,.9);
  color: #777;
  font-size: 12px;
  transition: opacity .2s ease;
}
.loading-overlay.hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, visibility 0s linear .2s;
}

.loader {
  width: 18px;
  height: 18px;
  border: 2px solid #333;
  border-top-color: #999;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed;
  right: 48px;
  bottom: 10px;
  z-index: 20;
  max-width: 420px;
  padding: 8px 10px;
  border: 1px solid #4d2c2c;
  background: #251717;
  color: #d1a1a1;
  font-size: 11px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: .2s ease;
}
.toast.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 1450px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 330px 34px; }
  .brand { width: 92px; }
  .chart-header { gap: 7px; padding: 0 7px; }
  .chart-metrics { gap: 2px; }
  .chart-card:not(.expanded) .chart-volume-chip { display: none; }
  .market-source, .tv-attribution { display: none; }
}

@media (max-width: 1100px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 320px 32px; }
  .ranking-standard { padding: 0 6px; font-size: 8px; }
  .chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(5, minmax(180px, 1fr)); overflow-y: auto; }
  .chart-card:last-child { grid-column: 1 / -1; }
  .chart-card.expanded { inset: calc(var(--toolbar-height) + 5px) 38px 5px 5px; display: grid; }
}

@media (max-width: 720px) {
  :root { --toolbar-height: 44px; }

  .toolbar {
    gap: 4px;
    padding: 0 max(6px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left));
  }
  .brand {
    width: 76px;
    flex: 0 0 76px;
    gap: 5px;
    font-size: 10px;
  }
  .brand-mark { width: 14px; height: 14px; flex-basis: 14px; }
  .interval-group {
    min-width: 0;
    flex: 1 1 auto;
  }
  .interval-group .tool {
    min-width: 0;
    height: 30px;
    flex: 1 1 0;
    padding: 0;
    font-size: 9px;
  }
  .ranking-standard,
  .toolbar-divider,
  .market-source,
  .tv-attribution,
  .search-shell { display: none; }
  .icon-button {
    width: 30px;
    min-width: 30px;
    height: 30px;
  }

  .workspace {
    display: block;
    height: calc(100dvh - var(--toolbar-height));
  }
  .chart-grid,
  .right-rail { display: none; }
  .side-panel {
    width: 100%;
    height: 100%;
    border-left: 0;
  }
  .panel-title {
    height: 42px;
    padding: 0 12px;
    font-size: 13px;
  }
  .mobile-coin-search {
    height: 42px;
    margin: 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 11px;
    border: 1px solid #2d2d2d;
    border-radius: 3px;
    background: #191919;
    color: #777;
  }
  .mobile-coin-search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: #d0d0d0;
    font: inherit;
    font-size: 12px;
    text-transform: uppercase;
  }
  .coin-header,
  .coin-row {
    grid-template-columns: minmax(46px, 1fr) 44px 41px 41px 46px 43px;
    gap: 3px;
    padding: 0 8px;
  }
  .coin-header {
    height: 44px;
    margin-top: 6px;
    font-size: 8px;
  }
  .coin-list {
    height: calc(100% - 134px);
    padding-bottom: env(safe-area-inset-bottom);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .coin-row {
    height: 36px;
    color: #bfc0c7;
    font-size: 11px;
  }
  .coin-sort-button { padding-right: 8px; }

  .window-backdrop { inset: var(--toolbar-height) 0 0; }
  .chart-card.expanded,
  .chart-card.coin-preview {
    inset: var(--toolbar-height) 0 env(safe-area-inset-bottom) 0;
    display: grid;
    grid-template-rows: 42px minmax(0, 1fr);
    border: 0;
    box-shadow: none;
  }
  .coin-preview .chart-header {
    gap: 7px;
    padding: 0 8px;
  }
  .coin-preview .chart-back-button {
    width: 28px;
    min-width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: #bcbcbc;
  }
  .coin-preview .chart-back-button svg { width: 16px; height: 16px; }
  .coin-preview .chart-window-button { display: none; }
  .coin-preview .chart-symbol { font-size: 14px; }
  .coin-preview .chart-metrics { gap: 2px; }
  .coin-preview .chart-volume-chip { display: none; }
  .coin-preview .wall-status { top: 6px; right: 8px; }
  .drawing-toolbar { width: 44px; padding: 5px; }
  .drawing-dock.open .drawing-dock-toggle { left: 44px; }
  .drawing-tool { width: 34px; height: 34px; }
  .drawing-tool::after { display: none; }
  .chart-drawing-measure-text { font-size: 8px; }
  .coin-preview .mobile-price-scale-handle {
    position: absolute;
    z-index: 7;
    top: 0;
    right: 0;
    bottom: 0;
    width: 58px;
    display: block;
    border: 0;
    outline: 0;
    background: transparent;
    cursor: ns-resize;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
  }
  .coin-preview .mobile-price-scale-handle::after {
    content: "↕";
    position: absolute;
    top: 50%;
    right: 2px;
    width: 15px;
    height: 28px;
    display: grid;
    place-items: center;
    transform: translateY(-50%);
    border: 1px solid #353535;
    border-radius: 3px;
    background: rgba(20, 20, 20, .78);
    color: #6f6f6f;
    font-size: 11px;
  }
  .coin-preview .mobile-price-scale-handle.active::after,
  .coin-preview .mobile-price-scale-handle:focus-visible::after {
    border-color: #52705b;
    color: #a9b4ab;
  }
  .toast {
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    left: 8px;
    max-width: none;
  }
}
