:root {
  color-scheme: dark;
  --bg: #010101;
  --bg-1: #030304;
  --plot-bg: #000000;
  --surface: #07080a;
  --surface-2: #0a0b0e;
  --surface-3: #101116;
  --edge: rgba(220, 226, 235, 0.13);
  --edge-soft: rgba(220, 226, 235, 0.075);
  --hover: rgba(235, 239, 245, 0.065);
  --active: rgba(235, 239, 245, 0.11);
  --text: #f0f3f7;
  --muted: #9da4ae;
  --dim: #68707b;
  --gold: #d99a28;
  --gold-soft: #a96d1e;
  --gold-strong: #f0c96a;
  --gold-peak: #ffe7a6;
  --bronze: #8b551d;
  --bronze-strong: #bf792c;
  --silver: #c5cbd4;
  --silver-light: #f2f5fa;
  --error: #f0b0a1;
  --brand-gold: var(--gold);
  --brand-gold-soft: rgba(217, 154, 40, 0.24);
  --brand-silver: var(--silver);
  --brand-silver-soft: rgba(197, 203, 212, 0.24);
  --chrome-text: #f3f6fa;
  --chrome-text-muted: #aeb6c2;
  --glass-bg: rgba(7, 8, 10, 0.74);
  --glass-bg-strong: rgba(10, 11, 14, 0.88);
  --glass-bg-soft: rgba(15, 17, 21, 0.52);
  --chrome-rail-start: rgba(18, 20, 24, 0.94);
  --chrome-rail-mid: rgba(10, 11, 14, 0.96);
  --chrome-rail-end: rgba(4, 5, 7, 0.98);
  --chrome-rail-top: rgba(18, 20, 24, 0.95);
  --chrome-rail-bottom: rgba(5, 6, 8, 0.98);
  --chrome-border: rgba(220, 226, 235, 0.14);
  --chrome-border-soft: rgba(220, 226, 235, 0.09);
  --chrome-border-faint: rgba(220, 226, 235, 0.05);
  --chrome-border-strong: rgba(232, 237, 246, 0.20);
  --chrome-highlight: rgba(220, 226, 235, 0.06);
  --chrome-highlight-soft: rgba(220, 226, 235, 0.038);
  --chrome-highlight-strong: rgba(232, 237, 246, 0.10);
  --chrome-glow: rgba(220, 226, 235, 0.095);
  --chrome-wash-faint: rgba(220, 226, 235, 0.010);
  --chrome-wash: rgba(220, 226, 235, 0.018);
  --chrome-wash-strong: rgba(220, 226, 235, 0.026);
  --chrome-wash-active: rgba(220, 226, 235, 0.070);
  --chrome-line: var(--chrome-border);
  --chrome-line-soft: var(--chrome-border-soft);
  --chrome-line-strong: var(--chrome-border-strong);
  --chrome-icon: #f3f6fa;
  --glass-border: var(--chrome-border);
  --glass-border-strong: var(--chrome-border-strong);
  --glass-border-accent: rgba(240, 201, 106, 0.28);
  --glass-highlight: var(--chrome-highlight);
  --glass-highlight-soft: var(--chrome-highlight-soft);
  --glass-shadow: 0 18px 42px rgba(0, 0, 0, 0.46), inset 0 1px 0 var(--glass-highlight), inset 0 -1px 0 rgba(0, 0, 0, 0.54);
  --glass-shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.34), inset 0 1px 0 var(--glass-highlight-soft);
  --glass-blur: 14px;
  --glass-sheen: linear-gradient(135deg, var(--chrome-highlight), transparent 34%, var(--chrome-border-faint) 64%, transparent 100%);
  --font-ui: Sora, "Segoe UI Variable Text", "Segoe UI", Arial, sans-serif;
  --font-display: Sora, "Segoe UI Variable Display", "Segoe UI", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --topbar-h: 52px;
  --bottom-h: 30px;
  --left-rail-w: 42px;
  --brand-logo-size: 36px;
  --brand-logo-rail-pad: calc((var(--topbar-h) - var(--brand-logo-size)) / 2);
  --brand-logo-word-gap: 10px;
  --brand-word-gap: 4px;
  --brand-word-size: clamp(18px, 0.98vw, 20px);
  --brand-right-gap: var(--toolbar-button-frame-inset);
  --topbar-control-gap: var(--toolbar-button-gap);
  --topbar-control-size: var(--toolbar-button-size);
  --topbar-control-frame-inset: var(--toolbar-button-frame-inset);
  --topbar-linked-control-offset: 0px;
  --chart-price-rail-w: 68px;
  --chart-time-rail-h: 32px;
  --chart-ruler-border: rgba(226, 232, 242, 0.16);
  --chart-ruler-highlight: rgba(255, 255, 255, 0.075);
  --chart-ruler-surface: linear-gradient(180deg, var(--chrome-rail-top), var(--chrome-rail-mid) 48%, var(--chrome-rail-bottom)), var(--chrome-rail-bottom);
  --platform-shell-border: 1px solid var(--chart-ruler-border);
  --toolbar-top-gap: 4px;
  --toolbar-inline-pad: 2px;
  --toolbar-bottom-gap: 6px;
  --toolbar-section-gap: 0px;
  --toolbar-button-size: 38px;
  --toolbar-button-frame-inset: 4px;
  --toolbar-button-gap: 0px;
  --toolbar-divider-gap: 4px;
  --zana-pointer-cursor: url("/assets/ui/zana-pointer-cursor.svg?v=pointer-v2") 7 6, auto;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

