/* PRLab · дизайн-система сайта: токены (цвета, шрифты, отступы) и компоненты с классами pl-. Свои правки сайта — в site.css и static/site/*.css. */
/* PRLab · токены. Одна светлая тема, как у админки, которую клиент принял.
   Контраст текстовых пар проверен: не ниже 4.5:1 на тех фонах, что указаны в комментариях. */
@import url("https://fonts.googleapis.com/css2?family=Golos+Text:wght@400;500;600;700&family=Cascadia+Mono:wght@400;700&display=swap");

:root {
  /* поверхности */
  --surface: #f4f5f8;          /* фон страницы */
  --surface-raised: #ffffff;   /* карточки, таблицы, поля, верхняя полоса */
  --surface-sunken: #f8f9fb;   /* шапка таблицы, заглушки, подложка кода */
  --line: #e2e5eb;             /* границы карточек и полей, линии таблиц */
  --line-strong: #cfd4dd;      /* граница поля при наведении, разделитель в тулбаре */

  /* текст */
  --ink: #1a1f2b;              /* основной текст на surface, surface-raised, surface-sunken */
  --ink-muted: #5f6776;        /* подписи, подсказки, вторичный текст на тех же фонах */
  --ink-faint: #9aa1ad;        /* только знаки «—», «···» и плейсхолдеры, не для смысла */

  /* сайдбар */
  --side: #161c2c;             /* фон сайдбара */
  --side-hover: #1f2638;
  --side-active: #2a3450;      /* активный пункт */
  --side-ink: #c7cdd9;         /* пункты на side */
  --side-ink-strong: #ffffff;  /* логотип и активный пункт */
  --side-muted: #8a93a6;       /* подписи групп, тег «скоро» на side */

  /* акцент */
  --accent: #2a4fd6;           /* главная кнопка, ссылки, прогресс, фокус; как текст — на surface и surface-raised */
  --accent-hover: #2343bd;
  --accent-soft: #e8edfc;      /* подложка чипа «идёт проверка», выбранный чип поисковика */
  --on-accent: #ffffff;        /* текст на заливке accent */

  /* уровни позиций — те же, что в админке (тон t10 затемнён до 4.7:1) */
  --t10: #16784a;  --t10-bg: #dcf3e5;   /* 1–10 */
  --t50: #2f6b47;  --t50-bg: #eef7f1;   /* 11–50 */
  --t100: #4b5563; --t100-bg: #f1f2f4;  /* 51–100 */

  /* состояния */
  --ok: #16784a;   --ok-bg: #e6f5ec;    /* готово */
  --warn: #955800; --warn-bg: #fff3dc;  /* не удалось проверить, лимит, ожидание */
  --bad: #c62828;  --bad-bg: #fde8e8;   /* ошибка ввода, капча */

  /* шрифт */
  --font-sans: "Golos Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "Cascadia Mono", ui-monospace, Consolas, monospace;

  /* шаг 4px */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px; --space-14: 56px;

  /* скругления */
  --radius-sm: 4px;    /* плашки позиций, теги */
  --radius-md: 6px;    /* кнопки, поля */
  --radius-lg: 10px;   /* карточки */
  --radius-full: 999px;/* чипы статусов и поисковиков */

  /* тени — редко: границы важнее теней */
  --shadow-sm: 0 1px 2px rgba(22, 28, 44, 0.05);
  --shadow-lg: 0 8px 24px -6px rgba(22, 28, 44, 0.18);
  --focus-ring: 0 0 0 2px #ffffff, 0 0 0 4px #2a4fd6;

  /* каркас */
  --side-w: 247px;
  --top-h: 56px;
  --content-max: 1200px;
}

/* PRLab · компоненты. Только токены из tokens.css, без фреймворков. Префикс классов pl-. */

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--surface); color: var(--ink); font: 14px/1.5 var(--font-sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }
.pl-num { font-variant-numeric: tabular-nums; }
.pl-muted { color: var(--ink-muted); }
.pl-faint { color: var(--ink-faint); }
.pl-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.pl-h1 { font-size: 26px; line-height: 32px; font-weight: 600; letter-spacing: -0.015em; margin: 0; text-wrap: balance; }
.pl-h2 { font-size: 17px; line-height: 24px; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.pl-h3 { font-size: 14px; line-height: 20px; font-weight: 600; margin: 0; }
.pl-text { font-size: 15px; line-height: 24px; max-width: 68ch; }

/* ------------------------------------------------------------ каркас */

.pl-app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.pl-main { display: flex; flex-direction: column; min-width: 0; }
.pl-content { flex: 1; width: 100%; max-width: var(--content-max); padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); }

