/* QuantMap terminal, rebuilt in code (src/js/terminal.js). Everything is scoped under .qmt.
   --u scales the chrome with the container (set by the module); --ph is the panel header height. */
.qmt {
  --u: 1; --ph: 34px;
  --qmt-bg: #050607; --qmt-panel: #08090B; --qmt-line: rgba(255,255,255,.08); --qmt-line-2: rgba(255,255,255,.12);
  --qmt-ink: #F2F4F5; --qmt-ink-2: #A3AAB0; --qmt-ink-3: #7F878E; --qmt-blue: #4A8DF8;
  position: relative; display: flex; flex-direction: column; width: 100%; height: 100%; min-height: 0;
  background: var(--qmt-panel); border-radius: 12px; overflow: hidden;
  font-family: 'Geist', ui-sans-serif, system-ui, -apple-system, sans-serif; color: var(--qmt-ink);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums; user-select: none; -webkit-user-select: none; contain: layout paint;
}
.qmt *, .qmt *::before, .qmt *::after { box-sizing: border-box; }
/* the window frame sits above everything (the workspace background would hide an inset shadow on .qmt) */
.qmt::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 5;
  box-shadow: inset 0 0 0 1px var(--qmt-line), inset 0 1px 0 rgba(255,255,255,.035); }
.qmt .qmt-i { width: calc(15px * var(--u)); height: calc(15px * var(--u)); flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; display: block; }