html,
body,
body *,
body *::before,
body *::after,
::file-selector-button {
  cursor: var(--zana-pointer-cursor) !important;
}

body {
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  letter-spacing: 0;
  cursor: var(--zana-pointer-cursor);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
  cursor: var(--zana-pointer-cursor);
}

*::-webkit-scrollbar,
*::-webkit-scrollbar-button,
*::-webkit-scrollbar-track,
*::-webkit-scrollbar-track-piece,
*::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-corner,
*::-webkit-resizer {
  cursor: var(--zana-pointer-cursor) !important;
}

button:focus-visible,
input:focus-visible {
  outline: 1px solid var(--gold-strong);
  outline-offset: 2px;
}

.platform-shell {
  display: grid;
  grid-template-columns: var(--left-rail-w) minmax(0, 1fr);
  grid-template-rows: var(--topbar-h) minmax(0, 1fr) var(--bottom-h);
  width: 100vw;
  height: 100vh;
  min-height: 480px;
  overflow: hidden;
  border: var(--platform-shell-border);
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-1) 100%);
}

.platform-main {
  display: grid;
  grid-template-columns: var(--left-rail-w) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) var(--bottom-h);
  grid-column: 1 / -1;
  grid-row: 2 / 4;
  min-width: 0;
  min-height: 0;
  border-top: 0;
}

.left-toolbar {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  grid-column: 1;
  grid-row: 1;
  gap: var(--toolbar-section-gap);
  min-width: 0;
  min-height: 0;
  padding: var(--toolbar-top-gap) var(--toolbar-inline-pad) var(--toolbar-bottom-gap);
  overflow: hidden;
  border: 0;
  border-right: var(--platform-shell-border);
  border-radius: 0;
  background: linear-gradient(180deg, var(--chrome-rail-start), var(--chrome-rail-mid) 52%, var(--chrome-rail-end));
  box-shadow: 8px 0 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(calc(var(--glass-blur) * 0.72)) saturate(124%);
  -webkit-backdrop-filter: blur(calc(var(--glass-blur) * 0.72)) saturate(124%);
}

.left-toolbar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--glass-sheen);
  opacity: 0.16;
}

.left-toolbar::after {
  content: "";
  position: absolute;
  bottom: 0;
  z-index: 0;
  inline-size: 100%;
  block-size: var(--chart-time-rail-h);
  pointer-events: none;
  background: var(--chart-ruler-surface);
}

.toolbar-rail-glow {
  position: absolute;
  inset: 0 0 auto;
  height: 120px;
  pointer-events: none;
  background: radial-gradient(circle at 50% 0%, var(--chrome-glow), transparent 60%);
  opacity: 0.26;
}

.toolbar-group {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  justify-items: center;
  gap: var(--toolbar-button-gap);
}

.toolbar-group {
  padding-bottom: var(--toolbar-section-gap);
}

