/* ─────────────────────────────────────────────────────────────
   SEO Intelligence — Design System v3 «Чернила по бумаге»
   Ink on paper — high-contrast typographic minimalism (cool slate)
   Based on brand book 2026-06-15
───────────────────────────────────────────────────────────── */

/* ─── 1. Design tokens ─── */
:root {
    /* Surfaces — cool paper (Чернила v3) */
    --paper:        #FAFAFA;
    --paper-deep:   #F1F5F9;
    --surface:      #FFFFFF;
    --surface-alt:  #F8FAFC;

    /* Ink — cool graphite slate (Чернила v3) */
    --ink:          #0F172A;
    --ink-2:        #334155;
    --ink-3:        #475569;
    --muted:        #64748B;
    --muted-2:      #94A3B8;

    /* Lines — hairline dividers (slate) */
    --rule:         #0F172A;
    --rule-soft:    #E2E8F0;
    --rule-faint:   #F1F5F9;

    /* Accent — monochrome ink (Чернила v3, no colored accent) */
    --accent:       #0F172A;
    --accent-2:     #1E293B;
    --accent-soft:  #F1F5F9;

    /* Data palette — saturated, charts only (Чернила v3) */
    --data-1:       #2563EB;   /* blue — GSC */
    --data-2:       #DC2626;   /* red — Yandex */
    --data-3:       #EA580C;   /* orange — GA4 */
    --data-4:       #7C3AED;   /* violet — Metrika */
    --data-5:       #D97706;   /* amber — generic */
    --data-6:       #0D9488;   /* teal — generic */

    /* Status — muted but readable (Чернила v3) */
    --pos:          #047857;
    --pos-bg:       #ECFDF5;
    --neg:          #BE123C;
    --neg-bg:       #FFF1F2;
    --warn-clr:     #B45309;
    --warn-bg:      #FFFBEB;
    --ftp-live:     #1D4ED8;
    --ftp-live-bg:  #EFF6FF;
    --info:         #334155;
    --info-bg:      #F1F5F9;

    /* Type families */
    --ff-serif:     'Instrument Serif', 'PT Serif', Georgia, serif;
    --ff-sans:      'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --ff-mono:      'JetBrains Mono', ui-monospace, Menlo, monospace;

    /* Radii */
    --r-xs:         3px;
    --r-sm:         6px;
    --r-md:         8px;
    --r-lg:         12px;
    --r-xl:         16px;

    /* Spacing */
    --s-1:  4px;
    --s-2:  8px;
    --s-3:  12px;
    --s-4:  16px;
    --s-5:  24px;
    --s-6:  32px;
    --s-7:  48px;
    --s-8:  64px;
    --s-9:  96px;

    /* Sidebar */
    --sidebar-w:    240px;

    /* Legacy compat aliases (keep old --sa-* working in JS/inline styles) */
    --sa-bg:           var(--paper);
    --sa-surface:      var(--surface);
    --sa-on:           var(--ink);
    --sa-on-variant:   var(--ink-2);
    --sa-muted:        var(--muted);
    --sa-primary:      var(--accent);
    --sa-outline:      var(--rule-soft);
    --sa-surface-alt:  var(--surface-alt);
    --sa-border:       var(--rule-soft);
    --sa-success:      var(--pos);
    --sa-success-bg:   var(--pos-bg);
    --sa-error:        var(--neg);
    --sa-error-bg:     var(--neg-bg);
    --sa-warning:      var(--warn-clr);
    --sa-warning-bg:   var(--warn-bg);
    --sa-cta:          #0F172A;
    --sa-dark-bg:      #0F172A;
    --sa-dark-text:    #E2E8F0;
    --sa-shadow-sm:    0 1px 2px rgba(15,23,42,0.04);
    --sa-shadow:       0 1px 3px rgba(15,23,42,0.08);
    --sa-shadow-lg:    0 8px 24px rgba(15,23,42,0.10);
}

/* ─── 2. Reset & base ─── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--ff-sans);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.app-body { background: var(--paper); }

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
img { max-width: 100%; }

/* Чернила v3: единый фокус-ринг для клавиатурной навигации (аддитивно, без сдвига лейаута) */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
select:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ─── 3. Typography scale ─── */
.serif  { font-family: var(--ff-serif); font-weight: 400; letter-spacing: -0.01em; }
.mono   { font-family: var(--ff-mono); font-variant-numeric: tabular-nums; }
.num    { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }

.t-display-xl { font-family: var(--ff-serif); font-size: 96px;  line-height: 0.95; letter-spacing: -0.025em; font-weight: 400; }
.t-display-l  { font-family: var(--ff-serif); font-size: 64px;  line-height: 1.0;  letter-spacing: -0.02em;  font-weight: 400; }
.t-display-m  { font-family: var(--ff-serif); font-size: 44px;  line-height: 1.05; letter-spacing: -0.02em;  font-weight: 400; }
.t-display-s  { font-family: var(--ff-serif); font-size: 32px;  line-height: 1.1;  letter-spacing: -0.015em; font-weight: 400; }

.t-h1    { font-family: var(--ff-sans); font-size: 28px; line-height: 1.2;  letter-spacing: -0.01em;  font-weight: 600; }
.t-h2    { font-family: var(--ff-sans); font-size: 20px; line-height: 1.3;  letter-spacing: -0.005em; font-weight: 600; }
.t-h3    { font-family: var(--ff-sans); font-size: 16px; line-height: 1.4;  font-weight: 600; }
.t-body  { font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.t-small { font-size: 12px; line-height: 1.4;  color: var(--ink-3); }
.t-micro { font-family: var(--ff-mono); font-size: 11px; line-height: 1.3; color: var(--muted); letter-spacing: 0.02em; }

.eyebrow {
    font-family: var(--ff-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    font-weight: 500;
}

/* ─── 4. App shell — sidebar + content ─── */
.admin-header {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--rule-soft);
    padding: 24px 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
}

.admin-header__brand {
    font-family: var(--ff-serif);
    font-size: 24px;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--ink);
    text-decoration: none;
    display: block;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--rule-soft);
}
.admin-header__brand em { font-style: italic; color: var(--ink-3); }

.admin-header__left {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

.admin-header__right {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--rule-soft);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Sidebar nav groups */
.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-nav__group-label {
    font-family: var(--ff-mono);
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted-2);
    padding: 0 8px 6px;
    margin-top: 4px;
}

.admin-nav__link {
    display: flex;
    align-items: center;
    padding: 11px 16px;
    border-radius: 10px;
    color: var(--ink-2);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.01em;
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease, padding-left 0.18s ease;
    white-space: nowrap;
}
.admin-nav__link:hover { background: rgba(15,23,42,0.05); color: var(--ink); padding-left: 20px; }
.admin-nav__link.is-active,
.admin-nav__link.is-active:hover {
    background: linear-gradient(135deg, #1E293B, #0F172A);
    color: #fff;
    padding-left: 16px;
    box-shadow: 0 4px 14px rgba(15,23,42,0.18);
}
.admin-nav__link-badge {
    margin-left: auto;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}
.admin-nav__link.is-active .admin-nav__link-badge { background: rgba(255,255,255,0.25); }

/* User footer in sidebar — Чернила: ADMIN label + avatar + logout */
.admin-header__user-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 9px 12px;
}
.admin-header__admin-label {
    font-family: var(--ff-mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted-2);
}
.admin-header__user-id { display: flex; align-items: center; gap: 8px; min-width: 0; }
.admin-header__avatar {
    width: 24px; height: 24px;
    flex: none;
    border-radius: 7px;
    background: var(--ink);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--ff-serif);
    font-style: italic;
    font-size: 15px;
    line-height: 1;
}
.admin-header__user {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ink-3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-header__logout {
    display: flex; align-items: center; justify-content: center;
    padding: 11px;
    border: 1px solid var(--rule-soft);
    border-radius: 11px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ink);
    background: var(--surface);
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.admin-header__logout:hover { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Main content area */
.admin-main {
    margin-left: var(--sidebar-w);
    padding: 36px 48px 80px;
    max-width: none;
    min-height: 100vh;
}

/* ─── 5. Page head ─── */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    padding-bottom: 28px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--rule);
}

.page-head__eyebrow {
    font-family: var(--ff-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    margin: 0 0 10px;
}

.page-head__title {
    font-family: var(--ff-serif);
    font-size: 48px;
    line-height: 1.0;
    letter-spacing: -0.02em;
    font-weight: 400;
    margin: 0 0 10px;
    color: var(--ink);
}
.page-head__title em { font-style: italic; color: var(--ink-3); }

.page-head__text,
.page-head__lede {
    margin: 0;
    max-width: 56ch;
    font-size: 14.5px;
    color: var(--ink-3);
    line-height: 1.55;
}

.page-head__meta {
    display: flex;
    align-items: center;
    gap: 20px;
    font-family: var(--ff-mono);
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    white-space: nowrap;
}
.page-head__meta b { color: var(--ink); font-weight: 500; }

.page-head--compact {
    padding-bottom: 16px;
    margin-bottom: 20px;
}
.page-head--compact .page-head__title { font-size: 32px; }
.page-head__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.page-review {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-sm);
    background: var(--surface);
    box-shadow: 0 8px 22px rgba(31, 27, 22, 0.04);
}
.page-review__status {
    font-family: var(--ff-mono);
    font-size: 10.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 8px 10px;
    border-radius: 6px;
    background: var(--surface-alt);
    color: var(--muted);
    white-space: nowrap;
}
.page-review__status--checked {
    background: rgba(4,120,87,0.12);
    color: var(--pos);
}
.page-review__status--stale {
    background: rgba(180,83,9,0.14);
    color: var(--warn-clr);
}
.page-review__btn,
.page-review__help,
.page-review-modal__close {
    border: 1px solid var(--rule-soft);
    background: var(--paper);
    color: var(--ink);
    border-radius: 6px;
    font: 500 12px/1 var(--ff-sans);
    cursor: pointer;
}
.page-review__btn { padding: 8px 10px; white-space: nowrap; }
.page-review__btn:disabled { opacity: 0.55; cursor: wait; }
.page-review__help {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    font-family: var(--ff-mono);
}
.page-review__btn:hover,
.page-review__help:hover,
.page-review-modal__close:hover { background: var(--surface-alt); }

.page-review-modal[hidden] { display: none; }
.page-review-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
}
.page-review-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(31, 27, 22, 0.22);
}
.page-review-modal__panel {
    position: relative;
    width: min(560px, calc(100vw - 32px));
    margin: 86px 40px 0 0;
    padding: 24px;
    background: var(--paper);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
    box-shadow: 0 24px 80px rgba(31, 27, 22, 0.18);
}
.page-review-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    font-size: 20px;
}
.page-review-modal__eyebrow {
    font-family: var(--ff-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 8px;
}
.page-review-modal h2 {
    margin: 0 40px 10px 0;
    font-size: 24px;
    line-height: 1.15;
}
.page-review-modal__desc {
    margin: 0 0 18px;
    color: var(--ink-3);
    line-height: 1.55;
}
.page-review-modal__grid {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 12px 18px;
    margin: 0;
}
.page-review-modal__grid dt {
    font-family: var(--ff-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}
.page-review-modal__grid dd {
    margin: 0;
    color: var(--ink);
    white-space: pre-line;
    line-height: 1.5;
}

/* Breadcrumb */
.breadcrumb {
    font-family: var(--ff-mono);
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0 0 16px;
}
.breadcrumb a { color: var(--ink-3); }
.breadcrumb a:hover { color: var(--ink); }

.link-external { color: var(--accent); }

/* ─── 6. Cards / Panels ─── */
.card, .panel {
    background: var(--surface);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
    padding: 24px;
}
.card__head, .panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 24px;
    margin: -24px -24px 20px;
    border-bottom: 1px solid var(--rule-faint);
}
.card__title, .panel__title {
    font-family: var(--ff-sans);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.005em;
    margin: 0;
    color: var(--ink);
}
.panel__hint {
    margin: -8px 0 16px;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
}

/* ─── 7. Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: var(--r-sm);
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.12s ease;
    white-space: nowrap;
    font-family: var(--ff-sans);
    line-height: 1.4;
}
.btn--primary {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
}
.btn--primary:hover { background: var(--ink-2); border-color: var(--ink-2); }

.btn--secondary, .btn--ghost {
    background: transparent;
    color: var(--ink);
    border-color: var(--rule-soft);
}
.btn--secondary:hover, .btn--ghost:hover {
    background: var(--surface-alt);
    border-color: var(--ink-3);
}

.btn--soft {
    background: var(--paper-deep);
    color: var(--ink);
    border-color: var(--rule-soft);
}
.btn--soft:hover { background: var(--rule-soft); }

.btn--link {
    background: transparent;
    color: var(--ink);
    padding: 4px 0;
    border-bottom: 1px solid var(--ink);
    border-radius: 0;
}

.btn--cta {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.btn--cta:hover { background: var(--accent-2); }

.btn--danger {
    background: var(--neg-bg);
    color: var(--neg);
    border-color: rgba(190,18,60,0.3);
}
.btn--danger:hover { background: #FFE4E6; }

.btn--sm { padding: 6px 10px; font-size: 12px; }
.btn--lg { padding: 12px 20px; font-size: 14px; }
.btn--auto { width: auto; }
.btn__arrow { transition: transform 0.15s; }
.btn:hover .btn__arrow { transform: translateX(3px); }

/* ─── 8. Forms ─── */
.field { display: grid; gap: 6px; }

.field__label {
    font-family: var(--ff-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    font-weight: 500;
}

.field__input,
.field__select {
    background: var(--surface);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-sm);
    padding: 10px 12px;
    font: inherit;
    font-size: 14px;
    color: var(--ink);
    transition: border 0.12s, box-shadow 0.12s;
    width: 100%;
}
.field__input:focus,
.field__select:focus {
    outline: none;
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(15,23,42,0.05);
}
.field__input::placeholder { color: var(--muted); }

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stack-form { display: flex; flex-direction: column; gap: 14px; }

/* ─── 9. Badges & status pills ─── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    font-family: var(--ff-mono);
    font-size: 10.5px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: var(--r-xs);
    font-weight: 500;
    background: var(--paper-deep);
    color: var(--ink-2);
    border: none;
}
.badge--pos, .badge--success { background: var(--pos-bg); color: var(--pos); }
.badge--neg, .badge--error   { background: var(--neg-bg); color: var(--neg); }
.badge--warn                 { background: var(--warn-bg); color: var(--warn-clr); }
.badge--info                 { background: var(--info-bg); color: var(--info); }
.badge--dot::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* Legacy status-pill */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: var(--r-xs);
    font-family: var(--ff-mono);
    font-size: 10.5px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}
.status-pill--ok   { background: var(--pos-bg); color: var(--pos); }
.status-pill--warn { background: var(--warn-bg); color: var(--warn-clr); }
.status-pill--off  { background: var(--paper-deep); color: var(--muted); }

/* Delta */
.delta, .kpi-card__delta {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-family: var(--ff-mono);
    font-size: 12px;
    font-weight: 500;
}
.delta--up, .kpi-card__delta--up     { color: var(--pos); }
.delta--down, .kpi-card__delta--down { color: var(--neg); }
.delta--flat, .kpi-card__delta--flat { color: var(--muted); }

/* ─── 10. KPI block (new + legacy compat) ─── */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
    background: var(--surface);
    margin-bottom: 28px;
    overflow: hidden;
}
.kpi-row > .kpi {
    padding: 20px 24px;
    border-right: 1px solid var(--rule-faint);
}
.kpi-row > .kpi:last-child { border-right: none; }

.kpi { display: flex; flex-direction: column; gap: 6px; }

.kpi__label {
    font-family: var(--ff-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}
.kpi__value {
    font-family: var(--ff-serif);
    font-size: 48px;
    line-height: 1;
    font-weight: 400;
    letter-spacing: -0.02em;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.kpi__sub {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--ink-3);
}

/* Legacy KPI cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1px;
    background: var(--rule-soft);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
    overflow: hidden;
    margin-bottom: 28px;
}
.kpi-card {
    background: var(--surface);
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: background 0.12s;
}
.kpi-card:hover { background: var(--surface-alt); }

.kpi-card__label {
    font-family: var(--ff-mono);
    font-size: 10.5px;
    font-weight: 500;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.kpi-card__value {
    font-family: var(--ff-serif);
    font-size: 36px;
    line-height: 1.0;
    font-weight: 400;
    letter-spacing: -0.02em;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.kpi-card__footer {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    font-size: 12px;
    color: var(--ink-3);
}

/* ─── 11. Tables ─── */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--r-md);
    border: 1px solid var(--rule-soft);
}
.table-wrap--short { max-height: 360px; overflow-y: auto; }

/* New canonical table */
.tbl, .data-table, .gsc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
.tbl thead th,
.data-table thead th,
.gsc-table thead th {
    text-align: left;
    padding: 11px 16px;
    font-family: var(--ff-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    font-weight: 500;
    border-bottom: 1px solid var(--rule-soft);
    background: var(--paper-deep);
    white-space: nowrap;
}
.tbl tbody td,
.data-table tbody td,
.gsc-table tbody td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--rule-faint);
    color: var(--ink-2);
    vertical-align: middle;
}
.tbl tbody tr:last-child td,
.data-table tbody tr:last-child td,
.gsc-table tbody tr:last-child td { border-bottom: none; }

.tbl tbody tr:hover,
.data-table tbody tr:hover,
.gsc-table tbody tr:hover { background: var(--surface-alt); }

/* Чернила v3: без зебры — только волосяные линии + hover (тело таблиц белое) */

/* Numeric cells */
.tbl .num, .data-table .num, .gsc-table td.num,
.tbl th.num, .data-table th.num {
    font-family: var(--ff-mono);
    font-size: 13px;
    color: var(--ink);
    text-align: right;
}

/* Key (bold link) cells */
.tbl .key, .data-table .key, .gsc-table .key {
    color: var(--ink);
    font-weight: 500;
    max-width: 460px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tbl .key-sub, .gsc-table .key-sub {
    display: block;
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 2px;
    font-family: var(--ff-mono);
}

/* Sortable columns */
.sortable { cursor: pointer; user-select: none; }
.sortable:hover { color: var(--ink); }

/* GSC-specific compact */
.gsc-table--compact td,
.gsc-table--compact th { font-size: 12.5px; padding: 9px 12px; }

/* ─── 12. Tabs ─── */
.tabs, .project-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--rule-soft);
    margin-bottom: 28px;
    overflow-x: auto;
}
.tab, .project-tabs__link {
    padding: 13px 18px 13px 0;
    margin-right: 24px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.12s;
    position: relative;
}
.tab:hover, .project-tabs__link:hover { color: var(--ink); }
.tab.is-active, .project-tabs__link.is-active {
    color: var(--ink);
    border-bottom-color: var(--ink);
}
.tab__count {
    font-family: var(--ff-mono);
    font-size: 11px;
    color: var(--muted);
    margin-left: 5px;
}

/* ─── 13. Toolbar / filter bar ─── */
.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    flex-wrap: wrap;
}
.toolbar__group {
    display: flex;
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-sm);
    overflow: hidden;
    background: var(--surface);
}
.toolbar__btn {
    background: var(--surface);
    border: none;
    padding: 8px 13px;
    font-size: 12.5px;
    color: var(--ink-3);
    border-right: 1px solid var(--rule-faint);
    font-weight: 500;
    cursor: pointer;
    font-family: var(--ff-sans);
}
.toolbar__btn:last-child { border-right: none; }
.toolbar__btn.is-active { background: var(--ink); color: var(--paper); }
.toolbar__btn:hover:not(.is-active) { background: var(--surface-alt); color: var(--ink); }

.search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-sm);
    padding: 8px 12px;
    min-width: 220px;
}
.search input {
    border: none; background: none; outline: none;
    font: inherit; font-size: 13.5px;
    width: 100%; color: var(--ink);
}
.search input::placeholder { color: var(--muted); }

/* ─── 14. Section head ─── */
.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 14px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--rule-faint);
}
.section-head__title {
    font-family: var(--ff-serif);
    font-size: 26px;
    line-height: 1.15;
    letter-spacing: -0.015em;
    font-weight: 400;
    margin: 0;
}
.section-head__title em { font-style: italic; color: var(--ink-3); }
.section-head__meta {
    font-family: var(--ff-mono);
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ─── 15. Live status pill ─── */
.live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--ff-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink-3);
}
.live::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--pos);
    box-shadow: 0 0 0 3px rgba(4,120,87,0.18);
    animation: live-pulse 1.6s ease-in-out infinite;
}
@keyframes live-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(4,120,87,0.18); }
    50%       { box-shadow: 0 0 0 6px rgba(4,120,87,0.05); }
}

/* ─── 15b. Spinner ─── */
.spinner-sm {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--muted-2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spinner-spin 0.6s linear infinite;
    vertical-align: -1px;
}
@keyframes spinner-spin {
    to { transform: rotate(360deg); }
}

/* ─── 16. Position chips ─── */
.pos-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px; height: 24px;
    padding: 0 6px;
    border-radius: var(--r-xs);
    font-family: var(--ff-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--ink);
    background: var(--paper-deep);
}
.pos-chip--top3  { background: var(--ink); color: #fff; }
.pos-chip--top10 { background: var(--ink-3); color: #fff; }
.pos-chip--top30 { background: #CBD5E1; color: var(--ink); }
.pos-chip--out   { background: var(--paper-deep); color: var(--muted); }

/* Keyword matrix cells — editorial pos-indicator (border-left + tint) */
.kw-cell {
    font-family: var(--ff-mono);
    font-size: 12px;
    color: var(--ink);
    position: relative;
    background-clip: padding-box;
    white-space: nowrap;
}
.kw-cell--top3 {
    background: rgba(15, 23, 42, 0.06);
    box-shadow: inset 3px 0 0 var(--ink);
    color: var(--ink);
    font-weight: 600;
}
.kw-cell--top10 {
    background: rgba(37, 99, 235, 0.07);
    box-shadow: inset 3px 0 0 var(--data-1);
    color: var(--ink);
    font-weight: 600;
}
.kw-cell--top30 {
    background: rgba(217, 119, 6, 0.08);
    box-shadow: inset 3px 0 0 var(--data-5);
    color: var(--ink);
    font-weight: 500;
}
.kw-cell--low {
    background: var(--surface);
    color: var(--ink-3);
    font-weight: 400;
}
.kw-cell--empty {
    color: var(--muted-2);
    font-weight: 400;
}

/* ─── 17. Mini bar ─── */
.bar-mini { display: flex; align-items: center; gap: 8px; }
.bar-mini__track { flex: 1; height: 4px; background: var(--rule-faint); border-radius: 2px; overflow: hidden; min-width: 60px; }
.bar-mini__fill  { height: 100%; background: var(--ink); border-radius: 2px; }

/* Archive progress bar */
.archive-progress { height: 6px; background: var(--paper-deep); border-radius: 3px; overflow: hidden; margin: 6px 0; }
.archive-progress__bar { height: 100%; background: var(--accent); border-radius: 3px; }

/* ─── 18. Alerts ─── */
.alert {
    padding: 12px 14px;
    border-radius: var(--r-sm);
    font-size: 13.5px;
    margin-bottom: 16px;
    border: 1px solid;
}
.alert--error   { background: var(--neg-bg); color: var(--neg); border-color: rgba(168,52,31,0.3); }
.alert--success { background: var(--pos-bg); color: var(--pos); border-color: rgba(4,120,87,0.3); }
.alert--warn    { background: var(--warn-bg); color: var(--warn-clr); border-color: rgba(138,90,20,0.3); }
.alert--info    { background: var(--info-bg); color: var(--info); border-color: rgba(15,23,42,0.3); }

/* ─── 19. Divider / misc helpers ─── */
.divider         { height: 1px; background: var(--rule-faint); margin: 20px 0; border: 0; }
.divider--strong { background: var(--rule); }

.stack { display: flex; flex-direction: column; }
.stack > * + * { margin-top: var(--gap, 16px); }

.row         { display: flex; align-items: center; gap: 16px; }
.row--between{ justify-content: space-between; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; vertical-align: middle; }

.empty-state {
    text-align: center;
    padding: 40px 24px;
    color: var(--muted);
    font-size: 13.5px;
}

.ov-muted { color: var(--muted); }

/* Footnote */
.footnote {
    margin-top: 48px;
    padding-top: 18px;
    border-top: 1px solid var(--rule-faint);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--ff-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}

/* ─── 20. Auth page ─── */
.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1.05fr;
}
.auth-pane {
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
}
.auth-pane--left { border-right: 1px solid var(--rule); }
.auth-pane--right {
    background: var(--paper);
    position: relative;
    overflow: hidden;
}
.auth-pane--right::before {
    content: '';
    position: absolute; inset: 48px 56px;
    background-image:
        linear-gradient(to right, var(--rule-faint) 1px, transparent 1px),
        linear-gradient(to bottom, var(--rule-faint) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.5;
    pointer-events: none;
}

/* Legacy .auth-card → styled like auth pane */
.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
    padding: 32px 28px;
}
.auth-card__eyebrow {
    font-family: var(--ff-mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 16px;
}
.auth-card__title {
    font-family: var(--ff-serif);
    font-size: 40px;
    line-height: 1.05;
    letter-spacing: -0.02em;
    font-weight: 400;
    margin: 0 0 10px;
    color: var(--ink);
}
.auth-card__subtitle {
    font-size: 14px;
    color: var(--ink-3);
    margin: 0 0 24px;
    line-height: 1.5;
}
.auth-form {
    display: grid;
    gap: 16px;
}
.auth-form .field__input {
    padding: 13px 0;
    font-size: 15px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--rule-soft);
    border-radius: 0;
}
.auth-form .field__input:focus {
    outline: none;
    border-bottom-color: var(--ink);
    box-shadow: none;
}

/* ─── 20b. Auth page — new 2-pane editorial layout ─── */
.auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1.05fr;
}
.auth__pane {
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
}
.auth__pane--left {
    background: var(--paper);
    border-right: 1px solid var(--rule-soft);
}
.auth__pane--right {
    background: var(--paper);
    position: relative;
    overflow: hidden;
}
.auth__pane--right::before {
    content: '';
    position: absolute; inset: 0;
    background-image:
        linear-gradient(to right, var(--rule-faint) 1px, transparent 1px),
        linear-gradient(to bottom, var(--rule-faint) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.45;
    pointer-events: none;
}
.auth__right-inner {
    position: relative; z-index: 1;
    display: flex; flex-direction: column;
    height: 100%;
}
.auth__head {
    display: flex; align-items: baseline; gap: 12px;
    font-family: var(--ff-mono); font-size: 11px;
    letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.auth__head--right { justify-content: space-between; }
.auth__brand { display: flex; align-items: center; }
.auth__brand-mark {
    font-family: var(--ff-serif);
    font-size: 28px;
    letter-spacing: -0.02em;
    color: var(--ink);
    font-weight: 400;
}
.auth__brand-mark em { font-style: italic; }
.auth__instance { margin-left: auto; }
.auth__cron { font-family: var(--ff-mono); font-size: 10.5px; color: var(--muted); }

.auth__center { margin: auto 0; max-width: 420px; width: 100%; }
.auth__eyebrow {
    font-family: var(--ff-mono); font-size: 11px;
    text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted);
    margin-bottom: 20px;
    display: block;
}
.auth__title {
    font-family: var(--ff-serif); font-size: 64px; line-height: 1.0;
    letter-spacing: -0.025em; font-weight: 400; margin: 0 0 14px; color: var(--ink);
}
.auth__title em { font-style: italic; color: var(--ink-3); }
.auth__lede {
    font-size: 14.5px; color: var(--ink-3); line-height: 1.55;
    margin: 0 0 32px; max-width: 42ch;
}
.auth__code {
    font-family: var(--ff-mono); font-size: 13px; color: var(--ink);
    background: var(--surface-alt); padding: 1px 5px; border-radius: var(--r-xs);
}

.auth-form  { display: grid; gap: 18px; }
.auth-field { display: flex; flex-direction: column; gap: 5px; }
.auth-field__label {
    font-family: var(--ff-mono); font-size: 11px;
    text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted);
}
.auth-field__input {
    padding: 13px 0; font-size: 15px; background: transparent;
    border: 0; border-bottom: 1px solid var(--rule-soft);
    border-radius: 0; font-family: var(--ff-sans); color: var(--ink);
    transition: border-color 0.15s;
}
.auth-field__input:focus { outline: none; border-bottom-color: var(--ink); box-shadow: none; }
.auth-field__input::placeholder { color: var(--muted-2); }
.auth-form__meta {
    font-family: var(--ff-mono); font-size: 11px; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.1em;
}
.btn--auth { justify-content: center; margin-top: 4px; }

.auth-alert {
    padding: 12px 14px; border-radius: var(--r-sm);
    font-size: 13.5px; margin-bottom: 20px; border: 1px solid;
    line-height: 1.5;
}
.auth-alert--error { background: var(--neg-bg); color: var(--neg); border-color: rgba(168,52,31,0.3); }

/* Right pane info block */
.auth__info { margin: auto 0; }
.auth__info-title {
    font-family: var(--ff-serif); font-size: 40px; line-height: 1.1;
    letter-spacing: -0.02em; font-weight: 400; margin: 0 0 16px; color: var(--ink);
}
.auth__info-title em { font-style: italic; color: var(--ink-3); }
.auth__info-text { color: var(--ink-3); font-size: 14px; line-height: 1.6; margin: 0 0 24px; max-width: 52ch; }

.auth-sources {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
    background: var(--rule-soft); border: 1px solid var(--rule-soft);
    border-radius: var(--r-md); overflow: hidden;
}
.auth-source { background: var(--surface); padding: 16px 18px; }
.auth-source__abbr {
    font-family: var(--ff-mono); font-size: 10.5px;
    text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted);
}
.auth-source__name {
    font-family: var(--ff-serif); font-size: 20px;
    letter-spacing: -0.01em; margin-top: 5px; color: var(--ink); line-height: 1.1;
}
.auth-source__desc { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; line-height: 1.45; }

.auth-meta {
    display: grid; grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--rule-soft); margin-top: 28px;
}
.auth-meta__item {
    padding: 16px 0;
    border-right: 1px solid var(--rule-faint);
}
.auth-meta__item:last-child { border-right: none; padding-left: 14px; }
.auth-meta__item + .auth-meta__item { padding-left: 14px; }
.auth-meta__label {
    font-family: var(--ff-mono); font-size: 10.5px;
    text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted);
}
.auth-meta__value {
    font-family: var(--ff-serif); font-size: 26px;
    line-height: 1; letter-spacing: -0.02em; margin-top: 5px; color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.auth-meta__sub { font-family: var(--ff-mono); font-size: 10.5px; color: var(--ink-3); margin-top: 3px; }

.auth__foot {
    margin-top: auto; padding-top: 24px;
    display: flex; justify-content: space-between; align-items: center;
    font-family: var(--ff-mono); font-size: 10.5px;
    text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted);
}
.auth__foot--right { border-top: 1px solid var(--rule-faint); }

@media (max-width: 900px) {
    .auth { grid-template-columns: 1fr; }
    .auth__pane--right { display: none; }
    .auth__pane--left { padding: 40px 32px; }
    .auth__title { font-size: 48px; }
}

/* ─── 21. Admin layout helpers ─── */
.admin-split {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 20px;
    align-items: start;
}
.admin-split--wide { grid-template-columns: minmax(280px, 380px) 1fr; }

/* ─── 22. Project list (admin/index.php) ─── */
.proj-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: var(--rule-soft);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
    overflow: hidden;
    margin-bottom: 28px;
}

/* Раздельные карточки проектов (по макету «Чернила») */
.project-list {
    list-style: none;
    margin: 0; padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
@media (max-width: 860px) { .project-list { grid-template-columns: 1fr; } }
.project-list__item {
    background: var(--surface);
    border: 1px solid var(--rule-soft);
    border-radius: 14px;
    transition: border-color .14s, box-shadow .14s;
}
.project-list__item:hover { border-color: #cbd5e1; box-shadow: 0 2px 8px rgba(15,23,42,0.05); }
.project-list__item--profile-gap { border-left: 3px solid #fde68a; }
.project-list__item.is-dragging { opacity: 0.45; }
.project-list--droppable.project-list--drag-over {
    outline: 2px dashed var(--accent, #2563eb);
    outline-offset: -2px;
    border-radius: 14px;
}

.project-portfolio {
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin-bottom: 28px;
}
.project-portfolio__section--extra .project-portfolio__title { color: var(--muted); }
.project-portfolio__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 14px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--ink);
}
.project-portfolio__title {
    margin: 0;
    font-family: var(--ff-serif);
    font-size: 26px;
    line-height: 1;
    font-weight: 400;
    letter-spacing: -0.01em;
    color: var(--ink);
}
.project-portfolio__problems { margin-left: auto; }
.project-portfolio__hint {
    font-size: 12px;
}
.project-portfolio__section--extra .project-list:empty {
    min-height: 48px;
}

.project-card-wrap {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 20px 22px 18px;
}
.project-card__drag-handle {
    flex: 0 0 auto;
    margin: 2px 0 0;
    padding: 0;
    border: none;
    background: transparent;
    color: #cbd5e1;
    font-size: 15px;
    line-height: 1.4;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    transition: color 0.12s;
}
.project-card__drag-handle:hover { color: var(--muted); }
.project-card__drag-handle:active { cursor: grabbing; }
.project-card-wrap .project-card { flex: 1 1 auto; min-width: 0; }
.project-card-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: transparent;
}
.project-card-main .project-card { background: transparent; }
.project-card-main .project-card:hover { background: transparent; }

.project-profile-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--rule-faint, #f1f5f9);
}
.project-profile-fields__chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: var(--r-xs);
    font-family: var(--ff-mono);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-decoration: none;
    line-height: 1.35;
}
.project-profile-fields__chip--ok {
    background: var(--pos-bg);
    color: var(--pos);
    box-shadow: 0 0 0 1px rgba(4, 120, 87, 0.22) inset;
}
.project-profile-fields__chip--missing {
    background: #fef2f2;
    color: #b91c1c;
    box-shadow: 0 0 0 1px #fecaca inset;
}
.project-profile-fields__chip--pending {
    background: var(--warn-bg);
    color: var(--warn-clr);
    box-shadow: 0 0 0 1px rgba(138, 90, 20, 0.25) inset;
}
.project-profile-fields__chip--missing:hover {
    background: #fee2e2;
    color: #991b1b;
}