/* header: logo, name, status */
.qmt-head { flex: none; display: flex; align-items: center; gap: calc(10px * var(--u)); height: calc(44px * var(--u)); padding: 0 calc(16px * var(--u)); border-bottom: 1px solid var(--qmt-line); }
.qmt-logo { width: calc(22px * var(--u)); height: calc(22px * var(--u)); flex: none; display: block; }
.qmt-logo > rect:first-child { fill: #0B0C0E; stroke: rgba(255,255,255,.14); stroke-width: 1.1; }
.qmt-logo .r { fill: #EF4F5A; }
.qmt-logo .g { fill: #00E676; }
.qmt-brand { font-size: calc(14.5px * var(--u)); font-weight: 600; letter-spacing: -.01em; color: var(--qmt-ink); }
.qmt-vsep { flex: none; width: 1px; height: calc(18px * var(--u)); background: var(--qmt-line-2); margin: 0 calc(4px * var(--u)); }
.qmt-status { display: inline-flex; align-items: center; gap: calc(7px * var(--u)); font-size: calc(13px * var(--u)); color: var(--qmt-ink-2); }
.qmt-status i { width: calc(6px * var(--u)); height: calc(6px * var(--u)); border-radius: 50%; background: #00E676; display: block; }

/* toolbar */
.qmt-bar { flex: none; display: flex; align-items: center; gap: calc(8px * var(--u)); height: calc(48px * var(--u)); padding: 0 calc(16px * var(--u)); border-bottom: 1px solid var(--qmt-line); }
.qmt-btn, .qmt-add { display: inline-flex; align-items: center; gap: calc(6px * var(--u)); height: calc(28px * var(--u)); padding: 0 calc(11px * var(--u));
  border-radius: calc(7px * var(--u)); font-size: calc(12.5px * var(--u)); font-weight: 500; color: var(--qmt-ink-2); white-space: nowrap;
  box-shadow: inset 0 0 0 1px var(--qmt-line-2); }
.qmt-btn .qmt-i { width: calc(13px * var(--u)); height: calc(13px * var(--u)); color: var(--qmt-ink-3); }
.qmt-add { color: var(--qmt-blue); background: rgba(59,130,247,.10); box-shadow: inset 0 0 0 1px rgba(74,141,248,.38); padding: 0 calc(13px * var(--u)) 0 calc(10px * var(--u)); }
.qmt-add .qmt-i { width: calc(14px * var(--u)); height: calc(14px * var(--u)); stroke-width: 2; }
.qmt-seg { position: relative; display: inline-flex; align-items: center; gap: calc(8px * var(--u)); }
.qmt-seg .qmt-btn { position: relative; z-index: 1; }
.qmt-ind { position: absolute; left: 0; top: 0; height: calc(28px * var(--u)); width: 0; border-radius: calc(7px * var(--u));
  background: rgba(255,255,255,.075); box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); will-change: transform; z-index: 0; }
.qmt-right { margin-left: auto; display: inline-flex; align-items: center; gap: calc(12px * var(--u)); color: var(--qmt-ink-3); }
.qmt-count { font-size: calc(12.5px * var(--u)); letter-spacing: .01em; color: var(--qmt-ink-3); }
.qmt-right .qmt-i { width: calc(16px * var(--u)); height: calc(16px * var(--u)); }
.qmt-reset { font-size: calc(12.5px * var(--u)); color: var(--qmt-ink-3); }

/* workspace + panels */
.qmt-grid { position: relative; flex: 1 1 auto; min-height: 0; background: var(--qmt-bg); }
.qmt-panel { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; background: var(--qmt-panel);
  border-radius: 10px; box-shadow: inset 0 0 0 1px var(--qmt-line); overflow: hidden; transform-origin: 50% 50%;
  transition: box-shadow .25s cubic-bezier(.16,1,.3,1); }
.qmt-panel.is-hover { box-shadow: inset 0 0 0 1px rgba(255,255,255,.22); }
.qmt-ph { flex: none; position: relative; display: flex; align-items: center; gap: calc(6px * var(--u)); height: var(--ph); margin: 1px 1px 0; padding: 0 calc(10px * var(--u)) 0 calc(6px * var(--u));
  border-bottom: 1px solid var(--qmt-line); white-space: nowrap; overflow: hidden; }
.qmt-grip { color: var(--qmt-ink-3); opacity: .7; width: calc(13px * var(--u)) !important; height: calc(15px * var(--u)) !important; fill: currentColor !important; stroke: none !important; }
.qmt-dot { flex: none; width: calc(6px * var(--u)); height: calc(6px * var(--u)); border-radius: 50%; background: #00E676; margin: 0 calc(3px * var(--u)) 0 0; display: block; }
.qmt-chip { display: inline-flex; align-items: center; gap: calc(3px * var(--u)); height: calc(22px * var(--u)); padding: 0 calc(8px * var(--u)); border-radius: calc(6px * var(--u));
  font-size: calc(12px * var(--u)); font-weight: 500; color: var(--qmt-ink); box-shadow: inset 0 0 0 1px var(--qmt-line-2); background: rgba(255,255,255,.02); }
.qmt-chip .qmt-i { width: calc(12px * var(--u)); height: calc(12px * var(--u)); color: var(--qmt-ink-3); margin-right: calc(-3px * var(--u)); }
.qmt-icons { margin-left: auto; display: inline-flex; align-items: center; gap: calc(13px * var(--u)); color: var(--qmt-ink-3); padding-left: calc(10px * var(--u)); }
.qmt-icons .qmt-i { width: calc(14px * var(--u)); height: calc(14px * var(--u)); }
.qmt-pb { position: relative; flex: 1 1 auto; min-height: 0; margin: 0 1px 1px; overflow: hidden; border-radius: 0 0 9px 9px; }
.qmt-pb canvas { position: absolute; left: 0; top: 0; display: block; }
@media (hover: hover) and (pointer: fine) { .qmt-pb canvas { cursor: crosshair; } }
.qmt-title { position: absolute; left: calc(8px * var(--u)); top: calc(8px * var(--u)); display: flex; align-items: center; gap: calc(5px * var(--u));
  padding: calc(5px * var(--u)) calc(10px * var(--u)) calc(5px * var(--u)) calc(5px * var(--u)); border-radius: calc(7px * var(--u));
  background: rgba(10,11,13,.9); box-shadow: inset 0 0 0 1px var(--qmt-line); pointer-events: none; max-width: calc(100% - 20px * var(--u)); }
.qmt-tgrip { color: var(--qmt-ink-3); opacity: .55; width: calc(11px * var(--u)) !important; height: calc(13px * var(--u)) !important; fill: currentColor !important; stroke: none !important; }
.qmt-tt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.qmt-t1 { white-space: nowrap; }
.qmt-tt b { font-weight: 600; font-size: calc(11.5px * var(--u)); color: var(--qmt-ink); letter-spacing: -.005em; white-space: nowrap; }
.qmt-sym { display: none; font-weight: 500; color: var(--qmt-ink-3); }
.qmt-sub { font-size: calc(10.5px * var(--u)); color: var(--qmt-ink-3); white-space: nowrap; }
.qmt-ohlc { display: none; font-family: 'Geist Mono', ui-monospace, Menlo, monospace; font-size: calc(10px * var(--u)); color: var(--qmt-ink-2); white-space: nowrap; }
.qmt-ohlc i { font-style: normal; color: var(--qmt-ink-3); margin-right: .35em; }
.qmt-title.is-ohlc .qmt-sub { display: none; }
.qmt-title.is-ohlc .qmt-ohlc { display: block; }
/* compact card in Quad / Dual / stacked: one line on a solid chip (no frosted glass); OHLC as a second line only while hovering */
.qmt-panel.is-compact .qmt-title { left: 8px; top: 8px; padding: 6px 10px; gap: 0; border-radius: 7px; background: rgba(8,9,11,.92); max-width: calc(100% - 16px); }
.qmt-panel.is-compact .qmt-tgrip, .qmt-panel.is-compact .qmt-sub { display: none; }
.qmt-panel.is-compact .qmt-sym { display: inline; }
.qmt-panel.is-compact .qmt-t1, .qmt-panel.is-compact .qmt-tt b { font-size: min(calc(11.5px * var(--u)), 12.5px); }
.qmt-panel.is-compact .qmt-ohlc { font-size: min(calc(10px * var(--u)), 11px); margin-top: 2px; }
.qmt-panel.is-compact .qmt-title:not(.is-ohlc) .qmt-ohlc { display: none; }

/* responsive chrome */
.qmt.is-narrow .qmt-cmd { display: none; }
.qmt.is-stack .qmt-sl, .qmt.is-stack .qmt-rx, .qmt.is-stack .qmt-cmd { display: none; }
.qmt.is-stack .qmt-head, .qmt.is-stack .qmt-bar { padding: 0 12px; }
.qmt.is-stack .qmt-bar { gap: 6px; }
.qmt.is-stack .qmt-seg { gap: 6px; }
.qmt.is-stack .qmt-btn, .qmt.is-stack .qmt-add { padding: 0 9px; }
.qmt.is-stack .qmt-add { padding: 0 10px 0 8px; }
.qmt.is-dual .qmt-w1, .qmt.is-stack .qmt-w1 { display: none; }
.qmt.is-stack .qmt-icons { display: none; }
/* phone: branding row, then one row of model chips (44 px targets) that pick the primary chart */
.qmt-chips { display: none; }
.qmt.is-stack .qmt-bar { display: none; }
.qmt.is-stack .qmt-chips { flex: none; display: flex; gap: 8px; padding: 6px 12px 7px; border-bottom: 1px solid var(--qmt-line); }
.qmt-mchip { flex: 1 1 0; min-height: 44px; padding: 0 14px; border-radius: 10px; font: 500 14px/1 'Geist', ui-sans-serif, system-ui, sans-serif; color: var(--qmt-ink-2);
  background: transparent; border: 0; box-shadow: inset 0 0 0 1px var(--qmt-line-2); cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: color .25s cubic-bezier(.16,1,.3,1), background-color .25s cubic-bezier(.16,1,.3,1), box-shadow .25s cubic-bezier(.16,1,.3,1); }
.qmt-mchip.is-on { color: var(--qmt-ink); background: rgba(255,255,255,.075); box-shadow: inset 0 0 0 1px rgba(255,255,255,.22); }
.qmt-mchip:focus-visible { outline: 2px solid var(--qmt-ink); outline-offset: 2px; }