.drawing-toolbar-group {
  padding-top: 0;
}

.drawing-toolbar-group::after {
  display: none;
}

.toolbar-group::after {
  content: "";
  display: block;
  width: 28px;
  height: 1px;
  margin-block: var(--toolbar-divider-gap);
  background: linear-gradient(90deg, transparent, var(--chrome-line), transparent);
}

.toolbar-bottom {
  margin-top: auto;
  padding-bottom: 0;
}

.toolbar-bottom::after {
  display: none;
}

.tool-button {
  position: relative;
  display: grid;
  place-items: center;
  isolation: isolate;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--chrome-icon);
  cursor: var(--zana-pointer-cursor);
  box-shadow: none;
  transition: color 140ms ease, opacity 140ms ease;
}

.tool-button::after {
  content: "";
  position: absolute;
  inset: var(--toolbar-button-frame-inset);
  z-index: 0;
  border: 1px solid var(--chrome-line-soft);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(18, 20, 24, 0.92), rgba(6, 7, 9, 0.94)),
    var(--chrome-wash);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.34), inset 0 1px 0 var(--chrome-highlight);
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.tool-button {
  width: var(--toolbar-button-size);
  height: var(--toolbar-button-size);
}

.tool-button svg {
  position: relative;
  z-index: 1;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool-button svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.85;
}

.tool-button:hover:not(:disabled),
.tool-button.active {
  color: var(--chrome-icon);
}

.tool-button:hover:not(:disabled)::after,
.tool-button.active::after {
  background:
    linear-gradient(180deg, rgba(28, 30, 35, 0.95), rgba(8, 9, 12, 0.96)),
    var(--chrome-wash-strong);
  border-color: var(--chrome-line-strong);
  box-shadow: 0 0 12px var(--chrome-glow), inset 0 1px 0 var(--chrome-highlight-strong);
}

.tool-button:disabled {
  color: var(--chrome-icon);
  cursor: var(--zana-pointer-cursor);
  opacity: 0.42;
}

.pointer-tool-icon {
  width: 20px;
  height: 20px;
}

.pointer-tool-shadow {
  fill: none;
  stroke: #050608;
  stroke-width: 6.2;
}

.pointer-tool-mark {
  fill: #07090c;
  stroke: #f4f7fb;
  stroke-width: 2.45;
}

.tool-button:disabled::after {
  border-color: var(--chrome-border-faint);
  background: var(--chrome-wash-faint);
  box-shadow: none;
}

.tool-button:disabled.active::after {
  border-color: var(--chrome-border-faint);
  background: var(--chrome-wash-faint);
  box-shadow: none;
}

.bottom-bar {
  display: flex;
  align-items: center;
  grid-column: 1 / -1;
  grid-row: 3;
  z-index: 12;
  min-width: 0;
  overflow: hidden;
  padding: 0 10px;
  background:
    linear-gradient(180deg, var(--chrome-rail-top), var(--chrome-rail-mid) 48%, var(--chrome-rail-bottom)),
    var(--chrome-rail-bottom);
  border: 0;
  border-top: var(--platform-shell-border);
  color: var(--chrome-text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  box-shadow: 0 -14px 30px rgba(0, 0, 0, 0.35), inset 0 1px 0 var(--chrome-highlight);
  backdrop-filter: blur(calc(var(--glass-blur) * 0.72)) saturate(122%);
  -webkit-backdrop-filter: blur(calc(var(--glass-blur) * 0.72)) saturate(122%);
}

.bottom-scroll {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: calc(var(--bottom-h) - 2px);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(220, 226, 235, 0.42) rgba(255, 255, 255, 0.035);
}

.bottom-scroll::-webkit-scrollbar {
  height: 5px;
}

.bottom-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.035);
}

.bottom-scroll::-webkit-scrollbar-thumb {
  background: rgba(220, 226, 235, 0.54);
  border-radius: 999px;
}

.bottom-item,
.bottom-metrics-cluster {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 5px;
  white-space: nowrap;
  line-height: 1;
}

.bottom-metrics-cluster {
  gap: 7px;
}

.bottom-metrics-cluster.hidden {
  display: none;
}