.project-portfolio__problems {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-family: var(--ff-mono);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: #fef2f2;
    color: #b91c1c;
    box-shadow: 0 0 0 1px #fecaca inset;
}
.project-portfolio__alert {
    margin: 0 0 10px;
    padding: 10px 14px;
    border-radius: var(--r-sm);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.project-card {
    display: block;
    padding: 0;
    background: transparent;
    text-decoration: none;
}

.project-card__domain {
    display: inline;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin-right: 8px;
}
.project-card__name {
    display: inline;
    font-size: 13px;
    color: var(--ink-3);
}
.project-card__meta {
    display: block;
    font-family: var(--ff-mono);
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 5px;
    margin-bottom: 12px;
}

.project-integ {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 4px;
}
.project-integ__chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px 3px 6px;
    border-radius: var(--r-xs);
    font-family: var(--ff-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--paper-deep);
    color: var(--ink-3);
}
.project-integ__chip--connected { background: var(--pos-bg); color: var(--pos); }
.project-integ__chip--pending   { background: var(--warn-bg); color: var(--warn-clr); }
.project-integ__chip--disconnected { background: var(--paper-deep); color: var(--muted); }
.project-integ__chip--error    { background: #fef2f2; color: #b91c1c; box-shadow: 0 0 0 1px #fecaca inset; }

.project-integ__mark {
    width: 6px; height: 6px;
    border-radius: 50%;
    display: inline-block;
    background: var(--muted);
}
.project-integ__mark--ok      { background: var(--pos); }
.project-integ__mark--pending { background: var(--warn-clr); }
.project-integ__mark--off     { background: var(--muted-2); }
.project-integ__mark--error   { background: #dc2626; box-shadow: 0 0 0 2px rgba(220,38,38,0.18); }

.project-integ-legend {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 12px;
}
.project-integ-legend__item { display: flex; align-items: center; gap: 5px; }

.project-gear {
    flex: 0 0 auto;
    align-self: flex-start;
    width: 32px; height: 32px;
    display: grid; place-items: center;
    border-radius: 8px;
    color: var(--muted-2, #94a3b8);
    border: none;
    background: transparent;
    transition: background 0.12s, color 0.12s;
}
.project-gear:hover { background: var(--surface-alt); color: var(--ink); }
.project-gear svg { width: 17px; height: 17px; fill: currentColor; }

/* Add-project card (from design) */
.add-card {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 0;
    border: 1px solid var(--rule-soft);
    border-radius: 16px;
    background: var(--surface);
    overflow: hidden;
    margin-bottom: 48px;
}
/* Левая «издательская» тёмная колонка */
.add-card > div:first-child {
    padding: 40px;
    background: var(--ink);
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.add-card h2 {
    font-family: var(--ff-serif);
    font-size: 44px;
    line-height: 0.98;
    letter-spacing: -0.02em;
    font-weight: 400;
    margin: 0 0 18px;
    color: #fff;
}
.add-card h2 em { font-style: italic; color: #94a3b8; }
.add-card p { color: #cbd5e1; font-size: 14px; line-height: 1.6; margin: 0; max-width: 340px; }
.add-card__form { padding: 36px 40px; display: grid; gap: 18px; align-content: center; }
.add-card__row  { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.add-card .field__label { font: 10.5px/1 "JetBrains Mono", monospace; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin-bottom: 7px; display: block; }
.add-card .field__input,
.add-card .field__select {
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: 8px;
    padding: 11px 14px;
    font-size: 14px;
    width: 100%;
}
.add-card .field__input:focus,
.add-card .field__select:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(15,23,42,0.06); outline: none; }
.add-card .btn { align-self: start; margin-top: 4px; }
@media (max-width: 720px) { .add-card { grid-template-columns: 1fr; } }

/* ─── 23. Project page head (project.php) ─── */
.project-head {
    padding-bottom: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--rule);
}

.page-head__eyebrow { /* already defined */ }

/* Project tabs */
.project-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--rule-soft);
    margin-bottom: 28px;
    overflow-x: auto;
    scrollbar-width: none;
}
.project-tabs::-webkit-scrollbar { display: none; }
.project-tabs__link {
    padding: 12px 18px 12px 0;
    margin-right: 22px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.12s;
}
.project-tabs__link:hover { color: var(--ink); }
.project-tabs__link.is-active {
    color: var(--ink);
    border-bottom-color: var(--ink);
}

/* ─── 24. Integration cards ─── */
.integration-list { display: flex; flex-direction: column; gap: 12px; }

.integration-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: var(--surface);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
}
.integration-card--on {
    border-color: rgba(4,120,87,0.35);
    background: var(--pos-bg);
}
.integration-card__title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 3px;
    color: var(--ink);
}
.integration-card__desc {
    margin: 0;
    font-size: 13px;
    color: var(--ink-3);
    line-height: 1.45;
}
.integration-card__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
}

/* ─── 25. Danger zone ─── */
.danger-zone {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--rule-faint);
}
.danger-zone__text { margin: 0 0 12px; font-size: 13px; color: var(--muted); }

/* ─── 26. GSC / data panels ─── */
.panel--gsc, .panel--overview { margin-bottom: 20px; }

.gsc-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.gsc-range { min-width: 180px; }
.gsc-range--overview {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 16px;
}
.gsc-range--overview label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 140px;
}

.ov-project-filter {
    flex: 1 1 100%;
    padding: 12px 16px;
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-sm);
    background: var(--surface-alt);
    margin-bottom: 4px;
}
.ov-project-filter__legend {
    font-family: var(--ff-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0 6px;
}
.ov-project-filter__modes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.ov-project-filter__mode {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
}
.ov-project-filter__mode input { accent-color: var(--ink); }
/* (старые .ov-project-pick стили переопределены в секции 27b) */

/* GSC summary cards */
.gsc-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1px;
    background: var(--rule-soft);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
    overflow: hidden;
    margin-bottom: 20px;
}
.gsc-summary__card {
    background: var(--surface);
    padding: 16px 20px;
}
.gsc-summary__label {
    font-family: var(--ff-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    margin-bottom: 6px;
}
.gsc-summary__value {
    font-family: var(--ff-serif);
    font-size: 28px;
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
}
.gsc-summary__delta {
    font-family: var(--ff-mono);
    font-size: 11px;
    margin-top: 4px;
    color: var(--ink-3);
}

/* Chart containers */
.chart-container, .ov-chart-card, .kw-chart-wrap {
    background: var(--surface);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
    padding: 20px;
    margin-bottom: 20px;
}
.chart-container__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 12px;
    flex-wrap: wrap;
}
.chart-container__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    margin: 0;
    font-family: var(--ff-sans);
}
.chart-container__canvas, .ov-chart-wrap {
    position: relative;
    height: 220px;
}

.chart-period-toggle {
    display: flex;
    background: var(--paper-deep);
    border-radius: var(--r-sm);
    padding: 3px;
    gap: 2px;
}
.chart-period-toggle__btn {
    padding: 4px 12px;
    border: none;
    background: transparent;
    border-radius: var(--r-xs);
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    font-family: var(--ff-sans);
    transition: all 0.12s;
}
.chart-period-toggle__btn.is-active {
    background: var(--ink);
    color: var(--paper);
}

.ov-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}
.ov-chart-card--off { opacity: 0.75; background: var(--surface-alt); }
.ov-chart-card--wide { grid-column: 1 / -1; }

/* ─── 27. Overview pages ─── */
.ov-pages-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin: 16px 0 10px;
}
.ov-pages-period { margin: 6px 0 0; }
.ov-pages-sort-hint { margin: 0 0 10px; font-size: 12.5px; color: var(--muted); }
.ov-pages-filter { flex: 1 1 420px; max-width: 100%; }
.ov-preset-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.ov-preset-btns .btn.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.ov-pages-custom { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
.ov-pages-custom label { display: flex; flex-direction: column; gap: 4px; min-width: 150px; }
.ov-pages-grid { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 16px; margin-top: 10px; }
@media (max-width: 1400px) { .ov-pages-grid { grid-template-columns: 1fr 1fr; } }
.ov-pages-unified { grid-column: 1 / -1; }
.ov-subtitle { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--ink); }

/* ─── 27b. Overview redesign — editorial sections ─── */
.overview {
    display: flex;
    flex-direction: column;
    gap: 36px;
}
.overview > * { min-width: 0; }

/* Filter bar (top of overview) */
.ov-filter {
    background: var(--surface);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
    padding: 20px 24px;
}
.ov-filter__form { display: flex; flex-direction: column; gap: 16px; }
.ov-filter__row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px 20px;
}
.ov-filter__field { display: flex; flex-direction: column; gap: 5px; min-width: 160px; flex: 0 0 auto; }
.ov-filter__field .field__input { min-width: 160px; }
.ov-filter__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }

/* Project picker (portfolio mode) — компактный editorial */
.ov-project-filter {
    margin: 0;
    border: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ov-project-filter__legend {
    padding: 0;
    margin: 0;
    font-family: var(--ff-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}

/* Mode toggle — компактный segmented control */
.ov-project-filter__modes {
    display: inline-flex;
    margin: 0;
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-sm);
    overflow: hidden;
    width: fit-content;
    background: var(--surface);
}
.ov-project-filter__mode {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12.5px;
    color: var(--ink-3);
    cursor: pointer;
    border-right: 1px solid var(--rule-faint);
    position: relative;
}
.ov-project-filter__mode:last-child { border-right: none; }
.ov-project-filter__mode input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.ov-project-filter__mode:has(input:checked) {
    background: var(--ink);
    color: var(--paper);
}

/* Pick block — компактно */
.ov-project-pick {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid var(--rule-faint);
    padding-top: 12px;
    margin-top: 4px;
}
.ov-project-pick.is-hidden { display: none; }

/* Пресеты-блоки портфеля — быстрый выбор пула сайтов */
.ov-project-presets {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.ov-project-presets__label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.ov-project-presets__btn {
    padding: 4px 10px;
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.4;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.ov-project-presets__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 17px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    color: var(--ink-3);
    background: var(--paper-deep);
}

.ov-project-pick__toolbar {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}
.ov-project-pick__toolbar .btn {
    padding: 4px 10px;
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--ink-3);
    background: var(--surface);
}
.ov-project-pick__toolbar .btn:hover {
    background: var(--paper-deep);
    color: var(--ink);
}

/* Items grid — плотная сетка чипов */
.ov-project-pick__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 4px;
}
.ov-project-pick__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    min-width: 0;
    background: var(--surface-alt);
    border: 1px solid var(--rule-faint);
    border-radius: var(--r-xs);
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
    line-height: 1.3;
}
.ov-project-pick__item:hover {
    background: var(--paper-deep);
    border-color: var(--rule-soft);
}
.ov-project-pick__item input {
    flex-shrink: 0;
    margin: 0;
    accent-color: var(--accent);
    width: 13px; height: 13px;
}
.ov-project-pick__item:has(input:checked) {
    background: var(--accent-soft);
    border-color: var(--accent);
}
.ov-project-pick__domain {
    font-family: var(--ff-mono);
    font-size: 11.5px;
    font-weight: 500;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1 1 auto;
    min-width: 0;
}
.ov-project-pick__name {
    font-family: var(--ff-mono);
    font-size: 10.5px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ov-project-pick__item:has(input:checked) .ov-project-pick__name {
    color: var(--accent);
    opacity: 0.8;
}

/* Compact year/date fields next to picker */
.ov-filter__row .ov-filter__field { min-width: 140px; }
.ov-filter__row .ov-filter__field .field__input {
    padding: 8px 12px;
    font-size: 13.5px;
}

/* Period meta + status row */
.ov-meta {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1px;
    background: var(--rule-soft);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
    overflow: hidden;
}
.ov-meta__period,
.ov-meta__status {
    background: var(--surface);
    padding: 18px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ov-meta__period-line {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 10px;
}
.ov-meta__period-line strong {
    font-family: var(--ff-serif);
    font-size: 28px;
    line-height: 1;
    color: var(--ink);
    font-weight: 400;
    letter-spacing: -0.01em;
}
.ov-meta__dates {
    font-family: var(--ff-mono);
    font-size: 11.5px;
    color: var(--ink-3);
}
.ov-meta__vs {
    font-family: var(--ff-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    padding: 0 4px;
}
.ov-meta__scope {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--ink-3);
}
.ov-meta__scope strong { color: var(--ink); font-weight: 500; }
.ov-meta__hint {
    margin: 6px 0 0;
    font-size: 12.5px;
    color: var(--ink-3);
    line-height: 1.5;
    max-width: 70ch;
}
.ov-meta__hint strong { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.ov-meta__badge {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 7px;
    background: var(--accent-soft);
    color: var(--accent);
    font-family: var(--ff-mono);
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: var(--r-xs);
    vertical-align: 1px;
}
.ov-meta__badge--ytd {
    background: var(--paper-deep);
    color: var(--ink-3);
}

/* Hint inside field label (e.g. «На дату · игнорируется для прошлых лет») */
.ov-filter__hint {
    font-family: var(--ff-mono);
    font-size: 10px;
    color: var(--muted);
    text-transform: none;
    letter-spacing: 0.04em;
    margin-left: 4px;
    font-weight: 400;
}
.ov-filter__field input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--paper-deep);
}

/* Source boxes — Чернила: 2×2 bordered grid */
.ov-status {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.ov-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 12px;
    background: var(--surface);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-sm);
    font-family: var(--ff-mono);
    font-size: 12px;
    color: var(--muted);
}
.ov-pill__name {
    padding: 0;
    font-family: var(--ff-sans);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink);
}
.ov-pill__count {
    padding: 0;
    border: none;
    background: transparent;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.ov-pill--on { border-color: var(--rule-soft); }
.ov-pill--on .ov-pill__name { color: var(--ink); }
.ov-pill--on .ov-pill__count { background: transparent; color: var(--pos); border: none; }

/* Archive progress block */
.ov-archive {
    background: var(--surface);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
    padding: 16px 20px;
}
.ov-archive__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 10px;
}
.ov-archive__pct {
    font-family: var(--ff-mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.ov-archive .archive-progress {
    height: 4px;
    background: var(--paper-deep);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 0 12px;
}
.ov-archive__details {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin: 0;
    font-family: var(--ff-mono);
    font-size: 11.5px;
    color: var(--ink-3);
    line-height: 1.5;
}
.ov-archive__details strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.ov-archive__failed { color: var(--neg); }
.ov-archive__link {
    color: var(--accent);
    border-bottom: 1px solid var(--accent-soft);
    margin-left: auto;
}
.ov-archive__link:hover { border-bottom-color: var(--accent); }

/* Section heads */
.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 16px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--ink);
}
.section-head__title {
    font-family: var(--ff-serif);
    font-size: 32px;
    line-height: 1.05;
    letter-spacing: -0.02em;
    font-weight: 400;
    margin: 4px 0 0;
    color: var(--ink);
}
.section-head__title em { font-style: italic; color: var(--ink-3); }
.section-head__lede {
    margin: 8px 0 0;
    font-size: 13.5px;
    color: var(--ink-3);
    line-height: 1.55;
    max-width: 60ch;
}
.section-head__lede strong { color: var(--ink); }
.section-head__meta {
    font-family: var(--ff-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    padding-top: 8px;
    white-space: nowrap;
}
.section-head--quiet { border-bottom-color: var(--rule-faint); }
.section-head--quiet .section-head__title { font-size: 24px; }

/* YoY KPI blocks */
.ov-yoy {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
@media (max-width: 860px) { .ov-yoy { grid-template-columns: 1fr; } }
.ov-yoy-block {
    background: var(--surface);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-lg);
    padding: 24px 26px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.ov-yoy-block__head {
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.ov-yoy-block__abbr {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    padding: 3px 8px;
    background: var(--paper-deep);
    color: var(--ink);
    font-family: var(--ff-mono);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: var(--r-xs);
}
.ov-yoy-block--gsc     .ov-yoy-block__abbr { background: var(--data-1); color: var(--paper); }
.ov-yoy-block--yandex  .ov-yoy-block__abbr { background: var(--data-2); color: var(--paper); }
.ov-yoy-block--ga4     .ov-yoy-block__abbr { background: var(--data-3); color: var(--paper); }
.ov-yoy-block--metrika .ov-yoy-block__abbr { background: var(--data-4); color: var(--paper); }
.ov-yoy-block--bing    .ov-yoy-block__abbr { background: #0078d4; color: #fff; }
.ov-yoy-block__abbr--unified { background: var(--ink); color: var(--paper); font-size: 14px; }

.ov-yoy-block__title {
    font-family: var(--ff-sans);
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    margin: 0;
}

.ov-yoy-block__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 4px 24px;
}
.ov-yoy-metric {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px 0;
}
.ov-yoy-metric__label {
    font-family: var(--ff-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
}
.ov-yoy-metric__value {
    font-family: var(--ff-serif);
    font-size: 34px;
    line-height: 1;
    letter-spacing: -0.02em;
    font-weight: 400;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.ov-yoy-metric__delta {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-family: var(--ff-mono);
    font-size: 11.5px;
}
.ov-yoy-metric__delta .delta--up,
.ov-yoy-metric__delta .ov-delta--up { color: var(--pos); }
.ov-yoy-metric__delta .delta--down,
.ov-yoy-metric__delta .ov-delta--down { color: var(--neg); }
.ov-yoy-metric__delta .delta--flat,
.ov-yoy-metric__delta .ov-delta--flat { color: var(--muted); }
.ov-yoy-metric__prev { color: var(--muted); }
.ov-yoy-bars {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 6px;
}
.ov-yoy-bars__row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-height: 12px;
}
.ov-yoy-bars__row span {
    font-family: var(--ff-mono);
    font-size: 10px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.ov-yoy-bars__row i {
    display: block;
    height: 7px;
    background: var(--paper-deep);
    border-radius: 2px;
    overflow: hidden;
}
.ov-yoy-bars__row b {
    display: block;
    height: 100%;
    min-width: 2px;
    background: var(--ink);
    border-radius: 2px;
}
.ov-yoy-bars__row--prev b {
    background: #CBD5E1;
}
.ov-yoy-metric__empty {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

/* Charts grid (overrides earlier) */
.ov-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 0;
}
.ov-chart-card {
    background: var(--surface);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
    padding: 20px 22px;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.ov-chart-card--wide { grid-column: 1 / -1; }
.ov-chart-card--off { opacity: 0.7; }

.ov-chart-card__head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--rule-faint);
}
.ov-chart-card__abbr {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    padding: 3px 8px;
    font-family: var(--ff-mono);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: var(--r-xs);
    background: var(--paper-deep);
    color: var(--ink);
}
.ov-chart-card__abbr--gsc     { background: var(--data-1); color: var(--paper); }
.ov-chart-card__abbr--yandex  { background: var(--data-2); color: var(--paper); }
.ov-chart-card__abbr--ga4     { background: var(--data-3); color: var(--paper); }
.ov-chart-card__abbr--metrika { background: var(--data-4); color: var(--paper); }
.ov-chart-card__abbr--links   { background: var(--ink); color: var(--paper); font-size: 14px; }

.ov-chart-card__title {
    font-family: var(--ff-sans);
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    margin: 0;
}
.ov-chart-card__note {
    margin: -4px 0 0;
    font-size: 12.5px;
    color: var(--ink-3);
    line-height: 1.45;
    max-width: 70ch;
}
.ov-chart-card__empty {
    margin: 0;
    padding: 40px 0;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

/* Pages toolbar */
.ov-pages-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px;
    background: var(--surface);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
    padding: 16px 20px;
}
.ov-pages-toolbar__presets {
    display: flex;
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-sm);
    overflow: hidden;
}
.ov-pages-toolbar__custom {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin-left: auto;
}
.ov-pages-toolbar__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 150px;
}
.ov-preset-btn {
    background: var(--surface);
    border: none;
    border-right: 1px solid var(--rule-faint);
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-3);
    cursor: pointer;
    font-family: var(--ff-sans);
    transition: background 0.12s, color 0.12s;
}
.ov-preset-btn:last-child { border-right: none; }
.ov-preset-btn:hover { background: var(--surface-alt); color: var(--ink); }
.ov-preset-btn.is-active {
    background: var(--ink);
    color: var(--paper);
}
.ov-pages-sort-hint {
    margin: -16px 0 0;
    font-family: var(--ff-mono);
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Pages grid */
.ov-pages-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 0;
}
.ov-pages-card {
    background: var(--surface);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.ov-pages-card--unified { grid-column: auto; }
@media (max-width: 1400px) { .ov-pages-card--unified { grid-column: 1 / -1; } }

.ov-pages-card__head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--rule-soft);
    background: var(--surface-alt);
}
.ov-pages-card__title {
    margin: 0;
    font-family: var(--ff-sans);
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}
.ov-pages-card__note {
    margin-left: auto;
    font-size: 12px;
    color: var(--muted);
    text-align: right;
}
.ov-pages-card .table-wrap {
    border: 0;
    border-radius: 0;
    max-height: 480px;
}
.ov-pages-card .gsc-table {
    border: 0;
}
.ov-empty-cell {
    text-align: center;
    color: var(--muted);
    padding: 24px !important;
    font-size: 13px;
}

/* Link blocks (inbound / outbound) */
.ov-links-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.ov-link-block {
    background: var(--surface);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.ov-link-block__head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--rule-faint);
}
.ov-link-block__arrow {
    display: grid;
    place-items: center;
    width: 40px; height: 40px;
    border-radius: var(--r-sm);
    background: var(--paper-deep);
    color: var(--ink);
    font-size: 18px;
    font-family: var(--ff-serif);
}
.ov-link-block__title {
    margin: 0;
    font-family: var(--ff-serif);
    font-size: 22px;
    line-height: 1.1;
    letter-spacing: -0.01em;
    font-weight: 400;
    color: var(--ink);
}
.ov-link-block__sub {
    display: block;
    font-family: var(--ff-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    margin-top: 2px;
}
.ov-link-block__hint {
    margin: 0;
    font-size: 13px;
    color: var(--ink-3);
    line-height: 1.5;
}
.ov-link-block__snapshot {
    margin: 0;
    font-family: var(--ff-mono);
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.ov-link-block__note {
    margin: 0;
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.45;
}
.ov-link-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: var(--rule-faint);
    border: 1px solid var(--rule-faint);
    border-radius: var(--r-sm);
    overflow: hidden;
}
.ov-link-stat {
    background: var(--surface);
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ov-link-stat__label {
    font-family: var(--ff-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}
.ov-link-stat__value {
    font-family: var(--ff-serif);
    font-size: 24px;
    line-height: 1;
    font-weight: 400;
    letter-spacing: -0.01em;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.ov-link-stat__value--muted { color: var(--muted); font-size: 18px; }

.ov-link-tables {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.ov-link-tbl__title {
    margin: 0 0 8px;
    font-family: var(--ff-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 8px;
}
.table-wrap--mini { max-height: 240px; }
.table-wrap--mini .gsc-table th { padding: 8px 12px; font-size: 10px; }
.table-wrap--mini .gsc-table td { padding: 8px 12px; font-size: 12.5px; }

/* Insights cards */
.ov-insights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}
.ov-insight {
    background: var(--surface);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ov-insight__label {
    font-family: var(--ff-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}
.ov-insight p {
    margin: 0;
    font-size: 13.5px;
    color: var(--ink-2);
    line-height: 1.55;
}

/* Small button variant */
.btn--sm { padding: 6px 12px; font-size: 12.5px; }

/* Responsive — overview */
@media (max-width: 1100px) {
    .ov-meta { grid-template-columns: 1fr; }
    .ov-yoy { grid-template-columns: 1fr; }
    .ov-chart-grid { grid-template-columns: 1fr; }
    .ov-pages-grid { grid-template-columns: 1fr; }
    .ov-pages-card--unified { grid-column: auto; }
    .ov-links-grid { grid-template-columns: 1fr; }
    .ov-link-tables { grid-template-columns: 1fr; }
}

/* ─── 27c. Yandex Webmaster tab (.ytab) ─── */
.ytab {
    display: flex;
    flex-direction: column;
    gap: 32px;
}
.ytab > * { min-width: 0; }

/* Head */
.ytab__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--rule);
    flex-wrap: wrap;
}
.ytab__title { flex: 1 1 320px; min-width: 0; }
.ytab__eyebrow { color: var(--data-2); }
.ytab__h2 {
    font-family: var(--ff-serif);
    font-size: 44px;
    line-height: 1.0;
    letter-spacing: -0.025em;
    font-weight: 400;
    color: var(--ink);
    margin: 6px 0 12px;
    display: flex;
    align-items: baseline;
    gap: 14px;
    flex-wrap: wrap;
}
.ytab__host {
    font-family: var(--ff-mono);
    font-size: 14px;
    color: var(--ink-3);
    text-transform: lowercase;
    letter-spacing: 0;
    padding: 4px 10px;
    background: var(--surface-alt);
    border: 1px solid var(--rule-faint);
    border-radius: var(--r-xs);
    vertical-align: middle;
}
.ytab__sub {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 24px;
    font-size: 12.5px;
    line-height: 1.5;
}
.ytab__sub-item {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}
.ytab__sub-label {
    font-family: var(--ff-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
}
.ytab__sub-val {
    color: var(--ink);
    font-weight: 500;
}
.ytab__sub-link {
    color: var(--accent);
    border-bottom: 1px solid var(--accent-soft);
}
.ytab__sub-link:hover { border-bottom-color: var(--accent); }

/* Period segmented buttons */
.ytab__period {
    display: inline-flex;
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-sm);
    overflow: hidden;
    background: var(--surface);
    margin: 0;
    height: fit-content;
}
.ytab__period-btn {
    background: var(--surface);
    border: none;
    border-right: 1px solid var(--rule-faint);
    padding: 9px 16px;
    font-family: var(--ff-sans);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ink-3);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.12s, color 0.12s;
}
.ytab__period-btn:last-child { border-right: none; }
.ytab__period-btn:hover { background: var(--surface-alt); color: var(--ink); }
.ytab__period-btn.is-active {
    background: var(--ink);
    color: var(--paper);
}

/* Status row — 5 cards */
.ytab-status {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1px;
    background: var(--rule-soft);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
    overflow: hidden;
}
.ytab-status__card {
    background: var(--surface);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 84px;
}
.ytab-status__card--verified-on  { background: linear-gradient(180deg, rgba(4,120,87,0.04), var(--surface)); }
.ytab-status__card--verified-off { background: linear-gradient(180deg, rgba(168,52,31,0.04), var(--surface)); }
.ytab-status__label {
    font-family: var(--ff-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}
.ytab-status__value {
    font-size: 18px;
    color: var(--ink);
    font-weight: 500;
    line-height: 1.1;
}
.ytab-status__value.serif {
    font-family: var(--ff-serif);
    font-size: 30px;
    line-height: 1;
    font-weight: 400;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.ytab-status__value.mono {
    font-family: var(--ff-mono);
    font-size: 13px;
}
.ytab-status__sub {
    font-family: var(--ff-mono);
    font-size: 11px;
    color: var(--muted);
    margin-top: -4px;
}
.ytab-status__spark {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--data-2);
    margin-top: -4px;
}
.ytab-status__spark svg { display: block; }
.ytab-status__spark .delta--up   { color: var(--pos); font-family: var(--ff-mono); font-size: 11.5px; font-weight: 500; }
.ytab-status__spark .delta--down { color: var(--neg); font-family: var(--ff-mono); font-size: 11.5px; font-weight: 500; }
.ytab-status__spark .delta--flat { color: var(--muted); font-family: var(--ff-mono); font-size: 11.5px; font-weight: 500; }

/* Pills (verified on/off) */
.ytab-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--r-xs);
    font-size: 12px;
    font-weight: 500;
}
.ytab-pill--on  { background: var(--pos-bg); color: var(--pos); }
.ytab-pill--off { background: var(--neg-bg); color: var(--neg); }

/* Notes */
.ytab-notes {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ytab-note {
    margin: 0;
    padding: 12px 16px;
    background: var(--surface-alt);
    border: 1px solid var(--rule-faint);
    border-radius: var(--r-sm);
    font-size: 13px;
    line-height: 1.5;
    color: var(--ink-3);
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.ytab-note__badge {
    flex-shrink: 0;
    padding: 2px 8px;
    background: var(--warn-bg);
    color: var(--warn-clr);
    font-family: var(--ff-mono);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-radius: var(--r-xs);
}
.ytab-note__badge--info { background: var(--accent-soft); color: var(--accent); }
.ytab-note--info {
    background: var(--accent-soft);
    border-color: rgba(15,23,42,0.25);
    color: var(--ink-2);
}
.ytab-note--info strong { color: var(--accent); font-weight: 600; }
.ytab-note--info a { color: var(--accent); border-bottom: 1px solid var(--accent); }

/* Source badge — архив vs live API */
.ytab-source-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--paper-deep);
    color: var(--ink-3);
    font-family: var(--ff-mono);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-radius: var(--r-xs);
}
.ytab-source-badge--api {
    background: var(--accent);
    color: var(--paper);
    position: relative;
    padding-left: 14px;
}
.ytab-source-badge--api::before {
    content: '';
    position: absolute;
    left: 6px; top: 50%;
    width: 5px; height: 5px;
    margin-top: -2.5px;
    background: #6FE56F;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(111,229,111,0.25);
    animation: ytab-live-pulse 1.6s ease-in-out infinite;
}
@keyframes ytab-live-pulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(111,229,111,0.25); }
    50%       { box-shadow: 0 0 0 4px rgba(111,229,111,0.05); }
}
.ytab-code {
    font-family: var(--ff-mono);
    font-size: 12px;
    background: var(--paper-deep);
    padding: 1px 6px;
    border-radius: var(--r-xs);
    color: var(--ink);
}

/* KPI grid for ytab uses base .kpi-grid; add unit + footer tone */
.kpi-grid--ytab { margin-bottom: 0; }
.kpi-card__unit {
    font-family: var(--ff-serif);
    font-size: 18px;
    color: var(--muted);
    margin-left: 2px;
    vertical-align: 4px;
}
.kpi-card__footer.delta--up   { color: var(--pos); font-family: var(--ff-mono); font-size: 11.5px; }
.kpi-card__footer.delta--down { color: var(--neg); font-family: var(--ff-mono); font-size: 11.5px; }
.kpi-card__footer.delta--flat { color: var(--muted); font-family: var(--ff-mono); font-size: 11.5px; }

/* HTTP indexing */
.ytab-http {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1px;
    background: var(--rule-soft);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
    overflow: hidden;
}
.ytab-http__card {
    background: var(--surface);
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    overflow: hidden;
}
.ytab-http__card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--muted-2);
}
.ytab-http__card--ok::before    { background: var(--pos); }
.ytab-http__card--info::before  { background: var(--accent); }
.ytab-http__card--warn::before  { background: var(--warn-clr); }
.ytab-http__card--neg::before   { background: var(--neg); }
.ytab-http__label {
    font-family: var(--ff-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
}
.ytab-http__value {
    font-family: var(--ff-serif);
    font-size: 28px;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

/* Show all toggle */
.ytab-all {
    margin: 0;
}
.ytab-all__toggle {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    background: var(--surface);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
    cursor: pointer;
    transition: background 0.12s;
}
.ytab-all__toggle:hover { background: var(--surface-alt); }
.ytab-all__toggle input { margin-top: 3px; accent-color: var(--accent); }
.ytab-all__text { display: flex; flex-direction: column; gap: 3px; }
.ytab-all__main {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ink);
}
.ytab-all__hint {
    font-family: var(--ff-mono);
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0.04em;
}

/* ── Yandex query exclusion filter ── */
.ym-exclude {
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
    background: var(--surface);
    margin-bottom: 16px;
}
.ym-exclude[open] {
    border-color: var(--accent);
}
.ym-exclude__summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ink);
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.ym-exclude__summary::-webkit-details-marker { display: none; }
.ym-exclude__summary:hover { background: var(--surface-alt); border-radius: var(--r-md); }
.ym-exclude[open] .ym-exclude__summary {
    border-bottom: 1px solid var(--rule-soft);
    border-radius: var(--r-md) var(--r-md) 0 0;
}
.ym-exclude__form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 18px;
}
.ym-exclude__label {
    font-size: 13px;
    color: var(--ink);
    line-height: 1.5;
}
.ym-exclude__textarea {
    width: 100%;
    max-width: 480px;
    min-height: 110px;
    padding: 8px 10px;
    font-family: var(--ff-mono);
    font-size: 12px;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--r-sm);
    resize: vertical;
    line-height: 1.6;
    box-sizing: border-box;
}
.ym-exclude__textarea:focus {
    outline: none;
    border-color: var(--accent);
}
.ym-exclude__btn {
    align-self: flex-start;
    padding: 7px 18px;
    font-size: 13px;
    font-weight: 500;
    color: var(--paper);
    background: var(--accent);
    border: none;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: opacity 0.12s;
}
.ym-exclude__btn:hover { opacity: 0.85; }
.ym-exclude__hint {
    font-size: 12px;
    color: var(--muted);
    font-family: var(--ff-mono);
}

/* Table cards */
.ytab-tables-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.ytab-tbl {
    background: var(--surface);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.ytab-tbl--wide   { grid-column: 1 / -1; }
.ytab-tbl--narrow { max-width: 640px; }

.ytab-tbl__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--surface-alt);
    border-bottom: 1px solid var(--rule-soft);
    flex-wrap: wrap;
}
.ytab-tbl__abbr {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px; height: 24px;
    padding: 0 6px;
    font-family: var(--ff-mono);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: var(--r-xs);
    background: var(--data-2);
    color: var(--paper);
    flex-shrink: 0;
}
.ytab-tbl__abbr--links { background: var(--ink); color: var(--paper); font-size: 13px; }
.ytab-tbl__abbr--neg   { background: var(--neg); color: var(--paper); font-size: 14px; }
.ytab-tbl__abbr--sqi   { background: var(--data-5); color: var(--paper); font-size: 10px; }