.pl-logo { display: inline-flex; flex-direction: column; color: var(--ink); font-size: 18px; line-height: 20px; font-weight: 700; letter-spacing: -0.02em; text-decoration: none; }
.pl-logo:hover { text-decoration: none; }
.pl-logo small { font-size: 11.5px; line-height: 16px; font-weight: 400; letter-spacing: 0; color: var(--ink-muted); margin-top: 2px; }
.pl-logo-dark { color: var(--side-ink-strong); }
.pl-logo-dark small { color: var(--side-muted); }

.pl-side { background: var(--side); color: var(--side-ink); padding: var(--space-5) var(--space-3); display: flex; flex-direction: column; gap: var(--space-6); position: sticky; top: 0; height: 100vh; max-height: 100%; }
.pl-side > .pl-logo { padding: 0 var(--space-2); }
.pl-nav { display: flex; flex-direction: column; gap: 2px; }
.pl-nav-sub { font-size: 11.5px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; color: var(--side-muted); padding: var(--space-4) var(--space-2) var(--space-1); }
.pl-nav-item { display: flex; align-items: center; gap: var(--space-2); height: 34px; padding: 0 var(--space-2); border-radius: var(--radius-md); color: var(--side-ink); font-size: 14px; text-decoration: none; }
.pl-nav-item:hover { background: var(--side-hover); color: var(--side-ink-strong); text-decoration: none; }
.pl-nav-item.is-active { background: var(--side-active); color: var(--side-ink-strong); font-weight: 500; }
.pl-nav-item.is-soon { color: var(--side-muted); }
.pl-nav-soon { margin-left: auto; font-size: 11px; line-height: 16px; padding: 0 6px; border-radius: var(--radius-full); border: 1px solid #343d55; color: var(--side-muted); }
.pl-nav-count { margin-left: auto; font-size: 12px; color: var(--side-muted); font-variant-numeric: tabular-nums; }
.pl-side-foot { margin-top: auto; padding: 0 var(--space-2); font-size: 12px; color: var(--side-muted); }

.pl-top { position: sticky; top: 0; z-index: 2; height: var(--top-h); display: flex; align-items: center; gap: var(--space-6); padding: 0 var(--space-6); background: var(--surface-raised); border-bottom: 1px solid var(--line); }
.pl-top-title { display: flex; align-items: baseline; gap: var(--space-3); font-size: 15px; font-weight: 600; min-width: 0; }
.pl-top-crumb { font-size: 13px; font-weight: 400; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-top-links { margin-left: auto; display: flex; gap: var(--space-5); }
.pl-top-links a { color: var(--ink-muted); font-size: 13.5px; }
.pl-top-links a:hover { color: var(--ink); text-decoration: none; }

.pl-foot { border-top: 1px solid var(--line); padding: var(--space-8) var(--space-6) var(--space-6); display: flex; flex-direction: column; gap: var(--space-8); }
.pl-foot-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 220px)); gap: var(--space-6); }
.pl-foot-col { display: flex; flex-direction: column; gap: var(--space-2); font-size: 13.5px; }
.pl-foot-col a { color: var(--ink-muted); }
.pl-foot-col a:hover { color: var(--ink); }
.pl-foot-head { font-size: 12px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.pl-foot-base { display: flex; align-items: center; gap: var(--space-4); font-size: 12.5px; color: var(--ink-muted); }

/* ------------------------------------------------------------ карточки и формы */

.pl-card { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-5); box-shadow: var(--shadow-sm); min-width: 0; }

.pl-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); height: 36px; padding: 0 var(--space-4); border-radius: var(--radius-md); border: 1px solid var(--line); background: var(--surface-raised); color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; }
.pl-btn:hover { border-color: var(--line-strong); text-decoration: none; }
.pl-btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pl-btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.pl-btn-ghost { background: transparent; border-color: transparent; color: var(--accent); padding: 0 var(--space-2); }
.pl-btn-ghost:hover { background: var(--accent-soft); border-color: transparent; }
.pl-btn-sm { height: 30px; padding: 0 var(--space-3); font-size: 13px; }
.pl-btn-lg { height: 44px; padding: 0 var(--space-6); font-size: 15px; font-weight: 600; }
.pl-btn:disabled { cursor: default; opacity: 1; background: var(--surface-sunken); border-color: var(--line); color: var(--ink-muted); }
.pl-btn:focus-visible { box-shadow: var(--focus-ring); border-radius: var(--radius-md); }

