﻿/* Load Inter when available */
/* Inter лежит у нас (assets/fonts): Google Fonts в РФ доступен не всем, см. fonts/inter.css. */
@import url('../fonts/inter.css?v=20260918');

:root {
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  --r: 16px;
  --r2: 12px;
  --shadow: 0 12px 28px rgba(16, 24, 40, 0.1);
  --shadow2: 0 18px 44px rgba(16, 24, 40, 0.12);
  --accent: #6d4aff;
  --accent2: #7c5cff;
  --good: #22c55e;
  --warn: #f59e0b;
  --bad: #f97316;
  --transition: 160ms ease;
}

:root[data-theme='light'] {
  --bg: #f6f8fc;
  --panel: #ffffff;
  --panel2: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --muted2: #94a3b8;
  --line: rgba(16, 24, 40, 0.12);
  --line2: rgba(16, 24, 40, 0.08);
  --input: #f1f5f9;
  --chip: #f1f5f9;
  --chipText: #334155;
  --ring: rgba(109, 74, 255, 0.18);
  --skeleton: #eef2f7;
  --primary: #6d4aff;
  --primary-soft: rgba(109, 74, 255, 0.14);
}

:root[data-theme='dark'] {
  --bg: #070a15;
  --panel: #0c1224;
  --panel2: #0c1224;
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.62);
  --muted2: rgba(255, 255, 255, 0.44);
  --line: rgba(255, 255, 255, 0.12);
  --line2: rgba(255, 255, 255, 0.08);
  --input: rgba(255, 255, 255, 0.07);
  --chip: rgba(255, 255, 255, 0.08);
  --chipText: rgba(255, 255, 255, 0.8);
  --ring: rgba(109, 74, 255, 0.22);
  --skeleton: rgba(255, 255, 255, 0.09);
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
  --shadow2: 0 20px 50px rgba(0, 0, 0, 0.4);
  --primary: #a78bfa;
  --primary-soft: rgba(167, 139, 250, 0.18);
}

:root[data-theme='oled'] {
  --bg: #111318;
  --panel: #1c1f27;
  --panel2: #1c1f27;
  --text: #e8eaef;
  --muted: #8b93a1;
  --muted2: #6b7380;
  --line: rgba(255, 255, 255, 0.09);
  --line2: rgba(255, 255, 255, 0.06);
  --input: #232730;
  --chip: #232730;
  --chipText: #c5cad2;
  --ring: rgba(139, 92, 246, 0.3);
  --skeleton: rgba(255, 255, 255, 0.06);
  --shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  --shadow2: 0 18px 52px rgba(0, 0, 0, 0.55);
  --primary: #a78bfa;
  --primary-soft: rgba(167, 139, 250, 0.16);
}

/* Третья тема в цикле: те же токены, что и «тёмная» (как было до варианта с #000) */
:root[data-theme='oled'] {
  --bg: #111318;
  --panel: #1c1f27;
  --panel2: #1c1f27;
  --text: #e8eaef;
  --muted: #8b93a1;
  --muted2: #6b7380;
  --line: rgba(255, 255, 255, 0.09);
  --line2: rgba(255, 255, 255, 0.06);
  --input: #232730;
  --chip: #232730;
  --chipText: #c5cad2;
  --ring: rgba(139, 92, 246, 0.3);
  --skeleton: rgba(255, 255, 255, 0.06);
  --shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  --shadow2: 0 18px 52px rgba(0, 0, 0, 0.55);
  --primary: #a78bfa;
  --primary-soft: rgba(167, 139, 250, 0.16);
}

html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  letter-spacing: 0;
}

/* Мобильная панель: общий скролл документа, без «окна» с overflow внутри main */
@media (max-width: 1080px) {
  html {
    height: auto;
    min-height: 100%;
    min-height: 100dvh;
  }
  body {
    height: auto;
    min-height: 100%;
    min-height: 100dvh;
  }
}

* {
  box-sizing: border-box;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
textarea {
  font-family: inherit;
}

/* Icons */
.i {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: middle;
}
.i.muted {
  color: var(--muted2);
}

/* Top progress */
.top-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #2ee59d);
  box-shadow: 0 0 18px rgba(109, 74, 255, 0.3);
  z-index: 120;
  transition: width 180ms ease;
}

/*
 * Мобильный Safari (и часть WebKit): при фокусе в поле с font-size < 16px страница «приближается».
 * Не трогаем viewport (user-scalable), поднимаем минимальный размер шрифта у вводов — обычная практика.
 */
@media screen and (max-width: 767px) {
  textarea,
  select,
  .input,
  .textarea,
  .input-compact,
  .select-modern,
  .dd .dd-toggle,
  .tg-select-trigger,
  input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='color']):not(
      [type='button']
    ):not([type='submit']):not([type='reset']):not([type='image']):not([type='file']):not(
      [type='hidden']
    ) {
    font-size: max(16px, 1em);
  }
}

