/* Task Brain — общие токены приложения.
   Светлая тема по умолчанию; тёмная — по системе или <html data-theme="dark">. Меняйте цвета только здесь.
   Бренд — индиго (сине-фиолетовый); единственный тёплый акцент — янтарная точка из знака (--accent):
   «Мой день», подсказки, отметка «сегодня». */

@font-face {
  font-family: 'Onest';
  src: url('/shared/fonts/onest-cyrillic-wght-normal.woff2') format('woff2-variations');
  font-weight: 100 900; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Onest';
  src: url('/shared/fonts/onest-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20B8, U+20BD, U+2122, U+2190-2199, U+2212, U+2215;
}

:root {
  /* бренд: индиго */
  --brand-50: #eef0ff; --brand-100: #e0e3ff; --brand-200: #c7cbfe; --brand-300: #a5abfc;
  --brand-400: #8188f8; --brand-500: #6366f1; --brand-600: #4b4ce0; --brand-700: #3e3cc4; --brand-800: #33339e;
  --brand: #4B4CE0;            /* знак, акценты, выбранный пункт */
  --primary: #3e3cc4;          /* кнопки и ссылки: белый текст 8:1 */
  --primary-hover: #33339e;
  --on-primary: #ffffff;
  --primary-soft: #eceeff;     /* фон выбранного/подсветки */
  --primary-soft-ink: #33339e;

  /* акцент: янтарь из знака — «Мой день», подсказки, «сегодня». Не для текста на белом. */
  --accent: #FFB020; --accent-soft: #fff3d6; --accent-ink: #8a5a00;

  /* нейтральные — холодные, с каплей синего */
  --bg: #f5f6fb;               /* фон страницы */
  --surface: #ffffff;          /* карточки, панели, боковая колонка */
  --surface-2: #eef0f7;        /* поля, полосы, наведение */
  --surface-3: #e3e6f0;
  --line: #e2e5ee;             /* разделители */
  --line-strong: #cdd1de;
  --ink: #141629;              /* основной текст */
  --ink-2: #363a52;
  --muted: #5d6178;            /* вторичный текст: 6:1 на белом */
  --faint: #969ab0;            /* подписи на крупном, плейсхолдеры */

  /* смысловые */
  --ok: #1f8a5f; --ok-soft: #dcf3e8;        /* выполнено */
  --warn: #a8590a; --warn-soft: #fff0cf;
  --danger: #c0262d; --danger-soft: #fde8e8; /* просрочено, удалить */
  --info: #2563eb; --info-soft: #e3ecff;

  /* важность задачи: 3 высокая · 2 средняя · 1 низкая */
  --p3: #d63c45; --p2: #d98a0b; --p1: #2f6fe4;

  /* цвета списков, меток и умных списков — коды из GET /api/meta → colors */
  --c-indigo: #4b4ce0; --c-blue: #2563eb; --c-sky: #0284c7; --c-teal: #0f8f84; --c-green: #1f9d55; --c-lime: #5f8f0a;
  --c-amber: #b7791f; --c-orange: #dd6b20; --c-red: #d63c45; --c-pink: #d0378e; --c-purple: #8b45d6; --c-gray: #6b6f80;

  /* форма */
  --r-xs: 6px; --r-sm: 10px; --r: 14px; --r-lg: 20px; --r-xl: 28px; --r-full: 999px;
  --sh-1: 0 1px 2px rgba(20,22,41,.06), 0 1px 1px rgba(20,22,41,.04);
  --sh-2: 0 4px 16px rgba(20,22,41,.08), 0 1px 3px rgba(20,22,41,.06);
  --sh-3: 0 18px 50px rgba(20,22,41,.18), 0 4px 12px rgba(20,22,41,.08);
  --ring: 0 0 0 3px rgba(75,76,224,.35);

  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --fs-xs: 12px; --fs-sm: 13px; --fs: 15px; --fs-md: 17px; --fs-lg: 20px; --fs-xl: 26px; --fs-2xl: 34px; --fs-3xl: 46px;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px;

  /* раскладка */
  --side-w: 272px;             /* боковая колонка ПК */
  --panel-w: 440px;            /* панель задачи справа на ПК */
  --tab-h: 64px;               /* нижнее меню телефона */

  --ease: cubic-bezier(.2,.8,.2,1);
  --t-fast: 120ms; --t: 200ms; --t-slow: 360ms;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #8f93ff;
    --primary: #9da1ff; --primary-hover: #b9bcff; --on-primary: #10123a;
    --primary-soft: #23264d; --primary-soft-ink: #c5c8ff;
    --accent: #ffb84a; --accent-soft: #3a2c08; --accent-ink: #ffd47a;
    --bg: #0e1018; --surface: #171a26; --surface-2: #1f2331; --surface-3: #292e3f;
    --line: #262a3a; --line-strong: #363b50;
    --ink: #eef0f8; --ink-2: #ced2e2; --muted: #9ea3b8; --faint: #6c7187;
    --ok: #5fb893; --ok-soft: #11372a; --warn: #f0b44c; --warn-soft: #3a2a0c;
    --danger: #f2777b; --danger-soft: #3d1416; --info: #7aa7ff; --info-soft: #14244a;
    --p3: #ff7b82; --p2: #f6c453; --p1: #6ea2ff;
    --c-indigo: #8f93ff; --c-blue: #6ea2ff; --c-sky: #5cc2f5; --c-teal: #4fd1c0; --c-green: #5fd38d; --c-lime: #a6d94a;
    --c-amber: #f6c453; --c-orange: #fb9a5b; --c-red: #ff7b82; --c-pink: #f77fc0; --c-purple: #c08cff; --c-gray: #a3a7b8;
    --sh-1: 0 1px 2px rgba(0,0,0,.4); --sh-2: 0 6px 20px rgba(0,0,0,.45); --sh-3: 0 20px 60px rgba(0,0,0,.6);
    --ring: 0 0 0 3px rgba(143,147,255,.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #8f93ff;
  --primary: #9da1ff; --primary-hover: #b9bcff; --on-primary: #10123a;
  --primary-soft: #23264d; --primary-soft-ink: #c5c8ff;
  --accent: #ffb84a; --accent-soft: #3a2c08; --accent-ink: #ffd47a;
  --bg: #0e1018; --surface: #171a26; --surface-2: #1f2331; --surface-3: #292e3f;
  --line: #262a3a; --line-strong: #363b50;
  --ink: #eef0f8; --ink-2: #ced2e2; --muted: #9ea3b8; --faint: #6c7187;
  --ok: #5fb893; --ok-soft: #11372a; --warn: #f0b44c; --warn-soft: #3a2a0c;
  --danger: #f2777b; --danger-soft: #3d1416; --info: #7aa7ff; --info-soft: #14244a;
  --p3: #ff7b82; --p2: #f6c453; --p1: #6ea2ff;
  --c-indigo: #8f93ff; --c-blue: #6ea2ff; --c-sky: #5cc2f5; --c-teal: #4fd1c0; --c-green: #5fd38d; --c-lime: #a6d94a;
  --c-amber: #f6c453; --c-orange: #fb9a5b; --c-red: #ff7b82; --c-pink: #f77fc0; --c-purple: #c08cff; --c-gray: #a3a7b8;
  --sh-1: 0 1px 2px rgba(0,0,0,.4); --sh-2: 0 6px 20px rgba(0,0,0,.45); --sh-3: 0 20px 60px rgba(0,0,0,.6);
  --ring: 0 0 0 3px rgba(143,147,255,.45);
  color-scheme: dark;
}

/* ── база ── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 var(--fs)/1.45 var(--font); font-feature-settings: 'tnum' 0;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -0.01em; font-weight: 700; }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; max-width: 100%; }
.ic { display: inline-flex; flex: none; line-height: 0; }
.num, .tnum { font-variant-numeric: tabular-nums; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-xs); }
::selection { background: var(--brand-200); color: #141629; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