.pl-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pl-label { display: flex; align-items: baseline; gap: var(--space-2); font-size: 13px; font-weight: 500; color: var(--ink); padding: 0; }
.pl-label-aside { margin-left: auto; font-weight: 400; color: var(--ink-muted); }
.pl-hint { font-size: 12.5px; line-height: 18px; color: var(--ink-muted); }
.pl-hint.is-error { color: var(--bad); }
.pl-input { width: 100%; height: 38px; padding: 0 var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); color: var(--ink); font: inherit; font-size: 14px; }
.pl-input::placeholder { color: var(--ink-faint); }
.pl-input:hover { border-color: var(--line-strong); }
.pl-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pl-input.is-error { border-color: var(--bad); }
.pl-textarea { height: auto; min-height: 150px; padding: var(--space-2) var(--space-3); line-height: 22px; resize: vertical; }
.pl-select { appearance: none; padding-right: var(--space-8); background-image: linear-gradient(45deg, transparent 50%, var(--ink-muted) 50%), linear-gradient(135deg, var(--ink-muted) 50%, transparent 50%); background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px; background-size: 5px 5px; background-repeat: no-repeat; }
.pl-counter { font-variant-numeric: tabular-nums; }
.pl-counter.is-over { color: var(--bad); font-weight: 500; }

.pl-engines { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pl-engine-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.pl-engine { position: relative; display: inline-flex; align-items: center; height: 34px; padding: 0 var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-full); background: var(--surface-raised); color: var(--ink-muted); font-size: 13.5px; cursor: pointer; user-select: none; }
.pl-engine input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pl-engine:hover { border-color: var(--line-strong); }
.pl-engine.is-on { background: var(--accent-soft); border-color: #bfcbf5; color: var(--accent); font-weight: 500; }
.pl-engine.is-on::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: var(--space-2); }
.pl-engine.is-locked { background: var(--surface-sunken); color: var(--ink-faint); cursor: not-allowed; }
.pl-engine:focus-within { box-shadow: var(--focus-ring); }

.pl-captcha { width: 304px; max-width: 100%; height: 78px; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 0 var(--space-4); border: 1px dashed var(--line-strong); border-radius: var(--radius-md); background: var(--surface-sunken); color: var(--ink-muted); font-size: 13px; }
.pl-captcha small { font-size: 11.5px; color: var(--ink-faint); }

.pl-form { display: flex; flex-direction: column; gap: var(--space-5); }
.pl-form-head { display: flex; flex-direction: column; gap: 2px; }
.pl-form-head .pl-muted { font-size: 13px; }
.pl-form-row { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: var(--space-5); align-items: end; }
.pl-form-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--line); }

/* ------------------------------------------------------------ статус и очередь */

.pl-chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--radius-full); font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.pl-chip i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pl-chip-wait { background: var(--warn-bg); color: var(--warn); }
.pl-chip-run { background: var(--accent-soft); color: var(--accent); }
.pl-chip-run i { animation: pl-pulse 1.4s ease-in-out infinite; }
.pl-chip-ok { background: var(--ok-bg); color: var(--ok); }
.pl-chip-bad { background: var(--bad-bg); color: var(--bad); }
.pl-chip-mute { background: var(--t100-bg); color: var(--t100); }
@keyframes pl-pulse { 50% { opacity: 0.3; } }

.pl-progress { height: 4px; background: #e9ecf2; border-radius: var(--radius-full); overflow: hidden; }
.pl-progress i { display: block; height: 100%; background: var(--accent); border-radius: var(--radius-full); transition: width 0.4s; }

.pl-queue { display: flex; flex-direction: column; gap: var(--space-3); }
.pl-queue-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); font-size: 13px; }
.pl-queue-big { display: flex; align-items: baseline; gap: var(--space-3); }
.pl-queue-big b { font-size: 32px; line-height: 36px; font-weight: 600; letter-spacing: -0.02em; }
.pl-queue-big span { color: var(--ink-muted); font-size: 13.5px; }
.pl-queue-note { font-size: 12.5px; color: var(--ink-muted); }

/* ------------------------------------------------------------ данные */

