/* tokens.css — единственный источник значений для UI Bingo Card Maker v1.
 * Линия: tools/design-line (светло + округло, один акцент, тёмной темы нет).
 * Проверка из корня репо: node ../tools/design-line/contrast-check.mjs tokens.css  (tools/ лежит рядом, D:\Буткамп	ools).
 * Акцент #d81b60 — со знака продукта (E0 07.09, буква владелицы); в UI один акцент на экран.
 * Значение объявлено в product.config.mjs (accent) и повторено здесь как --primary; тинт --primary-muted = акцент 12 % на белом.
 */
:root {
  /* --- поверхность (светлая, единственная тема) --- */
  --background: #ffffff;
  --foreground: #1f2328;          /* не чистый чёрный: мягче на белом */
  --card: #f7f8fa;                /* вторичная поверхность; НЕ рамка-в-рамке */
  --card-foreground: #1f2328;
  --muted: #eef0f3;
  --muted-foreground: #59616b;

  /* --- акцент: ОДИН на экран --- */
  --primary: #d81b60;             /* accent from product.config.mjs; активное состояние, primary-кнопка, фокус (Р-71) */
  --primary-foreground: #ffffff;
  --primary-muted: #fae4ec;       /* #d81b60 12 % на белом: чипы, заливка дропзоны, тинт строки */
  --destructive: #b3261e;
  --destructive-foreground: #ffffff;

  /* --- границы и фокус --- */
  --border: #dde1e6;
  --ring: var(--primary);

  /* --- форма: округло по вкусу владелицы --- */
  --radius: 12px;
  --radius-sm: 8px;
  --border-width: 1px;

  /* --- шрифт --- */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --text-sm: 12px;
  --text-base: 14px;
  --text-lg: 16px;
  /* Число — главный объект этого продукта, поэтому у него свой размер и своя ширина цифр. */
  --text-number: 22px;
  --tracking-number: 0.04em;

  /* --- отступы (4px сетка) --- */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px;  --space-4: 16px;  --space-6: 24px;

  /* --- поверхность попапа --- */
  --surface-width: 360px;         /* высота НЕ фиксируется: следует состоянию (правило 30.08 №3) */
  --void-max: 24px;               /* порог остатка пустоты снизу/по бокам для compact-check */
  --list-max-height: 320px;       /* единственный контейнер с внутренней прокруткой */

  /* --- состояние пустого ввода (референс: дроп-зона донора QR) --- */
  --dropzone-height: 168px;
  --border-width-dropzone: 1.5px;
  --primary-muted-dropzone: color-mix(in srgb, var(--primary-muted) 55%, transparent);

  /* --- моушен: попап не анимируется при открытии (daily+) --- */
  --duration-fast: 120ms;
  --duration-max: 300ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);

  /* --- цели нажатия --- */
  --target-min: 44px;             /* primary-действия; пол WCAG 24px для остальных */
  --target-compact: 24px;

  /* --- размеры контролов и глифов (компонентный CSS не держит сырых px) --- */
  --control: 32px;                /* иконка-источник, Copy в строке результата */
  --btn-height: 36px;             /* обычная кнопка состояния */
  --icon: 18px;                   /* глиф в строке источников */
  --icon-sm: 16px;                /* глиф Copy */
  --meta-gap: 2px;                /* межстрочный зазор мета-строк */

  /* --- добавлено на D07/H3-07: словарь классов реестра (DESIGN.md) --- */
  --ok: #1f7a3f;                  /* только точка-маркер перед именем готового файла */
  --warning-foreground: #8a4b00;  /* только строка fidelity — что перезапись не сохранила */
  --radius-xs: 6px;               /* марка бренда, плитка страницы, бейдж PRO, глиф файла */
  --radius-pill: 999px;           /* чипы и дорожка прогресса — токен, не кнопка */
  --outline-width: 2px;           /* фокус-кольцо и внутренняя обводка выбранной плитки */
  --text-xl: 20px;                /* заголовок пустого состояния, один раз на экран */
  --space-8: 32px;
  --content-max: 960px;           /* ширина реестра; шире — колонки расползаются */
  --shadow: 0 4px 14px rgba(31, 35, 40, 0.08), 0 1px 2px rgba(31, 35, 40, 0.06);
  --row-height: 56px;
  --strip-height: 64px;           /* полоса приёма, когда файл уже есть */
  --range-width: 220px;           /* главный ввод продукта */
  --range-min: 120px;
  --num-width: 84px;              /* поле счётчика: страниц на часть / число частей */
  --pw-max: 260px;
  --tile-min: 84px;               /* плитка сетки страниц, 3:4 */
  --bar-height: 6px;
  --dot: 8px;
  --mark: 22px;
  --glyph-width: 28px;
  --glyph-height: 34px;
  --glyph-fold: 9px;
  --row-selected: color-mix(in srgb, var(--primary-muted) 45%, transparent);
  --row-error: color-mix(in srgb, #fbe9e7 60%, transparent);
  --pages-ground: color-mix(in srgb, var(--primary-muted) 25%, transparent);
}

/* @pair --foreground on --background */
/* @pair --card-foreground on --card */
/* @pair --muted-foreground on --background */
/* @pair --muted-foreground on --card */
/* @pair --primary-foreground on --primary */
/* @pair --destructive-foreground on --destructive */
/* @pair --primary on --primary-muted */
/* @pair --primary on --background */

/* One frame at a time (owner rule 10.09): every focusable control draws its ring ON the border,
   never outside it; nothing falls back to the browser ring. Product rules may override. */
:where(input, select, textarea, button, [tabindex]):focus-visible {
  outline: var(--outline-width, 2px) solid var(--ring, currentColor);
  outline-offset: calc(-1 * var(--border-width, 1px));
}

:where(input, select, textarea)[aria-invalid='true']:focus-visible {
  outline-color: var(--destructive, currentColor);
}

/* Used only when the product tokens.css has no prefers-color-scheme block. */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --background: #14171b;
    --foreground: #e6e9ee;
    --card: #1c2027;
    --card-foreground: #e6e9ee;
    --muted: #262b33;
    --muted-foreground: #9aa3ae;
    --border: #333a44;
    --primary-foreground: #0a1b33;
  }
}