.ytab-tbl__title-wrap {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
}
.ytab-tbl__title {
    margin: 0;
    font-family: var(--ff-sans);
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}
.ytab-tbl__count {
    font-family: var(--ff-mono);
    font-size: 11.5px;
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
}
.ytab-tbl__count--ok  { color: var(--pos); }
.ytab-tbl__count--neg { color: var(--neg); }
.ytab-tbl__total { color: var(--muted); }
.ytab-tbl__actions { display: flex; gap: 4px; margin-left: auto; }

.ytab-export {
    padding: 3px 8px;
    font-family: var(--ff-mono);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--ink-3);
    background: var(--surface);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-xs);
    text-decoration: none;
    line-height: 1.4;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.ytab-export:hover {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
}

.ytab-tbl__error {
    margin: 0;
    padding: 10px 18px;
    background: var(--neg-bg);
    color: var(--neg);
    font-size: 12.5px;
    border-bottom: 1px solid rgba(168,52,31,0.2);
}
.ytab-tbl__search {
    padding: 10px 18px;
    border-bottom: 1px solid var(--rule-faint);
    background: var(--surface);
}
.ytab-tbl__input {
    width: 100%;
    padding: 8px 12px;
    background: var(--surface-alt);
    border: 1px solid var(--rule-faint);
    border-radius: var(--r-sm);
    font-family: var(--ff-sans);
    font-size: 13px;
    color: var(--ink);
}
.ytab-tbl__input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface);
}
.ytab-tbl__input::placeholder { color: var(--muted); }

/* Table cleanup inside .ytab-tbl */
.ytab-tbl .table-wrap {
    border: 0;
    border-radius: 0;
    max-height: 520px;
}
.ytab-tbl .gsc-table { border: 0; }

/* Misc utilities */
.ytab-link {
    color: var(--accent);
    border-bottom: 1px solid var(--accent-soft);
}
.ytab-link:hover { border-bottom-color: var(--accent); }
.ytab-broken-url {
    font-family: var(--ff-mono);
    font-size: 12.5px;
    color: var(--neg);
    word-break: break-all;
}

/* Empty state */
.ytab-empty {
    background: var(--surface);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
    padding: 48px 56px;
    text-align: left;
}
.ytab-empty .eyebrow { color: var(--data-2); }
.ytab-empty__title {
    font-family: var(--ff-serif);
    font-size: 40px;
    line-height: 1.05;
    letter-spacing: -0.02em;
    font-weight: 400;
    color: var(--ink);
    margin: 8px 0 12px;
}
.ytab-empty__text {
    margin: 0;
    font-size: 14.5px;
    color: var(--ink-3);
    line-height: 1.55;
    max-width: 60ch;
}

/* mono / nowrap utility */
td.mono, .mono.nowrap { font-family: var(--ff-mono); font-size: 12.5px; color: var(--ink-3); }
.nowrap { white-space: nowrap; }

/* Responsive */
@media (max-width: 1100px) {
    .ytab-tables-2col { grid-template-columns: 1fr; }
    .ytab__h2 { font-size: 32px; }
    .ytab__head { flex-direction: column; }
}

/* ─── 27d. GSC tab — переопределения акцентов (.gtab) ─── */
/* GSC использует тот же editorial-каркас .ytab, но с кобальтовым акцентом (data-1) вместо терракоты (data-2). */
.gtab .ytab__eyebrow,
.gtab__eyebrow { color: var(--data-1); }

.gtab .ytab__h2 em { color: var(--ink-3); }

.gtab .ytab-tbl__abbr,
.gtab__abbr {
    background: var(--data-1);
    color: var(--paper);
}

/* Section head actions (для секции «Внешние ссылки» — кнопка «Обновить») */
.section-head__actions {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding-top: 8px;
    flex-shrink: 0;
}
.section-head__actions .btn {
    padding: 6px 12px;
    font-size: 12px;
    line-height: 1.4;
}

/* GSC empty state — кобальтовая надпись eyebrow */
.gtab-empty .eyebrow { color: var(--data-1); }

/* ─── 27e. Yandex Metrika tab — сливовый акцент (.mtab) ─── */
.mtab .ytab__eyebrow,
.mtab__eyebrow { color: var(--data-4); }

.mtab .ytab-tbl__abbr,
.mtab__abbr {
    background: var(--data-4);
    color: var(--paper);
}
.mtab__abbr--ai {
    background: var(--ink);
    color: var(--paper);
    font-size: 11px;
}

.mtab-empty .eyebrow { color: var(--data-4); }

/* День недели (Пн/Вт/Сб/Вс) рядом с датой в таблице «По дням» */
.mtab-dow {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 5px;
    font-family: var(--ff-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: var(--r-xs);
    background: var(--paper-deep);
    color: var(--ink-3);
}
.mtab-dow--we {
    background: var(--accent-soft);
    color: var(--accent);
}
.mtab-weekend td.mono { color: var(--ink-3); }

/* Share-bar в «Источниках трафика» */
.mtab-share {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 140px;
    justify-content: flex-end;
}
.mtab-share__bar {
    display: inline-block;
    flex: 1;
    height: 4px;
    background: var(--paper-deep);
    border-radius: 2px;
    overflow: hidden;
    min-width: 60px;
    max-width: 100px;
}
.mtab-share__fill {
    display: block;
    height: 100%;
    background: var(--data-4);
    border-radius: 2px;
}
.mtab-share__val {
    font-family: var(--ff-mono);
    font-size: 11px;
    font-weight: 500;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    min-width: 48px;
    text-align: right;
}

/* Engine badge (Яндекс / Google) */
.mk-engine-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-family: var(--ff-mono);
    font-size: 11px;
    font-weight: 500;
    border-radius: var(--r-xs);
    background: var(--paper-deep);
    color: var(--ink-3);
    white-space: nowrap;
}
.mk-engine-badge--yandex {
    background: rgba(184, 72, 46, 0.12);
    color: var(--data-2);
}
.mk-engine-badge--google {
    background: rgba(15, 23, 42, 0.1);
    color: var(--data-1);
}

/* AI source badge */
.mk-ai-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-family: var(--ff-mono);
    font-size: 11px;
    font-weight: 500;
    border-radius: var(--r-xs);
    background: var(--paper-deep);
    color: var(--ink-3);
    white-space: nowrap;
}
.mk-ai-badge--chatgpt    { background: rgba(16, 163, 127, 0.12); color: #0E7C61; }
.mk-ai-badge--perplexity { background: rgba(124, 58, 237, 0.12); color: var(--data-4); }
.mk-ai-badge--gemini     { background: rgba(15, 23, 42, 0.1); color: var(--data-1); }
.mk-ai-badge--claude     { background: rgba(217, 119, 6, 0.12); color: var(--data-5); }
.mk-ai-badge--copilot    { background: rgba(44, 107, 111, 0.12); color: var(--data-6); }
.mk-ai-badge--yandex     { background: rgba(184, 72, 46, 0.12); color: var(--data-2); }

/* Filter в section-head__actions (для секций 05/06) */
.mtab-filter {
    align-self: flex-start;
}
.mtab-filter__label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 180px;
}
.mtab-filter__label .field__input {
    padding: 7px 10px;
    font-size: 12.5px;
}

/* Доп. KPI grid для mtab (5 карточек) */
.kpi-grid--mtab {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

/* ─── 28. Keywords tab ─── */
.panel--keywords { margin-top: 0; }

.kw-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.kw-view-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-sm);
    overflow: hidden;
    margin-bottom: 8px;
}
.kw-view-nav__link {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-3);
    text-decoration: none;
    border-right: 1px solid var(--rule-soft);
    background: var(--surface);
    white-space: nowrap;
    transition: background 0.12s;
}
.kw-view-nav__link:last-child { border-right: none; }
.kw-view-nav__link:hover { background: var(--surface-alt); color: var(--ink); }
.kw-view-nav__link.is-active { background: var(--ink); color: var(--paper); }

.kw-engine-nav {
    display: flex;
    gap: 0;
    background: var(--paper-deep);
    padding: 3px;
    border-radius: var(--r-sm);
    border: 1px solid var(--rule-soft);
    margin-bottom: 16px;
}
.kw-engine-nav__link {
    padding: 7px 16px;
    border-radius: var(--r-xs);
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-3);
    text-decoration: none;
    transition: background 0.12s;
}
.kw-engine-nav__link.is-active { background: var(--ink); color: var(--paper); }

.kw-toolbar { margin-bottom: 16px; }
.kw-toolbar__row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    align-items: flex-end;
    margin-bottom: 10px;
}
.kw-add-row .field__input { max-width: 260px; }

.kw-custom-dates .kw-date-pair {
    display: flex; gap: 8px;
}

.kw-chart-wrap {
    position: relative;
    margin-bottom: 16px;
    padding: 0;
    border: none;
    background: transparent;
}

.kw-matrix-wrap {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
    max-height: 70vh;
    overflow-y: auto;
}
.kw-matrix-hint {
    margin: 4px 0 10px;
    font-family: var(--ff-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.kw-data-status {
    margin: 12px 0 12px;
    padding: 12px 14px;
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--ink-2);
    font-size: 14px;
    line-height: 1.55;
}

.kw-data-status strong {
    color: var(--ink);
    font-weight: 700;
}

.kw-data-status--warning {
    border-color: rgba(181, 121, 0, 0.35);
    background: rgba(181, 121, 0, 0.08);
}

.kw-matrix {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    background: var(--surface);
}
.kw-matrix thead th {
    padding: 10px 12px;
    font-family: var(--ff-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    font-weight: 600;
    border-bottom: 1px solid var(--rule-soft);
    background: var(--paper-deep);
    text-align: left;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}
.kw-matrix thead th.kw-matrix__sticky {
    z-index: 3;
    border-right: 1px solid var(--rule-faint);
}
.kw-matrix tbody td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--rule-faint);
    color: var(--ink);
    vertical-align: middle;
    background: var(--surface);
}
.kw-matrix tbody tr:hover td { background: var(--surface-alt); }
.kw-matrix tbody tr:last-child td { border-bottom: none; }

/* Sticky-колонки слева — запрос всегда виден при горизонтальном скролле */
.kw-matrix__sticky {
    position: sticky;
    left: 0;
    background: var(--surface);
    z-index: 1;
    border-right: 1px solid var(--rule-faint);
}
.kw-matrix tbody tr:hover .kw-matrix__sticky { background: var(--surface-alt); }

.kw-matrix__sticky:first-child { left: 0; min-width: 32px; padding-right: 0; }
.kw-matrix__sticky.kw-matrix__query { left: 32px; }
.kw-matrix__query {
    min-width: 200px;
    max-width: 280px;
    font-weight: 500;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
}
.kw-matrix__last, .kw-matrix__delta {
    font-family: var(--ff-mono);
    font-weight: 600;
    color: var(--ink);
    min-width: 76px;
    text-align: center;
}

/* Pos/Delta inside matrix cells (and «Последняя/Δ» columns) */
.kw-pos-val {
    font-family: var(--ff-mono);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    margin-right: 6px;
}
.kw-delta-val {
    font-family: var(--ff-mono);
    font-size: 11px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}
.kw-cell--empty .kw-pos-val { color: var(--muted-2); font-weight: 400; }

.kw-delta-improved, .kw-delta-up   { color: var(--pos); }
.kw-delta-worse,   .kw-delta-down  { color: var(--neg); }
.kw-delta-flat                     { color: var(--muted); }

.kw-empty { text-align: center; padding: 24px; color: var(--muted); }

/* «Изменения позиций» — header + segmented control + card */
.kw-changes-head {
    margin-top: 32px;
}
.kw-changes-meta {
    max-width: 70ch;
    line-height: 1.5;
    color: var(--ink-3);
}
.kw-changes-meta strong {
    color: var(--ink);
    font-family: var(--ff-mono);
    font-size: 12.5px;
    font-weight: 600;
}
.kw-changes-windows {
    display: inline-flex;
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-sm);
    overflow: hidden;
    background: var(--surface);
    flex-shrink: 0;
}
.kw-changes-btn {
    padding: 8px 16px;
    background: var(--surface);
    border: none;
    border-right: 1px solid var(--rule-faint);
    font-family: var(--ff-sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-3);
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
}
.kw-changes-btn:last-child { border-right: none; }
.kw-changes-btn:hover { background: var(--surface-alt); color: var(--ink); }
.kw-changes-btn.is-active { background: var(--ink); color: var(--paper); }

.kw-changes-card {
    margin-top: 12px;
}
.kw-changes-card .table-wrap {
    max-height: 60vh;
    overflow-y: auto;
}
.kw-changes-card .kw-delta-improved,
.kw-changes-card .kw-delta-worse,
.kw-changes-card .kw-delta-flat {
    font-weight: 600;
}

.kw-pending-banner {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
    margin: 10px 0; padding: 13px 16px;
    background: var(--warn-bg);
    border: 1px solid rgba(138,90,20,0.3);
    border-radius: var(--r-sm);
    font-size: 13.5px;
}
.kw-pending-banner p { margin: 0; flex: 1; min-width: 200px; }

.kw-sync-cell { font-family: var(--ff-mono); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.kw-sync-cell--pending { color: var(--warn-clr); }
.kw-sync-cell--ok      { color: var(--pos); }
.kw-sync-cell--no_data { color: var(--muted); }
.kw-sync-cell--lost    { color: var(--neg); font-weight: 700; }
.kw-sync-cell--error   { color: var(--neg); }

.kw-sync-status { font-family: var(--ff-mono); font-size: 12px; color: var(--muted); min-width: 120px; }

.kw-popular-table__query { max-width: 360px; font-weight: 500; text-align: left; }
.kw-toolbar--popular { margin-top: 0; }

/* Keywords project bar (keyword-positions.php) */
.kw-project-bar {
    margin-bottom: 16px;
    padding: 16px 20px;
    background: var(--surface);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
}
.kw-project-bar__main {
    display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px;
}
.kw-project-bar__select-field { min-width: min(100%, 280px); flex: 1 1 220px; }
.kw-project-bar__meta { display: flex; flex-direction: column; gap: 2px; flex: 1 1 160px; }
.kw-project-bar__domain { font-family: var(--ff-serif); font-size: 20px; letter-spacing: -0.02em; color: var(--ink); }
.kw-project-bar__name   { font-size: 12.5px; color: var(--ink-3); }

.kw-project-bar__pills {
    display: flex; flex-wrap: wrap; gap: 5px;
    margin-top: 12px; padding-top: 12px;
    border-top: 1px solid var(--rule-faint);
}
.kw-project-bar__pill {
    padding: 5px 12px;
    border-radius: var(--r-sm);
    font-family: var(--ff-mono);
    font-size: 11.5px;
    font-weight: 500;
    text-decoration: none;
    color: var(--ink-3);
    background: var(--surface-alt);
    border: 1px solid var(--rule-soft);
    transition: all 0.12s;
}
.kw-project-bar__pill:hover { border-color: var(--ink-3); color: var(--ink); }
.kw-project-bar__pill.is-active { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* ─── 29. Sync page ─── */
.sync-summary {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 14px;
    margin-bottom: 20px;
}
.sync-card {
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
    padding: 18px 20px;
    background: var(--surface);
}
.sync-card--hero { border-left: 3px solid var(--accent); }
.sync-card__label { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.sync-card__value {
    margin: 0 0 8px;
    font-family: var(--ff-serif);
    font-size: 48px;
    line-height: 1;
    font-weight: 400;
    letter-spacing: -0.02em;
    color: var(--ink);
}
.sync-card__value--warn { color: var(--neg); }
.sync-card__stats { margin: 8px 0 0; padding-left: 1rem; font-size: 13px; color: var(--muted); }

.sync-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.sync-row-bar { height: 5px; border-radius: 4px; background: var(--paper-deep); overflow: hidden; margin-bottom: 3px; max-width: 120px; }
.sync-row-bar .archive-progress__bar { background: var(--accent); }

/* Dark terminal — intentionally dark for readability */
.sync-cli-log {
    background: #0F172A;
    color: #E2E8F0;
    border-radius: var(--r-sm);
    padding: 14px 16px;
    font-family: var(--ff-mono);
    font-size: 12.5px;
    line-height: 1.5;
    overflow: auto;
    max-height: 300px;
}

.sync-log-filter { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.sync-err-cell { max-width: 320px; word-break: break-word; font-size: 13px; }

.log-row--error td { background: rgba(168,52,31,0.06); }
.log-row--warn  td { background: rgba(138,90,20,0.06); }

/* ─── 30. FAQ page ─── */
.faq-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 40px;
    align-items: start;
}
.faq-toc {
    position: sticky;
    top: 20px;
    background: var(--surface);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
    padding: 16px;
}
.faq-toc a {
    display: block;
    padding: 6px 8px;
    border-radius: var(--r-xs);
    font-size: 13px;
    color: var(--ink-3);
    text-decoration: none;
    transition: background 0.12s;
}
.faq-toc a:hover { background: var(--surface-alt); color: var(--ink); }
.faq-content h2 {
    font-family: var(--ff-serif);
    font-size: 28px;
    font-weight: 400;
    letter-spacing: -0.015em;
    margin: 32px 0 14px;
    border-bottom: 1px solid var(--rule-faint);
    padding-bottom: 10px;
}
.faq-content h3 { font-size: 16px; font-weight: 600; margin: 20px 0 10px; color: var(--ink); }
.faq-content p  { margin: 0 0 12px; line-height: 1.6; color: var(--ink-2); }
.faq-content ul { padding-left: 1.4em; margin: 0 0 12px; }
.faq-content li { margin-bottom: 6px; line-height: 1.5; color: var(--ink-2); }
.faq-section    { margin-bottom: 28px; }
.faq-code       { font-family: var(--ff-mono); font-size: 12.5px; background: var(--paper-deep); padding: 2px 6px; border-radius: var(--r-xs); color: var(--ink); }
.faq-steps      { padding-left: 1.4em; counter-reset: step; list-style: decimal; }
.faq-steps li   { margin-bottom: 10px; line-height: 1.55; }
.faq-callout {
    margin: 16px 0;
    padding: 14px 16px;
    background: var(--info-bg);
    border-left: 3px solid var(--accent);
    border-radius: var(--r-xs);
    font-size: 13.5px;
    color: var(--ink-2);
    line-height: 1.55;
}
.faq-callout--warn { background: var(--warn-bg); border-color: var(--warn-clr); }

/* ─── 31. Archive & misc panels ─── */
.panel--archive .archive-stats { list-style: none; padding: 0; margin: 0; display: flex; gap: 20px; flex-wrap: wrap; }
.panel--archive .archive-stats li { font-size: 13px; color: var(--muted); }

/* ─── 32. Pagination ─── */
.pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}
.pagination__btn {
    padding: 7px 14px;
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--ink-2);
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.12s;
}
.pagination__btn:hover { background: var(--surface-alt); }
.pagination__info { font-family: var(--ff-mono); font-size: 12px; color: var(--muted); padding: 0 4px; }

/* ─── 33. Export buttons ─── */
.btn--export { font-size: 12px; padding: 6px 12px; }

/* ─── 34. Misc ─── */
.ov-muted { color: var(--muted); }
.text-muted { color: var(--muted); }
.link-underline { color: var(--ink); border-bottom: 1px solid var(--rule-soft); }
.link-underline:hover { border-bottom-color: var(--ink); }

/* form hint */
.form-hint, .field__hint {
    font-size: 11.5px;
    color: var(--muted);
    line-height: 1.4;
}

/* progress note */
.progress-note { font-size: 12px; color: var(--muted); margin: 4px 0 0; }

/* ─── TOP-10 content tool ─── */
.panel--inset {
    background: var(--surface-alt);
    border-color: var(--rule-faint);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35);
}
.field--inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 4px 14px 4px 0;
    font-size: 13.5px;
    color: var(--ink-2);
}
.field--inline input { accent-color: var(--ink); }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 20px; }
.code-block {
    max-height: 420px;
    overflow: auto;
    margin: 0;
    padding: 16px;
    border: 1px solid var(--rule-faint);
    border-radius: var(--r-sm);
    background: #0F172A;
    color: #F1F5F9;
    font-family: var(--ff-mono);
    font-size: 12px;
    line-height: 1.55;
    white-space: pre-wrap;
}
.top10-workbench { position: relative; }
.top10-notice {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid var(--rule-soft);
    border-left-width: 3px;
    border-radius: var(--r-sm);
    font-size: 13.5px;
    line-height: 1.5;
}
.top10-notice--info { background: var(--info-bg); border-left-color: var(--info); color: var(--info); }
.top10-notice--success { background: var(--pos-bg); border-left-color: var(--pos); color: var(--pos); }
.top10-notice--error { background: var(--neg-bg); border-left-color: var(--neg); color: var(--neg); }
.top10-progress {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
    background:
        linear-gradient(135deg, rgba(15,23,42,0.06), transparent 38%),
        var(--surface-alt);
}
.top10-progress__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 12px;
}
.top10-progress__message {
    margin: 8px 0 0;
    color: var(--ink-3);
    font-size: 13px;
}
.top10-progress__pct {
    font-family: var(--ff-serif);
    font-size: 34px;
    line-height: 1;
    font-weight: 400;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.top10-progress__bar {
    width: 100%;
    height: 8px;
    border: 0;
    border-radius: 999px;
    overflow: hidden;
    background: var(--rule-faint);
}
.top10-progress__bar::-webkit-progress-bar { background: var(--rule-faint); }
.top10-progress__bar::-webkit-progress-value { background: var(--ink); border-radius: 999px; }
.top10-progress__bar::-moz-progress-bar { background: var(--ink); border-radius: 999px; }
.top10-task-grid,
.top10-source-grid,
.top10-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
}
.top10-task-grid { margin-top: 14px; }
.top10-task,
.top10-source,
.top10-summary__item {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--rule-faint);
    border-radius: var(--r-sm);
    background: var(--surface);
}
.top10-task__top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}
.top10-task strong,
.top10-source strong,
.top10-summary__item strong {
    display: block;
    color: var(--ink);
    font-weight: 600;
}
.top10-task__top span,
.top10-task small,
.top10-source small,
.top10-summary__item span,
.top10-source__label {
    font-family: var(--ff-mono);
    font-size: 10.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
.top10-task__bar {
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--rule-faint);
    margin-bottom: 7px;
}
.top10-task__bar i {
    display: block;
    height: 100%;
    background: var(--accent);
    border-radius: inherit;
    transition: width 0.18s ease;
}
.top10-task--ready { border-color: rgba(4,120,87,0.28); background: var(--pos-bg); }
.top10-task--error { border-color: rgba(168,52,31,0.28); background: var(--neg-bg); }
.top10-task--error .top10-task__bar i { background: var(--neg); }
.top10-sources { margin-top: 18px; }
.top10-summary {
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
    background: var(--rule-soft);
    margin-bottom: 14px;
}
.top10-summary__item {
    border: 0;
    border-radius: 0;
    padding: 16px;
}
.top10-summary__item strong {
    margin-top: 4px;
    font-family: var(--ff-serif);
    font-size: 28px;
    line-height: 1;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
}
.top10-source {
    display: grid;
    gap: 4px;
    border-left-width: 3px;
}
.top10-source--ok { border-left-color: var(--pos); }
.top10-source--empty { border-left-color: var(--warn-clr); background: var(--warn-bg); }
.top10-source--skipped { border-left-color: var(--muted-2); background: var(--paper-deep); }
.top10-source--error { border-left-color: var(--neg); background: var(--neg-bg); }
.top10-json {
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-sm);
    background: var(--surface);
    overflow: hidden;
}
.top10-json summary {
    cursor: pointer;
    padding: 11px 14px;
    font-family: var(--ff-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-3);
    border-bottom: 1px solid var(--rule-faint);
}
.top10-json .code-block {
    border: 0;
    border-radius: 0;
}

/* Yandex ICS bar */
.ics-bar { display: flex; align-items: center; gap: 12px; }
.ics-bar__value { font-family: var(--ff-serif); font-size: 28px; letter-spacing: -0.02em; color: var(--ink); }
.ics-bar__track { flex: 1; height: 6px; background: var(--paper-deep); border-radius: 3px; overflow: hidden; }
.ics-bar__fill  { height: 100%; background: var(--data-2); border-radius: 3px; }

/* Table sort icons */
.sort-icon { font-size: 10px; opacity: 0.5; margin-left: 4px; }

/* Broken links section */
.broken-links__count { font-family: var(--ff-mono); font-size: 12px; color: var(--neg); }

/* ─── 35. Responsive ─── */
@media (max-width: 1024px) {
    :root { --sidebar-w: 200px; }
    .admin-main { padding: 24px 28px 60px; }
    .page-head__title { font-size: 36px; }
    .proj-grid { grid-template-columns: 1fr; }
    .add-card { grid-template-columns: 1fr; gap: 24px; }
    .ov-pages-grid { grid-template-columns: 1fr; }
    .ov-chart-grid { grid-template-columns: 1fr; }
    .kpi-row { grid-template-columns: repeat(2, 1fr); }
    .kpi-row > .kpi:nth-child(2) { border-right: none; }
    .kpi-row > .kpi:nth-child(3) { border-top: 1px solid var(--rule-faint); }
    .faq-layout { grid-template-columns: 1fr; }
    .sync-summary { grid-template-columns: 1fr; }
    .admin-split, .admin-split--wide { grid-template-columns: 1fr; }
    .project-list { grid-template-columns: 1fr; }
}

/* ─── Keywords popular (top_yandex / top_google): toolbar, sortable, sticky, load-more ─── */
.kw-popular__toolbar {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    margin-bottom: var(--s-4);
    padding-bottom: var(--s-3);
    border-bottom: 1px solid var(--rule-faint);
}
.kw-popular__toolbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--s-3);
}
.kw-popular__toolbar-row--filters { align-items: center; justify-content: space-between; }
.kw-popular__toolbar-row--status {
    border-top: 1px dashed var(--rule-faint);
    padding-top: var(--s-2);
    font-family: var(--ff-mono);
    font-size: 12px;
    color: var(--muted);
}
.kw-popular__filter-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s-3);
}
.kw-popular__filter-group .field__label {
    font-family: var(--ff-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}
.kw-popular__range {
    display: flex;
    align-items: center;
    gap: 6px;
}
.kw-popular__range input[type="number"] {
    width: 74px;
    padding: 6px 8px;
    font-family: var(--ff-mono);
    font-size: 13px;
    text-align: center;
}
.kw-popular__range-dash { color: var(--muted); font-family: var(--ff-mono); }
.kw-popular__export {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kw-popular__tablewrap {
    max-height: 70vh;
    overflow-y: auto;
    border: 1px solid var(--rule-faint);
    border-radius: var(--r-sm);
    background: var(--surface);
}
.kw-popular__tablewrap .kw-popular-table { margin: 0; }
.kw-popular__tablewrap .kw-popular-table thead th {
    position: sticky;
    top: 0;
    background: var(--paper-deep);
    z-index: 1;
    box-shadow: 0 1px 0 var(--rule-soft);
}

.kw-popular-table__th--sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.12s;
}
.kw-popular-table__th--sortable:hover { background: var(--surface-alt); }
.kw-popular-table__th--num { text-align: right; }
.kw-popular-table__num { font-family: var(--ff-mono); text-align: right; font-variant-numeric: tabular-nums; }
.kw-popular-table__sort {
    display: inline-block;
    margin-left: 4px;
    font-size: 10px;
    color: var(--muted);
    font-family: var(--ff-mono);
    min-width: 10px;
}
.kw-popular-table__sort--active { color: var(--accent); font-weight: 700; }

.kw-popular__empty {
    text-align: center;
    color: var(--muted);
    padding: var(--s-5) var(--s-3);
    font-size: 14px;
}

.kw-popular__loadmore-wrap {
    text-align: center;
    margin-top: var(--s-4);
}
.kw-popular__loadmore-rest { color: var(--muted); font-family: var(--ff-mono); font-size: 12px; }

/* ─── Issues info banner (Inspection queue, etc.) ─── */
.issues-info-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--info-bg);
    border: 1px solid var(--rule-soft);
    border-left: 3px solid var(--info);
    border-radius: var(--r-sm);
    padding: 12px 16px;
    margin-bottom: 18px;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--ink-2);
}
.issues-info-banner__icon {
    font-size: 18px;
    line-height: 1;
    margin-top: 2px;
    flex: 0 0 auto;
}
.issues-info-banner__body { display: flex; flex-direction: column; gap: 4px; }
.issues-info-banner__body strong { color: var(--ink); font-weight: 600; }
.issues-info-banner__text { color: var(--ink-3); }

/* ─── Canonical pages count (fu-card--canonical) ─── */
.fu-card--canonical {
    background: var(--accent-soft);
    border-left: 3px solid var(--accent) !important;
    border-color: var(--accent);
}
.fu-card--canonical span em {
    font-style: italic;
    color: var(--accent);
    font-weight: 500;
    font-family: var(--ff-mono);
    font-size: 11px;
    margin-left: 4px;
}
.fu-card--canonical strong { color: var(--accent); }

/* ─── URL Inspection Tool (/admin/tools.php) ─── */
.section-head__num {
    font-family: var(--ff-mono);
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
    margin-right: 6px;
    letter-spacing: 0.05em;
}

.ti-form { display: grid; gap: 20px; margin-bottom: 24px; }
.ti-form__actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.ti-help {
    flex: 1;
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-sm);
    background: var(--surface);
    padding: 0;
}
.ti-help summary {
    cursor: pointer;
    padding: 10px 14px;
    font-family: var(--ff-mono);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-3);
    user-select: none;
}
.ti-help summary:hover { color: var(--ink); }
.ti-help[open] summary {
    border-bottom: 1px solid var(--rule-faint);
    color: var(--ink);
}
.ti-help__content { padding: 14px 18px 18px; font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }
.ti-help__content h4 {
    font-family: var(--ff-sans);
    font-size: 13px;
    font-weight: 600;
    margin: 12px 0 6px;
    color: var(--ink);
}
.ti-help__content h4:first-child { margin-top: 0; }
.ti-help__content p { margin: 0 0 8px; }
.ti-help__content ul { margin: 0 0 10px; padding-left: 18px; }
.ti-help__content li { margin: 2px 0; }
.ti-help__content code {
    background: var(--paper-deep);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: var(--ff-mono);
    font-size: 12px;
}

.ti-progress {
    background: var(--surface);
    border: 1px solid var(--rule-faint);
    border-radius: var(--r-sm);
    padding: 14px 16px;
    margin-bottom: 16px;
}
.ti-progress__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.ti-progress__count {
    font-family: var(--ff-mono);
    font-size: 13px;
    color: var(--ink);
    font-weight: 500;
}