.bottom-item span {
  color: var(--chrome-text-muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.bottom-item strong {
  color: var(--chrome-text);
  font-size: 11.5px;
  font-weight: 900;
}

.bottom-item {
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid var(--chrome-border-soft);
  border-radius: 7px;
  background:
    linear-gradient(180deg, var(--chrome-highlight-soft), var(--chrome-wash)),
    var(--chrome-wash);
  box-shadow: inset 0 1px 0 var(--chrome-highlight-soft);
}

.bottom-item[hidden] {
  display: none;
}

.bottom-item:hover {
  border-color: var(--chrome-line-strong);
  background:
    linear-gradient(180deg, var(--chrome-wash-active), var(--chrome-wash-strong)),
    var(--chrome-wash-strong);
}

.bottom-bar.is-empty .bottom-item {
  cursor: var(--zana-pointer-cursor);
  opacity: 0.70;
  border-color: var(--chrome-border-faint);
  background: var(--chrome-wash-faint);
  box-shadow: none;
}

.bottom-bar.is-empty .bottom-item:hover {
  border-color: var(--chrome-border-faint);
  background: var(--chrome-wash-faint);
}

.bottom-bar.is-empty .bottom-item span,
.bottom-bar.is-empty .bottom-item strong {
  color: var(--chrome-text-muted);
}

.bottom-mode strong {
  color: var(--gold-strong);
}

.bottom-live-word {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 22px;
  margin-left: 10px;
  padding: 0 9px;
  border: 1px solid var(--chrome-border-soft);
  border-radius: 7px;
  background:
    linear-gradient(180deg, var(--chrome-highlight-soft), var(--chrome-wash)),
    var(--chrome-wash);
  box-shadow: inset 0 1px 0 var(--chrome-highlight-soft);
  color: #31d47d;
  font-size: 10.5px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.bottom-live-word.is-live {
  border-color: rgba(49, 212, 125, 0.55);
  background:
    linear-gradient(180deg, rgba(49, 212, 125, 0.20), rgba(49, 212, 125, 0.08)),
    var(--chrome-wash);
  color: #31d47d;
}

.bottom-live-word.is-offline {
  border-color: rgba(242, 88, 92, 0.58);
  background:
    linear-gradient(180deg, rgba(242, 88, 92, 0.20), rgba(242, 88, 92, 0.08)),
    var(--chrome-wash);
  color: #ff686d;
}

.bottom-live-word[hidden] {
  display: none;
}

@media (max-width: 860px) {
  :root {
    --topbar-h: 54px;
    --left-rail-w: 40px;
    --bottom-h: 28px;
    --brand-logo-size: 32px;
    --brand-logo-word-gap: 0px;
    --brand-right-gap: 0px;
    --topbar-control-gap: 0px;
    --toolbar-top-gap: 4px;
    --toolbar-bottom-gap: 6px;
    --toolbar-section-gap: 0px;
    --toolbar-button-size: 34px;
    --toolbar-button-frame-inset: 4px;
    --toolbar-button-gap: 0px;
    --toolbar-divider-gap: 4px;
  }

  .platform-shell {
    height: 100dvh;
    min-height: 100vh;
  }

  .platform-main {
    grid-template-columns: var(--left-rail-w) minmax(0, 1fr);
  }

  .tool-button svg {
    width: 16px;
    height: 16px;
  }

  .bottom-bar {
    padding: 0 7px;
    font-size: 10px;
  }

  .bottom-scroll {
    gap: 7px;
  }

  .bottom-live-word {
    margin-left: 7px;
    padding: 0 7px;
  }
}

@media (max-width: 480px) {
  :root {
    --topbar-h: 50px;
    --left-rail-w: 38px;
    --brand-logo-size: 29px;
    --toolbar-top-gap: 3px;
    --toolbar-bottom-gap: 5px;
    --toolbar-section-gap: 0px;
    --toolbar-button-size: 32px;
    --toolbar-button-frame-inset: 3px;
    --toolbar-button-gap: 0px;
    --toolbar-divider-gap: 3px;
  }

  .bottom-item span {
    font-size: 9px;
  }

  .bottom-item strong {
    font-size: 10px;
  }

  .bottom-live-word {
    font-size: 10px;
  }
}
