/* Ночная тема: включается атрибутом <html data-mode="dark"> (кнопка 🌙/☀️, static/mode.js).
   Один файл для кабинета (style.css), публичного сайта (site.css) и инструкций (help.css).
   Анимации в инструкциях (demos.css) остаются светлыми — это «скриншоты» окон. */

/* ---------- кабинет ---------- */
html[data-mode="dark"] body,
html[data-mode="dark"] body[data-theme] {
  --bg: #0f1714;
  --panel: #18221e;
  --ink: #e4eeea;
  --muted: #93a59e;
  --line: #27352f;
  --brand: #1f9a74;
  --brand-2: #26ad84;
  --brand-soft: #173a2f;
  --ok: #3ccf86;
  --ok-soft: #133528;
  --danger: #ff6b63;
  --danger-soft: #3b1d1c;
  --warn: #e8b35a;
  --warn-soft: #3a2f18;
  --shadow: 0 1px 3px rgba(0, 0, 0, .4);
  color-scheme: dark;
}
html[data-mode="dark"] a:not(.b):not(.btn):not(.sp-btn):not(.tile) { color: #4cd3a5; }
html[data-mode="dark"] .btn, html[data-mode="dark"] a.btn, html[data-mode="dark"] .b-main { color: #fff; }
html[data-mode="dark"] code,
html[data-mode="dark"] .search input,
html[data-mode="dark"] .btn.ghost,
html[data-mode="dark"] .langs,
html[data-mode="dark"] .pre,
html[data-mode="dark"] td input.cell { background: #223029; color: var(--ink); }
html[data-mode="dark"] .btn.ghost, html[data-mode="dark"] a.btn.ghost { color: var(--ink); }
html[data-mode="dark"] .btn.ghost:hover { background: #2b3b33; }
html[data-mode="dark"] input, html[data-mode="dark"] select, html[data-mode="dark"] textarea,
html[data-mode="dark"] .topbar .shop-switch select,
html[data-mode="dark"] .search input:focus,
html[data-mode="dark"] td input.cell:focus,
html[data-mode="dark"] .name-in:focus { background: #131c18; color: var(--ink); border-color: var(--line); }
html[data-mode="dark"] input::placeholder, html[data-mode="dark"] textarea::placeholder { color: #6f817a; }
html[data-mode="dark"] .nav a:hover { background: #223029; }
html[data-mode="dark"] .langs a.on { background: #18221e; color: #4cd3a5; }
html[data-mode="dark"] .pill, html[data-mode="dark"] .st { background: #26332d; color: var(--muted); }
html[data-mode="dark"] .pill.on { background: var(--ok-soft); color: var(--ok); }
html[data-mode="dark"] .drop { background: #131c18; border-color: #34443c; }
html[data-mode="dark"] .ptable td input.sku-in { background: #2c2617; }
html[data-mode="dark"] .link-box { background: #241f12; border-color: #5c4a20; }
html[data-mode="dark"] .ptable th.chk, html[data-mode="dark"] .ptable td.chk,
html[data-mode="dark"] .ptable th:nth-child(2), html[data-mode="dark"] .ptable td:nth-child(2),
html[data-mode="dark"] .drawer { background: var(--panel); }
html[data-mode="dark"] .flash.ok { color: #5fe0a2; }
html[data-mode="dark"] .flash.warn, html[data-mode="dark"] .posb.pn { color: #f0c47a; }
/* цветные значки меню и плиток — тёмные подложки */
html[data-mode="dark"] .t-blue { background: #1a2a45; color: #7aa7ff; }
html[data-mode="dark"] .t-orange { background: #3a2a17; color: #ffaa4d; }
html[data-mode="dark"] .t-green { background: #143426; color: #4fd690; }
html[data-mode="dark"] .t-purple { background: #2c2142; color: #b591ff; }
html[data-mode="dark"] .t-teal { background: #12322f; color: #4fd1cf; }
html[data-mode="dark"] .t-pink { background: #3a1c29; color: #ff7aa8; }
html[data-mode="dark"] .t-gray { background: #26302c; color: #b3c2bc; }
html[data-mode="dark"] .t-yellow { background: #362f14; color: #f0cf4f; }
html[data-mode="dark"] [data-theme="green"] .t-blue { background: #173a2f; color: #4cd3a5; }
@media (min-width: 901px) {
  html[data-mode="dark"] [data-theme="green"] .side { background: #0d2a22; }
}

/* ---------- публичный сайт ---------- */
html[data-mode="dark"] body:not([data-theme]) {
  --ink: #e4f1ec;
  --paper: #0f1714;
  --mist: #132520;
  --muted: #9cb7ad;
  --line: #24382f;
  --danger: #ff6b63;
}
html[data-mode="dark"] .s-head { background: rgba(15, 23, 20, .94); }
html[data-mode="dark"] .s-lang > div,
html[data-mode="dark"] .s-head.open .s-nav { background: #18221e; }
html[data-mode="dark"] .sec-ink, html[data-mode="dark"] .s-foot { background: #0a120f; }
html[data-mode="dark"] .tag, html[data-mode="dark"] .offer { background: #18241f; }
html[data-mode="dark"] .field input, html[data-mode="dark"] .field textarea, html[data-mode="dark"] .field select {
  background: #131c18; color: var(--ink); }
html[data-mode="dark"] .final, html[data-mode="dark"] .final h2,
html[data-mode="dark"] .b-sun { color: #0f2a22; }
html[data-mode="dark"] .final a:not(.b) { color: #0f2a22; }
html[data-mode="dark"] .err-box { background: #3b1d1c; }
html[data-mode="dark"] .corridor .dot { border-color: #0f1714; }
html[data-mode="dark"] .b-ghost { color: var(--ink); }

/* ---------- инструкции и блок поддержки (help.css) ---------- */
html[data-mode="dark"] .hp { --hp-line: #27352f; --hp-soft: #18221e; --hp-muted: #93a59e; --hp-brand: #4cd3a5; }
html[data-mode="dark"] .hp-search input,
html[data-mode="dark"] .hp-q,
html[data-mode="dark"] .hp-steps > .hp-topic,
html[data-mode="dark"] .hp-acc .hp-topic { background: #18221e; color: var(--ink, #e4eeea); }
html[data-mode="dark"] .hp-tip { background: #2c2617; }
html[data-mode="dark"] .hp-num { background: #1f9a74; }

/* ---------- логотип: на тёмном фоне — светлый вариант ---------- */
.brand-logo .brand-full-d { display: none; }
html[data-mode="dark"] .brand-logo .brand-full-l { display: none; }
html[data-mode="dark"] .brand-logo .brand-full-d { display: block; }

/* ---------- кнопка переключения ---------- */
.mode-btn { flex: none; width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line, #e3ece8); background: transparent;
  display: inline-grid; place-items: center; cursor: pointer; font-size: 18px; line-height: 1; padding: 0; color: inherit; }
.mode-btn:hover { background: rgba(127, 127, 127, .12); }
.mode-btn .sun { display: none; }
html[data-mode="dark"] .mode-btn .sun { display: inline; }
html[data-mode="dark"] .mode-btn .moon { display: none; }