.ri-quota-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.ri-quota-selected {
    padding: 12px 14px;
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-sm);
    background: var(--surface-alt);
    margin-bottom: 12px;
}
.ri-quota-selected__title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 8px;
}
#ri-quota-table tr.ri-quota-row--active td {
    background: color-mix(in srgb, var(--accent, #2563eb) 8%, var(--surface));
}

.ri-engine-quota {
    display: inline-block;
    margin-left: 6px;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.02em;
    opacity: 0.75;
    vertical-align: middle;
}
.ri-engine-quota--before {
    margin-left: 0;
    margin-right: 6px;
}
.ytab__period-btn.is-active .ri-engine-quota {
    opacity: 0.85;
}
.ri-result-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
}
.ri-result-detail {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.3;
    max-width: 280px;
}
.ri-history-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.ti-results__url,
.ti-history__url {
    font-family: var(--ff-mono);
    font-size: 12.5px;
    color: var(--ink-2);
    max-width: 480px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ti-history__time {
    font-family: var(--ff-mono);
    font-size: 11.5px;
    color: var(--muted);
    white-space: nowrap;
}
.ti-history__project {
    font-family: var(--ff-mono);
    font-size: 12px;
    color: var(--ink-2);
}

.ti-history-filter { margin-bottom: 18px; }

.ti-empty {
    text-align: center;
    color: var(--muted);
    padding: 32px 16px;
    font-size: 14px;
    background: var(--surface-alt);
    border-radius: var(--r-sm);
    border: 1px dashed var(--rule-soft);
}

@media (max-width: 768px) {
    :root { --sidebar-w: 0px; }
    .admin-header {
        position: fixed;
        left: 0; right: 0; bottom: auto;
        top: 0; width: 100%;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 12px 16px;
        border-right: none;
        border-bottom: 1px solid var(--rule-soft);
        overflow: visible;
    }
    .admin-header__left { flex-direction: row; gap: 12px; flex: 0 0 auto; }
    .admin-header__right { flex-direction: row; gap: 8px; margin-top: 0; padding-top: 0; border-top: none; }
    .admin-nav { flex-direction: row; flex-wrap: wrap; }
    .admin-main { margin-left: 0; padding: 70px 16px 40px; }
    .page-head { flex-direction: column; align-items: flex-start; gap: 12px; }
    .page-head__title { font-size: 28px; }
    .page-head__actions { justify-content: flex-start; width: 100%; }
    .page-review { width: 100%; flex-wrap: wrap; }
    .page-review__status { flex: 1 1 auto; }
    .page-review-modal__panel { margin: 80px 16px 0; }
    .page-review-modal__grid { grid-template-columns: 1fr; }
    .kpi-row { grid-template-columns: 1fr 1fr; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .auth-page { grid-template-columns: 1fr; }
    .auth-pane--right { display: none; }
    .faq-layout { grid-template-columns: 1fr; }
    .faq-toc { position: static; }
    .kw-matrix-wrap { overflow-x: auto; }
}

/* ======================================================================
   Issues / Traffic redesign — 2026-05-26
   Scope: .issues-traffic-redesign (только subtab=traffic)
   Источник дизайна (макет) /screens/03-issues-traffic.html
   ====================================================================== */

/* — Шапка страницы (Issues head) — */
.issues-traffic-redesign .issues-head {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 48px;
    align-items: end;
    padding-bottom: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--rule-soft);
}
.issues-traffic-redesign .issues-head .eyebrow {
    font-family: var(--ff-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
    font-weight: 500;
}
.issues-traffic-redesign .issues-head .panel__title {
    font-family: var(--ff-serif);
    font-size: 52px;
    line-height: 1;
    letter-spacing: -0.025em;
    font-weight: 400;
    margin: 10px 0 12px;
    color: var(--ink);
}
.issues-traffic-redesign .issues-head .panel__hint {
    margin: 0;
    color: var(--ink-3);
    font-size: 14.5px;
    line-height: 1.6;
    max-width: 64ch;
}
.issues-traffic-redesign .issues-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
}

/* — Фильтры — */
.issues-traffic-redesign .issues-filters {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.issues-traffic-redesign .issues-filters .field {
    display: grid;
    gap: 6px;
    min-width: 120px;
}
.issues-traffic-redesign .issues-filters .field__label {
    font-family: var(--ff-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    font-weight: 500;
}
.issues-traffic-redesign .issues-filters .field__input {
    background: var(--surface);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-sm);
    padding: 9px 12px;
    font-size: 13.5px;
    color: var(--ink);
    transition: border 0.12s, box-shadow 0.12s;
}
.issues-traffic-redesign .issues-filters .field__input:focus {
    outline: none;
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(15,23,42,0.05);
}

/* — Сводные карточки (7) — */
.issues-traffic-redesign .issues-summary-grid--traffic {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--rule-soft);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
    overflow: hidden;
    margin-bottom: 24px;
}
.issues-traffic-redesign .issues-card--traffic {
    background: var(--surface);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 132px;
    border: none;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
}
.issues-traffic-redesign .issues-card--traffic > span {
    font-family: var(--ff-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
}
.issues-traffic-redesign .issues-card--traffic > strong {
    font-family: var(--ff-serif);
    font-size: 38px;
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
    margin-top: auto;
    font-weight: 400;
}
.issues-traffic-redesign .issues-card--traffic > small {
    font-size: 12px;
    color: var(--ink-3);
    line-height: 1.4;
}
/* Акцентируем 5-ю карточку (Автоцели Метрики) тёмной */
.issues-traffic-redesign .issues-summary-grid--traffic .issues-card--traffic:nth-child(5) {
    background: linear-gradient(180deg, #0F172A 0%, #1E293B 100%);
    color: var(--paper);
}
.issues-traffic-redesign .issues-summary-grid--traffic .issues-card--traffic:nth-child(5) > span,
.issues-traffic-redesign .issues-summary-grid--traffic .issues-card--traffic:nth-child(5) > small {
    color: rgba(245,242,235,0.65);
}
.issues-traffic-redesign .issues-summary-grid--traffic .issues-card--traffic:nth-child(5) > strong {
    color: var(--paper);
}
@media (max-width: 1280px) {
    .issues-traffic-redesign .issues-summary-grid--traffic { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 800px) {
    .issues-traffic-redesign .issues-summary-grid--traffic { grid-template-columns: repeat(2, 1fr); }
    .issues-traffic-redesign .issues-head { grid-template-columns: 1fr; gap: 16px; }
    .issues-traffic-redesign .issues-head .panel__title { font-size: 36px; }
}

/* — AI summary для трафика — */
.issues-traffic-redesign .issues-ai--traffic {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 32px;
    padding: 22px 24px;
    background: var(--surface);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
    margin-bottom: 24px;
    align-items: start;
}
.issues-traffic-redesign .issues-ai--traffic h3 {
    font-family: var(--ff-serif);
    font-size: 28px;
    line-height: 1.05;
    letter-spacing: -0.02em;
    font-weight: 400;
    margin: 0;
    color: var(--ink);
}
.issues-traffic-redesign .issues-ai--traffic h3::before {
    content: 'AI Summary';
    display: block;
    font-family: var(--ff-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    margin-bottom: 8px;
    font-weight: 500;
}
.issues-traffic-redesign .issues-ai--traffic .issues-help { display: none; }
.issues-traffic-redesign .issues-ai--traffic p {
    margin: 0;
    color: var(--ink-2);
    font-size: 14.5px;
    line-height: 1.65;
    max-width: 72ch;
}
@media (max-width: 800px) {
    .issues-traffic-redesign .issues-ai--traffic { grid-template-columns: 1fr; gap: 16px; }
}

/* — Подвкладки — */
.issues-traffic-redesign .issues-subtabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--rule-soft);
    margin-bottom: 28px;
    overflow-x: auto;
}
.issues-traffic-redesign .issues-subtabs__link {
    padding: 14px 18px;
    font-size: 13.5px;
    color: var(--muted);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    text-decoration: none;
    border-radius: 0;
    background: transparent;
}
.issues-traffic-redesign .issues-subtabs__link:hover { color: var(--ink); background: transparent; }
.issues-traffic-redesign .issues-subtabs__link.is-active {
    color: var(--ink);
    border-bottom-color: var(--ink);
    background: transparent;
}

/* ======================================================================
   .goals — блок «Самые конверсионные страницы из Яндекса»
   ====================================================================== */
.goals {
    background: var(--surface);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
    overflow: hidden;
    margin-bottom: 24px;
}
.goals__head {
    padding: 28px 28px 24px;
    border-bottom: 1px solid var(--rule-faint);
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 40px;
    align-items: flex-start;
}
.goals__eyebrow {
    font-family: var(--ff-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    font-weight: 500;
}
.goals__head h3 {
    font-family: var(--ff-serif);
    font-size: 32px;
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-weight: 400;
    margin: 8px 0 8px;
    color: var(--ink);
}
.goals__head h3 em { font-style: italic; color: var(--ink-3); }
.goals__lede {
    margin: 0;
    color: var(--ink-3);
    font-size: 14px;
    line-height: 1.6;
    max-width: 64ch;
}
.goals__lede mark {
    background: var(--yandex-tint, #FFF1F2);
    color: var(--ink);
    padding: 0 4px;
    border-radius: 2px;
}
.goals__help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--paper-deep);
    color: var(--ink-3);
    font-family: var(--ff-sans);
    font-size: 11px;
    font-weight: 600;
    cursor: help;
    margin-left: 8px;
    vertical-align: middle;
}

/* Stats блок справа в head */
.goals__stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0;
    background: var(--paper);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-sm);
}
.goals__stats > div {
    padding: 16px 18px;
    border-right: 1px solid var(--rule-faint);
}
.goals__stats > div:last-child { border-right: none; }
.goals__stats-lbl {
    font-family: var(--ff-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    font-weight: 500;
}
.goals__stats-val {
    font-family: var(--ff-serif);
    font-size: 30px;
    line-height: 1;
    margin-top: 8px;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
}
.goals__stats-sub {
    font-family: var(--ff-mono);
    font-size: 10.5px;
    color: var(--ink-3);
    margin-top: 6px;
}
.goals__stats-of {
    font-size: 15px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

/* Used goals chips */
.goals__used {
    padding: 16px 28px;
    background: var(--paper);
    border-bottom: 1px solid var(--rule-faint);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.goals__used-label {
    font-family: var(--ff-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    font-weight: 500;
}
.goal-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: var(--surface);
    border: 1px solid var(--rule-soft);
    border-radius: 100px;
    font-size: 12.5px;
    color: var(--ink-2);
}
.goal-chip__num {
    font-family: var(--ff-mono);
    font-size: 11px;
    color: var(--muted);
    padding: 0 6px;
    background: var(--paper);
    border-radius: 100px;
    margin-right: -2px;
}
.goal-chip--primary {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
}
.goal-chip--primary .goal-chip__num {
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.75);
}
.goal-chip__meta {
    font-size: 10.5px;
    color: var(--muted);
    border-left: 1px solid var(--rule-soft);
    padding-left: 6px;
    margin-left: 2px;
}
.goal-chip--primary .goal-chip__meta {
    color: rgba(255,255,255,0.7);
    border-left-color: rgba(255,255,255,0.2);
}
.goal-chip__badge {
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: .03em;
    padding: 1px 5px;
    border-radius: 100px;
    background: var(--paper);
    color: var(--muted);
}
.goal-chip__badge--manual {
    background: #e7f0ff;
    color: #2b5fb3;
}
.goal-chip--primary .goal-chip__badge {
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.8);
}

/* Section block (control + main) */
.goals__block {
    padding: 22px 28px 24px;
    border-bottom: 1px solid var(--rule-faint);
    background: linear-gradient(180deg, #F8FAFC 0%, #FFFFFF 100%);
}
.goals__block--main {
    background: var(--surface);
    padding-bottom: 0;
    border-bottom: none;
}
.goals__block-title {
    font-family: var(--ff-sans);
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px;
    color: var(--ink);
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.goals__block-title::before {
    content: '';
    width: 4px;
    height: 14px;
    background: var(--ink);
    border-radius: 1px;
    display: inline-block;
    transform: translateY(2px);
    flex-shrink: 0;
}
.goals__block-desc {
    font-size: 12.5px;
    color: var(--ink-3);
    line-height: 1.55;
    margin: 0 0 16px;
    max-width: 90ch;
}

.goals__notice {
    margin: 20px 28px;
    padding: 14px 16px;
    background: var(--warn-bg);
    border: 1px solid #E3D7AC;
    border-radius: var(--r-sm);
    color: var(--warn-clr);
    font-size: 13px;
    line-height: 1.5;
}

/* Таблица */
.goals__tbl-wrap {
    position: relative;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}
.goals__tbl-wrap--main {
    max-height: 720px;
    overflow-y: auto;
    border-top: 1px solid var(--rule-faint);
}
.goals__tbl-wrap::-webkit-scrollbar { height: 10px; width: 10px; }
.goals__tbl-wrap::-webkit-scrollbar-track { background: var(--paper-deep); }
.goals__tbl-wrap::-webkit-scrollbar-thumb { background: var(--muted-2); border-radius: 5px; }
.goals__tbl-wrap::-webkit-scrollbar-thumb:hover { background: var(--muted); }

.goals__tbl {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    font-size: 13px;
    background: var(--surface);
}
.goals__col-url    { width: 360px; }
.goals__col-slice  { width: 340px; }
.goals__col-num    { width: 110px; }
.goals__col-goal   { width: 112px; }
.goals__col-total  { width: 118px; }
.goals__col-cr     { width: 110px; }
.goals__col-top    { width: 220px; }

.goals__tbl thead th {
    text-align: right;
    padding: 12px 14px;
    font-family: var(--ff-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-weight: 500;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    position: sticky;
    top: 0;
    z-index: 5;
    white-space: nowrap;
    vertical-align: bottom;
}
.goals__tbl thead th.goals__th-left { text-align: left; }
.goals__tbl thead th.goals__th-total { background: #F3EFE2; }
.goals__tbl thead th .goals__goal-name {
    display: block;
    color: var(--ink);
    font-family: var(--ff-sans);
    font-size: 11.5px;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 600;
    margin-bottom: 2px;
    white-space: normal;
    line-height: 1.2;
}
.goals__tbl thead th .goals__goal-meta {
    display: block;
    color: var(--muted);
    font-size: 9.5px;
    font-family: var(--ff-mono);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.goals__tbl tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--rule-faint);
    color: var(--ink-2);
    vertical-align: middle;
    text-align: right;
    background: var(--surface);
}
.goals__tbl tbody tr:hover td { background: var(--surface-alt); }

/* Sticky URL колонка */
.goals__tbl .goals__url-cell {
    position: sticky;
    left: 0;
    z-index: 3;
    background: var(--surface);
    text-align: left;
    box-shadow: inset -1px 0 0 var(--rule-faint);
}
.goals__tbl tbody tr:hover .goals__url-cell { background: var(--surface-alt); }
.goals__tbl thead th.goals__th-left:first-child {
    position: sticky;
    left: 0;
    z-index: 6;
    background: var(--paper);
    box-shadow: inset -1px 0 0 var(--rule), 0 1px 0 var(--rule);
}

.goals__url-flex {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.goals__url-rank {
    flex-shrink: 0;
    width: 22px;
    font-family: var(--ff-mono);
    font-size: 11px;
    color: var(--muted);
    text-align: right;
}
.goals__url-path {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--ff-mono);
    font-size: 12.5px;
    color: var(--ink);
    letter-spacing: -0.01em;
}
.goals__url-domain { color: var(--muted); }
.goals__url-link {
    flex-shrink: 0;
    color: var(--muted-2);
    text-decoration: none;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.12s, color 0.12s;
}
.goals__tbl tbody tr:hover .goals__url-link { opacity: 1; }
.goals__url-link:hover { color: var(--ink); }

/* Slice cell в контрольной таблице */
.goals__slice-cell {
    text-align: left !important;
    font-family: var(--ff-sans);
    font-size: 13.5px;
    color: var(--ink);
    font-weight: 500;
}
.goals__slice-sub {
    display: block;
    font-family: var(--ff-mono);
    font-size: 10.5px;
    color: var(--muted);
    margin-top: 2px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Numeric cells */
.goals__num {
    font-family: var(--ff-mono);
    font-size: 13px;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}
.goals__num--zero { color: var(--muted-2); }
.goals__num--strong { color: var(--ink); font-weight: 600; }
.goals__num--total {
    background: #FBF9F3 !important;
    font-weight: 600;
    color: var(--ink);
}

/* Goal cell with mini bar */
.goals__goal-cell {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}
.goals__goal-bar {
    display: inline-block;
    width: 28px;
    height: 4px;
    background: var(--rule-faint);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}
.goals__goal-bar > span {
    display: block;
    height: 100%;
    background: var(--data-1);
    border-radius: 2px;
}
.goals__goal-cell--strong .goals__goal-bar > span { background: var(--ink); }

/* CR badge */
.goals__cr {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: var(--r-xs);
    font-family: var(--ff-mono);
    font-size: 12px;
    font-weight: 500;
}
.goals__cr--high { background: var(--pos-bg); color: var(--pos); }
.goals__cr--med  { background: var(--warn-bg); color: var(--warn-clr); }
.goals__cr--low  { background: var(--neg-bg); color: var(--neg); }
.goals__cr--zero { background: var(--paper-deep); color: var(--muted); }

/* Top goal pill */
.goals__top-goal {
    text-align: left !important;
    font-size: 12.5px;
    color: var(--ink-2);
}
.goals__top-pill {
    display: inline-block;
    padding: 3px 10px;
    background: var(--paper-deep);
    border-radius: 100px;
    font-size: 11.5px;
    color: var(--ink-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.goals__top-none {
    color: var(--muted-2);
    font-style: italic;
    font-size: 11.5px;
}

/* Footer блока */
.goals__foot {
    padding: 18px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid var(--rule-faint);
    background: var(--paper);
    font-family: var(--ff-mono);
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    flex-wrap: wrap;
}
.goals__foot b { color: var(--ink); font-weight: 600; }
.goals__foot-actions { display: flex; gap: 8px; }

@media (max-width: 900px) {
    .goals__head { grid-template-columns: 1fr; gap: 20px; }
    .goals__used { padding: 14px 18px; }
    .goals__block { padding: 18px 18px 20px; }
    .goals__foot { padding: 14px 18px; }
}

/* ======================================================================
   Issues / Traffic functional upgrade — 2026-05-26
   Фильтры, sortable th, таблица фраз
   ====================================================================== */

/* Форма фильтров */
.goals__filters {
    padding: 16px 28px 14px;
    background: var(--paper);
    border-bottom: 1px solid var(--rule-faint);
    display: flex;
    gap: 14px;
    align-items: flex-end;
    flex-wrap: wrap;
}
.goals__filter-field {
    display: grid;
    gap: 6px;
    min-width: 200px;
}
.goals__filter-label {
    font-family: var(--ff-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    font-weight: 500;
}
.goals__filter-input {
    background: var(--surface);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-sm);
    padding: 8px 12px;
    font: inherit;
    font-size: 13px;
    color: var(--ink);
    transition: border 0.12s, box-shadow 0.12s;
}
.goals__filter-input:focus {
    outline: none;
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.05);
}
.goals__filter-field--check {
    flex-direction: row;
    align-items: center;
    min-width: 0;
    gap: 8px;
    padding-bottom: 9px;
}
.goals__filter-field--check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--ink);
    cursor: pointer;
}
.goals__filter-label-inline {
    font-size: 13px;
    color: var(--ink-2);
    cursor: pointer;
    user-select: none;
}

/* Sortable th */
.goals__th--sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.12s, color 0.12s;
}
.goals__th--sortable:hover {
    background: var(--paper-deep) !important;
    color: var(--ink) !important;
}
.goals__th--sortable .goals__sort {
    display: inline-block;
    margin-left: 4px;
    font-family: var(--ff-mono);
    font-size: 10px;
    color: var(--muted-2);
    min-width: 8px;
}
.goals__th--sorted-asc,
.goals__th--sorted-desc {
    color: var(--ink) !important;
    background: var(--paper-deep) !important;
}
.goals__th--sorted-asc .goals__sort,
.goals__th--sorted-desc .goals__sort {
    color: var(--ink);
}

/* Таблица фраз — упрощённая, без sticky URL */
.goals--phrases {
    margin-top: 24px;
}
.goals__col-phrase { width: 380px; }
.goals__tbl--phrases .goals__phrase-cell {
    text-align: left;
    background: var(--surface);
    position: sticky;
    left: 0;
    z-index: 3;
    box-shadow: inset -1px 0 0 var(--rule-faint);
    display: table-cell;
}
.goals__tbl--phrases tbody tr:hover .goals__phrase-cell {
    background: var(--surface-alt);
}
.goals__tbl--phrases thead th.goals__th-left:first-child {
    position: sticky;
    left: 0;
    z-index: 6;
    background: var(--paper);
    box-shadow: inset -1px 0 0 var(--rule), 0 1px 0 var(--rule);
}
.goals__phrase-cell .goals__url-rank {
    display: inline-block;
    margin-right: 10px;
    vertical-align: middle;
}
.goals__phrase-text {
    font-family: var(--ff-sans);
    font-size: 13.5px;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 320px;
    display: inline-block;
    vertical-align: middle;
}

@media (max-width: 900px) {
    .goals__filters { padding: 14px 18px; gap: 10px; }
    .goals__filter-field { min-width: 160px; }
}

/* ======================================================================
   Issues/Traffic — Google-блоки (GA4 + GSC), 2026-05-26 (третья итерация)
   ====================================================================== */

/* Цветовые акценты источника в eyebrow */
.goals--google .goals__eyebrow {
    color: var(--data-1); /* cobalt — Google */
}
.goals--gsc .goals__eyebrow {
    color: var(--data-3); /* olive — second Google source */
}

/* GSC-таблица — без mini-bar колонок, увеличенный col-phrase под query */
.goals--gsc .goals__col-phrase { width: 460px; }

/* Звёздочка для key events в чипах */
.goals--google .goal-chip {
    cursor: help;
}

/* Текстовые KPI-карточки на странице issues/traffic — мельче, с ellipsis */
.issues-traffic-redesign .issues-card--traffic-text > strong {
    font-family: var(--ff-sans);
    font-size: 15px;
    line-height: 1.3;
    font-weight: 600;
    letter-spacing: -0.005em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-width: 100%;
    word-break: break-all;
}
.issues-traffic-redesign .issues-summary-grid--traffic .issues-card--traffic-text:nth-child(5) > strong {
    color: var(--paper);
}

/* ══════════════════════════════════════════════════════════════
   Company Report — /admin/company-report.php
   «Warm Paper. Ink. Numbers.» brand-book 2026-05
══════════════════════════════════════════════════════════════ */

/* ── Filter bar ── */
.cr-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-3);
    align-items: flex-end;
    margin-bottom: var(--s-5);
}
.cr-filter-bar__item {
    display: flex;
    flex-direction: column;
    gap: var(--s-1);
}
.cr-filter-bar__label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
}
.cr-select {
    font-family: var(--ff-sans);
    font-size: 13px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-sm);
    padding: 6px 32px 6px 10px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238A887E' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
}
.cr-select:focus {
    outline: 2px solid var(--accent-2);
    outline-offset: 1px;
}

/* ── KPI grid override для company-report ── */
.kpi-grid--cr {
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: var(--s-5);
}
@media (max-width: 700px) { .kpi-grid--cr { grid-template-columns: 1fr; } }

/* ── Year badges in section header ── */
.cr-year-badge {
    display: inline-block;
    font-family: var(--ff-mono);
    font-size: 12px;
    font-weight: 600;
    background: var(--accent);
    color: #fff;
    border-radius: var(--r-xs);
    padding: 1px 6px;
    margin-left: 6px;
    vertical-align: middle;
}
.cr-year-badge--prev {
    background: var(--muted-2);
    color: var(--ink-2);
}

/* ── Chart panel ── */
.cr-chart-panel {
    margin-bottom: var(--s-5);
}
.cr-chart-wrap {
    position: relative;
    width: 100%;
    height: 320px;
}

/* ── Срезы по месяцам: архивный календарь ── */
.ms-calendar-panel { margin-bottom: var(--s-5); }
/* ─── Срезы по месяцам: итоги ─────────────────────────────────────────────
   Восемь одинаковых плиток читались как однородная каша, поэтому введена
   иерархия: три главные метрики крупно, детализация по системам — мельче. */
