/* Obsidian Black (default theme): colour only where it means something — price, candles, alerts, the main action.
   Chosen / active controls are a quiet dark grey with white text instead of a cobalt fill. Loaded after glass.css. */
[data-theme="obsidian"], :root:not([data-theme]) {
  --obs-active: #2A2A2A;
}
:is([data-theme="obsidian"], :root:not([data-theme])) :is(.tfbar button.active, #mTf button.active, .hhq-levs button[aria-pressed="true"]) {
  background: var(--obs-active); color: #FFFFFF;
}
:is([data-theme="obsidian"], :root:not([data-theme])) :is(.icon-btn.active, .tb.active, .icon-btn[aria-pressed="true"], .tb[aria-pressed="true"],
    .drawbar button.active, .drawbar .dg-main.active, .drawbar .dg-main[aria-pressed="true"], #btnFocus[aria-pressed="true"],
    .ds-bar button.on, .ds-bar .ds-act.on, .ds-mi.on, .range-bar button.active,
    #chartTools .compare-wrap.is-on > #btnCompare, #chartTools .tools-more.has-active, #sideStrip .strip-btn.active) {
  background: var(--obs-active); color: #FFFFFF; border-color: transparent;
}
:is([data-theme="obsidian"], :root:not([data-theme])) #mFab { background: #2A2A2A; color: #FFFFFF; border: 1px solid #3A3A3A; }
:is([data-theme="obsidian"], :root:not([data-theme])) .seg > button.active,
:is([data-theme="obsidian"], :root:not([data-theme])) .seg > button[aria-pressed="true"] { background: var(--obs-active); color: #FFFFFF; }

/* Number fields everywhere: no ▲▼ spinners over the digits (arrow keys and the wheel still change the value) */
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* Obsidian focus: a neutral grey edge instead of a cobalt glow; keyboard focus stays clearly visible */
:is([data-theme="obsidian"], :root:not([data-theme])) :is(input:where(:not([type=checkbox]):not([type=radio]):not([type=range])), select, textarea):focus {
  border-color: #5A5A5A; box-shadow: 0 0 0 1px #5A5A5A; outline: none;
}
:is([data-theme="obsidian"], :root:not([data-theme])) :is(button, a, [tabindex]):focus-visible { outline: 2px solid #9A9A9A; outline-offset: 1px; }
:is([data-theme="obsidian"], :root:not([data-theme])) { --focus: 0 0 0 2px #000, 0 0 0 4px #8A8A8A; }

/* native selects get a visible chevron (they looked like plain text fields) */
:is(.hhq-f select, .dd select, .sup-panel select) {
  appearance: none; -webkit-appearance: none; padding-right: 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23A0A0A0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: right 8px center !important; background-size: 12px !important;
}

/* Main action (one per screen): white with black text like TradingView; Graphite keeps cobalt.
   Long / Short keep green / red; the header «Демо-угода» (plain .btn) stays cobalt as the terminal's own CTA. */
:is([data-theme="obsidian"], :root:not([data-theme])) .btn.btn-primary {
  --_bg: var(--btn-primary-bg); --_fg: var(--btn-primary-fg); --_bd: transparent; --_bg-h: var(--btn-primary-hover); font-weight: 600;
}
:is([data-theme="obsidian"], :root:not([data-theme])) .btn.btn-primary:focus-visible { outline: 2px solid #9A9A9A; outline-offset: 2px; }
:is([data-theme="obsidian"], :root:not([data-theme])) .toast { background: var(--toast-bg); }
:is([data-theme="obsidian"], :root:not([data-theme])) .toast:not(.success, .error, .alert, .warn) { border-left-color: #5A5A5A; }