.pl-stat { display: flex; flex-direction: column; gap: 2px; min-width: 104px; padding: var(--space-3) var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); }
.pl-stat-label { font-size: 12px; color: var(--ink-muted); }
.pl-stat b { font-size: 22px; line-height: 28px; font-weight: 600; letter-spacing: -0.01em; }
.pl-stat-sub { font-size: 11.5px; color: var(--ink-faint); }
.pl-stat-t10 b { color: var(--t10); }
.pl-stat-t50 b { color: var(--t50); }
.pl-stat-t100 b { color: var(--t100); }

.pl-summary { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-raised); }
.pl-summary-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; }
.pl-summary-head .pl-muted { font-size: 12.5px; }
.pl-summary-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); }
.pl-summary-tiles .pl-stat { min-width: 0; padding: var(--space-2) var(--space-3); border: 0; background: var(--surface-sunken); }
.pl-summary-tiles .pl-stat b { font-size: 20px; line-height: 26px; }

.pl-pos { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 24px; padding: 0 var(--space-2); border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pl-pos-t10 { background: var(--t10-bg); color: var(--t10); }
.pl-pos-t50 { background: var(--t50-bg); color: var(--t50); }
.pl-pos-t100 { background: var(--t100-bg); color: var(--t100); }
.pl-pos-none { font-weight: 400; font-size: 12px; color: var(--ink-muted); }
.pl-pos-err { font-weight: 500; font-size: 12px; color: var(--warn); background: var(--warn-bg); }
.pl-pos-skip, .pl-pos-pending { font-weight: 400; color: var(--ink-faint); }

.pl-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-raised); }
.pl-table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.pl-table th { position: sticky; top: 0; background: var(--surface-sunken); text-align: left; font-size: 12px; font-weight: 500; color: var(--ink-muted); padding: 0 var(--space-3); height: 36px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.pl-table td { padding: 0 var(--space-3); height: 42px; border-bottom: 1px solid #eef0f3; vertical-align: middle; }
.pl-table tr:last-child td { border-bottom: 0; }
.pl-table tbody tr:hover td { background: #fafbfc; }
.pl-table .pl-c { text-align: center; width: 112px; }
.pl-table .pl-q { min-width: 220px; line-height: 19px; padding-block: var(--space-2); }
.pl-table .pl-url { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.pl-table .pl-url a { color: var(--ink-muted); }

.pl-cache { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-sunken); font-size: 13.5px; color: var(--ink-muted); }
.pl-cache b { color: var(--ink); font-weight: 600; }

.pl-notice { display: flex; flex-direction: column; gap: 2px; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); font-size: 13.5px; line-height: 20px; border: 1px solid transparent; }
.pl-notice b { font-weight: 600; }
.pl-notice-info { background: var(--accent-soft); border-color: #d3dcf8; color: var(--ink); }
.pl-notice-warn { background: var(--warn-bg); border-color: #f1dfb8; color: var(--ink); }
.pl-notice-warn b { color: var(--warn); }
.pl-notice-bad { background: var(--bad-bg); border-color: #f6cccc; color: var(--bad); }

.pl-empty { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); padding: var(--space-8) var(--space-6); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); background: var(--surface-raised); }
.pl-empty b { font-size: 15px; font-weight: 600; }
.pl-empty p { margin: 0; max-width: 56ch; color: var(--ink-muted); }
.pl-empty > .pl-btn-ghost { margin-left: calc(-1 * var(--space-2)); }

/* ------------------------------------------------------------ узкий экран */

@media (max-width: 860px) {
  .pl-app { grid-template-columns: 1fr; }
  .pl-side { position: static; height: auto; flex-direction: row; align-items: center; gap: var(--space-4); padding: var(--space-3) var(--space-4); overflow-x: auto; }
  .pl-nav { flex-direction: row; }
  .pl-nav-sub, .pl-side-foot, .pl-nav-soon { display: none; }
  .pl-nav-item { white-space: nowrap; }
  .pl-top { padding: 0 var(--space-4); }
  .pl-top-links { display: none; }
  .pl-content { padding: var(--space-4); }
  .pl-form-row { grid-template-columns: 1fr; }
  .pl-summary-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pl-foot { padding: var(--space-6) var(--space-4); }
}
@media (prefers-reduced-motion: reduce) {
  .pl-chip-run i { animation: none; }
  .pl-progress i { transition: none; }
}