.ms-kpi-panel { margin-bottom: var(--s-5); }
.ms-primary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    background: var(--rule-soft);
    border-top: 1px solid var(--rule-soft);
    border-bottom: 1px solid var(--rule-soft);
}
.ms-primary__card { background: var(--surface); padding: 18px 20px 16px; }
.ms-primary__label {
    font-family: var(--ff-mono); font-size: 10px; letter-spacing: .08em;
    text-transform: uppercase; color: var(--muted-2);
}
.ms-primary__value { font-size: 34px; line-height: 1.1; margin-top: 6px; letter-spacing: -.02em; }
.ms-primary__note { font-size: 12px; color: var(--muted-2); margin-top: 2px; }
.ms-cmp { margin-top: 14px; display: flex; flex-direction: column; gap: 7px; }
.ms-cmp__item { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ms-cmp__period { font-size: 11.5px; color: var(--muted-2); min-width: 132px; }
.ms-cmp__base { font-size: 11.5px; color: var(--muted-2); font-family: var(--ff-mono); }
.ms-cmp__delta {
    font-family: var(--ff-mono); font-size: 12px; font-weight: 600;
    padding: 1px 6px; border-radius: 3px; white-space: nowrap;
}
.ms-cmp__delta.is-up { color: #065F46; background: rgba(6, 95, 70, .09); }
.ms-cmp__delta.is-down { color: #9F1239; background: rgba(159, 18, 57, .08); }
.ms-cmp__delta.is-flat { color: var(--muted-2); background: rgba(100, 116, 139, .08); }

.ms-secondary {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1px;
    background: var(--rule-soft);
}
.ms-secondary__card { background: var(--surface); padding: 12px 14px; }
.ms-secondary__label {
    font-family: var(--ff-mono); font-size: 9.5px; letter-spacing: .06em;
    text-transform: uppercase; color: var(--muted-2);
}
/* Двух карточек конверсии на шесть колонок мало — растягиваем на половину ширины. */
.ms-secondary--pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Блок «Что происходит на рынке»: объяснение словами, а не набор процентов. */
/* Фильтр по группам: активная кнопка должна читаться сразу. */
.ms-project-filter__actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.ms-project-filter__actions .btn.is-active {
    background: var(--ink); border-color: var(--ink); color: var(--surface);
}
.ms-project-filter__actions .btn.is-active:hover { background: var(--ink); color: var(--surface); }
.ms-project-filter__count { opacity: .6; margin-left: 4px; font-family: var(--ff-mono); font-size: 11px; }

.ms-plain { display: flex; flex-direction: column; }
.ms-plain__row {
    display: grid; grid-template-columns: 148px 1fr; gap: 20px;
    padding: 16px 0; border-top: 1px solid var(--rule-soft); align-items: start;
}
.ms-plain__row:first-child { border-top: none; }
.ms-plain__num { font-size: 27px; line-height: 1.1; letter-spacing: -.02em; text-align: right; white-space: nowrap; }
.ms-plain__num.is-up { color: #065F46; }
.ms-plain__num.is-down { color: #9F1239; }
.ms-plain__text { font-size: 13.5px; line-height: 1.55; color: var(--ink); max-width: 78ch; }
.ms-plain__text b { font-weight: 600; }
@media (max-width: 900px) {
    .ms-plain__row { grid-template-columns: 1fr; gap: 6px; }
    .ms-plain__num { text-align: left; }
}
.ms-secondary__value { font-size: 19px; line-height: 1.2; margin: 4px 0 7px; letter-spacing: -.01em; }
.ms-secondary__row { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 11px; color: var(--muted-2); margin-top: 3px; }
.ms-secondary__key { white-space: nowrap; }
@media (max-width: 1200px) {
    .ms-primary { grid-template-columns: 1fr; }
    .ms-secondary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) { .ms-secondary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Таблица проектов: число и дельта разной подачей, иначе строка читается как сплошной поток цифр. */
.ms-table td { padding-top: 9px; padding-bottom: 9px; }
.ms-table .ms-cell__now { font-family: var(--ff-mono); font-size: 13px; color: var(--ink); white-space: nowrap; }
.ms-table td.num { white-space: nowrap; }
.ms-table .ms-issue { display: block; font-size: 11.5px; color: var(--muted-2); margin-top: 3px; line-height: 1.35; max-width: 280px; }
.ms-table td.num .ms-cmp__delta { margin-left: 8px; font-size: 11px; }
.ms-table td.key { font-weight: 600; letter-spacing: -.01em; }
.ms-table tbody tr:hover td { background: var(--surface-alt); }
.ms-table thead th { position: sticky; top: 0; z-index: 1; }

.ms-kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .ms-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ms-kpi-foot { display: flex; flex-wrap: wrap; gap: 2px 12px; }
.ms-kpi-foot__row { white-space: nowrap; }
.ms-chart-wrap { position: relative; width: 100%; }
.ms-hint { color: var(--muted-2); font-size: 12px; margin-top: 6px; }
.ms-total-row td { background: var(--surface-alt) !important; font-weight: 700; border-top: 1.5px solid var(--rule); }
.ms-years {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 var(--s-5) var(--s-4);
    border-bottom: 1px solid var(--rule-faint);
}
.ms-years__item {
    padding: 5px 9px;
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-xs);
    font-family: var(--ff-mono);
    font-size: 12px;
    color: var(--muted);
}
.ms-years__item:hover,
.ms-years__item.is-active { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.ms-month-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1px;
    background: var(--rule-soft);
    border-top: 1px solid var(--rule-soft);
}
.ms-month {
    min-height: 52px;
    padding: 9px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    justify-content: center;
    background: var(--surface);
    transition: background .12s ease, color .12s ease;
}
.ms-month:not(.is-empty):hover { background: var(--surface-alt); }
.ms-month.is-selected { background: var(--ink); color: var(--surface); }
.ms-month.is-empty { background: var(--paper-deep); color: var(--muted-2); cursor: default; }
.ms-month__name { font-weight: 600; letter-spacing: -.01em; font-size: 13px; }
.ms-month__state { font-family: var(--ff-mono); font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--pos); }
.ms-month.is-selected .ms-month__state { color: #A7F3D0; }
.ms-month.is-empty .ms-month__state { color: var(--muted-2); }
@media (max-width: 900px) { .ms-month-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 560px) {
    .ms-years { padding-left: var(--s-4); padding-right: var(--s-4); }
    .ms-month-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ms-month { min-height: 48px; padding: 8px 10px; }
}

/* ── Table panel ── */
.cr-table-panel {
    margin-bottom: var(--s-5);
}
.cr-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Компактная таблица месяцев */
.cr-monthly-table {
    min-width: 700px;
    width: 100%;
    border-collapse: collapse;
}
.cr-monthly-table th,
.cr-monthly-table td {
    padding: 9px 10px;
    font-size: 13px;
    white-space: nowrap;
    border-bottom: 1px solid var(--rule-faint);
}
.cr-th-source { text-align: left; min-width: 150px; font-weight: 600; }
.cr-th-mon    { min-width: 58px; font-weight: 600; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.cr-th-total  { min-width: 72px; font-weight: 700; background: var(--surface-alt); }

/* Source column */
.cr-td-source {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: var(--ink-2);
}
.cr-td-source--total { font-weight: 700; color: var(--ink); }
.cr-td-total { font-weight: 600; background: var(--surface-alt); }

/* Engine dot */
.cr-engine-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}
.cr-engine-dot--yandex { background: var(--data-2); }  /* terracotta */
.cr-engine-dot--google { background: var(--data-3); }  /* olive */
.cr-engine-dot--total  { background: var(--accent);  } /* cobalt */

/* Row highlights */
.cr-row--yandex td { background: #FDF5F2; }
.cr-row--google td { background: #F6F8EE; }
.cr-row--total  td { background: var(--accent-soft); font-weight: 600; }
.cr-row--bounce td { background: var(--wash); font-size: 12px; color: var(--muted); }
.cr-row--bounce .cr-td-source { color: var(--text); font-weight: 500; }
.cr-engine-dot--bounce { background: var(--muted); }
.cr-row--yandex:hover td,
.cr-row--google:hover td,
.cr-row--total:hover td  { filter: brightness(.97); }

/* Future month cell */
.cr-cell--future {
    color: var(--muted-2) !important;
    font-style: italic;
}

/* Hint text */
.cr-table-hint {
    margin-top: var(--s-3);
    font-size: 11px;
    color: var(--muted);
    line-height: 1.5;
}

/* ──────────────────────────────────────────────────────────────────────
   Диагностика — sidebar-виджет + страница /admin/diagnostic.php
   ────────────────────────────────────────────────────────────────────── */

.admin-nav__diag {
    display: block;
    margin-top: 0;
    padding: 11px 14px;
    border-radius: 11px;
    background: var(--surface);
    border: 1px solid var(--rule-soft);
    text-decoration: none;
    color: var(--ink);
    transition: background 0.18s, border-color 0.18s;
}
.admin-nav__diag:hover { background: var(--surface-alt); }
.admin-nav__diag.is-active { background: var(--ink); color: var(--paper); }
.admin-nav__diag.is-active .admin-nav__diag-line { color: rgba(255,255,255,0.7); }

.admin-nav__diag--ok       { border-left: 3px solid #16a34a; }
.admin-nav__diag--warn     { border-left: 3px solid #d97706; }
.admin-nav__diag--critical { border-left: 3px solid #dc2626; }

.admin-nav__diag-head { display: flex; align-items: center; gap: 6px; }
.admin-nav__diag-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.admin-nav__diag--ok .admin-nav__diag-dot       { background: #16a34a; box-shadow: 0 0 0 2px rgba(22,163,74,0.18); }
.admin-nav__diag--warn .admin-nav__diag-dot     { background: #d97706; box-shadow: 0 0 0 2px rgba(217,119,6,0.18); }
.admin-nav__diag--critical .admin-nav__diag-dot { background: #dc2626; box-shadow: 0 0 0 2px rgba(220,38,38,0.2); animation: diag-pulse 1.6s infinite; }

@keyframes diag-pulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(220,38,38,0.2); }
    50%      { box-shadow: 0 0 0 5px rgba(220,38,38,0.08); }
}

.admin-nav__diag-title { font-weight: 600; font-size: 13px; }
.admin-nav__diag-count {
    margin-left: auto;
    background: #dc2626;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    min-width: 18px;
    text-align: center;
}
.admin-nav__diag--ok .admin-nav__diag-count { background: #16a34a; }
.admin-nav__diag--warn .admin-nav__diag-count { background: #d97706; }

.admin-nav__diag-lines {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 6px;
    font-size: 10.5px;
    color: var(--muted, #6b7280);
    line-height: 1.4;
}
.admin-nav__diag-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-nav__diag-line--critical { color: #dc2626; }
.admin-nav__diag-line--warn     { color: #d97706; }
.admin-nav__diag-line--ok       { color: #16a34a; }

.admin-nav__diag-block { display: block; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--rule-soft); }
.admin-nav__diag-sub {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 8px;
    padding-left: 4px;
}
.admin-nav__diag-sub-link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 9px;
    border: none;
    color: var(--muted);
    text-decoration: none;
    background: transparent;
    transition: background 0.18s, color 0.18s;
}
.admin-nav__diag-sub-link:hover { background: rgba(15,23,42,0.05); color: var(--ink); }
.admin-nav__diag-sub-link.is-active {
    background: var(--ink);
    color: var(--paper);
}
.admin-nav__diag-sub-link .admin-nav__link-badge { margin-left: auto; }
.admin-nav__diag-sub-link.is-active .admin-nav__link-badge { background: rgba(255,255,255,0.25); }

/* ──────────────────────────────────────────────────────────────────────
   Виджет фоновых задач (очередь sync_jobs) в шапке — поллинг queue-status.js
   ────────────────────────────────────────────────────────────────────── */

.admin-nav__queue { position: relative; margin-top: 8px; }
.admin-nav__queue-badge {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 11px 14px;
    border-radius: 11px;
    background: var(--surface);
    border: 1px solid var(--rule-soft);
    color: var(--ink);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s;
}
.admin-nav__queue-badge:hover { background: var(--surface-alt); }
.admin-nav__queue-label { flex: 1; text-align: left; }
.admin-nav__queue-chevron { flex: none; color: var(--muted); transition: transform 0.2s ease; }
.admin-nav__queue-badge[aria-expanded="true"] .admin-nav__queue-chevron { transform: rotate(180deg); }

.admin-nav__queue-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #9ca3af;
}
.admin-nav__queue--running .admin-nav__queue-dot {
    background: #2563eb;
    animation: queue-pulse 1.2s infinite;
}
@keyframes queue-pulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(37,99,235,0.25); }
    50%      { box-shadow: 0 0 0 5px rgba(37,99,235,0.08); }
}

.admin-nav__queue-count {
    margin-left: 0;
    background: rgba(15,23,42,0.08);
    color: var(--ink-2);
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    min-width: 18px;
    text-align: center;
}
.admin-nav__queue-fail {
    background: #dc2626;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    min-width: 18px;
    text-align: center;
}

.admin-nav__queue-panel {
    position: static;
    width: 100%;
    margin-top: 8px;
    padding: 12px;
    border-radius: var(--r-sm);
    background: var(--paper, #FAFAFA);
    border: 1px solid var(--rule-soft, rgba(0,0,0,0.1));
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.admin-nav__queue-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.admin-nav__queue-title { margin: 0; font-size: 13px; font-weight: 700; }
.admin-nav__queue-refresh { border: 0; background: transparent; color: var(--ink-2); font-size: 11px; font-weight: 600; cursor: pointer; }
.admin-nav__queue-summary { margin: 6px 0 10px; font-size: 11px; color: var(--muted); line-height: 1.4; }
.admin-nav__queue-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: min(48vh, 390px);
    overflow-y: auto;
}
.admin-nav__queue-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 12px;
    line-height: 1.4;
    padding: 8px 0;
    border-top: 1px solid var(--rule-soft);
}
.admin-nav__queue-item--empty { color: var(--muted, #6b7280); font-style: italic; }
.admin-nav__queue-item-head { display: flex; align-items: flex-start; gap: 8px; }
.admin-nav__queue-item-label { min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.admin-nav__queue-item-detail, .admin-nav__queue-item-error { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.admin-nav__queue-item-error { color: #b42336; }
.admin-nav__queue-item-state { font-size: 10px; font-weight: 700; color: #2563eb; }
.admin-nav__queue-item--pending .admin-nav__queue-item-state { color: #8a5a00; }
.admin-nav__queue-item--remote .admin-nav__queue-item-state { color: #2563eb; }
.admin-nav__queue-item--failed .admin-nav__queue-item-state { color: #b42336; }
.admin-nav__queue-item-time { margin-left: auto; flex-shrink: 0; font-size: 11px; color: var(--muted, #6b7280); }
.admin-nav__queue-item-pct { margin-left: auto; flex-shrink: 0; font-size: 11px; font-weight: 700; color: #2563eb; }

/* Прогресс-бар текущего джоба (реальные этапы из SyncProgress) */
.admin-nav__queue-bar {
    display: block;
    height: 4px;
    border-radius: 999px;
    background: rgba(15,23,42,0.08);
    overflow: hidden;
}
.admin-nav__queue-bar-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: #2563eb;
    transition: width 0.6s ease;
}
.admin-nav__queue-bar--indeterminate .admin-nav__queue-bar-fill {
    width: 35%;
    animation: queue-running-bar 1.5s ease-in-out infinite;
}
@keyframes queue-running-bar { from { transform: translateX(-110%); } to { transform: translateX(300%); } }
.admin-nav__queue-meta {
    margin: 8px 0 0;
    padding-top: 8px;
    border-top: 1px solid var(--rule-soft, rgba(0,0,0,0.06));
    font-size: 11px;
    color: var(--muted, #6b7280);
    line-height: 1.5;
}
.admin-nav__queue-more {
    display: inline-block;
    margin-top: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-2);
}

/* ──────────────────────────────────────────────────────────────────────
   Прогресс-баннер сбора «живых данных» (вкладка «Сводка» проекта)
   ────────────────────────────────────────────────────────────────────── */

.live-progress {
    margin: 12px 0;
    padding: 14px 16px;
    border-radius: var(--r-sm);
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}
.live-progress--failed { background: #fef2f2; border-color: #fecaca; }

.live-progress__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
}
.live-progress__spinner {
    width: 12px; height: 12px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 2px solid #2563eb;
    border-top-color: transparent;
    animation: live-progress-spin 0.9s linear infinite;
}
.live-progress--failed .live-progress__spinner { display: none; }
@keyframes live-progress-spin { to { transform: rotate(360deg); } }

.live-progress__pct { margin-left: auto; font-weight: 700; color: #2563eb; }

.live-progress__bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(37,99,235,0.15);
    overflow: hidden;
}
.live-progress__bar-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: #2563eb;
    transition: width 0.6s ease;
}
.live-progress__hint { margin: 8px 0 0; font-size: 11.5px; color: var(--muted, #6b7280); }

.cr-bounce-note { font-size: 10.5px; color: var(--muted, #6b7280); font-weight: 400; }

/* ──────────────────────────────────────────────────────────────────────
   «А Позиции» — трекер позиций на Arsenkin (Topvisor-style, бренд-токены)
   Структура-референс сгенерирована Stitch, цвета переведены в тёплую палитру.
   ────────────────────────────────────────────────────────────────────── */

.ape-toolbar { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; background: var(--surface); border: 1px solid var(--rule-soft); border-radius: var(--r-lg); padding: 20px 24px; }
.ape-toolbar__form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; }
.ape-field { display: flex; flex-direction: column; gap: 4px; }
.ape-field__label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.ape-field .field__input { min-width: 200px; }
.ape-limit { margin-left: auto; align-self: center; display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); border: 1px solid var(--rule-soft); border-radius: var(--r-sm); background: var(--surface-alt); padding: 9px 14px; }
.ape-limit::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--pos); flex: none; }
.ape-limit strong { color: var(--ink); font-family: var(--ff-mono); }
.ape-tabs { margin: 0; }

.ape-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 20px; background: var(--surface); border: 1px solid var(--rule-soft); border-radius: var(--r-lg); padding: 16px 20px; }
.ape-depth { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.ape-depth .field__input { padding: 6px 10px; }
.ape-status { font-size: 12.5px; color: var(--muted); }

/* Прогресс проверки */
.ape-progress { margin: 4px 0 16px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--accent-soft); border: 1px solid var(--rule-soft); }

/* Панель метрик (Topvisor summary) */
.ape-summary { background: var(--surface); border: 1px solid var(--rule-soft); border-radius: var(--r-md); padding: 18px; margin-bottom: 18px; }
.ape-summary__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.ape-summary__engine { font-family: var(--ff-serif); font-size: 22px; color: var(--ink); }
.ape-summary__note { font-size: 12.5px; color: var(--muted); }

.ape-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.ape-kpi { background: var(--surface-alt); border: 1px solid var(--rule-faint); border-radius: var(--r-sm); padding: 12px 14px; }
.ape-kpi__label { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 6px; }
.ape-kpi__value { font-family: var(--ff-serif); font-size: 30px; line-height: 1; color: var(--ink); display: flex; align-items: baseline; gap: 8px; }
.ape-kpi--movement .ape-kpi__value { font-family: var(--ff-sans); font-size: 15px; gap: 10px; }
.ape-movement { display: flex; gap: 10px; }

/* Распределение по топам */
.ape-buckets { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; border: 1px solid var(--rule-soft); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.ape-bucket { background: var(--surface); border: none; border-right: 1px solid var(--rule-faint); border-radius: 0; padding: 18px 20px; }
.ape-bucket:last-child { border-right: none; }
.ape-bucket__range { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 6px; font-family: var(--ff-mono); font-size: 11px; font-weight: 600; color: var(--ink); background: #E2E8F0; margin-bottom: 14px; }
.ape-bucket__count { font-family: var(--ff-serif); font-size: 32px; line-height: 1; color: var(--ink); display: flex; align-items: baseline; gap: 8px; }
.ape-bucket__pct { font-family: var(--ff-mono); font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.ape-bucket--1-3 .ape-bucket__range     { background: #0F172A; color: #fff; }
.ape-bucket--4-10 .ape-bucket__range    { background: #334155; color: #fff; }
.ape-bucket--11-20 .ape-bucket__range   { background: #475569; color: #fff; }
.ape-bucket--21-50 .ape-bucket__range   { background: #94A3B8; color: #fff; }
.ape-bucket--51-100 .ape-bucket__range  { background: #CBD5E1; color: var(--ink); }
.ape-bucket--101plus .ape-bucket__range { background: #E2E8F0; color: var(--ink); }
@media (max-width: 1100px) {
    .ape-buckets { grid-template-columns: repeat(3, 1fr); }
    .ape-bucket { border-bottom: 1px solid var(--rule-faint); }
    .ape-bucket:nth-child(3n) { border-right: none; }
}
@media (max-width: 600px) { .ape-buckets { grid-template-columns: repeat(2, 1fr); } }

/* Дельты */
.ape-delta { font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 2px; }
.ape-delta--up   { color: var(--pos); }
.ape-delta--down { color: var(--neg); }
.ape-delta--flat { color: var(--muted-2); }

/* Таблица позиций */
.ape-table th.ape-th-check, .ape-table td.ape-th-check { width: 34px; text-align: center; }
.ape-table .ape-q { font-weight: 500; color: var(--ink); max-width: 460px; overflow: hidden; text-overflow: ellipsis; }
.ape-table .ape-grp { color: var(--muted); font-size: 12.5px; }
.ape-pos { display: inline-flex; min-width: 30px; justify-content: center; padding: 2px 8px; border-radius: var(--r-xs); font-family: var(--ff-mono); font-size: 12.5px; font-weight: 700; }
.ape-pos--top3  { background: var(--ink); color: #fff; }
.ape-pos--top10 { background: var(--ink-3); color: #fff; }
.ape-pos--top30 { background: #CBD5E1; color: var(--ink); }
.ape-pos--low   { background: #F1F5F9; color: var(--ink-3); }
.ape-pos--none  { background: transparent; color: var(--muted-2); }

/* Модалки добавления/импорта */
.ape-modal { position: fixed; inset: 0; z-index: 200; background: rgba(15,23,42,0.45); display: flex; align-items: center; justify-content: center; padding: 20px; }
.ape-modal__box { background: var(--paper); border-radius: var(--r-md); width: 100%; max-width: 560px; max-height: 86vh; overflow: auto; box-shadow: 0 12px 40px rgba(0,0,0,0.25); }
.ape-modal__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--rule-soft); }
.ape-modal__head h3 { margin: 0; font-size: 17px; }
.ape-modal__close { border: none; background: transparent; font-size: 24px; line-height: 1; cursor: pointer; color: var(--muted); }
.ape-modal__body { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.ape-modal__row { display: flex; gap: 12px; flex-wrap: wrap; }
.ape-modal__row label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; flex: 1; }
.ape-modal__foot { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.ape-imp-cluster { display: flex; align-items: center; gap: 8px; padding: 7px 4px; border-bottom: 1px solid var(--rule-faint); font-size: 13.5px; cursor: pointer; }

/* ── Период (Topvisor-style): пресеты последних проверок + произвольные даты ── */
.ape-periodbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; padding: 18px 24px; margin-bottom: 0; background: var(--surface-alt); border: 1px solid var(--rule-soft); border-bottom: none; border-radius: var(--r-lg) var(--r-lg) 0 0; }
.ape-seg { display: inline-flex; padding: 3px; background: var(--paper-deep); border: 1px solid var(--rule-soft); border-radius: 9px; }
.ape-seg button { padding: 6px 13px; font-size: 12.5px; font-weight: 500; border: 0; background: transparent; color: var(--muted); border-radius: 6px; cursor: pointer; transition: background .15s, color .15s; }
.ape-seg button.is-active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(15,23,42,0.06); }
.ape-seg button:hover:not(.is-active) { color: var(--ink); }
.ape-periodbar__dates { display: flex; align-items: flex-end; gap: 10px; }
.ape-periodbar__dates .field__input { padding: 7px 10px; }
.ape-periodbar__note { font-size: 12px; color: var(--muted); margin-left: auto; align-self: center; font-family: var(--ff-mono); }

/* ── KPI-полоса над матрицей ── */
.ape-kpi-strip { display: grid; grid-template-columns: repeat(6, 1fr); background: var(--surface); border: 1px solid var(--rule-soft); border-radius: var(--r-lg); margin-bottom: 16px; overflow: hidden; }
.ape-kpi-cell { padding: 20px 22px; border-right: 1px solid var(--rule-faint); min-width: 0; }
.ape-kpi-cell:last-child { border-right: none; }
.ape-kpi-cell .lbl { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); white-space: nowrap; }
.ape-kpi-cell .val { font-family: var(--ff-serif); font-size: 34px; line-height: 1; letter-spacing: -0.01em; margin: 12px 0 8px; font-variant-numeric: tabular-nums; color: var(--ink); }
.ape-kpi-cell .val small { font-size: 13px; color: var(--muted); margin-left: 2px; }
.ape-kpi-cell .sub { font-size: 11px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.ape-kpi-cell--movement .val { font-family: var(--ff-sans); font-size: 15px; display: flex; gap: 10px; align-items: baseline; padding-top: 6px; }

/* ── Матрица позиций: ключи × даты проверок ── */
.ape-matrix-card { background: var(--surface); border: 1px solid var(--rule-soft); border-radius: var(--r-xl); overflow: hidden; margin-bottom: 22px; }
.ape-matrix-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--rule-soft); }
.ape-matrix-head__title { font-family: var(--ff-serif); font-size: 22px; font-weight: 400; letter-spacing: -0.01em; margin: 0; display: flex; align-items: baseline; gap: 10px; }
.ape-matrix-head__title .mono-note { font-family: var(--ff-mono, ui-monospace, monospace); font-size: 11px; font-weight: 400; color: var(--muted); }
.ape-matrix-legend { display: flex; gap: 12px; font-size: 10.5px; color: var(--ink-3); }
.ape-matrix-legend span { display: inline-flex; align-items: center; gap: 5px; }
.ape-matrix-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

.ape-matrix-scroll { overflow-x: auto; }
.ape-matrix { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
.ape-matrix thead th {
    position: sticky; top: 0; z-index: 3;
    background: var(--surface);
    font-size: 10px; text-transform: uppercase; letter-spacing: .06em;
    color: var(--muted); font-weight: 600;
    padding: 10px 8px; text-align: center;
    border-bottom: 1px solid var(--rule-soft);
    white-space: nowrap;
}
.ape-matrix thead th .sub { display: block; font-size: 9.5px; color: var(--muted-2); margin-top: 2px; letter-spacing: 0; text-transform: none; font-weight: 500; }
.ape-matrix .col-check { position: sticky; left: 0; z-index: 4; background: var(--surface); width: 36px; text-align: center; padding-left: 12px; }
.ape-matrix .col-query { position: sticky; left: 36px; z-index: 4; background: var(--surface); text-align: left; min-width: 260px; max-width: 360px; box-shadow: 1px 0 0 var(--rule-faint); }
.ape-matrix thead .col-check, .ape-matrix thead .col-query { z-index: 5; }
.ape-matrix tbody td { padding: 0; border-bottom: 1px solid var(--rule-faint); min-height: 44px; }
.ape-matrix tbody tr:hover td { background: var(--surface-alt); }

.ape-qcell { display: flex; align-items: center; gap: 10px; padding: 6px 12px; min-width: 0; }
.ape-qcell__q { display: block; font-size: 13px; color: var(--ink); font-weight: 500; white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
.ape-qcell__meta { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.ape-qcell__meta::before { content: '#'; opacity: .5; }

.ape-lastcell { padding: 0 12px !important; text-align: right; white-space: nowrap; }
.ape-lastcell__pos { font-family: var(--ff-mono, ui-monospace, monospace); font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; }
.ape-deltacell { text-align: center; white-space: nowrap; padding: 0 10px !important; }

/* Колонка частотности Wordstat (переключатель типа — в фильтрах) */
.ape-matrix thead th.ape-freqhead { text-align: right; }
.ape-freqcell {
    text-align: right; white-space: nowrap; padding: 0 12px !important;
    font-family: var(--ff-mono, ui-monospace, monospace); font-size: 13px;
    color: var(--ink); font-variant-numeric: tabular-nums; min-width: 78px;
}
.ape-freqcell--empty { color: var(--muted-2); }
.ape-seg--freq button { padding: 7px 12px; }

.ape-mx { text-align: center; font-family: var(--ff-mono, ui-monospace, monospace); font-size: 12.5px; font-variant-numeric: tabular-nums; min-width: 44px; padding: 0 4px !important; }
.ape-mx span { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 24px; padding: 0 6px; border-radius: var(--r-xs); }
.ape-mx--t3   span { background: var(--ink); color: #fff; font-weight: 600; }
.ape-mx--t10  span { background: var(--ink-3); color: #fff; }
.ape-mx--t30  span { background: #CBD5E1; color: var(--ink); }
.ape-mx--t100 span { background: #F1F5F9; color: var(--ink-3); }
.ape-mx--empty span { color: var(--muted-2); }
/* Клик по позиции → страница ключа в новой вкладке. Цвет наследуем от ячейки (топ-3 белый на тёмном). */
.ape-pos-link { color: inherit; text-decoration: none; cursor: pointer; }
.ape-pos-link:hover { text-decoration: underline; text-underline-offset: 2px; }

/* Фильтры над матрицей */
.ape-filterbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; padding: 18px 24px; margin-bottom: 24px; background: var(--surface-alt); border: 1px solid var(--rule-soft); border-top: 1px solid var(--rule-faint); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.ape-filterbar .ape-field .field__input { min-width: 150px; }
.ape-filterbar__search { flex: 1; min-width: 200px; }

@media (max-width: 980px) {
    .ape-kpi-strip { grid-template-columns: repeat(3, 1fr); }
    .ape-kpi-cell:nth-child(3) { border-right: none; }
}
@media (max-width: 860px) {
    .ape-kpis { grid-template-columns: repeat(2, 1fr); }
    .ape-buckets { grid-template-columns: repeat(3, 1fr); }
    .ape-kpi-strip { grid-template-columns: repeat(2, 1fr); }
}

/* ─── Семантика (конструктор ядра) ─── */
.sem-boards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.sem-board-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 18px;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 140px;
}
.sem-board-card__title { font-weight: 700; font-size: 15px; margin: 0; }
.sem-board-card__meta { font-size: 12px; color: var(--muted); }
.sem-board-card__vis { font-size: 12px; margin: 0; line-height: 1.4; }
.sem-board-card__actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; }

.sem-vis-actions {
    margin-bottom: 16px;
    padding: 18px 20px;
    border: 2px solid #2563eb;
    border-radius: 14px;
    background: linear-gradient(180deg, #eff6ff 0%, var(--surface) 100%);
}
.sem-vis-actions__title {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
}
.sem-vis-actions__lede {
    margin: 0 0 14px;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.45;
}
.sem-vis-actions__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.sem-vis-actions__main {
    font-size: 15px;
    padding: 12px 20px;
}
.sem-vis-actions__meta {
    margin: 12px 0 0;
    font-size: 12px;
    color: var(--muted);
}

.sem-vis-progress-wrap {
    margin-bottom: 14px;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--wash);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sem-vis-progress-track {
    height: 8px;
    border-radius: 999px;
    background: var(--line);
    overflow: hidden;
}
.sem-vis-progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #2563eb, #15803d);
    border-radius: 999px;
    transition: width 0.25s ease;
}
.sem-vis-progress-bar.is-indeterminate {
    animation: sem-vis-pulse 1.2s ease-in-out infinite;
}
@keyframes sem-vis-pulse {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 1; }
}
.sem-vis-progress-text { font-size: 13px; font-weight: 600; }

.sem-vis-engine-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-bottom: 14px;
    padding: 12px 16px;
    border: 2px solid var(--ink);
    border-radius: 12px;
    background: var(--surface);
}
.sem-vis-engine-panel__label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}
.sem-vis-engine-panel__meta { font-size: 12px; max-width: 100%; }
.sem-vis-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
}
.sem-vis-badge--yandex { background: #ffdb4d; color: #1a1a1a; }
.sem-vis-badge--google { background: var(--data-1); color: #fff; }
.sem-vis-badge--both { background: var(--ink); color: var(--paper); }
.sem-vis-engine--yandex.is-active { box-shadow: inset 0 0 0 2px #e6a800; }
.sem-vis-engine--google.is-active { box-shadow: inset 0 0 0 2px var(--data-1); }
.sem-vis-hint { font-size: 13px; line-height: 1.45; }

.sem-vis-project-tabs,
.sem-vis-engine-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.sem-vis-project-tabs { margin-bottom: 12px; }
.sem-vis-tab {
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 120px;
    text-align: left;
}
.sem-vis-tab__name { font-weight: 600; line-height: 1.2; }
.sem-vis-tab__vis { font-size: 11px; color: var(--muted); line-height: 1.25; }
.sem-vis-tab.is-active .sem-vis-tab__vis { color: #d4d4d8; }
.sem-vis-engine,
.sem-vis-filter {
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
}
.sem-vis-tab.is-active,
.sem-vis-engine.is-active,
.sem-vis-filter.is-active {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
}
.sem-vis-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}
.sem-vis-stat { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.sem-vis-stat__label { color: var(--muted); }
.sem-vis-stat--wide { grid-column: 1 / -1; }
.sem-vis-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.sem-vis-layout {
    display: grid;
    grid-template-columns: minmax(200px, 260px) 1fr;
    gap: 16px;
    align-items: start;
}
@media (max-width: 900px) {
    .sem-vis-layout { grid-template-columns: 1fr; }
}
.sem-vis-clusters {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}
.sem-vis-cluster-search-wrap {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 4px;
    background: var(--surface);
}
.sem-vis-cluster-search {
    flex: 1;
    min-width: 0;
    padding: 7px 10px;
    font-size: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg);
}
.sem-vis-cluster-search:focus {
    outline: none;
    border-color: var(--text);
}
.sem-vis-cluster-search-meta {
    font-size: 10px;
    color: var(--muted);
    white-space: nowrap;
}
.sem-vis-cluster__hint {
    font-size: 10px;
    color: var(--muted);
    font-weight: 400;
}
.sem-vis-cluster {
    text-align: left;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 8px 10px;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
}
.sem-vis-cluster__name { font-weight: 600; line-height: 1.25; }
.sem-vis-cluster__vis { font-size: 11px; color: var(--muted); }
.sem-vis-cluster.is-active {
    background: var(--wash);
    border-color: var(--line);
}
.sem-vis-keys {
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    overflow-x: auto;
}
.sem-vis-keys__title { margin: 0 0 12px; font-size: 15px; }
.sem-vis-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sem-vis-table th,
.sem-vis-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.sem-vis-table th { color: var(--muted); font-weight: 600; }

/* ── Page-head доски (по макету «Чернила»): крупный заголовок + хлебные крошки ── */
.sem-head { margin-bottom: 22px; }
.sem-head__crumbs { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.sem-head__eyebrow { font: 11px/1 "JetBrains Mono", monospace; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.sem-head__slash { color: var(--line); }
.sem-head__back { border: 0; background: transparent; font-size: 13px; color: var(--muted); cursor: pointer; padding: 0; }
.sem-head__back:hover { color: var(--ink); }
.sem-head__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.sem-head__title {
    font-family: var(--ff-serif, "Instrument Serif", serif);
    font-weight: 400;
    font-size: 44px;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--ink);
    padding: 2px 10px;
    margin-left: -10px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    max-width: 560px;
    width: 100%;
    transition: border-color .12s, background .12s;
}
.sem-head__title:hover { border-color: var(--line); }
.sem-head__title:focus { outline: none; border-color: var(--ink); background: var(--paper); box-shadow: 0 0 0 3px rgba(15,23,42,0.06); }
.sem-head__meta { font: 13px/1.4 "JetBrains Mono", monospace; color: var(--muted); margin: 10px 0 0; }
.sem-head__actions { display: flex; align-items: center; gap: 10px; }

.sem-info {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 13px 18px;
    border: 1px solid var(--line);
    background: var(--surface-alt, #f8fafc);
    border-radius: 10px;
    margin-bottom: 20px;
}
.sem-info__i { color: #475569; font-weight: 600; flex: none; }
.sem-info p { font-size: 13px; color: #475569; margin: 0; }

.sem-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 14px 18px;
    padding: 18px 22px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    margin-bottom: 24px;
}
.sem-toolbar .field__label { font: 10px/1 "JetBrains Mono", monospace; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; display: block; }
.sem-toolbar__group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sem-toolbar__sep { width: 1px; height: 38px; background: var(--line); align-self: center; }
.sem-toolbar__actions { display: flex; gap: 10px; margin-left: auto; }
.sem-btn-danger { border-color: #fecdd3; background: #fff1f2; color: #be123c; }
.sem-btn-danger:hover { background: #ffe4e6; border-color: #fda4af; color: #9f1239; }
.sem-toolbar__status { font-size: 12px; color: var(--muted); }
.sem-toolbar__status.is-busy { color: #b45309; }
.sem-toolbar__status.is-ok { color: #15803d; }
.sem-toolbar__status.is-warn { color: #b45309; }
.sem-toolbar__status.is-err { color: #b91c1c; }

.sem-region-field { min-width: 200px; }
.sem-combo { position: relative; min-width: 220px; }
.sem-combo__input { width: 100%; min-width: 200px; }
.sem-combo__list {
    position: absolute;
    z-index: 40;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    max-height: 280px;
    overflow-y: auto;
    margin: 0;
    padding: 4px 0;
    list-style: none;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(17, 24, 39, 0.12);
}
.sem-combo__list li { margin: 0; }
.sem-combo__list button {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
}
.sem-combo__list button:hover { background: var(--surface-alt); }
.sem-combo__empty {
    padding: 10px 12px;
    font-size: 12px;
    color: var(--muted);
}

.sem-ws-field .field__label { display: block; margin-bottom: 6px; }
.sem-ws-checks { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sem-ws-check {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 13px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color .12s, color .12s;
}
.sem-ws-check:has(input:checked) { border-color: var(--ink); color: var(--ink); }
.sem-ws-check input { margin: 0; accent-color: var(--ink); }

.sem-view-tabs { display: inline-flex; padding: 3px; background: var(--surface-alt, #f1f5f9); border-radius: 8px; }
.sem-view-tabs button {
    border: 0;
    background: transparent;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    color: var(--muted);
}
.sem-view-tabs button.is-active { background: var(--paper); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(15,23,42,0.06); }

/* Строка заголовков частот в карточке кластера (WS / «WS» / !WS) */
.sem-cluster-card__freqhead {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px 6px 30px;
    background: var(--surface-alt, #fbfcfd);
    border-bottom: 1px solid var(--line);
}
.sem-freqhead__sp { flex: 1; min-width: 40px; }
.sem-freqhead__cols { display: flex; gap: 6px; flex: none; }
.sem-freqhead__cols span {
    font: 9px/1 "JetBrains Mono", monospace;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    text-align: right;
    min-width: 2.5em;
}
.sem-freqhead__act { flex: none; width: 24px; }

.sem-cluster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
    align-items: start;
}
.sem-cluster-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    aspect-ratio: 1 / 1;
    max-height: 420px;
    min-height: 260px;
    overflow: hidden;
    transition: box-shadow .15s, border-color .15s;
}
.sem-cluster-card:hover { border-color: #cbd5e1; box-shadow: 0 2px 10px rgba(15,23,42,0.04); }
.sem-cluster-card.is-drop-target { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,.25); }
.sem-cluster-card.is-selected { border-color: var(--ink); box-shadow: 0 0 0 2px rgba(17,24,39,.12); }
.sem-cluster-card__head {
    padding: 12px 12px 8px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.sem-cluster-card__name {
    flex: 1;
    font-weight: 700;
    font-size: 13px;
    border: 0;
    background: transparent;
    padding: 2px 0;
    min-width: 0;
}
.sem-cluster-card__count { font-size: 11px; color: var(--muted); white-space: nowrap; }
.sem-cluster-card__body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sem-query-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 12px;
    background: var(--surface-alt, #f8fafc);
    cursor: grab;
}
.sem-query-row:active { cursor: grabbing; }
.sem-query-row.is-selected { background: #e0e7ff; }
.sem-query-row__freq {
    margin-left: auto;
    font: 600 10px/1 "JetBrains Mono", monospace;
    color: var(--muted);
    display: flex;
    gap: 6px;
}
.sem-query-row__freq span { min-width: 2.5em; text-align: right; }
.sem-query-export {
    flex-shrink: 0;
    padding: 2px 6px;
    font-size: 12px;
    line-height: 1;
    opacity: 0.55;
}
.sem-query-row:hover .sem-query-export { opacity: 1; }
.sem-query-del {
    flex-shrink: 0;
    padding: 2px 6px;
    font-size: 14px;
    line-height: 1;
    color: var(--muted);
    opacity: 0.45;
}
.sem-query-row:hover .sem-query-del { opacity: 1; }
.sem-query-del:hover { background: #fff1f2; color: #be123c; border-color: #fecdd3; }
.sem-focus-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.sem-focus-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 16px;
    min-height: 480px;
}
@media (max-width: 900px) {
    .sem-focus-layout { grid-template-columns: 1fr; }
}
.sem-focus-sidebar {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    overflow-y: auto;
    max-height: 70vh;
}
.sem-focus-sidebar button {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
    background: transparent;
    font-size: 12px;
    cursor: pointer;
}
.sem-focus-sidebar button.is-active { background: var(--surface-alt); font-weight: 700; }
.sem-focus-panel {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    padding: 14px;
}
.sem-focus-panel .sem-query-row { font-size: 13px; padding: 8px 10px; }

.sem-add-cluster {
    border: 2px dashed var(--line);
    border-radius: 14px;
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    cursor: pointer;
    background: transparent;
    font-weight: 600;
    aspect-ratio: 1 / 1;
}
.sem-add-cluster:hover { border-color: var(--ink); color: var(--ink); }

.sem-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.45);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.sem-modal-backdrop.is-open { display: flex; }
.sem-modal {
    background: var(--paper);
    border-radius: 16px;
    width: min(480px, 100%);
    max-height: 90vh;
    overflow: auto;
    padding: 20px;
    box-shadow: 0 24px 60px rgba(15,23,42,.2);
}
.sem-modal h3 { margin: 0 0 12px; font-size: 16px; }
.sem-modal .field { margin-bottom: 12px; }
.sem-export-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255,255,255,.58);
}
.sem-export-summary div {
    min-width: 0;
}
.sem-export-summary span {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 10px;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.sem-export-summary strong {
    display: block;
    overflow-wrap: anywhere;
    font-size: 13px;
}
.sem-export-confirm {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-alt);
    font-size: 13px;
    line-height: 1.35;
}
.sem-export-confirm input {
    margin-top: 2px;
}
.sem-export-result {
    padding: 12px;
    border: 1px solid rgba(34, 197, 94, .32);
    border-radius: 10px;
    background: rgba(34, 197, 94, .08);
}
.sem-export-result p {
    margin: 0 0 8px;
}
.sem-export-result p:last-child {
    margin-bottom: 0;
}
.sem-export-result__errors {
    color: #9f3412;
}

/* ─── Документы — справочник средних цен ─── */
/* Hero-карточка по макету «Чернила»: единая карточка, левая часть + правая KPI-колонка */
.docs-hero {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 0;
    padding: 0;
    align-items: stretch;
    overflow: hidden;
    border-radius: 16px;
    background: var(--surface);
}
.docs-hero > div:first-child {
    padding: 36px 40px;
    border-right: 1px solid var(--rule-faint, #f1f5f9);
}
.docs-hero__eyebrow {
    margin: 0 0 14px;
    font-family: var(--ff-mono);
    font-size: 10.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}
.docs-hero__title {
    margin: 0;
    font-family: var(--ff-serif);
    font-size: 40px;
    line-height: 1;
    font-weight: 400;
    letter-spacing: -0.01em;
}
.docs-hero__text {
    max-width: 420px;
    margin: 14px 0 0;
    color: var(--ink-3);
    font-size: 14px;
    line-height: 1.6;
}
.docs-hero__stats {
    display: grid;
    grid-template-rows: 1fr 1fr;
    border: 0;
    border-radius: 0;
    background: transparent;
}
.docs-hero__stats div {
    padding: 24px 32px;
    border-right: 0;
    border-bottom: 1px solid var(--rule-faint, #f1f5f9);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.docs-hero__stats div:last-child { border-bottom: 0; }
.docs-hero__stats span {
    margin: 0;
    font-family: var(--ff-mono);
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.docs-hero__stats strong {
    font-family: var(--ff-serif);
    font-size: 40px;
    line-height: 1;
    font-weight: 400;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
@media (max-width: 720px) {
    .docs-hero { grid-template-columns: 1fr; }
    .docs-hero > div:first-child { border-right: 0; border-bottom: 1px solid var(--rule-faint, #f1f5f9); }
}
.docs-add { border-radius: 16px; }
.docs-add__form {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(180px, 260px) auto;
    gap: 14px;
    align-items: end;
}
.docs-table-panel { padding-bottom: 28px; }
.docs-table-wrap {
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
    overflow: auto;
    background: var(--surface);
}
.docs-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 880px;
    table-layout: fixed;
}
/* Пропорции колонок (3): имя — широкое, цена — узкая, кластер — средняя. */
.docs-table th:nth-child(1), .docs-table td:nth-child(1) { width: 50%; }
.docs-table th:nth-child(2), .docs-table td:nth-child(2) { width: 16%; }
.docs-table th:nth-child(3), .docs-table td:nth-child(3) { width: 34%; }
.docs-table th {
    padding: 14px 16px;
    background: var(--paper-deep);
    border-bottom: 1px solid var(--rule-soft);
    color: var(--muted);
    font-family: var(--ff-mono);
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-align: left;
}
.docs-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--rule-faint);
    vertical-align: middle;
}
.docs-table tbody tr:last-child td { border-bottom: 0; }
.docs-table tbody tr:hover td { background: rgba(15,23,42,0.035); }
.docs-table__input {
    width: 100%;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--ink);
    padding: 9px 10px;
    transition: border-color .12s, background .12s;
}
.docs-table__input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface);
}
.docs-table__input--name { font-weight: 650; text-overflow: ellipsis; }
.docs-row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}
.docs-move-cat {
    appearance: auto;
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-sm);
    background: var(--paper);
    color: var(--muted);
    font-size: 12px;
    line-height: 1.2;
    padding: 4px 8px;
    max-width: 170px;
    cursor: pointer;
}
.docs-move-cat:hover { border-color: var(--accent); color: var(--ink); }
.docs-table__input--price {
    max-width: 140px;
    font-family: var(--ff-mono);
    font-size: 14px;
    text-align: right;
}
.docs-table__price-cell {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}
.docs-row-del {
    flex: 0 0 auto;
    padding: 6px 9px;
    line-height: 1;
    font-size: 13px;
    color: var(--muted-2, #94a3b8);
    opacity: 0;
    transition: opacity .12s, background .12s, color .12s;
}
.docs-table tbody tr:hover .docs-row-del,
.docs-row-del:focus-visible { opacity: 1; }
.docs-row-del:hover { color: #be123c; background: #fff1f2; }
.docs-table-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 16px;
}
.docs-table-toast {
    position: sticky;
    top: 14px;
    z-index: 12;
    margin-bottom: 14px;
    padding: 11px 15px;
    border: 1px solid #bbf7d0;
    border-radius: var(--r-md);
    background: #f0fdf4;
    color: #14532d;
    box-shadow: 0 14px 42px rgba(31,41,51,.08);
}
.docs-table-toast.is-danger {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}
.docs-table__input.is-saving {
    opacity: .55;
}
/* Столбец «Кластер ключей» */
/* Ячейка «Кластер ключей» — двухстрочная: имя сверху, кнопки снизу.
   ВАЖНО: оставляем td обычной table-cell (без display:flex) — иначе table-layout:fixed
   не отдаёт колонке её ширину и имя кластера схлопывается. Контент стекаем блоками. */
.docs-cluster {
    min-width: 0;
    white-space: normal;
    vertical-align: middle;
}
.docs-cluster__name { width: 100%; min-width: 0; margin-bottom: 6px; }
.docs-cluster__link {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    width: 100%;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
    line-height: 1.3;
}
.docs-cluster__link:hover { text-decoration: underline; }
.docs-cluster__actions { display: flex; gap: 6px; flex-wrap: wrap; }
.docs-cluster__btn {
    border: 1px solid var(--rule-soft);
    background: var(--surface);
    border-radius: 6px;
    cursor: pointer;
    line-height: 1;
    font-size: 12px;
    padding: 5px 9px;
    color: var(--ink);
    white-space: nowrap;
}
.docs-cluster__btn:hover { border-color: var(--accent); }
.docs-cluster__btn--ghost { color: var(--muted); }
.docs-cluster__btn--ghost:hover { color: var(--ink); border-color: var(--rule-soft); }
.docs-cluster__attach {
    border: 1px dashed var(--rule-soft);
    background: var(--surface);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    padding: 6px 10px;
    color: var(--accent);
    font-weight: 600;
    white-space: nowrap;
}
.docs-cluster__attach:hover { border-color: var(--accent); border-style: solid; }
/* пометка занятого кластера в пикере */
.docs-cluster-list__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.docs-cluster-list__item.is-busy { opacity: .6; cursor: not-allowed; }
.docs-cluster-list__busy { font-size: 11px; color: var(--muted); white-space: nowrap; font-style: normal; }
.docs-cluster-modal {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, .45);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 7vh 16px;
    z-index: 60;
}
.docs-cluster-modal[hidden] { display: none; }
.docs-cluster-modal__card {
    background: var(--surface);
    border-radius: var(--r-md);
    width: min(560px, 100%);
    max-height: 82vh;
    overflow: auto;
    padding: 18px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .25);
}
.docs-cluster-modal__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.docs-cluster-modal__tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.docs-cluster-modal__tabs button {
    border: 1px solid var(--rule-soft);
    background: var(--surface-alt);
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    color: var(--ink);
}
.docs-cluster-modal__tabs button.is-active { background: var(--accent); color: #fff; border-color: transparent; }
.docs-cluster-list { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; max-height: 48vh; overflow: auto; }
.docs-cluster-list__item {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    width: 100%; text-align: left;
    border: 1px solid var(--rule-soft); background: var(--surface);
    border-radius: 8px; padding: 8px 10px; cursor: pointer; color: var(--ink);
}
.docs-cluster-list__item:hover { border-color: var(--accent); background: var(--surface-alt); }
/* Панели категорий справочника */
/* Навигация по категориям (чипы-якоря) */
.docs-cat-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
}
.docs-cat-nav__chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 13px;
    border: 1px solid var(--rule-soft);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink-2);
    font-size: 13px;
    text-decoration: none;
    transition: border-color .12s, color .12s;
}
.docs-cat-nav__chip:hover { border-color: var(--accent); color: var(--accent); }
.docs-cat-nav__num {
    font-family: var(--ff-mono);
    font-size: 11px;
    color: var(--muted);
    background: var(--paper-deep);
    border-radius: 999px;
    padding: 1px 8px;
}
/* Панель категории — карточка edge-to-edge (по макету «Чернила») */
.docs-cat-panel { margin-bottom: 16px; scroll-margin-top: 16px; padding: 0; overflow: hidden; border-radius: 16px; }
.docs-cat-panel__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 18px 24px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--rule-soft);
}
/* Таблица внутри карточки категории — без собственной рамки (рамку даёт карточка) */
.docs-cat-panel .docs-table-wrap { border: 0; border-radius: 0; }
.docs-cat-panel__title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; flex: 1 1 auto; min-width: 0; }
.docs-cat-panel__title .section-head__title { font-family: var(--ff-serif); font-size: 24px; font-weight: 400; letter-spacing: -0.015em; margin: 0; }
.docs-cat-name {
    font-family: var(--ff-serif);
    font-size: 24px;
    font-weight: 400;
    letter-spacing: -0.015em;
    line-height: 1.15;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--ink);
    padding: 2px 6px;
    margin-left: -6px;
    width: 460px;
    max-width: 100%;
}
.docs-cat-name:hover { border-color: var(--rule-soft); }
.docs-cat-name:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.docs-cat-delete-form .btn { color: var(--muted); }
.docs-cat-delete-form .btn:hover { color: #991b1b; border-color: #fecaca; }
.docs-cat-select { width: 100%; max-width: 210px; color: var(--ink-2); font-size: 13px; }
.docs-cat-empty td { padding: 14px 10px; }
.docs-empty {
    border: 1px dashed var(--rule-soft);
    border-radius: var(--r-md);
    padding: 28px;
    background: var(--surface-alt);
}
.docs-empty__title {
    margin: 0 0 6px;
    font-weight: 700;
    font-size: 16px;
}

/* ─── Документы на сайтах ─── */
.doc-presence-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: end;
    margin-bottom: 22px;
    background: var(--surface);
}
.doc-presence-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}
.doc-presence-status {
    margin-bottom: 18px;
}
.doc-presence-status__head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 16px;
}
.doc-presence-status__head h2 {
    margin: 0 0 6px;
    font-size: 24px;
    line-height: 1.15;
}
.doc-presence-status__head p {
    margin: 0;
    color: var(--muted);
}
.doc-presence-status__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}
.doc-presence-status__grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    border: 1px solid var(--rule-faint);
    border-radius: var(--r-md);
    overflow: hidden;
}
.doc-presence-status__grid div {
    padding: 12px;
    border-right: 1px solid var(--rule-faint);
    background: var(--paper);
}
.doc-presence-status__grid div:last-child { border-right: 0; }
.doc-presence-status__grid span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-family: var(--ff-mono);
    font-size: 9px;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.doc-presence-status__grid strong {
    display: block;
    font-size: 20px;
    line-height: 1;
}
.doc-presence-result-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}
.doc-presence-result-card {
    display: block;
    padding: 14px 16px;
    border: 1px solid var(--rule-faint);
    border-radius: var(--r-md);
    background: var(--surface);
    color: inherit;
    text-decoration: none;
    transition: border-color .14s, box-shadow .14s, transform .14s;
}
.doc-presence-result-card:hover {
    border-color: var(--rule-soft);
    box-shadow: 0 12px 28px rgba(31,41,51,.08);
    transform: translateY(-1px);
}
.doc-presence-result-card span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-family: var(--ff-mono);
    font-size: 10px;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.doc-presence-result-card strong {
    display: block;
    font-size: 28px;
    line-height: 1;
}
.doc-presence-result-card.is-found strong { color: #15803d; }
.doc-presence-result-card.is-missing strong { color: #991b1b; }
.doc-presence-result-card.is-review strong { color: #b45309; }
.doc-presence-result-card.is-unchecked strong { color: var(--ink); }
.doc-presence-status__meta {
    margin-top: 10px;
    color: var(--muted);
    font-size: 12px;
}
.doc-presence-toast {
    position: sticky;
    top: 14px;
    z-index: 12;
    margin-bottom: 14px;
    padding: 13px 16px;
    border: 1px solid #bbf7d0;
    border-radius: var(--r-md);
    background: #f0fdf4;
    color: #14532d;
    box-shadow: 0 14px 42px rgba(31,41,51,.08);
}
.doc-presence-toast.is-danger {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}
.doc-presence-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 16px;
}
.doc-presence-card {
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
    background: var(--surface);
    overflow: hidden;
    box-shadow: 0 16px 44px rgba(31,41,51,.05);
}
.doc-presence-card.is-done {
    border-color: #86efac;
    box-shadow: 0 16px 44px rgba(21,128,61,.10);
}
.doc-presence-card.is-active {
    border-color: #fbbf24;
    box-shadow: 0 16px 44px rgba(180,83,9,.08);
}
.doc-presence-card__main {
    display: block;
    padding: 20px 20px 14px;
    color: inherit;
    text-decoration: none;
}
.doc-presence-card__main:hover h2 { color: var(--accent); }
.doc-presence-card__eyebrow {
    display: block;
    margin-bottom: 8px;
    font-family: var(--ff-mono);
    font-size: 10px;
    color: var(--muted);
    letter-spacing: .14em;
    text-transform: uppercase;
}
.doc-presence-card__state {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 3px 7px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: 9px;
    letter-spacing: .08em;
}
.doc-presence-card__state.is-active {
    background: #fef3c7;
    color: #92400e;
}
.doc-presence-card h2 {
    margin: 0;
    font-size: 22px;
    line-height: 1.1;
    transition: color .14s;
}
.doc-presence-card p {
    margin: 6px 0 14px;
    color: var(--muted);
}
.doc-presence-meter {
    height: 8px;
    border-radius: 99px;
    overflow: hidden;
    background: var(--paper-deep);
}
.doc-presence-meter span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
}
.doc-presence-card.is-done .doc-presence-meter span { background: #15803d; }
.doc-presence-card.is-active .doc-presence-meter span { background: #b45309; }
.doc-presence-card__progress {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-family: var(--ff-mono);
    font-size: 11px;
}
.doc-presence-card__stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    border-top: 1px solid var(--rule-faint);
    border-bottom: 1px solid var(--rule-faint);
}
.doc-presence-card__stats div {
    padding: 12px 10px;
    border-right: 1px solid var(--rule-faint);
}
.doc-presence-card__stats div:last-child { border-right: 0; }
.doc-presence-card__stats span {
    display: block;
    margin-bottom: 5px;
    font-family: var(--ff-mono);
    font-size: 9px;
    color: var(--muted);
    letter-spacing: .1em;
    text-transform: uppercase;
}
.doc-presence-card__stats strong {
    display: block;
    font-size: 19px;
    line-height: 1;
}
.doc-presence-card__stats .is-found strong { color: #15803d; }
.doc-presence-card__stats .is-missing strong { color: #991b1b; }
.doc-presence-card__stats .is-review strong { color: #b45309; }
.doc-presence-card__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 20px 16px;
    color: var(--muted);
    font-size: 12px;
}
.doc-presence-card__foot .btn { margin-left: auto; }
.doc-presence-table-panel {
    margin-bottom: 20px;
    scroll-margin-top: 22px;
}
.doc-presence-table {
    width: 100%;
    min-width: 1120px;
    border-collapse: collapse;
}
.doc-presence-table th {
    padding: 13px 14px;
    background: var(--paper-deep);
    border-bottom: 1px solid var(--rule-soft);
    color: var(--muted);
    font-family: var(--ff-mono);
    font-size: 10px;
    letter-spacing: .14em;
    text-align: left;
    text-transform: uppercase;
}
.doc-presence-table td {
    padding: 14px;
    border-bottom: 1px solid var(--rule-faint);
    vertical-align: top;
}
/* Подсказка-«?» у заголовка столбца «Ручное решение» (нативный title при наведении) */
.doc-presence-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    margin-left: 4px;
    border: 1px solid var(--rule-soft);
    border-radius: 50%;
    font-family: var(--ff-mono);
    font-size: 10px;
    line-height: 1;
    color: var(--muted);
    cursor: help;
    vertical-align: middle;
}
.doc-presence-help:hover { border-color: var(--accent); color: var(--accent); }
.doc-presence-table tbody tr:last-child td { border-bottom: 0; }
.doc-presence-table strong,
.doc-presence-table small {
    display: block;
}
.doc-presence-table small {
    margin-top: 5px;
    color: var(--muted);
    line-height: 1.35;
}
.doc-presence-table a {
    color: var(--accent);
    word-break: break-all;
}
.doc-presence-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.doc-presence-badge--found { background: #dcfce7; color: #166534; }
.doc-presence-badge--missing,
.doc-presence-badge--unchecked { background: var(--paper-deep); color: var(--ink-3); }
.doc-presence-badge--review,
.doc-presence-badge--error { background: #fef3c7; color: #92400e; }
.doc-presence-score {
    font-family: var(--ff-mono);
    font-size: 15px;
    font-weight: 700;
}
.doc-presence-manual {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.doc-presence-manual--inline {
    margin-top: 6px;
    gap: 4px;
}
.doc-presence-manual--inline .btn {
    padding: 2px 8px;
    font-size: 11px;
    line-height: 1.35;
    min-height: 0;
    border-radius: 4px;
}
.doc-presence-doc-cell strong {
    display: block;
}
.doc-presence-url-cell .status-pill,
.doc-presence-sitemap-col .status-pill {
    display: inline-block;
    margin-top: 4px;
    font-size: 10px;
}
.doc-presence-sitemap-col small {
    display: block;
    margin-top: 2px;
}

@media (max-width: 960px) {
    .docs-hero { grid-template-columns: 1fr; }
    .doc-presence-hero { grid-template-columns: 1fr; }
    .doc-presence-actions { justify-content: flex-start; }
    .doc-presence-status__head { flex-direction: column; }
    .doc-presence-status__actions { justify-content: flex-start; }
    .doc-presence-status__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .doc-presence-status__grid div { border-bottom: 1px solid var(--rule-faint); }
    .doc-presence-result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .doc-presence-card__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .doc-presence-card__foot .btn { margin-left: 0; }
    .docs-add__form { grid-template-columns: 1fr; }
    .docs-hero__stats { grid-template-columns: 1fr; }
    .docs-hero__stats div {
        border-right: 0;
        border-bottom: 1px solid var(--rule-soft);
    }
    .docs-hero__stats div:last-child { border-bottom: 0; }
}

/* Страница диагностики — баннер */
.diag-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 22px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid;
}
.diag-banner--ok       { background: #f0fdf4; border-color: #bbf7d0; color: #14532d; }
.diag-banner--warn     { background: #fffbeb; border-color: #fde68a; color: #78350f; }
.diag-banner--critical { background: #fef2f2; border-color: #fecaca; color: #7f1d1d; }

.diag-banner__icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.diag-banner--ok .diag-banner__icon       { background: #dcfce7; color: #16a34a; }
.diag-banner--warn .diag-banner__icon     { background: #fef3c7; color: #d97706; }
.diag-banner--critical .diag-banner__icon { background: #fee2e2; color: #dc2626; }

.diag-banner__main { flex: 1; }
.diag-banner__title { margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.diag-banner__subtitle { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }

.diag-banner__chip {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.7);
}
.diag-banner__chip--ok       { color: #16a34a; }
.diag-banner__chip--warn     { color: #d97706; }
.diag-banner__chip--critical { color: #dc2626; }

/* Инструкция */
.panel--warn { background: #fffbeb; border-left: 4px solid #d97706; }
.diag-instructions { font-size: 0.95em; line-height: 1.6; }
.diag-instructions ol { padding-left: 20px; }
.diag-instructions li { margin-bottom: 6px; }
.diag-instructions code {
    background: rgba(0,0,0,0.06);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.88em;
}

/* Матрица интеграций */
.diag-matrix-wrap { overflow-x: auto; }
.diag-matrix { min-width: 760px; }
.diag-matrix th, .diag-matrix td {
    border: 1px solid var(--rule-soft, rgba(0,0,0,0.08));
    padding: 8px;
    vertical-align: top;
}
.diag-matrix thead th { background: var(--paper-deep); font-size: 0.85em; }

.diag-cell--connected    { background: #f0fdf4; }
.diag-cell--pending      { background: #fffbeb; }
.diag-cell--degraded     { background: #fef3c7; }
.diag-cell--error        { background: #fef2f2; }
.diag-cell--disconnected { background: #fafafa; }

.diag-cell__chip {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255,255,255,0.7);
}
.diag-cell--connected    .diag-cell__chip { color: #16a34a; }
.diag-cell--pending      .diag-cell__chip { color: #d97706; }
.diag-cell--degraded     .diag-cell__chip { color: #92400e; }
.diag-cell--error        .diag-cell__chip { color: #dc2626; }
.diag-cell--disconnected .diag-cell__chip { color: #6b7280; }

/* Узкие кнопки в матрице */
.btn--xs {
    padding: 2px 8px;
    font-size: 11px;
    line-height: 1.4;
}

/* ──────────────────────────────────────────────────────────────────────
   Bing Webmaster — карточка на странице проекта + виджет квот
   ────────────────────────────────────────────────────────────────────── */

.bing-card {
    margin-top: 18px;
    padding: 18px 20px;
    border-radius: 12px;
    border: 1px solid var(--rule-soft, rgba(0,0,0,0.08));
    background: var(--paper, #FAFAFA);
}
.bing-card--connected  { border-left: 4px solid #16a34a; }
.bing-card--unverified { border-left: 4px solid #d97706; background: #fffbeb; }
.bing-card--api_error  { border-left: 4px solid #d97706; background: #fffbeb; }
.bing-card--missing    { border-left: 4px solid #dc2626; background: #fef2f2; }
.bing-card--no_key     { border-left: 4px solid #9ca3af; }

.bing-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.bing-card__title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
    font-family: var(--ff-serif, serif);
}
.bing-card__desc {
    margin: 0;
    font-size: 12.5px;
    color: var(--muted, #6b7280);
    line-height: 1.5;
}
.bing-card__meta {
    margin: 12px 0 0;
    font-size: 13px;
    color: var(--ink-2, #1f2937);
}
.bing-card__meta code {
    background: rgba(0,0,0,0.06);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.92em;
}

/* Яндекс Бизнес — монитор (Общие настройки) */
.yb-monitor {
    margin-top: 20px;
    padding: 22px 24px;
    border-radius: var(--r-md, 12px);
    border: 1px solid var(--rule-soft);
    background: linear-gradient(145deg, var(--surface) 0%, var(--paper) 100%);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}
.yb-monitor--ok {
    border-color: rgba(4, 120, 87, 0.35);
    box-shadow: inset 4px 0 0 var(--pos, #047857);
}
.yb-monitor--bad {
    border-color: rgba(185, 28, 28, 0.25);
    background: linear-gradient(145deg, #fffbfb 0%, var(--paper) 100%);
    box-shadow: inset 4px 0 0 #b91c1c;
}
.yb-monitor--warn {
    border-color: rgba(180, 83, 9, 0.3);
    box-shadow: inset 4px 0 0 var(--warn-clr, #b45309);
}
.yb-monitor--neutral {
    box-shadow: inset 4px 0 0 var(--muted);
}
.yb-monitor__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.yb-monitor__brand {
    display: flex;
    align-items: center;
    gap: 14px;
}
.yb-monitor__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #fc3f1d;
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    font-family: var(--ff-sans, system-ui, sans-serif);
    flex-shrink: 0;
}
.yb-monitor__title {
    margin: 0 0 4px;
    font-size: 17px;
    font-weight: 600;
    font-family: var(--ff-serif, serif);
    color: var(--ink);
}
.yb-monitor__subtitle {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.45;
}
.yb-monitor__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}
@media (max-width: 560px) {
    .yb-monitor__grid { grid-template-columns: 1fr; }
}
.yb-monitor__tile {
    padding: 16px 18px;
    border-radius: 10px;
    border: 1px solid var(--rule-soft);
    background: var(--surface);
}
.yb-monitor__tile--ok {
    border-color: rgba(4, 120, 87, 0.3);
    background: var(--pos-bg);
}
.yb-monitor__tile--bad {
    border-color: rgba(185, 28, 28, 0.22);
    background: #fef2f2;
}
.yb-monitor__tile--warn {
    border-color: rgba(180, 83, 9, 0.28);
    background: var(--warn-bg);
}
.yb-monitor__tile--neutral {
    background: var(--paper-deep, #F1F5F9);
}
.yb-monitor__tile-label {
    margin: 0 0 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
.yb-monitor__tile-value {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--ink);
    font-family: var(--ff-serif, serif);
}
.yb-monitor__tile--ok .yb-monitor__tile-value { color: var(--pos, #047857); }
.yb-monitor__tile--bad .yb-monitor__tile-value { color: #b91c1c; }
.yb-monitor__tile--warn .yb-monitor__tile-value { color: var(--warn-clr); }
.yb-monitor__tile-hint {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--ink-3, #4b5563);
}
.yb-monitor__lead {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.03);
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--ink-2);
}
.yb-monitor--bad .yb-monitor__lead {
    background: rgba(185, 28, 28, 0.06);
}
.yb-monitor__timeline {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
}
.yb-monitor__timeline li {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 140px;
}
.yb-monitor__timeline-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}
.yb-monitor__timeline-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}
.yb-monitor__history {
    margin-top: 8px;
    font-size: 13px;
}
.yb-monitor__history summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--ink-2);
    padding: 6px 0;
}
.yb-monitor__history-list {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    border-top: 1px solid var(--rule-faint);
}
.yb-monitor__history-item {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--rule-faint);
}
.yb-monitor__history-item time {
    color: var(--muted);
    font-size: 12.5px;
    white-space: nowrap;
}
.yb-monitor__history-item span {
    color: var(--ink);
    font-weight: 500;
    text-align: right;
    flex: 1;
    min-width: 12rem;
}

/* Виджет квоты */
.bing-quota {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.bing-quota__row { display: flex; flex-direction: column; gap: 4px; }
.bing-quota__label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted, #6b7280);
    font-weight: 500;
}
.bing-quota__value {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 14px;
}
.bing-quota__value strong {
    font-size: 22px;
    font-weight: 600;
    font-feature-settings: "tnum";
}
.bing-quota__pct {
    margin-left: auto;
    font-size: 12px;
    color: var(--muted-2, #9ca3af);
    font-feature-settings: "tnum";
}
.bing-quota__bar {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(0,0,0,0.06);
    overflow: hidden;
}
.bing-quota__fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.6s ease, background 0.3s;
}
.bing-quota__fill--ok  { background: linear-gradient(90deg, #16a34a, #22c55e); }
.bing-quota__fill--med { background: linear-gradient(90deg, #d97706, #f59e0b); }
.bing-quota__fill--low { background: linear-gradient(90deg, #dc2626, #ef4444); }

.bing-quota__hint {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--muted, #6b7280);
    line-height: 1.5;
}

/* Bing overview-таблица на странице Настройки */
.bing-overview {
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: 10px;
    background: var(--paper-deep, #F1F5F9);
    border: 1px solid var(--rule-soft, rgba(0,0,0,0.06));
}
.bing-overview__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.bing-overview__title { margin: 0; font-size: 15px; font-weight: 600; }
.bing-overview__stats {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 12px;
}
.bing-overview__stat {
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.7);
    color: var(--muted, #6b7280);
}
.bing-overview__stat strong { color: var(--ink, #1f2937); }
.bing-overview__stat--ok    { background: #dcfce7; color: #166534; }
.bing-overview__stat--ok strong { color: #14532d; }
.bing-overview__stat--warn  { background: #fef3c7; color: #92400e; }
.bing-overview__stat--warn strong { color: #78350f; }
.bing-overview__stat--err   { background: #fee2e2; color: #991b1b; }
.bing-overview__stat--err strong { color: #7f1d1d; }

.bing-overview__tbl { background: var(--paper, #fff); border-radius: 6px; }
.bing-overview__tbl td { vertical-align: middle; padding: 10px 12px; }

.bing-overview__cell { display: flex; flex-direction: column; gap: 4px; }
.bing-overview__num  { font-size: 13px; font-feature-settings: "tnum"; }
.bing-overview__num strong { font-size: 15px; }
.bing-overview__bar { width: 100%; }

.bing-overview__hint {
    margin: 10px 0 0;
    font-size: 11.5px;
    color: var(--muted, #6b7280);
    line-height: 1.5;
}

/* ──────────────────────────────────────────────────────────────────────
   Вкладка «Ссылки» (project.php?tab=links)
   ────────────────────────────────────────────────────────────────────── */

.ytab-tbl__abbr--bing { background: #0078d4; color: #fff; }

.bing-links-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-top: 16px;
}
.bing-links-stat {
    padding: 14px 16px;
    border-radius: 10px;
    background: var(--paper-deep, #F1F5F9);
    border-left: 3px solid #0078d4;
}
.bing-links-stat__label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted, #6b7280);
    font-weight: 500;
}
.bing-links-stat__value {
    font-size: 24px;
    font-weight: 600;
    font-feature-settings: "tnum";
    margin: 4px 0 2px;
    color: var(--ink, #1f2937);
}
.bing-links-stat__sub {
    font-size: 11.5px;
    color: var(--muted, #6b7280);
}

/* Бейджи "↗ исходящие" / "↙ Bing" в сводной таблице */
.badge--out, .badge--in {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 999px;
    margin: 0 2px;
}
.badge--out { background: #fef3c7; color: #92400e; }
.badge--in  { background: #dbeafe; color: #1e40af; }

/* Links-tab: новые бейджи и хайлайт пересечений */
.ytab-tbl__abbr--ya { background: #ff0000; color: #fff; }

.badge--ya, .badge--bing {
    display: inline-block;
    width: 22px; height: 22px;
    line-height: 22px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50%;
    margin: 0 2px;
}
.badge--ya   { background: #ff0000; color: #fff; }
.badge--bing { background: #0078d4; color: #fff; }

.row-highlight { background: linear-gradient(90deg, rgba(254,243,199,0.5), rgba(254,243,199,0.15)); }
.row-highlight td:first-child { border-left: 3px solid #d97706; }

/* ===== РАДАР — годовая макро-аналитика ===== */
.radar-kpis {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0;
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-lg);
    background: var(--surface);
    overflow: hidden;
    margin: 4px 0 24px;
}
.radar-kpis .ape-kpi {
    background: var(--surface);
    border: none;
    border-right: 1px solid var(--rule-faint);
    border-radius: 0;
    padding: 22px 24px;
}
.radar-kpis .ape-kpi:last-child { border-right: none; }
.radar-kpis .ape-kpi__label { margin-bottom: 14px; letter-spacing: 0.09em; }
.radar-kpis .ape-kpi__value { font-size: 34px; }
@media (max-width: 1100px) {
    .radar-kpis { grid-template-columns: repeat(3, 1fr); }
    .radar-kpis .ape-kpi { border-bottom: 1px solid var(--rule-faint); }
    .radar-kpis .ape-kpi:nth-child(3n) { border-right: none; }
}
@media (max-width: 640px) {
    .radar-kpis { grid-template-columns: repeat(2, 1fr); }
    .radar-kpis .ape-kpi:nth-child(3n) { border-right: 1px solid var(--rule-faint); }
    .radar-kpis .ape-kpi:nth-child(2n) { border-right: none; }
}
.radar-kpi__note { font-size: 10px; color: var(--warn-clr); font-weight: 600; }

.radar-card { background: var(--surface); border: 1px solid var(--rule-soft); border-radius: var(--r-xl); padding: 24px 28px; margin-bottom: 24px; }
.radar-card__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.radar-card__title { margin: 0; font-family: var(--ff-serif); font-size: 22px; font-weight: 400; line-height: 1.1; letter-spacing: -0.01em; color: var(--ink); }
.radar-chart-wrap { position: relative; height: 300px; }

/* Переключатели корзин на графике */
.radar-bucket-toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.radar-bucket-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; font-size: 12px; font-weight: 500; border: 1px solid var(--rule-soft); border-radius: var(--r-xs); background: var(--surface); color: var(--muted); cursor: pointer; transition: all .12s; }
.radar-bucket-toggle .radar-bucket-dot { width: 10px; height: 10px; border-radius: 2px; opacity: .35; transition: opacity .12s; }
.radar-bucket-toggle.is-on { color: var(--ink); border-color: var(--rule); }
.radar-bucket-toggle.is-on .radar-bucket-dot { opacity: 1; }
.radar-bucket-toggle:hover { background: var(--surface-alt); }
.radar-bucket-toggle--all { font-weight: 600; }

/* Бейдж позиции по корзине */
.radar-pos { display: inline-flex; min-width: 34px; justify-content: center; padding: 2px 8px; border-radius: var(--r-xs); font-family: var(--ff-mono); font-size: 12.5px; font-weight: 700; }
.radar-pos--t10  { background: var(--ink); color: #fff; }
.radar-pos--t20  { background: var(--ink-3); color: #fff; }
.radar-pos--t30  { background: #94A3B8; color: #fff; }
.radar-pos--t50  { background: #CBD5E1; color: var(--ink); }
.radar-pos--t51  { background: #F1F5F9; color: var(--ink-3); }
.radar-pos--none { color: var(--muted-2); font-family: var(--ff-mono); }

/* Главная таблица запросов */
.radar-queries-card { margin-bottom: 18px; border-radius: var(--r-xl); }
.radar-queries-card .ytab-tbl__head { padding: 20px 24px; background: var(--surface); }
.radar-queries-card .ytab-tbl__title { font-size: 17px; }
.radar-queries-card .ytab-tbl__abbr {
    background: var(--ink); color: var(--paper);
    min-width: 30px; height: 30px; border-radius: var(--r-sm);
    font-family: var(--ff-serif); font-style: italic; font-weight: 400;
    font-size: 17px; letter-spacing: 0; text-transform: none;
}
.radar-q-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 18px; padding: 18px 24px; border-bottom: 1px solid var(--rule-faint); background: var(--surface-alt); }
.radar-q-month-field .field__input { min-width: 150px; }
.radar-q-search-field { flex: 1 1 220px; }
.radar-q-bucket-field { display: flex; flex-direction: column; gap: 6px; }
.radar-q-bucket-field .field__label { margin-bottom: 0; }
.radar-q-table { width: 100%; }
.radar-q-th--sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.radar-q-th--sortable:hover { color: var(--ink); background: var(--surface-alt); }
.radar-q-sort { font-size: 10px; color: var(--data-1); }
.radar-q-more { display: flex; gap: 12px; align-items: center; padding: 14px 18px; }

/* ═══ Полоса задач (мини-таск-менеджер) ═══ */
/* Лежит в области контента (справа от сайдбара) и липнет к верху при скролле. */
.admin-taskbar {
    margin-left: var(--sidebar-w);
    position: sticky;
    top: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    gap: 14px;
    height: 78px;                 /* фикс высота — плитки не растягивают полосу */
    padding: 0 560px 0 48px;      /* справа резерв под кластер статуса (.admin-statusbar: Доступность·ARS·BH·↻·⚡) */
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: saturate(140%) blur(8px);
    border-bottom: 1px solid var(--rule-soft);
}
@media (max-width: 1400px) { .admin-taskbar { padding-right: 480px; } }
@media (max-width: 1100px) { .admin-taskbar { height: 74px; padding: 0 360px 0 24px; } }
@media (max-width: 900px)  { .admin-taskbar { padding-right: 150px; } }
.admin-taskbar__create {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--ink);
    border-radius: 8px;
    background: var(--ink);
    color: var(--paper);
    font: 500 13px/1 var(--ff-sans, inherit);
    cursor: pointer;
    transition: background .12s;
}
.admin-taskbar__create:hover { background: #1e293b; }
.admin-taskbar__plus { font-size: 15px; line-height: 1; }
.admin-taskbar__tiles { display: flex; align-items: stretch; gap: 12px; flex: 1 1 auto; min-width: 0; overflow-x: auto; padding: 2px; }
.admin-taskbar__empty { font-size: 12.5px; color: var(--muted); align-self: center; }
.admin-taskbar__all { flex: 0 0 auto; font: 500 12px/1 var(--ff-mono); color: var(--muted); text-decoration: none; white-space: nowrap; }
.admin-taskbar__all:hover { color: var(--ink); }

.task-tile {
    flex: 0 0 auto;
    width: 340px;                 /* шире по горизонтали */
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;                     /* плотнее по вертикали */
    padding: 7px 16px;
    border: 1px solid var(--rule-soft);
    border-radius: 11px;
    background: var(--paper);
    text-align: left;
    cursor: pointer;
    transition: border-color .14s, box-shadow .14s, transform .14s;
}
.task-tile:hover { border-color: #cbd5e1; box-shadow: 0 2px 10px rgba(15,23,42,0.06); }
.task-tile--warn { border-left: 3px solid #d97706; }
.task-tile--over { border-left: 3px solid #dc2626; }
.task-tile__assignee {
    font: 600 9.5px/1 var(--ff-mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}
.task-tile__title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.25;
    white-space: nowrap;          /* в одну строку → плитка ниже */
    overflow: hidden;
    text-overflow: ellipsis;
}
.task-progress { display: block; height: 4px; border-radius: 3px; background: var(--rule-soft); overflow: hidden; }
.task-progress__fill { display: block; height: 100%; background: var(--ink); border-radius: 3px; transition: width .3s; }
.task-tile--warn .task-progress__fill { background: #d97706; }
.task-tile--over .task-progress__fill { background: #dc2626; }
.task-tile__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font: 500 10.5px/1.2 var(--ff-mono); }
.task-tile__scope { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-tile__left { color: var(--ink-3); flex: 0 0 auto; }
.task-tile--warn .task-tile__left { color: #b45309; }
.task-tile--over .task-tile__left { color: #be123c; }

/* Напоминание раз в 5 минут — мягкое «подёргивание» + подсветка (по «Чернила») */
@keyframes taskNudge {
    0%, 100% { transform: translateX(0); box-shadow: 0 0 0 0 rgba(15,23,42,0); }
    15% { transform: translateX(-3px); }
    30% { transform: translateX(3px); }
    45% { transform: translateX(-2px); }
    60% { transform: translateX(2px); box-shadow: 0 0 0 3px rgba(15,23,42,0.08); }
    75% { transform: translateX(0); }
}
.task-tile--nudge { animation: taskNudge 1.4s ease-in-out; }
@media (prefers-reduced-motion: reduce) { .task-tile--nudge { animation: none; } }

/* Конструктор + детали (внутри .ape-modal) */
.task-builder { display: flex; flex-direction: column; gap: 14px; }
.task-builder__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.task-builder__foot { display: flex; align-items: center; gap: 12px; }
.task-builder__status { font-size: 12.5px; color: var(--muted); }
.task-proj { display: flex; align-items: center; gap: 7px; font-size: 13px; padding: 3px 0; cursor: pointer; }
.task-proj--all { font-weight: 600; margin-bottom: 4px; }
.task-projects { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 16px; max-height: 220px; overflow-y: auto; padding: 8px 0 0; border-top: 1px solid var(--rule-faint); margin-top: 6px; }

.task-detail { display: flex; flex-direction: column; gap: 12px; }
.task-detail__meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.task-detail__period { font: 500 12px/1.3 var(--ff-mono); color: var(--muted); }
.task-detail__period .task-left--warn { color: #b45309; }
.task-detail__period .task-left--over { color: #be123c; }
.task-detail__title { margin: 0; font-family: var(--ff-serif); font-weight: 400; font-size: 26px; line-height: 1.1; letter-spacing: -0.01em; color: var(--ink); }
.task-detail__desc { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink-2, #334155); }
.task-detail__projects { margin: 0; font-size: 13px; color: var(--ink-3); }
.task-detail__foot { display: flex; align-items: center; gap: 12px; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--rule-faint); }
.task-detail__del { margin-left: auto; }
.task-detail__done { color: #047857; font-weight: 600; font-size: 13px; }

.task-files { display: flex; flex-wrap: wrap; gap: 10px; }
.task-files__empty { width: 100%; margin: 0; }
.task-file { position: relative; }
.task-file__thumb img { display: block; width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--rule-soft); }
.task-file__doc { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--rule-soft); border-radius: 8px; font-size: 12.5px; color: var(--ink); text-decoration: none; background: var(--surface); }
.task-file__doc:hover { border-color: var(--ink); }
.task-file__del { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--rule-soft); background: var(--paper); color: var(--muted); font-size: 13px; line-height: 1; cursor: pointer; }
.task-file__del:hover { background: #fff1f2; color: #be123c; border-color: #fecdd3; }
.task-attach { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px dashed var(--rule-soft); border-radius: 8px; font-size: 13px; color: var(--muted); cursor: pointer; align-self: flex-start; }
.task-attach:hover { border-color: var(--ink); color: var(--ink); }
.task-attach__status { font-size: 12px; color: var(--muted); }

/* Страница /admin/tasks.php */
.tasks-tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-alt); border-radius: 10px; margin-bottom: 22px; }
.tasks-tabs__link { padding: 8px 16px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--muted); text-decoration: none; }
.tasks-tabs__link:hover { color: var(--ink); }
.tasks-tabs__link.is-active { background: var(--paper); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(15,23,42,0.06); }
.tasks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.task-card {
    display: flex; flex-direction: column; gap: 8px;
    padding: 18px 20px;
    border: 1px solid var(--rule-soft);
    border-radius: 14px;
    background: var(--surface);
    text-align: left;
    cursor: pointer;
    transition: border-color .14s, box-shadow .14s;
}
.task-card:hover { border-color: #cbd5e1; box-shadow: 0 2px 10px rgba(15,23,42,0.05); }
.task-card.task-tile--warn { border-left: 3px solid #d97706; }
.task-card.task-tile--over { border-left: 3px solid #dc2626; }
.task-card.task-tile--done { opacity: 0.72; }
.task-card__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.task-card__badge { font: 600 9.5px/1 var(--ff-mono); text-transform: uppercase; letter-spacing: 0.08em; padding: 3px 8px; border-radius: 6px; }
.task-card__badge--done { background: var(--pos-bg, #ecfdf5); color: #047857; }
.task-card__title { font-size: 16px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.task-card__desc { font-size: 13px; color: var(--ink-3); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.task-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; font: 500 11px/1.2 var(--ff-mono); color: var(--muted); margin-top: 2px; }
.task-card.task-tile--warn .task-progress__fill { background: #d97706; }
.task-card.task-tile--over .task-progress__fill { background: #dc2626; }
.task-card.task-tile--warn .task-tile__left { color: #b45309; }
.task-card.task-tile--over .task-tile__left { color: #be123c; }

/* ─── Commercial Traffic tab ─── */
.ct-tab .ct-rules {
    font-family: var(--ff-mono);
    font-size: 13px;
    line-height: 1.5;
    background: var(--surface);
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-sm);
    padding: 10px 12px;
    width: 100%;
    resize: vertical;
    color: var(--ink);
    transition: border 0.12s, box-shadow 0.12s;
}
.ct-tab .ct-rules:focus {
    outline: none;
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(15,23,42,0.05);
}
.ct-help {
    margin-bottom: 16px;
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-md);
    background: var(--surface);
}
.ct-help__toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    cursor: pointer;
    font-family: var(--ff-sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-2);
    list-style: none;
}
.ct-help__toggle::-webkit-details-marker { display: none; }
.ct-help__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--paper-deep);
    font-family: var(--ff-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    flex-shrink: 0;
}
.ct-help__body {
    padding: 0 16px 14px;
    border-top: 1px solid var(--rule-faint);
}
.ct-help__body p { margin: 8px 0 0; }
.ct-help__body p:first-child { margin-top: 12px; }
.ct-help__body code {
    font-family: var(--ff-mono);
    font-size: 11px;
    background: var(--paper-deep);
    padding: 2px 5px;
    border-radius: 3px;
}
.ct-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.ct-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}
.ct-chart-block {
    padding: 16px 0;
}
.ct-chart-block + .ct-chart-block {
    border-top: 1px solid var(--rule-faint);
}
.ct-chart-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.ct-chart-wrap {
    position: relative;
    height: 300px;
}
.ct-chart-wrap--compact { height: 240px; }

@media (max-width: 768px) {
    .ct-tab .kpi-grid { grid-template-columns: 1fr 1fr; }
    .ct-chart-wrap { height: 220px; }
    .ct-chart-wrap--compact { height: 180px; }
}

/* ──────────────────────────────────────────────────────────────────────
   Доступность сайтов: виджет в taskbar + страница мониторинга
   ────────────────────────────────────────────────────────────────────── */

.status-pill--danger { background: var(--neg-bg); color: var(--neg); }

/* Страница */
.site-avail-toast {
    margin: 0 0 14px; padding: 10px 14px;
    border-radius: 10px; border: 1px solid var(--rule-soft);
    background: var(--surface-alt); color: var(--ink-2); font-size: 13px;
}
.site-avail-toast.is-danger { background: var(--neg-bg); color: var(--neg); border-color: var(--neg); }

.site-avail-status { padding: 18px 20px; margin-bottom: 16px; }
.site-avail-status__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.site-avail-status__head h2 { margin: 2px 0 4px; font-size: 18px; }
.site-avail-status__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.site-avail-status__grid {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px; margin-top: 16px;
}
.site-avail-status__grid > div {
    background: var(--surface-alt); border: 1px solid var(--rule-soft);
    border-radius: 10px; padding: 10px 12px;
    display: flex; flex-direction: column; gap: 4px;
}
.site-avail-status__grid span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.site-avail-status__grid strong { font-size: 22px; font-weight: 700; }
.site-avail-status__grid .is-down strong { color: var(--neg); }
.site-avail-status__grid .is-warn strong { color: var(--warn-clr); }
.site-avail-status__grid .is-ok strong { color: var(--pos); }
@media (max-width: 900px) { .site-avail-status__grid { grid-template-columns: repeat(2, 1fr); } }

/* Фильтр сайтов по состоянию — сегментированный переключатель */
.site-avail-filter {
    display: inline-flex;
    flex-wrap: wrap;
    border: 1px solid var(--rule-soft);
    border-radius: var(--r-sm);
    overflow: hidden;
    background: var(--surface);
    margin-bottom: 14px;
}
.site-avail-filter__btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 14px;
    border-right: 1px solid var(--rule-faint);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ink-3);
    text-decoration: none;
    white-space: nowrap;
    transition: background .12s, color .12s;
}
.site-avail-filter__btn:last-child { border-right: none; }
.site-avail-filter__btn:hover { background: var(--surface-alt); color: var(--ink); }
.site-avail-filter__btn.is-active { background: var(--ink); color: var(--paper); }
.site-avail-filter__count {
    font-family: var(--ff-mono, monospace);
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--surface-alt);
    color: var(--ink-3);
}
.site-avail-filter__btn.is-alarm .site-avail-filter__count { background: var(--neg-bg); color: var(--neg); }
.site-avail-filter__btn.is-active .site-avail-filter__count {
    background: color-mix(in srgb, var(--paper) 24%, transparent);
    color: var(--paper);
}
.site-avail-filter__btn.is-alarm.is-active .site-avail-filter__count { background: var(--neg); color: var(--paper); }

.site-avail-grid[data-view="attention"] .site-avail-card--ok,
.site-avail-grid[data-view="attention"] .site-avail-card--unchecked,
.site-avail-grid[data-view="down"] .site-avail-card--warn,
.site-avail-grid[data-view="down"] .site-avail-card--ok,
.site-avail-grid[data-view="down"] .site-avail-card--unchecked,
.site-avail-grid[data-view="ok"] .site-avail-card--down,
.site-avail-grid[data-view="ok"] .site-avail-card--warn,
.site-avail-grid[data-view="ok"] .site-avail-card--unchecked,
.site-avail-grid[data-view="unchecked"] .site-avail-card--down,
.site-avail-grid[data-view="unchecked"] .site-avail-card--warn,
.site-avail-grid[data-view="unchecked"] .site-avail-card--ok { display: none; }

.site-avail-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}
.site-avail-card {
    display: flex; flex-direction: column;
    border: 1px solid var(--rule-soft); border-left: 4px solid var(--muted-2);
    border-radius: 12px; background: var(--surface); overflow: hidden;
}
.site-avail-card--ok   { border-left-color: var(--pos); }
.site-avail-card--warn { border-left-color: var(--warn-clr); }
.site-avail-card--down { border-left-color: var(--neg); }
.site-avail-card__main { display: block; padding: 16px 18px; text-decoration: none; color: var(--ink); flex: 1; }
.site-avail-card__main:hover { background: var(--surface-alt); }
.site-avail-card__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
/* Место под крестик, чтобы он не накрывал пилюлю вердикта. */
.site-avail-card:has(.site-avail-card__close) .site-avail-card__top { padding-right: 24px; }
.site-avail-card__top h2 { margin: 0; font-size: 15px; word-break: break-all; }
.site-avail-card__name { margin: 4px 0 10px; color: var(--muted); font-size: 12.5px; }
.site-avail-filter--group { margin-left: 8px; }
.site-avail-card__tag--group-main { border-color: color-mix(in srgb, var(--pos) 45%, var(--rule-soft)); color: var(--pos); }
.site-avail-card__tag--group-secondary { color: var(--ink-3); }
.site-avail-card__tag--group-dropping { border-color: color-mix(in srgb, var(--warn-clr) 45%, var(--rule-soft)); color: var(--warn-clr); }
.site-avail-card__tag--group-dead { border-color: var(--rule-soft); color: var(--muted); }

.site-avail-grid[data-group="main"] .site-avail-card:not(.site-avail-card--group-main),
.site-avail-grid[data-group="secondary"] .site-avail-card:not(.site-avail-card--group-secondary),
.site-avail-grid[data-group="dropping"] .site-avail-card:not(.site-avail-card--group-dropping),
.site-avail-grid[data-group="dead"] .site-avail-card:not(.site-avail-card--group-dead),
.site-avail-grid[data-group="none"] .site-avail-card:not(.site-avail-card--group-none) { display: none; }

.site-avail-card { position: relative; }
.site-avail-card__close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 22px;
    height: 22px;
    line-height: 1;
    padding: 0;
    border: 1px solid var(--rule-soft);
    border-radius: 50%;
    background: var(--surface);
    color: var(--muted);
    font-size: 15px;
    cursor: pointer;
    transition: background .12s, color .12s, border-color .12s;
}
.site-avail-card__close:hover { background: var(--neg-bg); color: var(--neg); border-color: var(--neg); }
.site-avail-card__close:disabled { opacity: .5; cursor: default; }

.site-avail-card--add { border-left-color: var(--rule-soft); border-style: dashed; background: var(--surface-alt); }
.site-avail-card--add button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-height: 150px;
    border: none;
    background: none;
    color: var(--ink-3);
    font-family: var(--ff-sans);
    font-size: 13px;
    cursor: pointer;
}
.site-avail-card--add button:hover { color: var(--ink); }
.site-avail-card--add__plus { font-size: 30px; line-height: 1; font-weight: 300; }

.site-avail-card__expiry {
    margin-top: 10px;
    font-size: 12px;
    font-family: var(--ff-mono, monospace);
    color: var(--ink-3);
}
.site-avail-card__expiry--bad { color: var(--neg); font-weight: 600; }
.site-avail-card__expiry--warn { color: var(--warn-clr); }
.site-avail-card__expiry--ok { color: var(--ink-3); }
.site-avail-card__expiry--muted { color: var(--muted); }

.site-avail-card__ftp {
    border-top: 1px solid var(--rule-faint);
    padding: 8px 18px 10px;
    font-size: 12.5px;
}
.site-avail-card__ftp > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    list-style: none;
}
.site-avail-card__ftp > summary::-webkit-details-marker { display: none; }
.site-avail-card__ftp-kicker {
    font-family: var(--ff-mono, monospace);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
}
.site-avail-card__ftp-pill {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11.5px;
    background: var(--surface-alt);
    color: var(--ink-3);
}
.site-avail-card__ftp-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    border: 1px solid transparent;
}
.site-avail-card__ftp-pill::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex: 0 0 auto;
}
/* Рабочий доступ — синий: он не про «здоровье сайта», а про то, что мы можем зайти. */
.site-avail-card__ftp-pill--live {
    background: var(--ftp-live-bg);
    color: var(--ftp-live);
    border-color: color-mix(in srgb, var(--ftp-live) 28%, transparent);
}
.site-avail-card__ftp-pill--bad {
    background: var(--neg-bg);
    color: var(--neg);
    border-color: color-mix(in srgb, var(--neg) 28%, transparent);
}
.site-avail-card__ftp-pill--warn {
    background: var(--warn-bg);
    color: var(--warn-clr);
    border-color: color-mix(in srgb, var(--warn-clr) 30%, transparent);
}
.site-avail-card__ftp-pill--muted { background: var(--surface-alt); color: var(--muted); border-color: var(--rule-soft); }

/* Полоска состояния доступа слева от свёрнутого блока */
.site-avail-card--ftp-ok .site-avail-card__ftp { box-shadow: inset 3px 0 0 var(--ftp-live); }
.site-avail-card--ftp-bad .site-avail-card__ftp { box-shadow: inset 3px 0 0 var(--neg); }
.site-avail-card--ftp-unchecked .site-avail-card__ftp { box-shadow: inset 3px 0 0 var(--warn-clr); }

/* Пилюли фильтра по доступу — те же цвета, чтобы связь читалась сразу */
.site-avail-filter__btn--ftp-ok .site-avail-filter__count { background: var(--ftp-live-bg); color: var(--ftp-live); }
.site-avail-filter__btn--ftp-bad .site-avail-filter__count { background: var(--neg-bg); color: var(--neg); }
.site-avail-filter__btn--ftp-unchecked .site-avail-filter__count { background: var(--warn-bg); color: var(--warn-clr); }
.site-avail-filter__btn--ftp-ok.is-active .site-avail-filter__count { background: var(--ftp-live); color: var(--paper); }
.site-avail-filter__btn--ftp-bad.is-active .site-avail-filter__count { background: var(--neg); color: var(--paper); }
.site-avail-filter__btn--ftp-unchecked.is-active .site-avail-filter__count { background: var(--warn-clr); color: var(--paper); }

.site-avail-grid[data-ftp="ok"] .site-avail-card:not(.site-avail-card--ftp-ok),
.site-avail-grid[data-ftp="bad"] .site-avail-card:not(.site-avail-card--ftp-bad),
.site-avail-grid[data-ftp="unchecked"] .site-avail-card:not(.site-avail-card--ftp-unchecked),
.site-avail-grid[data-ftp="none"] .site-avail-card:not(.site-avail-card--ftp-none) { display: none; }
.site-avail-grid[data-ftp="ok"] .site-avail-card--add,
.site-avail-grid[data-ftp="bad"] .site-avail-card--add,
.site-avail-grid[data-ftp="unchecked"] .site-avail-card--add,
.site-avail-grid[data-ftp="none"] .site-avail-card--add,
.site-avail-grid[data-group="main"] .site-avail-card--add,
.site-avail-grid[data-group="secondary"] .site-avail-card--add,
.site-avail-grid[data-group="dropping"] .site-avail-card--add,
.site-avail-grid[data-group="dead"] .site-avail-card--add,
.site-avail-grid[data-group="none"] .site-avail-card--add { display: none; }

/* Ряд фильтров: три сегмента в одну линию с переносом */
.site-avail-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.site-avail-filters .site-avail-filter { margin-bottom: 0; }
.site-avail-filter--group, .site-avail-filter--ftp { margin-left: 0; }
.site-avail-card__ftp-date { color: var(--muted); font-size: 11px; margin-left: auto; }
.site-avail-card__ftp-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 10px 0 4px;
}
.site-avail-card__ftp-fields .field__input { font-size: 12px; padding: 6px 8px; }
.site-avail-card__ftp-fields .field__label { font-size: 9.5px; }
.site-avail-card__ftp-error { margin: 6px 0 0; color: var(--neg); font-size: 11.5px; line-height: 1.4; }
.site-avail-card__ftp-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.site-avail-detail__access { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0; }
.site-avail-detail__access .site-avail-card__ftp-pill { padding: 5px 12px; font-size: 12.5px; }

.site-avail-grid[data-view="attention"] .site-avail-card--add,
.site-avail-grid[data-view="down"] .site-avail-card--add,
.site-avail-grid[data-view="ok"] .site-avail-card--add,
.site-avail-grid[data-view="unchecked"] .site-avail-card--add { display: none; }

.site-avail-card__tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--surface-alt);
    border: 1px solid var(--rule-soft);
    color: var(--ink-3);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .03em;
    vertical-align: middle;
}
.site-avail-card__meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--ink-3); font-family: var(--ff-mono, monospace); }
.site-avail-card__problems { margin: 12px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--neg); line-height: 1.45; }
.site-avail-card--warn .site-avail-card__problems { color: var(--warn-clr); }
.site-avail-card__foot { padding: 10px 18px; border-top: 1px solid var(--rule-soft); background: var(--surface-alt); display: flex; justify-content: flex-end; }
.site-avail-card__yb {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 6px;
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: var(--r-sm);
    font-size: 12px;
    line-height: 1.35;
}
.site-avail-card__yb-kicker {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 10px;
}
.site-avail-card__yb--ok { background: color-mix(in srgb, var(--pos) 12%, var(--surface)); color: var(--pos); }
.site-avail-card__yb--bad { background: color-mix(in srgb, var(--neg) 10%, var(--surface)); color: var(--neg); }
.site-avail-card__yb--warn { background: color-mix(in srgb, var(--warn-clr) 12%, var(--surface)); color: var(--warn-clr); }
.site-avail-card__yb--muted { background: var(--surface-alt); color: var(--muted); }
.site-avail-card__yb-value { font-weight: 600; color: var(--ink); }
.site-avail-card__yb-date { color: var(--muted); font-size: 11px; }
.site-avail-card__yb--detail { margin: 14px 0; }
.site-avail-card__yb-link {
    width: 100%;
    margin-top: 4px;
    font-size: 11px;
    color: var(--accent, #2563eb);
    text-decoration: none;
}
.site-avail-card__yb-link:hover { text-decoration: underline; }
#site-avail-report-panel .field--checkbox { display: flex; align-items: center; gap: 8px; margin: 12px 0; }

.site-avail-detail { padding: 18px 20px; margin-bottom: 16px; }
.site-avail-detail__summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 12px; }
.site-avail-detail__problems { margin: 0 0 14px; padding-left: 20px; line-height: 1.55; color: var(--ink-2); }
.site-avail-detail__problems li { margin-bottom: 4px; }
.site-avail-detail__metrics { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--ink-3); padding-top: 12px; border-top: 1px dashed var(--rule-soft); }
.site-avail-table-panel { padding: 0; overflow: hidden; }
.site-avail-table-panel .section-head { padding: 16px 20px 0; }
.site-avail-table-panel .table-wrap { padding: 12px 20px 18px; }

/* Карточки: бейджи, пилюли проблем, downtime, hover, прогресс очереди */
.site-avail-card { transition: box-shadow .15s ease; }
.site-avail-card:hover { box-shadow: 0 6px 20px rgba(15, 23, 42, .12); }
.site-avail-card__badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 2px; font-size: 12px; color: var(--ink-3); font-family: var(--ff-mono, monospace); }
.site-avail-http { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; font-family: var(--ff-mono, monospace); border: 1px solid transparent; white-space: nowrap; }
.site-avail-http--ok { background: color-mix(in srgb, var(--pos) 12%, transparent); color: var(--pos); border-color: color-mix(in srgb, var(--pos) 30%, transparent); }
.site-avail-http--redir { background: var(--surface-alt); color: var(--ink-3); border-color: var(--rule-soft); }
.site-avail-http--err { background: var(--neg-bg); color: var(--neg); border-color: color-mix(in srgb, var(--neg) 30%, transparent); }
.site-avail-card__pbadges { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.site-avail-card__pbadge { font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--surface-alt); border: 1px solid var(--rule-soft); color: var(--ink-3); white-space: nowrap; }
.site-avail-card--down .site-avail-card__pbadge { background: var(--neg-bg); border-color: color-mix(in srgb, var(--neg) 28%, transparent); color: var(--neg); }
.site-avail-card--warn .site-avail-card__pbadge { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn-clr) 30%, transparent); color: var(--warn-clr); }
.site-avail-card__pbadge--more { font-family: var(--ff-mono, monospace); }
.site-avail-card__downtime { margin: 8px 0 0; font-size: 12px; font-weight: 600; color: var(--neg); }
.site-avail-card__downtime--warn { color: var(--warn-clr); }
.site-avail-status__progress { margin-top: 12px; }
.site-avail-status__bar { height: 8px; border-radius: 999px; background: var(--surface-alt); border: 1px solid var(--rule-soft); overflow: hidden; }
.site-avail-status__bar-fill { height: 100%; width: 0; background: var(--pos); transition: width .4s ease; }
.site-avail-status__prow { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.site-avail-card {
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(25, 38, 58, .05);
}
.site-avail-card__main { padding: 18px 20px 20px; }
.site-avail-card__top h2 { font-size: 18px; letter-spacing: -.02em; }
.site-avail-card__badges { margin: 12px 0 0; gap: 8px; }
.site-avail-card__name { margin: 8px 0 0; line-height: 1.9; }
.site-avail-card__section { margin-top: 16px; }
.site-avail-card__section--availability {
    padding: 12px 13px;
    border: 1px solid var(--rule-soft);
    border-radius: 12px;
    background: var(--surface-alt);
}
.site-avail-card__availability { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; line-height: 1.3; }
.site-avail-card__availability strong { font-size: 14px; letter-spacing: -.01em; }
.site-avail-card__availability span { font-size: 12px; color: var(--muted); }
.site-avail-card__availability--ok strong { color: var(--pos); }
.site-avail-card__availability--warn strong { color: var(--warn-clr); }
.site-avail-card__availability--down strong { color: var(--neg); }
.site-avail-card__availability--down span { color: var(--neg); font-family: var(--ff-mono, monospace); font-weight: 600; }
.site-avail-card__checked { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--rule-soft); color: var(--muted); font-size: 11px; }
.site-avail-card__checked time { color: var(--ink-3); font-family: var(--ff-mono, monospace); font-size: 11px; }
.site-avail-card__downtime { margin: 8px 0 0; font-size: 12px; font-weight: 700; color: var(--neg); }
.site-avail-card__downtime--warn { color: var(--warn-clr); }
.site-avail-card__section--signals { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.site-avail-card__signal { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 7px; min-width: 0; padding: 9px 10px; border-radius: 10px; background: var(--surface-alt); color: var(--ink-3); font-size: 11px; }
.site-avail-card__signal-label { width: 100%; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.site-avail-card__signal strong { color: var(--ink); font-size: 12px; }
.site-avail-card__signal--yb strong { color: var(--ink); }
.site-avail-card__signal > span:not(.site-avail-card__signal-label) { color: var(--muted); }
.site-avail-card__section--problems { padding-top: 13px; border-top: 1px dashed var(--rule-soft); }
.site-avail-card__section-title { margin-bottom: 8px; color: var(--warn-clr); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.site-avail-card__section--problems .site-avail-card__pbadges { margin-top: 0; }
.site-avail-card--down .site-avail-card__section--availability { border-color: color-mix(in srgb, var(--neg) 28%, var(--rule-soft)); background: var(--neg-bg); }
.site-avail-card--warn .site-avail-card__section--availability { border-color: color-mix(in srgb, var(--warn-clr) 28%, var(--rule-soft)); background: var(--warn-bg); }
.site-avail-card__foot { padding: 11px 18px; }
@media (max-width: 480px) {
    .site-avail-grid { grid-template-columns: minmax(0, 1fr); }
    .site-avail-card { min-width: 0; }
    .site-avail-card__main { min-width: 0; padding: 14px; }
    .site-avail-card__top { flex-wrap: wrap; }
    .site-avail-card__section--signals { grid-template-columns: minmax(0, 1fr); }
    .site-avail-status__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Сезонность: спрос и наш трафик на одной шкале */
.sz-block { margin-bottom: 18px; }
.sz-chart { position: relative; height: 340px; margin-top: 14px; }
.sz-note { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line, #E2E8F0); font-size: 14px; line-height: 1.6; color: var(--text, #0F172A); }
.sz-note b { font-weight: 650; }
@media (max-width: 720px) { .sz-chart { height: 280px; } }

/* Сезонность: апдейты поисковых систем */
.sz-updates { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line, #E2E8F0); }
.sz-updates__head { font-size: 13px; color: var(--muted, #64748B); margin-bottom: 10px; }
.sz-updates__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.sz-update { display: flex; align-items: baseline; gap: 8px; font-size: 13.5px; line-height: 1.5; flex-wrap: wrap; }
.sz-update__dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 2px; transform: translateY(1px); }
.sz-update--google .sz-update__dot { background: #4285F4; }
.sz-update--yandex .sz-update__dot { background: #FC3F1D; }
.sz-update__date { font-variant-numeric: tabular-nums; color: var(--muted, #64748B); white-space: nowrap; }
.sz-update__title { font-weight: 600; }
.sz-update__title a { color: inherit; text-decoration: none; border-bottom: 1px solid rgba(15, 23, 42, .25); }
.sz-update__title a:hover { border-bottom-color: currentColor; }
.sz-update__text { color: var(--muted, #64748B); flex: 1 1 320px; min-width: 220px; }
@media (max-width: 720px) { .sz-update__text { flex-basis: 100%; } }

/* Срезы: причина изменения трафика — выдача или видимость */
.ms-cause { white-space: nowrap; }
.ms-cause__label { display: inline-block; font-weight: 600; font-size: 12.5px; padding: 2px 8px; border-radius: 999px; border: 1px solid transparent; }
.ms-cause__nums { display: block; margin-top: 3px; font-size: 11.5px; color: var(--muted, #64748B); font-variant-numeric: tabular-nums; }
.ms-cause--serp .ms-cause__label { background: #FEF3C7; border-color: #FCD34D; color: #92400E; }
.ms-cause--visibility .ms-cause__label { background: #FEE2E2; border-color: #FCA5A5; color: #9F1239; }
.ms-cause--mixed .ms-cause__label { background: #F1F5F9; border-color: #CBD5E1; color: #475569; }
.ms-cause--growth .ms-cause__label { background: #DCFCE7; border-color: #86EFAC; color: #065F46; }
.ms-cause--none .ms-cause__label { color: var(--muted, #94A3B8); }
.ms-cause-summary { margin: 0 0 14px; padding: 12px 14px; border-radius: 10px; background: #F8FAFC; border: 1px solid var(--line, #E2E8F0); font-size: 13.5px; line-height: 1.65; }

/* Link monitor: editorial cards and dense, inspectable data. */
.linkmon { max-width: 1720px; }
.linkmon-head { align-items: center; }
.linkmon-picker { min-width: 220px; display: grid; gap: 7px; }
.linkmon-picker label, .linkmon-eyebrow { font: 600 10px var(--ff-mono); letter-spacing: .11em; text-transform: uppercase; color: var(--muted); }
.linkmon select, .linkmon input[type="search"], .linkmon input[type="file"], .linkmon textarea { border: 1px solid var(--rule-soft); background: var(--surface); color: var(--ink); border-radius: var(--r-sm); padding: 10px 12px; font: 13px var(--ff-sans); }
.linkmon select { min-height: 40px; }
.linkmon-notice { margin: 0 0 20px; padding: 12px 16px; border-radius: var(--r-sm); background: var(--info-bg); color: var(--info); }
.linkmon-notice--ok { background: var(--pos-bg); color: var(--pos); }
.linkmon-notice--error { background: var(--neg-bg); color: var(--neg); }
.linkmon-action-message { margin: 10px 0 14px; padding: 10px 13px; border-radius: var(--r-sm); background: var(--info-bg); color: var(--info); font-size: 12px; }
.linkmon-action-message.linkmon-notice--ok { background: var(--pos-bg); color: var(--pos); }
.linkmon-action-message.linkmon-notice--error { background: var(--neg-bg); color: var(--neg); }
.linkmon-action-message[hidden], .linkmon-progress__results[hidden] { display: none; }
.linkmon-runbar { position: sticky; top: 78px; z-index: 85; display: grid; grid-template-columns: 9px minmax(190px,1fr) minmax(100px,240px) auto auto; align-items: center; gap: 13px; min-height: 54px; margin: 0 0 16px; padding: 9px 16px; border: 1px solid var(--rule-soft); border-left: 3px solid var(--ink); border-radius: var(--r-sm); background: color-mix(in srgb, var(--surface) 96%, transparent); box-shadow: 0 6px 20px rgba(20,32,51,.07); backdrop-filter: blur(8px); }
.linkmon-runbar__pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--muted-2); }
.linkmon-runbar.is-active .linkmon-runbar__pulse { background: var(--pos); box-shadow: 0 0 0 4px var(--pos-bg); animation: linkmon-pulse 1.6s ease-in-out infinite; }
.linkmon-runbar.is-error .linkmon-runbar__pulse { background: var(--neg); }
@keyframes linkmon-pulse { 50% { box-shadow: 0 0 0 8px transparent; } }
.linkmon-runbar__copy { min-width: 0; display: grid; gap: 2px; }
.linkmon-runbar__copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.linkmon-runbar__copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--muted); }
.linkmon-runbar progress, .linkmon-progress__summary + progress, .linkmon-progress--tracked > progress, .linkmon-project-queue progress { display: block; width: 100%; height: 8px; accent-color: var(--pos); }
.linkmon-runbar__percent { min-width: 34px; text-align: right; font: 700 11px var(--ff-mono); color: var(--pos); }
.linkmon-runbar a { white-space: nowrap; font-size: 11px; color: var(--ink-2); }
.linkmon-progress { margin: 14px 0 20px; padding: 18px; border: 1px solid var(--rule-soft); border-radius: var(--r-sm); background: var(--surface-alt); scroll-margin-top: 90px; }
.linkmon-progress__head, .linkmon-progress__item-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.linkmon-progress__head h2 { margin: 4px 0 6px; font: 400 27px/1.15 var(--ff-serif); }
.linkmon-progress__head p { max-width: 760px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.linkmon-progress__head > .btn { flex: none; }
.linkmon-progress__head-action { display: grid; justify-items: end; gap: 5px; flex: none; }
.linkmon-progress__head-action small, .linkmon-progress__results small, .linkmon-progress__help { color: var(--muted); font-size: 10px; line-height: 1.45; }
.linkmon-progress__help { display: block; margin-top: -3px; }
.linkmon-progress--portfolio { padding: 15px 18px; }
.linkmon-progress--portfolio .linkmon-progress__head h2 { margin-bottom: 0; font-size: 24px; }
.linkmon-progress__portfolio-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; flex: none; }
.linkmon-progress__compact-status { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.linkmon-progress__portfolio-details { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--rule-soft); }
.linkmon-progress__portfolio-details[hidden] { display: none; }
.linkmon-progress__intro { max-width: 760px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.linkmon-progress__toggle { white-space: nowrap; }
.linkmon-progress--tracked .linkmon-progress__scope { margin-bottom: 9px; }
.linkmon-progress--tracked .linkmon-progress__help { margin-top: 8px; }
.linkmon-progress--tracked .linkmon-progress__help + .linkmon-progress__help { margin-top: 4px; }
.linkmon-reindex { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px 22px; align-items: end; margin: -6px 0 20px; padding: 17px 18px; border: 1px solid var(--rule-soft); border-left: 3px solid var(--ink); border-radius: var(--r-sm); background: var(--surface); }
.linkmon-reindex h2 { margin: 4px 0 6px; font: 400 22px/1.18 var(--ff-serif); }
.linkmon-reindex p { max-width: 760px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.linkmon-reindex__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.linkmon-reindex__actions .btn { white-space: normal; text-align: center; }
.linkmon-reindex > small { grid-column: 1 / -1; color: var(--muted); font-size: 10px; line-height: 1.45; }
.linkmon-reindex__status { grid-column: 1 / -1; padding-top: 10px; border-top: 1px solid var(--rule-soft); overflow-wrap: anywhere; }
.linkmon-action-choices { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 17px; }
.linkmon-action-choice { min-width: 0; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 16px; border: 1px solid var(--rule-soft); border-top: 2px solid var(--ink); border-radius: var(--r-sm); background: var(--surface); }
.linkmon-action-choice:nth-child(2) { border-top-color: var(--pos); }
.linkmon-action-choice strong { font-size: 13px; }
.linkmon-action-choice p { margin: 6px 0 0; max-width: 450px; font-size: 11px; line-height: 1.5; color: var(--muted); }
.linkmon-action-choice .btn { white-space: normal; text-align: center; }
.linkmon-progress__summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 18px 0 10px; }
.linkmon-progress__summary strong { font-size: 13px; }
.linkmon-project-queue { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 16px; }
.linkmon-project-queue__item { min-width: 0; padding: 14px 15px; border: 1px solid var(--rule-soft); border-radius: var(--r-sm); background: var(--surface); }
.linkmon-project-queue__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.linkmon-project-queue__head a { color: var(--ink); font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.linkmon-project-queue__head span { color: var(--pos); font: 700 11px var(--ff-mono); }
.linkmon-project-queue__stage { display: block; margin-top: 8px; color: var(--ink-2); font-size: 11px; line-height: 1.5; }
.linkmon-project-queue__detail { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.linkmon-project-queue__item.is-error .linkmon-project-queue__head span { color: var(--neg); }
.linkmon-progress__scope { margin: 11px 0 14px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.linkmon-progress__grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.linkmon-progress__item { min-width: 0; padding: 14px; border: 1px solid var(--rule-soft); border-radius: var(--r-sm); background: var(--surface); }
.linkmon-progress__item-head strong { font-size: 13px; }
.linkmon-progress__item-head span { font: 700 12px var(--ff-mono); color: var(--pos); }
.linkmon-progress__item progress { display: block; width: 100%; height: 12px; margin: 12px 0; accent-color: var(--pos); }
.linkmon-progress__item p { margin: 0 0 7px; color: var(--ink); font-size: 12px; line-height: 1.5; }
.linkmon-progress__item small { display: block; color: var(--muted); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.linkmon-progress__results { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
@media (max-width: 1100px) { .linkmon-runbar { grid-template-columns: 9px minmax(140px,1fr) minmax(80px,170px) auto; } .linkmon-runbar a { display: none; } }
@media (max-width: 768px) { .linkmon-progress__grid, .linkmon-action-choices, .linkmon-project-queue { grid-template-columns: 1fr; } .linkmon-progress__head { align-items: flex-start; flex-wrap: wrap; } .linkmon-progress__head > .btn { width: 100%; } .linkmon-progress__portfolio-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); width: 100%; } .linkmon-progress__portfolio-actions .btn { min-width: 0; white-space: normal; } .linkmon-reindex { grid-template-columns: 1fr; } .linkmon-reindex__actions { justify-content: stretch; display: grid; grid-template-columns: 1fr; } .linkmon-runbar { grid-template-columns: 9px minmax(0,1fr) auto; top: 136px; padding: 9px 11px; } .linkmon-runbar progress { grid-column: 2 / -1; } .linkmon-runbar__percent { grid-column: 3; grid-row: 1; } .linkmon-progress__summary { align-items: flex-start; flex-wrap: wrap; } }
@media (max-width: 768px) { .linkmon-progress--tracked .linkmon-progress__portfolio-actions { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .linkmon-runbar.is-active .linkmon-runbar__pulse { animation: none; } }
.linkmon-kpis { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.linkmon-kpis article { background: var(--surface); border: 1px solid var(--rule-soft); border-top: 2px solid var(--ink); border-radius: var(--r-sm); padding: 19px 20px 18px; min-width: 0; }
.linkmon-kpis span, .linkmon-kpis small { display: block; color: var(--muted); font-size: 11px; }
.linkmon-kpis span { text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.linkmon-kpis strong { display: block; font: 400 43px/1.1 var(--ff-serif); margin: 11px 0 8px; letter-spacing: -.025em; }
.linkmon-charts { display: grid; grid-template-columns: minmax(0,2fr) repeat(2,minmax(210px,1fr)); gap: 14px; margin-bottom: 18px; }
.linkmon-trend-section { margin-bottom: 18px; }
.linkmon-trend__scroller { max-width: 100%; overflow-x: auto; overflow-y: hidden; }
.linkmon-trend__scroller:focus-visible { outline: 2px solid #1A2C5B; outline-offset: 2px; }
.linkmon-chart--trend .linkmon-chart__canvas { height: 290px; }
.linkmon-trend__year { color: var(--muted); font: 600 13px var(--ff-mono); }
.linkmon-trend__highlights { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.linkmon-trend__month { color: var(--muted); font-size: 12px; margin-right: 5px; }
.linkmon-trend__badge { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--rule-soft); border-radius: 20px; padding: 5px 10px; font-size: 12px; }
.linkmon-trend__badge strong { font: 700 13px var(--ff-mono); }
.linkmon-trend__badge--yandex strong { color: #047857; }
.linkmon-trend__badge--google strong { color: #1A2C5B; }
.linkmon-trend__empty { padding: 35px 0; color: var(--muted); font-size: 14px; }
.linkmon-charts--internal { grid-template-columns: repeat(3,minmax(0,1fr)); }
.linkmon-chart { background: var(--surface); border: 1px solid var(--rule-soft); border-radius: var(--r-sm); padding: 20px; min-width: 0; }
.linkmon-chart__head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.linkmon-chart h2, .linkmon-import h2, .linkmon-table-head h2, .linkmon-start h2 { font: 400 27px/1.12 var(--ff-serif); margin: 6px 0 14px; }
.linkmon-chart__canvas { height: 235px; position: relative; }
.linkmon-chart--donut .linkmon-chart__canvas { height: 255px; }
.linkmon-donut-center { position: absolute; left: 50%; top: 43%; transform: translate(-50%,-50%); display: grid; justify-items: center; gap: 2px; text-align: center; pointer-events: none; line-height: 1.1; }
.linkmon-donut-center strong { font: 400 27px var(--ff-serif); white-space: nowrap; }
.linkmon-donut-center b { font-size: 17px; color: var(--pos); margin-top: 5px; }
.linkmon-donut-center span, .linkmon-donut-center small { font: 10px var(--ff-sans); color: var(--muted); white-space: nowrap; }
.linkmon-analysis { display: grid; grid-template-columns: minmax(250px,1fr) minmax(0,2fr); gap: 14px; margin-bottom: 18px; }
.linkmon-chart__canvas--bars { height: 285px; }
.linkmon-target-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 5px; }
.linkmon-target-list li { display: flex; justify-content: space-between; gap: 12px; min-width: 0; overflow: hidden; padding: 5px 0; border-bottom: 1px solid var(--rule-soft); font: 11px var(--ff-mono); }
.linkmon-target-list span { min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.linkmon-target-list strong { color: var(--ink); }
.linkmon-yandex { margin-bottom: 18px; padding: 22px; border: 1px solid var(--rule-soft); background: var(--surface); border-radius: var(--r-sm); }
.linkmon-yandex__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.linkmon-yandex h2 { font: 400 27px/1.12 var(--ff-serif); margin: 6px 0 8px; }
.linkmon-yandex p { color: var(--muted); font-size: 12px; line-height: 1.55; }
.linkmon-yandex__metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin: 16px 0; }
.linkmon-yandex__metrics div { border-top: 1px solid var(--rule-soft); padding-top: 9px; }
.linkmon-yandex__metrics strong { display: block; font: 400 29px var(--ff-serif); }
.linkmon-yandex__metrics span { color: var(--muted); font-size: 11px; }
.linkmon-yandex__charts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px; }
.linkmon-yandex__charts article { min-width: 0; }
.linkmon-yandex__charts h3 { font: 400 20px/1.2 var(--ff-serif); margin: 12px 0; }
.linkmon-export { display: flex; flex-wrap: wrap; gap: 8px; margin: -2px 0 16px; }
.linkmon-chart--wide .linkmon-chart__canvas { height: 265px; }
.linkmon-chart__note, .linkmon-chart--explainer p, .linkmon-import p, .linkmon-table-head p, .linkmon-start p { font-size: 12px; line-height: 1.55; color: var(--muted); }
.linkmon-chart__note { margin: 10px 0 0; }
.linkmon-chart--explainer p { font-size: 13px; }
.linkmon-import, .linkmon-table-panel, .linkmon-start { margin-bottom: 18px; padding: 22px; border: 1px solid var(--rule-soft); background: var(--surface); border-radius: var(--r-sm); }
.linkmon-import { display: grid; grid-template-columns: minmax(200px,1fr) minmax(280px,1.5fr); gap: 18px 26px; }
.linkmon-import form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.linkmon-import form[data-add-pages] { align-items: stretch; flex-direction: column; }
.linkmon-import__file { display: grid; gap: 5px; color: var(--muted); font-size: 11px; }
.linkmon-import__file input { max-width: 100%; font-size: 12px; }
.linkmon textarea { width: 100%; min-height: 106px; resize: vertical; }
.linkmon-preview, .linkmon-import__last { grid-column: 1/-1; padding-top: 15px; border-top: 1px solid var(--rule-soft); }
.linkmon-preview ul { padding-left: 20px; }
.linkmon-preview li { margin: 6px 0; }
.linkmon-preview li small { color: var(--muted); margin-left: 8px; }
.linkmon-import-warnings { margin: 14px 0; padding: 14px 16px; border: 1px solid #e8bb70; border-radius: var(--r-sm); background: #fff8eb; color: var(--ink); }
.linkmon-import-warnings strong { display: block; font-size: 14px; }
.linkmon-import-warnings p { margin: 5px 0 8px; }
.linkmon-import-warnings ul { margin: 0; padding-left: 20px; }
.linkmon-campaign-confirm { flex: 1 0 100%; display: flex; align-items: flex-start; gap: 9px; padding: 12px 14px; background: var(--surface-alt); border: 1px solid var(--rule-soft); border-radius: var(--r-sm); font-size: 12px; line-height: 1.5; }
.linkmon-campaign-confirm input { margin-top: 3px; flex: none; }
.linkmon-table-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.linkmon-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.linkmon-filters { display: flex; flex-wrap: wrap; gap: 9px; padding: 15px 0; border-top: 1px solid var(--rule-soft); }
.linkmon-filters input { min-width: min(100%,320px); }
.linkmon-table { border-collapse: collapse; width: 100%; font-size: 12px; }
.linkmon-table th { text-align: left; font: 600 10px var(--ff-mono); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); white-space: nowrap; background: var(--surface-alt); }
.linkmon-table th, .linkmon-table td { padding: 12px 13px; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
.linkmon-table td { min-width: 90px; }
.linkmon-table td:first-child { min-width: 250px; max-width: 420px; overflow-wrap: anywhere; }
.linkmon-table td small { display: block; color: var(--muted); margin-top: 5px; line-height: 1.45; }
.linkmon-article { color: var(--ink); font-weight: 600; text-decoration-color: var(--muted-2); text-underline-offset: 3px; }
.linkmon-empty { color: var(--muted); text-align: center; padding: 36px !important; }
.linkmon-status { display: inline-block; white-space: nowrap; padding: 5px 8px; border-radius: 3px; font-size: 11px; font-weight: 600; }
.linkmon-status.is-yes { color: var(--pos); background: var(--pos-bg); }
.linkmon-status.is-no { color: var(--neg); background: var(--neg-bg); }
.linkmon-status.is-unknown { color: var(--ink-3); background: var(--paper-deep); }
.linkmon-status.is-queued { color: var(--info); background: var(--info-bg); }
.linkmon-dot { color: var(--muted-2); }
.linkmon-row-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.linkmon-row-actions button { background: none; border: 0; padding: 0; color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font: 11px var(--ff-sans); }
.linkmon-row-actions button:disabled { opacity: .5; cursor: wait; }
.linkmon-detail-row td { background: var(--surface-alt); padding: 18px !important; }
.linkmon-detail { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; }
.linkmon-detail b { font-size: 13px; }
.linkmon-detail ul { padding-left: 18px; }
.linkmon-detail li { margin: 8px 0; overflow-wrap: anywhere; }
.linkmon-detail li span { margin-right: 10px; }
.linkmon-history { list-style: none; padding: 0 !important; max-height: 300px; overflow: auto; }
.linkmon-history li { display: flex; flex-wrap: wrap; gap: 10px; border-bottom: 1px solid var(--rule-soft); padding: 7px 0; }
.linkmon-history time, .linkmon-history span { color: var(--muted); }
.linkmon-history small { width: 100%; }
.linkmon-visibility { border-top: 1px solid var(--rule-soft); margin-top: 12px; padding-top: 10px; }
.linkmon-visibility h3 { margin: 0 0 7px; font-size: 13px; }
.linkmon-queries { padding-left: 20px; max-height: 210px; overflow: auto; }
.linkmon-pagination { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 15px; }
.linkmon-pagination a { padding: 5px 9px; border: 1px solid var(--rule-soft); color: var(--ink); text-decoration: none; }
.linkmon-pagination a.is-active { background: var(--ink); color: var(--surface); }
@media (max-width: 1250px) { .linkmon-charts { grid-template-columns: repeat(2,minmax(0,1fr)); } .linkmon-chart--wide { grid-column: 1/-1; } .linkmon-charts--internal { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 1080px) { .linkmon-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 760px) { .linkmon-head, .linkmon-table-head { display: block; } .linkmon-picker { margin-top: 18px; } .linkmon-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); } .linkmon-charts, .linkmon-charts--internal, .linkmon-analysis { grid-template-columns: 1fr; } .linkmon-chart--wide { grid-column: auto; } .linkmon-import, .linkmon-detail { grid-template-columns: 1fr; } .linkmon-preview, .linkmon-import__last { grid-column: auto; } .linkmon-actions { justify-content: flex-start; margin: 15px 0; } .linkmon-yandex__head { display: block; } .linkmon-yandex__metrics { grid-template-columns: repeat(2,minmax(0,1fr)); } .linkmon-table { min-width: 900px; } }
@media (max-width: 760px) { .linkmon-yandex__charts { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .linkmon-kpis article { padding: 13px; } .linkmon-kpis strong { font-size: 34px; } }
@media (max-width: 768px) {
    .linkmon-page .admin-header { height: 82px; flex-direction: column; flex-wrap: nowrap; align-items: stretch; padding: 8px 12px; gap: 6px; }
    .linkmon-page .admin-header__left { display: flex; flex-direction: column; flex: none; gap: 5px; min-width: 0; }
    .linkmon-page .admin-header__brand { font-size: 19px; }
    .linkmon-page .admin-nav { display: flex; flex-wrap: nowrap; gap: 3px; overflow-x: auto; width: 100%; scrollbar-width: none; }
    .linkmon-page .admin-nav::-webkit-scrollbar { display: none; }
    .linkmon-page .admin-nav__link { padding: 6px 10px; font-size: 12px; }
    .linkmon-page .admin-header__right, .linkmon-page .admin-nav__diag-block { display: none; }
    .linkmon-page .admin-taskbar { margin-top: 82px; top: 82px; height: 54px; padding: 0 16px; }
    .linkmon-page .admin-taskbar__tiles, .linkmon-page .admin-taskbar__all { display: none; }
    .linkmon-page .admin-main { padding-top: 22px; }
}


/* Навигация с мини-иконками — общий каркас панели, 2026-09-28. */
.admin-header--icon-nav { scrollbar-width: thin; scrollbar-color: #cbd2dc transparent; }
.admin-header--icon-nav .admin-header__left { gap: 16px; min-width: 0; }
.admin-header--icon-nav .admin-nav { gap: 3px; }
.admin-header--icon-nav .admin-nav__link {
    position: relative;
    gap: 10px;
    min-height: 40px;
    padding: 6px 10px;
    font-size: 13px;
    line-height: 20px;
    transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}
.admin-nav__label { min-width: 0; }
.admin-nav__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    color: var(--nav-accent, #64748b);
    background: color-mix(in srgb, var(--nav-accent, #64748b) 9%, transparent);
    transition: background 180ms ease, color 180ms ease, transform 220ms ease;
}
.admin-nav__icon svg { display: block; flex: none; }
.admin-header--icon-nav .admin-nav__link:hover { padding-left: 10px; background: #f0f3f7; }
.admin-nav__link:hover .admin-nav__icon {
    background: color-mix(in srgb, var(--nav-accent, #64748b) 16%, transparent);
    transform: translateY(-1px);
}
.admin-header--icon-nav .admin-nav__link.is-active,
.admin-header--icon-nav .admin-nav__link.is-active:hover {
    padding-left: 10px;
    background: linear-gradient(125deg, #243249, #111a2c);
    box-shadow: 0 3px 10px rgba(15,23,42,0.14), inset 0 1px 0 rgba(255,255,255,0.1);
}
.admin-nav__link.is-active .admin-nav__icon,
.admin-nav__diag-sub-link.is-active .admin-nav__icon { color: #fff; background: rgba(255,255,255,0.13); }
.admin-header--icon-nav .admin-nav__link:focus-visible,
.admin-header--icon-nav .admin-nav__diag-sub-link:focus-visible { outline: 2px solid #6482b2; outline-offset: 2px; }
.admin-header--icon-nav .admin-nav__diag-sub { padding-left: 0; gap: 2px; }
.admin-header--icon-nav .admin-nav__diag-sub-link { gap: 10px; padding: 6px 10px; min-height: 36px; }
.admin-nav__diag-sub-link .admin-nav__icon { flex-basis: 24px; width: 24px; height: 24px; background: transparent; border-radius: 6px; }
.admin-nav__diag-sub-link .admin-nav__icon svg { width: 16px; height: 16px; }
@media (min-width: 769px) and (max-width: 1024px) {
    :root { --sidebar-w: 224px; }
}
@media (max-width: 768px) {
    .admin-header.admin-header--icon-nav {
        height: 120px;
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        padding: 8px 12px;
        gap: 0;
        overflow: hidden;
    }
    .admin-header--icon-nav .admin-header__left { flex-direction: column; flex: none; gap: 6px; min-width: 0; }
    .admin-header--icon-nav .admin-header__brand { font-size: 19px; line-height: 20px; border: 0; padding: 0; }
    .admin-header--icon-nav .admin-nav {
        flex-direction: row;
        flex-wrap: nowrap;
        width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
        padding: 0 0 2px;
    }
    .admin-header--icon-nav .admin-nav::-webkit-scrollbar,
    .admin-header--icon-nav .admin-nav__diag-sub::-webkit-scrollbar { display: none; }
    .admin-header--icon-nav .admin-nav__link { flex-shrink: 0; gap: 7px; font-size: 12px; min-height: 40px; padding: 6px 9px; }
    .admin-header--icon-nav .admin-nav__link:hover,
    .admin-header--icon-nav .admin-nav__link.is-active,
    .admin-header--icon-nav .admin-nav__link.is-active:hover { padding-left: 9px; }
    .admin-header--icon-nav .admin-nav__icon { flex-basis: 24px; width: 24px; height: 24px; border-radius: 7px; }
    .admin-header--icon-nav .admin-nav__icon svg { width: 16px; height: 16px; }
    .admin-header--icon-nav .admin-nav__diag-block { display: block; margin: 0; padding: 0; border: 0; }
    .admin-header--icon-nav .admin-nav__diag,
    .admin-header--icon-nav .admin-nav__queue { display: none; }
    .admin-header--icon-nav .admin-nav__diag-sub { flex-direction: row; gap: 3px; margin: 0; overflow-x: auto; scrollbar-width: none; }
    .admin-header--icon-nav .admin-nav__diag-sub-link { flex-shrink: 0; gap: 4px; font-size: 11px; min-height: 32px; padding: 4px 7px; }
    .admin-header--icon-nav .admin-nav__diag-sub-link .admin-nav__icon { flex-basis: 18px; width: 18px; height: 18px; }
    .admin-header--icon-nav .admin-header__right { display: block; position: absolute; top: 8px; right: 12px; }
    .admin-header--icon-nav .admin-header__user-row { display: none; }
    .admin-header--icon-nav .admin-header__logout { font-size: 11px; padding: 2px 0; line-height: 20px; }
    .admin-header--icon-nav + .admin-taskbar { margin-top: 120px; top: 120px; height: 54px; padding: 0 16px; }
    .admin-header--icon-nav + .admin-taskbar .admin-taskbar__tiles,
    .admin-header--icon-nav + .admin-taskbar .admin-taskbar__all { display: none; }
    .admin-header--icon-nav ~ .admin-main { padding-top: 22px; }
    .admin-header--icon-nav ~ .admin-statusbar { top: 130px; right: 12px; gap: 6px; }
    .admin-header--icon-nav ~ .admin-statusbar .perf-toolbar__panel { max-height: calc(100dvh - 190px); }
}
@media (prefers-reduced-motion: reduce) {
    .admin-header--icon-nav .admin-nav__link,
    .admin-header--icon-nav .admin-nav__diag-sub-link,
    .admin-header--icon-nav .admin-nav__icon { transition: none; }
    .admin-header--icon-nav .admin-nav__icon,
    .admin-header--icon-nav .admin-nav__link:hover .admin-nav__icon { transform: none; }
}

/* Компактная шапка: задачи и показатели в одном потоке, без перекрытия. */
.admin-taskbar.admin-taskbar--compact {
    height: 60px;
    padding: 0 24px;
    gap: 10px;
}
.admin-taskbar--compact .admin-taskbar__create,
.admin-taskbar--compact .admin-taskbar__all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    height: 36px;
    gap: 7px;
    padding: 0 11px;
    border-radius: 9px;
    font: 500 12px/1 var(--ff-sans);
    white-space: nowrap;
    transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}
.admin-taskbar--compact .admin-taskbar__all { border: 1px solid var(--rule-soft); background: var(--surface); color: var(--ink-2); }
.admin-taskbar--compact .admin-taskbar__all:hover { background: #f0f3f7; border-color: #cbd2dc; }
.admin-taskbar--compact .admin-nav__icon { flex-basis: 20px; width: 20px; height: 20px; border-radius: 5px; background: transparent; }
.admin-taskbar--compact .admin-taskbar__create .admin-nav__icon { color: #fff; }
.admin-taskbar--compact .admin-taskbar__tiles { gap: 8px; height: 50px; padding: 1px 0; overflow-y: hidden; scrollbar-width: none; }
.admin-taskbar--compact .admin-taskbar__tiles::-webkit-scrollbar { display: none; }
.admin-taskbar--compact .admin-taskbar__empty { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 11px; white-space: nowrap; }
.admin-taskbar--compact .admin-taskbar__empty > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.admin-taskbar--compact .task-tile { width: 230px; max-width: 100%; min-width: 140px; height: 48px; gap: 3px; padding: 5px 10px; border-radius: 8px; }
.admin-taskbar--compact .task-tile__assignee { display: none; }
.admin-taskbar--compact .task-tile__title { font-size: 11px; }
.admin-taskbar--compact .task-tile__foot { font-size: 9px; }
.admin-taskbar--compact .task-progress { height: 3px; }
.admin-taskbar__status { flex: 0 0 auto; min-width: 0; margin-left: auto; }
.admin-taskbar__status .admin-statusbar { position: static; gap: 7px; }
.admin-statusbar--compact .admin-nav__icon { flex: 0 0 18px; width: 18px; height: 18px; background: transparent; color: var(--nav-accent); }
.admin-statusbar--compact .admin-statusbar__avail,
.admin-statusbar--compact .api-limits-toolbar__summary,
.admin-statusbar--compact .perf-toolbar__badge,
.admin-statusbar--compact .api-limits-toolbar__refresh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    gap: 6px;
    padding: 0 9px;
    border: 1px solid #e1e6ed;
    border-radius: 9px;
    background: var(--surface, #fff);
    box-shadow: 0 1px 3px rgba(15,23,42,0.03);
    transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
    cursor: pointer;
}
.admin-statusbar--compact .admin-statusbar__avail:hover,
.admin-statusbar--compact .api-limits-toolbar__summary:hover,
.admin-statusbar--compact .api-limits-toolbar__group[open] .api-limits-toolbar__summary,
.admin-statusbar--compact .api-limits-toolbar__refresh:hover { background: #f0f3f7; border-color: #cbd2dc; }
.admin-statusbar--compact .admin-statusbar__avail { font-size: 11px; }
.admin-statusbar--compact .admin-statusbar__avail.is-ok .admin-nav__icon { color: #15835e; }
.admin-statusbar--compact .admin-statusbar__avail.is-warn .admin-nav__icon { color: #b46b23; }
.admin-statusbar--compact .admin-statusbar__avail.is-critical .admin-nav__icon { color: #c34c59; }
.admin-statusbar--compact .admin-statusbar__avail.is-checking .admin-nav__icon { animation: sa-pulse 1.8s ease-in-out infinite; }
.admin-statusbar--compact .admin-statusbar__avail-count { min-width: 16px; padding: 1px 5px; font-size: 10px; }
.admin-statusbar--compact .api-limits-toolbar { display: flex; gap: 5px; }
.admin-statusbar--compact .api-limits-toolbar__group { display: block; position: relative; padding: 0; border: 0; border-radius: 9px; box-shadow: none; background: transparent; }
.admin-statusbar--compact .api-limits-toolbar__summary { list-style: none; }
.admin-statusbar--compact .api-limits-toolbar__summary::-webkit-details-marker { display: none; }
.admin-statusbar--compact .api-limits-toolbar__label { font-size: 9px; letter-spacing: 0.02em; }
.admin-statusbar--compact .api-limits-toolbar__value { font-size: 10px; }
.admin-statusbar--compact .api-limits-toolbar__group--bad .api-limits-toolbar__summary { background: #fff4f4; border-color: #f1d5d8; }
.admin-statusbar--compact .api-limits-toolbar__group--warn .api-limits-toolbar__summary { background: #fff8eb; border-color: #ecdfc6; }
.api-limits-toolbar__panel { position: absolute; top: 42px; right: 0; width: max-content; min-width: 200px; max-width: calc(100vw - 24px); padding: 14px 16px; border: 1px solid var(--rule-soft); border-radius: 12px; background: var(--surface); box-shadow: 0 12px 32px rgba(15,23,42,0.12); font: 600 13px/1.5 var(--ff-mono); color: var(--ink); }
.api-limits-toolbar__name { display: block; margin-bottom: 5px; color: var(--muted); font: 500 11px/1.5 var(--ff-sans); }
.admin-statusbar--compact .api-limits-toolbar__refresh { width: 34px; padding: 0; }
.admin-statusbar--compact .api-limits-toolbar__refresh.is-loading svg { animation: header-refresh 900ms linear infinite; }
.admin-statusbar--compact .api-limits-toolbar__refresh:disabled { cursor: progress; opacity: 0.65; }
.admin-statusbar--compact .perf-toolbar__badge { font: 600 11px/1 var(--ff-mono); }
.admin-statusbar--compact .perf-toolbar__badge--ok { background: #eff8f4; border-color: #d5e9df; color: #237455; }
.admin-statusbar--compact .perf-toolbar__badge--warn { background: #fff8eb; border-color: #ecdfc6; color: #946221; }
.admin-statusbar--compact .perf-toolbar__badge--bad { background: #fff0f1; border-color: #f1d5d8; color: #a73e50; }
.admin-statusbar--compact .perf-toolbar__badge .admin-nav__icon { color: inherit; }
.admin-taskbar--compact button:focus-visible,
.admin-taskbar--compact a:focus-visible,
.admin-taskbar--compact summary:focus-visible { outline: 2px solid #6482b2; outline-offset: 2px; }
@keyframes header-refresh { to { transform: rotate(360deg); } }
@media (max-width: 1399px) {
    .admin-taskbar--compact .admin-taskbar__all-label { display: none; }
    .admin-taskbar--compact .admin-taskbar__all { width: 36px; padding: 0; }
    .admin-statusbar--compact .admin-statusbar__avail-label { display: none; }
}
@media (max-width: 1100px) {
    .admin-taskbar.admin-taskbar--compact { padding: 0 16px; gap: 8px; }
    .admin-statusbar--compact .api-limits-toolbar__value { display: none; }
}
@media (max-width: 900px) {
    .admin-taskbar--compact .admin-taskbar__create-label { display: none; }
    .admin-taskbar--compact .admin-taskbar__create { width: 36px; padding: 0; }
}
@media (max-width: 768px) {
    .admin-taskbar.admin-taskbar--compact { margin-top: 120px; top: 120px; height: 54px; padding: 0 12px; gap: 6px; }
    .admin-taskbar.admin-taskbar--compact .admin-taskbar__all { display: inline-flex; }
    .admin-taskbar--compact .admin-taskbar__status .admin-statusbar { gap: 5px; }
    .admin-statusbar--compact .api-limits-toolbar__label { display: none; }
    .admin-statusbar--compact .api-limits-toolbar { gap: 4px; }
    .admin-statusbar--compact .api-limits-toolbar__summary,
    .admin-statusbar--compact .api-limits-toolbar__refresh { width: 32px; padding: 0; }
    .admin-statusbar--compact .admin-statusbar__avail { padding: 0 7px; gap: 4px; }
    .admin-statusbar--compact .perf-toolbar__badge { padding: 0 7px; gap: 4px; }
    .admin-taskbar--compact .admin-taskbar__status { position: relative; }
    .admin-statusbar--compact .api-limits-toolbar__group { position: static; }
    .admin-statusbar--compact .api-limits-toolbar__panel { top: 50px; right: 0; width: min(280px, calc(100vw - 24px)); }
    .admin-taskbar--compact .admin-statusbar .perf-toolbar__panel { max-height: calc(100dvh - 190px); }
}
@media (prefers-reduced-motion: reduce) {
    .admin-taskbar--compact .admin-nav__icon,
    .admin-statusbar--compact .api-limits-toolbar__refresh.is-loading svg { animation: none; }
    .admin-taskbar--compact button,
    .admin-taskbar--compact a,
    .admin-taskbar--compact summary { transition: none; }
}
@media (max-width: 359px) {
    .admin-taskbar.admin-taskbar--compact { gap: 4px; }
    .admin-taskbar--compact .admin-taskbar__create,
    .admin-taskbar.admin-taskbar--compact .admin-taskbar__all { width: 32px; }
    .admin-statusbar--compact .perf-toolbar__badge { width: 34px; padding: 0; }
    .admin-statusbar--compact .perf-toolbar__badge [data-perf-total] { display: none; }
}

/* Project ownership and compact, decorative content icons. */
.projects-page .admin-main .admin-nav__icon {
    display: inline-flex; width: 16px; height: 16px; flex: 0 0 16px;
    border: 0; border-radius: 0; background: transparent; color: currentColor;
    vertical-align: middle; box-shadow: none;
}
.projects-page .admin-main .admin-nav__icon svg { width: 16px; height: 16px; }
.projects-page .page-head__eyebrow,
.projects-page .field__label { display: inline-flex; align-items: center; gap: 7px; }
.projects-page .project-portfolio__title { display: inline-flex; align-items: center; gap: 10px; }
.projects-page .project-portfolio__title .admin-nav__icon {
    width: 32px; height: 32px; flex-basis: 32px; border-radius: 10px;
    background: #edf2f7; color: #637e96;
}
.projects-page .project-portfolio__title .admin-nav__icon svg { width: 19px; height: 19px; }
.projects-page .project-card-wrap { gap: 10px; padding: 18px; }
.projects-page .project-card__drag-handle { padding: 5px 0; }
.projects-page .project-card__domain { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 3px; }
.projects-page .project-card__domain > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.projects-page .project-card__domain .admin-nav__icon { margin-top: 4px; color: #637e96; }
.projects-page .project-card__meta { overflow-wrap: anywhere; }
.projects-page .project-profile-fields__chip { gap: 4px; padding: 4px 6px; }
.projects-page .project-profile-fields__chip .admin-nav__icon { width: 12px; height: 12px; flex-basis: 12px; }
.projects-page .project-profile-fields__chip .admin-nav__icon svg { width: 12px; height: 12px; }
.project-card__assignment { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rule-faint, #f1f5f9); }
.project-card__manager { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.project-card__assign { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 10px; min-height: 34px; border: 1px solid #dce4ed; border-radius: 8px; background: #f5f8fc; color: #526a90; font: 600 12px var(--ff-sans); cursor: pointer; transition: background .18s, border-color .18s, transform .18s; }
.project-card__assign:hover { background: #eaf0f8; border-color: #bacadd; transform: translateY(-1px); }
.project-card__assign:active { transform: translateY(0); }
.project-card__assign:focus-visible { outline: 2px solid #526a90; outline-offset: 3px; }
.projects-page .project-list__item { scroll-margin-top: 100px; }
.projects-page .project-list__item:target { outline: 2px solid #91a9c3; outline-offset: 3px; }
.project-assignment { width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); box-sizing: border-box; padding: 28px; border: 1px solid #dce4ed; border-radius: 20px; color: var(--ink); background: var(--surface, #fff); box-shadow: 0 30px 90px #14223733; }
.project-assignment::backdrop { background: #14223766; backdrop-filter: blur(3px); }
.project-assignment[open] { animation: project-dialog-in .2s ease-out; }
.project-assignment .admin-nav__icon { width: 16px; height: 16px; background: transparent; border: 0; color: currentColor; }
.project-assignment__symbol { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: #edf2f8; color: #526a90; margin-bottom: 18px; }
.project-assignment__symbol .admin-nav__icon, .project-assignment__symbol svg { width: 24px; height: 24px; }
.project-assignment h2 { font-size: 24px; line-height: 1.2; margin: 0 0 8px; }
.project-assignment__domain { margin: 0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.project-assignment__current { margin: 6px 0 24px; font-size: 13px; color: var(--muted); }
.project-assignment .field { display: flex; flex-direction: column; gap: 8px; }
.project-assignment .field__label { display: inline-flex; align-items: center; gap: 6px; }
.project-assignment__note { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 12px 0 20px; }
.project-assignment__error { color: #b91c1c; font-size: 13px; line-height: 1.5; margin: 0 0 16px; }
.project-assignment__error:empty { display: none; }
.project-assignment__actions { display: flex; justify-content: flex-end; gap: 8px; }
.project-assignment__actions .btn:disabled { opacity: .5; cursor: default; }
@keyframes project-dialog-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) {
    .projects-page .project-card-wrap { padding: 14px 12px; gap: 7px; }
    .projects-page .project-gear { width: 24px; height: 28px; }
    .projects-page .project-portfolio__head { flex-wrap: wrap; gap: 8px; }
    .projects-page .project-portfolio__problems { margin-left: 0; }
    .projects-page .project-card__assign { min-height: 40px; }
    .projects-page .project-list__item { scroll-margin-top: 170px; }
    .project-assignment { padding: 24px; }
}
@media (prefers-reduced-motion: reduce) {
    .project-assignment[open] { animation: none; }
    .project-card__assign { transition: none; }
}
