/* ══ SEO-анализ текста (/tools/text-analysis, spec-text-analysis §3.6, §3.7, §9) — классы ta-* ══
   Макет согласован 2026-10-17 (бывший templates/preview.html). Классы ta-* переиспользует макет
   уникальности (templates/preview_uniq.html) — имена не переименовывать. Только токены base.css, обе темы. */

:root {
  --ta-heat-1: color-mix(in srgb, var(--yellow) 18%, transparent);
  --ta-heat-2: color-mix(in srgb, var(--yellow) 34%, transparent);
  --ta-heat-3: color-mix(in srgb, var(--red) 30%, transparent);
  --ta-heat-4: color-mix(in srgb, var(--red) 50%, transparent);
  --ta-water: color-mix(in srgb, var(--green) 22%, transparent);
  --ta-key-1: color-mix(in srgb, var(--accent) 22%, transparent);
  --ta-key-2: color-mix(in srgb, var(--accent) 42%, transparent);
  --ta-mixed: color-mix(in srgb, var(--red) 38%, transparent);
  --ta-long-1: color-mix(in srgb, var(--yellow) 22%, transparent);
  --ta-long-2: color-mix(in srgb, var(--red) 26%, transparent);
  --ta-sticky-top: calc(var(--space-4xl) + var(--space-lg));
}

.tool-page.ta-page { max-width: 1200px; }
/* светлая тема: --text-muted даёт 2,9–3,5:1 на мелком тексте — внутри страницы поднимаем до --text-dim */
.light .ta-page { --text-muted: var(--text-dim); }
.ta-page .tool-hero h1 { font-family: var(--font-heading); }
.ta-page .tool-breadcrumb a { display: inline-flex; align-items: center; min-height: 44px; }
.ta-page a.tool-btn { text-decoration: none; }
.ta-page .tool-results { padding: var(--space-xl); }
.ta-page .tool-results-header { margin-bottom: var(--space-lg); }
.ta-page .tool-copy-all, .ta-page .tool-consult-btn { min-height: 44px; padding: 0 var(--space-lg); font-size: var(--fs-md); }

/* общие заголовки блоков */
.ta-block { min-width: 0; }
.ta-title { font-family: var(--font-heading); font-size: calc(var(--fs-base) + 3px); font-weight: 700; color: var(--text); margin: 0; }
.ta-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm) var(--space-md); flex-wrap: wrap; margin-bottom: var(--space-md); }
.ta-head-aside { font-size: var(--fs-sm); color: var(--text-dim); }
.ta-num { font-variant-numeric: tabular-nums; }
.ta-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-xl); box-shadow: var(--shadow-xs); }
.light .ta-card { border-color: transparent; box-shadow: var(--shadow-sm); }
.ta-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ta-sec { margin-top: var(--space-3xl); }
.ta-mt { margin-top: var(--space-lg); margin-bottom: 0; }
.ta-hint { margin: var(--space-xs) 0 0; font-size: var(--fs-sm); color: var(--text-dim); line-height: 1.5; }
.ta-label { display: block; margin-bottom: var(--space-xs); font-size: var(--fs-sm); font-weight: 600; color: var(--text-dim); }

/* ── 0. Форма ── */
.ta-tabs { display: flex; gap: var(--space-2xs); border-bottom: 2px solid var(--border); margin-bottom: var(--space-md); }
.ta-tab { min-height: 44px; padding: 0 var(--space-lg); background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -2px; font-family: var(--font-heading); font-size: var(--fs-md); font-weight: 600; color: var(--text-dim); cursor: pointer; display: inline-flex; align-items: center; gap: var(--space-xs); transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.ta-tab:hover { color: var(--text); }
.ta-tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.ta-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--radius-xs); }
.ta-pane[hidden] { display: none; }
.ta-textarea { width: 100%; min-height: 220px; resize: vertical; line-height: 1.55; font-size: var(--fs-lg); padding: var(--space-md) var(--space-lg); display: block; }
.ta-url { width: 100%; min-height: 48px; font-size: var(--fs-lg); }
.ta-form-meta { display: flex; justify-content: space-between; align-items: center; gap: var(--space-sm); flex-wrap: wrap; margin-top: var(--space-sm); }
.ta-counter { font-size: var(--fs-sm); color: var(--text-dim); }
.ta-counter b { color: var(--text); font-weight: 600; }
.ta-counter.is-over, .ta-counter.is-over b { color: var(--red); font-weight: 700; }
.ta-btn-ghost { min-height: 44px; display: inline-flex; align-items: center; gap: var(--space-xs); padding: 0 var(--space-lg); border: 1px solid var(--border); border-radius: var(--radius-sm); background: transparent; color: var(--text); font: inherit; font-size: var(--fs-md); cursor: pointer; text-decoration: none; transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.ta-btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.ta-btn-ghost:focus-visible, .ta-link-btn:focus-visible, .ta-mode:focus-visible, .ta-sort:focus-visible, .ta-next-card:focus-visible, .ta-more a:focus-visible, .ta-spell-meta a:focus-visible, .ta-q > summary:focus-visible, .ta-kw > summary:focus-visible, .ta-acc-i > summary:focus-visible, summary.ta-stat:focus-visible, .ta-tbl tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-xs); }
.ta-btn-ghost[aria-disabled="true"] { color: var(--text-muted); border-style: dashed; cursor: not-allowed; }
.ta-btn-ghost[aria-disabled="true"]:hover { border-color: var(--border-hover); color: var(--text-dim); }
.ta-btn-ghost.is-locked { color: var(--text-dim); border-style: dashed; }
/* «Вставить пример» — тихая текстовая ссылка, не кнопка: не спорит с «Проверить» */
.ta-example { min-height: 44px; display: inline-flex; align-items: center; gap: var(--space-2xs); padding: 0; border: 0; background: none; color: var(--text-dim); font: inherit; font-size: var(--fs-sm); cursor: pointer; transition: color var(--dur-fast) var(--ease); }
.ta-example svg { width: 14px; height: 14px; opacity: 0.7; }
.ta-example:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.ta-example:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-xs); }

.ta-kw { margin-top: var(--space-md); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.ta-kw > summary { list-style: none; min-height: 44px; display: flex; align-items: center; gap: var(--space-sm); padding: 0 var(--space-lg); cursor: pointer; font-weight: 600; color: var(--text); }
.ta-kw > summary::-webkit-details-marker { display: none; }
.ta-kw > summary svg { color: var(--text-dim); transition: transform var(--dur-fast); }
.ta-kw[open] > summary svg { transform: rotate(180deg); }
.ta-kw-sub { font-weight: 400; color: var(--text-dim); font-size: var(--fs-sm); }
.ta-kw-sub.is-over { color: var(--red); font-weight: 600; }
.ta-kw-body { padding: 0 var(--space-lg) var(--space-lg); }
.ta-kw-input { width: 100%; min-height: 100px; resize: vertical; }

.ta-submit-row { display: flex; align-items: center; gap: var(--space-md) var(--space-lg); flex-wrap: wrap; margin-top: var(--space-lg); }
.ta-submit-row .tool-btn { min-height: 48px; padding: 0 var(--space-2xl); font-size: var(--fs-lg); }
.ta-quota { font-size: var(--fs-sm); color: var(--text-dim); }
.ta-quota b { color: var(--text); font-weight: 600; }

/* загрузка */
.ta-progress { display: flex; align-items: center; gap: var(--space-md); margin-top: var(--space-md); font-size: var(--fs-sm); color: var(--text-dim); }
.ta-progress[hidden] { display: none; }
.ta-progress-bar { position: relative; flex: 0 0 160px; height: 6px; border-radius: 9999px; background: var(--bg-input); overflow: hidden; }
.ta-progress-bar i { position: absolute; top: 0; bottom: 0; left: 0; width: 40%; border-radius: 9999px; background: var(--accent); animation: ta-indet 1.2s var(--ease) infinite; }
@keyframes ta-indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) { .ta-progress-bar i { animation: none; width: 100%; opacity: 0.5; } }

/* ошибки запроса */
.ta-alert { display: flex; align-items: flex-start; gap: var(--space-sm); margin-top: var(--space-md); padding: var(--space-md) var(--space-lg); border-radius: var(--radius-sm); border: 1px solid color-mix(in srgb, var(--red) 35%, transparent); background: var(--red-bg); color: var(--text); font-size: var(--fs-md); line-height: 1.5; }
.ta-alert[hidden] { display: none; }
.ta-alert.is-warn { border-color: color-mix(in srgb, var(--yellow) 40%, transparent); background: var(--yellow-bg); }
.ta-alert-ico { flex-shrink: 0; display: inline-flex; padding-top: 2px; color: var(--red); }
.ta-alert.is-warn .ta-alert-ico { color: var(--yellow); }
.ta-alert a { color: var(--accent); font-weight: 600; }

/* капча: невидимая, контейнер без размеров */
.ta-captcha:empty { display: none; }
.ta-consent { margin: var(--space-sm) 0 0; font-size: var(--fs-xs); color: var(--text-dim); }
.ta-consent[hidden] { display: none; }
.ta-consent a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ── 0а. «+ Проверить уникальность» (скоро) ── */
.ta-uniq { margin-top: var(--space-md); padding-top: var(--space-md); border-top: 1px solid var(--border); display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2xs); }
.ta-uniq-row { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; }
.ta-uniq .ta-check { font-weight: 600; }
.ta-uniq-opts { display: flex; align-items: center; gap: var(--space-xs) var(--space-md); flex-wrap: wrap; margin: 0; padding: 0; border: 0; min-width: 0; }
.ta-uniq-opts legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ta-seg { display: inline-flex; padding: var(--space-2xs); gap: var(--space-2xs); border-radius: var(--radius-sm); background: var(--bg-input); border: 1px solid var(--border); }
.ta-seg-i { position: relative; display: inline-flex; align-items: center; gap: var(--space-2xs); min-height: 44px; padding: 0 var(--space-md); border-radius: var(--radius-xs); font-size: var(--fs-md); font-weight: 500; color: var(--text-dim); cursor: pointer; white-space: nowrap; }
.ta-seg-i input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: inherit; }
.ta-seg-i:hover { color: var(--text); }
.ta-seg-i:has(input:checked) { background: var(--bg-card); color: var(--text); font-weight: 600; box-shadow: var(--shadow-xs), inset 0 0 0 1px var(--border-hover); }
.ta-uniq.is-on .ta-seg-i:has(input:checked) { box-shadow: var(--shadow-xs), inset 0 0 0 1px var(--accent); }
.ta-seg-i:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--accent-glow); }
.ta-seg-l { display: inline-flex; align-items: center; gap: var(--space-2xs); }
.ta-seg-cost { font-size: var(--fs-sm); color: var(--text-muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.ta-seg-i.is-locked { color: var(--text-muted); cursor: not-allowed; }
.ta-seg-i.is-locked:hover { color: var(--text-muted); }
.ta-uniq:not(.is-on) .ta-uniq-opts, .ta-uniq:not(.is-on) .ta-uniq-quota { opacity: 0.55; transition: opacity var(--dur-fast); }
.ta-uniq:not(.is-on) .ta-uniq-opts:hover, .ta-uniq:not(.is-on) .ta-uniq-opts:focus-within { opacity: 1; }
.ta-uniq-quota { font-size: var(--fs-sm); color: var(--text-dim); }
.ta-uniq-quota b { color: var(--text); font-weight: 600; }
#ta-uniq .ta-uniq-quota { opacity: 1; }

/* ── Вкладки общего отчёта (§4.5) ── */
.ta-rtabs { margin-bottom: var(--space-xl); }
.ta-rtab-note { white-space: nowrap; font-family: var(--font-body); font-size: var(--fs-xs); font-weight: 500; color: var(--text-muted); padding: 1px var(--space-xs); border-radius: var(--radius-xs); background: var(--bg-input); }
.ta-rtab-n { font-family: var(--font-body); font-size: var(--fs-xs); font-weight: 700; min-width: 20px; padding: 1px var(--space-xs); border-radius: 9999px; background: var(--red-bg); color: var(--red); text-align: center; font-variant-numeric: tabular-nums; }
.ta-rtab-n[hidden] { display: none; }
.ta-panel[hidden], .ta-report[hidden], .ta-stop[hidden] { display: none; }
.ta-panel--narrow { max-width: 760px; }
.ta-empty { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-sm); max-width: 640px; padding: var(--space-xl); border: 1px dashed var(--border-hover); border-radius: var(--radius); }
.ta-empty-ico { width: 44px; height: 44px; border-radius: var(--radius-sm); background: var(--accent-glow); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; }
.ta-empty p { margin: 0; font-size: var(--fs-md); color: var(--text-dim); line-height: 1.55; }
.ta-empty p b { color: var(--text); }
.ta-empty .tool-btn { min-height: 48px; gap: var(--space-xs); margin-top: var(--space-xs); }

/* ── Раскладка отчёта ── */
.ta-results.tool-results { padding: var(--space-xl); }
.ta-report-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-sm) var(--space-md); flex-wrap: wrap; margin-bottom: var(--space-lg); }
.ta-report-head .tool-results-header-utils { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.ta-grid { display: grid; grid-template-columns: minmax(0, 1fr) 452px; gap: var(--space-2xl) var(--space-xl); align-items: start; margin-top: var(--space-2xl); }
.ta-grid > .ta-block { grid-column: 1; }
.ta-grid > .ta-block[hidden] { display: none; }
.ta-grid > .ta-side { grid-column: 2; grid-row: 1 / span 6; position: sticky; top: var(--ta-sticky-top); align-self: start; }

/* ── 1. Сводка ── */
.ta-verdict { display: flex; align-items: center; gap: var(--space-md) var(--space-lg); flex-wrap: wrap; padding: var(--space-lg) var(--space-xl); border-radius: var(--radius); background: var(--red-bg); border: 1px solid color-mix(in srgb, var(--red) 30%, transparent); margin-bottom: var(--space-lg); }
.ta-verdict--ok { background: var(--green-bg); border-color: color-mix(in srgb, var(--green) 30%, transparent); }
.ta-verdict-ico { color: var(--red); display: inline-flex; }
.ta-verdict--ok .ta-verdict-ico { color: var(--green); }
.ta-verdict-t { font-family: var(--font-heading); font-size: calc(var(--fs-base) + 5px); font-weight: 700; color: var(--text); }
.ta-verdict-list { display: flex; gap: var(--space-xs); flex-wrap: wrap; }
.ta-verdict-chip { font-size: var(--fs-sm); padding: var(--space-2xs) var(--space-sm); border-radius: var(--radius-xs); background: var(--bg-card); color: var(--text); border: 1px solid var(--border); }
.ta-verdict-was { margin-left: auto; font-size: var(--fs-sm); color: var(--text-dim); }
.ta-verdict-note { flex-basis: 100%; margin: 0; font-size: var(--fs-sm); color: var(--text-dim); line-height: 1.5; }

.ta-sum { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-md); }
.ta-sum .metric-card { position: relative; display: flex; flex-direction: column; gap: var(--space-xs); padding: var(--space-lg); background: var(--bg-card); border: 1px solid var(--border); border-top: 3px solid var(--border-hover); border-radius: var(--radius); min-width: 0; }
.light .ta-sum .metric-card { border-color: transparent; border-top-color: var(--border-hover); box-shadow: var(--shadow-sm); }
.ta-sum .metric-card.is-ok { border-top-color: var(--green); }
.ta-sum .metric-card.is-warn { border-top-color: var(--yellow); }
.ta-sum .metric-card.is-bad { border-top-color: var(--red); }
.ta-sum .metric-label { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2xs); font-size: var(--fs-sm); color: var(--text-dim); font-weight: 500; min-height: 44px; margin: calc(-1 * var(--space-sm)) calc(-1 * var(--space-sm)) 0 0; }
.ta-sum .metric-value { font-family: var(--font-heading); font-size: calc(var(--fs-base) + 13px); font-weight: 700; color: var(--text); line-height: 1.1; font-variant-numeric: tabular-nums; }
.ta-sum .metric-value small { font-size: var(--fs-lg); font-weight: 600; color: var(--text-dim); }
.ta-sum .metric-card.is-muted .metric-value { color: var(--text-dim); }
.ta-sum .metric-sub { font-size: var(--fs-sm); color: var(--text-dim); line-height: 1.45; overflow-wrap: anywhere; }
.ta-sum .metric-sub b { color: var(--text); font-weight: 600; }
.ta-status { white-space: nowrap; display: inline-flex; align-items: center; gap: var(--space-2xs); align-self: flex-start; font-size: var(--fs-sm); font-weight: 600; padding: 2px var(--space-sm); border-radius: var(--radius-xs); }
.ta-status--ok { background: var(--green-bg); color: var(--green); }
.ta-status--warn { background: var(--yellow-bg); color: var(--yellow); }
.ta-status--bad { background: var(--red-bg); color: var(--red); }
.ta-status--muted { background: var(--bg-input); color: var(--text-dim); }
/* светлая тема: зелёный 3,6:1 и жёлтый 3,3:1 на мелком тексте статуса — затемняем к --text */
.light .ta-status--ok { color: color-mix(in srgb, var(--green) 65%, var(--text)); }
.light .ta-status--warn, .light .ta-soon { color: color-mix(in srgb, var(--yellow) 65%, var(--text)); }
.ta-status-row { display: flex; gap: var(--space-2xs); flex-wrap: wrap; }
.ta-delta { display: inline-flex; align-items: center; gap: var(--space-2xs); font-size: var(--fs-sm); color: var(--text-dim); font-variant-numeric: tabular-nums; }
.ta-delta s { color: var(--text-muted); }
.ta-delta b { color: var(--green); font-weight: 600; }
.ta-delta.is-worse b { color: var(--red); }
.ta-delta.is-same b { color: var(--text-dim); }
.light .ta-delta b { color: color-mix(in srgb, var(--green) 65%, var(--text)); }
.light .ta-delta.is-worse b { color: var(--red); }

/* ── «?»-подсказка ── */
.ta-q { display: inline-block; position: static; flex-shrink: 0; }
.ta-q > summary { list-style: none; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 50%; }
.ta-q > summary::-webkit-details-marker { display: none; }
.ta-q > summary span { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--border-hover); color: var(--text-dim); font-size: var(--fs-xs); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.ta-q > summary:hover span, .ta-q[open] > summary span { border-color: var(--accent); color: var(--accent); }
.ta-q-pop { position: absolute; left: 0; right: 0; top: calc(100% - var(--space-2xs)); z-index: var(--z-popover); padding: var(--space-md) var(--space-lg); border-radius: var(--radius-sm); background: var(--bg-surface); border: 1px solid var(--border-hover); box-shadow: var(--shadow-md); font-size: var(--fs-sm); color: var(--text-dim); line-height: 1.5; font-weight: 400; }
.ta-q-pop p { margin: 0 0 var(--space-xs); }
.ta-q-pop b { color: var(--text); }
.ta-q-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); text-decoration: none; font-weight: 600; margin-bottom: calc(-1 * var(--space-sm)); }
.ta-q-link:hover { text-decoration: underline; }

/* ── 2. Статистика ── */
.ta-stats { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.ta-stats > * { border-bottom: 1px solid var(--border); }
.ta-stats > *:last-child { border-bottom: 0; }
.ta-stat { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-md); min-height: 44px; padding: var(--space-xs) var(--space-lg); font-size: var(--fs-md); }
summary.ta-stat { list-style: none; cursor: pointer; }
summary.ta-stat::-webkit-details-marker { display: none; }
summary.ta-stat:hover { background: var(--bg-card-hover); }
.ta-stat-l { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2xs) var(--space-sm); color: var(--text); min-width: 0; }
.ta-qi { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--border-hover); color: var(--text-dim); font-size: var(--fs-xs); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
summary.ta-stat:hover .ta-qi, .ta-stat-d[open] .ta-qi { border-color: var(--accent); color: var(--accent); }
.ta-stat-d[open] > summary.ta-stat { background: var(--bg-card-hover); }
.ta-stat-hint { padding: var(--space-sm) var(--space-lg) var(--space-md); background: var(--bg-card-hover); border-top: 1px dashed var(--border); font-size: var(--fs-sm); color: var(--text-dim); line-height: 1.5; }
.ta-stat-hint p { margin: 0 0 var(--space-xs); }
.ta-stat-hint b { color: var(--text); }
.ta-stat-v { display: flex; align-items: center; gap: var(--space-sm); justify-content: flex-end; flex-wrap: wrap; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; text-align: right; }
.ta-stat-v .ta-status { font-size: var(--fs-xs); }
.ta-stats > .ta-stat--ours, .ta-stat-d.ta-stat--ours { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.ta-stat-sep { padding: var(--space-sm) var(--space-lg); font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--accent) 5%, transparent); }

/* ── Таблицы (3, 5–7) ── */
.ta-tools { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; margin-bottom: var(--space-sm); }
.ta-search { position: relative; flex: 1 1 200px; min-width: 0; }
.ta-search svg { position: absolute; left: var(--space-md); top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.ta-search .form-input { width: 100%; min-height: 44px; padding-left: calc(var(--space-md) + 24px); }
.ta-lock-wrap { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.ta-lock-hint { font-size: var(--fs-xs); color: var(--text-muted); }
.ta-tbl-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ta-tbl.table { width: 100%; }
.ta-tbl.table th { padding: 0 var(--space-md); }
.ta-tbl.table td { padding: var(--space-sm) var(--space-md); height: 44px; }
.ta-tbl .r { text-align: right; }
.ta-tbl th.r .ta-sort { justify-content: flex-end; }
.ta-sort { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; gap: var(--space-2xs); background: none; border: 0; padding: 0; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
.ta-sort:hover { color: var(--text); }
.ta-sort.is-sorted { color: var(--accent); }
.ta-tbl tbody tr { cursor: pointer; }
.ta-tbl tbody tr:hover td { background: var(--bg-card-hover); }
.ta-tbl tbody tr.is-picked td { background: var(--accent-glow); }
.ta-tbl tbody tr.is-picked td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.ta-tbl-empty td { color: var(--text-dim); text-align: center; cursor: default; }
.ta-phrase { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.ta-td-phrase { min-width: 0; }
.ta-forms { display: flex; flex-wrap: wrap; gap: var(--space-2xs); margin-top: var(--space-xs); }
.ta-form-chip { font-size: var(--fs-sm); padding: 1px var(--space-sm); border-radius: var(--radius-xs); background: var(--bg-input); color: var(--text-dim); font-variant-numeric: tabular-nums; }
.ta-form-chip b { color: var(--text); font-weight: 600; }
.ta-expand { display: inline-flex; align-items: center; gap: var(--space-2xs); }
.ta-expand svg { color: var(--text-dim); transition: transform var(--dur-fast); }
.ta-expand.is-open svg { transform: rotate(180deg); }
.ta-tbl-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--space-sm); flex-wrap: wrap; margin-top: var(--space-sm); font-size: var(--fs-sm); color: var(--text-dim); }
.ta-link-btn { min-height: 44px; display: inline-flex; align-items: center; gap: var(--space-2xs); background: none; border: 0; padding: 0 var(--space-xs); color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.ta-link-btn:hover { text-decoration: underline; }
.ta-link-btn:disabled { color: var(--text-muted); cursor: not-allowed; text-decoration: none; }
.ta-bar { display: inline-block; width: 56px; height: 6px; border-radius: 3px; background: var(--bg-input); vertical-align: middle; margin-right: var(--space-xs); overflow: hidden; }
.ta-bar i { display: block; height: 100%; width: var(--w, 0%); background: var(--accent); border-radius: 3px; }

/* ── 4. Текст с подсветкой ── */
.ta-side { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card); box-shadow: var(--shadow-sm); max-height: calc(100vh - var(--ta-sticky-top) - var(--space-lg)); min-height: 0; }
.ta-side-head { padding: var(--space-lg) var(--space-lg) var(--space-sm); border-bottom: 1px solid var(--border); }
.ta-modes { display: flex; flex-wrap: wrap; gap: var(--space-2xs); margin-top: var(--space-sm); }
.ta-mode { min-height: 44px; padding: 0 var(--space-md); border-radius: 9999px; border: 1px solid var(--border); background: transparent; color: var(--text-dim); font: inherit; font-size: var(--fs-sm); font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: var(--space-2xs); transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease); }
.ta-mode:hover { color: var(--text); border-color: var(--border-hover); }
.ta-mode.is-active { background: var(--accent-glow); border-color: var(--accent); color: var(--text); font-weight: 600; }
.ta-mode-n { font-size: var(--fs-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.ta-mode.is-active .ta-mode-n { color: var(--text-dim); }
.ta-legend { display: flex; align-items: center; gap: var(--space-xs) var(--space-md); flex-wrap: wrap; margin-top: var(--space-sm); min-height: 24px; font-size: var(--fs-xs); color: var(--text-dim); }
.ta-legend-i { display: inline-flex; align-items: center; gap: var(--space-2xs); }
.ta-legend-sw { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }
.ta-legend-err { text-decoration: underline wavy var(--red); text-underline-offset: 3px; color: var(--text); }
.ta-legend .ta-link-btn { min-height: 44px; font-size: var(--fs-xs); }
.ta-text { position: relative; flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: var(--space-lg); font-size: var(--fs-lg); line-height: 1.75; color: var(--text); outline: none; white-space: pre-wrap; overflow-wrap: anywhere; }
.ta-text:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-glow); }
.ta-text-empty { color: var(--text-dim); font-size: var(--fs-md); white-space: normal; }
.ta-hm { color: inherit; border-radius: 3px; padding: 0 1px; background: transparent; }
.ta-hm1, .ta-h-lvl1 { background: var(--ta-heat-1); }
.ta-hm2, .ta-h-lvl2 { background: var(--ta-heat-2); }
.ta-hm3, .ta-h-lvl3 { background: var(--ta-heat-3); }
.ta-hm4, .ta-h-lvl4 { background: var(--ta-heat-4); }
.ta-hm4 { box-shadow: 0 1px 0 var(--red); }
.ta-hw, .ta-sw-water { background: var(--ta-water); }
.ta-hk1, .ta-sw-key1 { background: var(--ta-key-1); }
.ta-hk2, .ta-sw-key2 { background: var(--ta-key-2); }
.ta-hk2 { box-shadow: 0 1px 0 var(--accent); }
.ta-he { text-decoration: underline wavy var(--red); text-underline-offset: 3px; text-decoration-skip-ink: none; }
.ta-hx, .ta-sw-mixed { background: var(--ta-mixed); }
.ta-hl1, .ta-sw-long1 { background: var(--ta-long-1); }
.ta-hl2, .ta-sw-long2 { background: var(--ta-long-2); }
.ta-hm.is-focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.ta-side-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); flex-wrap: wrap; padding: var(--space-md) var(--space-lg); border-top: 1px solid var(--border); }
.ta-side-foot .tool-btn { min-height: 44px; gap: var(--space-xs); }
.ta-side-note { font-size: var(--fs-xs); color: var(--text-muted); line-height: 1.4; flex: 1 1 200px; }
.ta-side-note b { color: var(--text-dim); font-weight: 600; }
.ta-side-note.is-stale { color: var(--text); }
.ta-side-note.is-stale b { color: var(--accent); }
.ta-text-more { display: none; }

/* ── 8. Ошибки ── */
.ta-errs { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); }
.ta-err { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm) var(--space-md); flex-wrap: wrap; padding: var(--space-xs) var(--space-xs) var(--space-xs) var(--space-lg); border-bottom: 1px solid var(--border); }
.ta-err:last-child { border-bottom: 0; }
.ta-err-w { font-size: var(--fs-lg); color: var(--text); min-width: 0; }
.ta-err-w s { text-decoration: underline wavy var(--red); text-underline-offset: 3px; color: var(--text); }
.ta-err-w b { color: var(--green); font-weight: 600; }
.light .ta-err-w b { color: color-mix(in srgb, var(--green) 65%, var(--text)); }
.ta-err-w i { font-style: normal; color: var(--text-dim); font-size: var(--fs-md); }
.ta-err .ta-link-btn { font-size: var(--fs-sm); }
.ta-err-ctx { display: block; font-size: var(--fs-sm); color: var(--text-dim); overflow-wrap: anywhere; }
.ta-errs-ok { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-lg); border: 1px solid var(--border); border-radius: var(--radius); font-size: var(--fs-lg); color: var(--text); }
.ta-errs-ok svg { color: var(--green); flex-shrink: 0; }
.ta-errs-ok.is-muted svg { color: var(--text-dim); }
.ta-spell-meta { margin-top: var(--space-md); display: flex; flex-direction: column; gap: var(--space-2xs); font-size: var(--fs-lg); color: var(--text-dim); line-height: 1.5; }
.ta-spell-meta a { color: inherit; text-decoration: underline; text-underline-offset: 3px; display: inline-block; padding: var(--space-md) 0; margin: calc(-1 * var(--space-md)) 0; white-space: nowrap; }
.ta-spell-meta a:hover { color: var(--text); }

/* ── 9. Читаемость ── */
.ta-read-top { display: flex; align-items: center; gap: var(--space-md) var(--space-xl); flex-wrap: wrap; margin-bottom: var(--space-md); }
.ta-read-val { font-family: var(--font-heading); font-size: calc(var(--fs-base) + 21px); font-weight: 700; color: var(--text); line-height: 1; font-variant-numeric: tabular-nums; }
.ta-scale { flex: 1 1 260px; min-width: 0; }
.ta-scale-bar { position: relative; display: grid; grid-template-columns: 25fr 15fr 20fr 40fr; height: 10px; border-radius: 9999px; overflow: visible; gap: 2px; }
.ta-scale-bar i { display: block; height: 100%; }
.ta-scale-bar i:first-child { border-radius: 9999px 0 0 9999px; background: var(--ta-heat-4); }
.ta-scale-bar i:nth-child(2) { background: var(--ta-heat-2); }
.ta-scale-bar i:nth-child(3) { background: color-mix(in srgb, var(--green) 35%, transparent); }
.ta-scale-bar i:nth-child(4) { border-radius: 0 9999px 9999px 0; background: color-mix(in srgb, var(--green) 60%, transparent); }
.ta-scale-mark { position: absolute; top: -5px; left: var(--pos, 50%); width: 4px; height: 20px; margin-left: -2px; border-radius: 2px; background: var(--text); box-shadow: 0 0 0 2px var(--bg-card); }
.ta-scale-lbl { display: grid; grid-template-columns: 25fr 15fr 20fr 40fr; gap: 2px; margin-top: var(--space-xs); font-size: var(--fs-xs); color: var(--text-muted); }
.ta-scale-lbl span.is-cur { color: var(--text); font-weight: 600; }
.ta-long { margin-top: var(--space-xs); padding: var(--space-sm) var(--space-md); border-left: 3px solid var(--red); background: var(--red-bg); border-radius: 0 var(--radius-xs) var(--radius-xs) 0; font-size: var(--fs-sm); color: var(--text); line-height: 1.5; overflow-wrap: anywhere; }

/* ── 10. ТОП-10 ── */
.ta-gap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-lg) var(--space-xl); align-items: center; margin-top: var(--space-2xl); }
.ta-gap-t { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; }
.ta-gap p { margin: var(--space-xs) 0 0; font-size: var(--fs-md); color: var(--text-dim); line-height: 1.55; }
.ta-soon { font-size: var(--fs-xs); font-weight: 700; padding: 2px var(--space-sm); border-radius: 9999px; background: var(--yellow-bg); color: var(--yellow); text-transform: uppercase; letter-spacing: 0.04em; }
.ta-gap-act { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-2xs); }
.ta-gap-act .tool-btn, .ta-gap-act .ta-btn-ghost { min-height: 48px; gap: var(--space-xs); }
.ta-gap-act small { font-size: var(--fs-xs); color: var(--text-muted); }

/* ── 11. Что дальше ── */
.ta-next { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-md); }
.ta-next-card { display: flex; flex-direction: column; gap: var(--space-xs); padding: var(--space-lg); min-height: 44px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-card); text-decoration: none; color: var(--text); transition: border-color var(--dur-fast); }
.ta-next-card:hover { border-color: var(--accent); }
.light .ta-next-card { border-color: transparent; box-shadow: var(--shadow-sm); }
.ta-next-ico { width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--accent-glow); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; }
.ta-next-t { font-family: var(--font-heading); font-weight: 700; font-size: var(--fs-lg); }
.ta-next-d { font-size: var(--fs-sm); color: var(--text-dim); line-height: 1.45; }
.ta-next-go { margin-top: auto; font-size: var(--fs-sm); font-weight: 600; color: var(--accent); }
.ta-more { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-md); margin-top: var(--space-md); font-size: var(--fs-sm); color: var(--text-dim); }
.ta-more a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; color: var(--text); text-decoration: underline; text-decoration-color: var(--border-hover); text-underline-offset: 3px; }
.ta-more a:hover { color: var(--accent); }

/* ── 12. FAQ (аккордеон) ── */
.ta-acc { border-top: 1px solid var(--border); }
.ta-acc-i { border-bottom: 1px solid var(--border); }
.ta-acc-i > summary { list-style: none; min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); cursor: pointer; font-size: var(--fs-xl); font-weight: 600; color: var(--text); padding: var(--space-xs) 0; }
.ta-acc-i > summary::-webkit-details-marker { display: none; }
.ta-acc-i > summary svg { flex-shrink: 0; color: var(--text-dim); transition: transform var(--dur-fast); }
.ta-acc-i[open] > summary svg { transform: rotate(180deg); }
.ta-acc-a { padding: 0 0 var(--space-lg); font-size: var(--fs-lg); color: var(--text-dim); line-height: 1.6; }
.ta-acc-a b { color: var(--text); font-weight: 600; }
.ta-acc-a a { color: var(--accent); }

/* ── Квота исчерпана: окно подтверждения (dialog) и блок гостя ── */
.ta-dialog { display: flex; flex-direction: column; border-radius: var(--radius); background: var(--bg-surface); border: 1px solid var(--border-hover); box-shadow: var(--shadow-lg); padding: var(--space-xl); color: var(--text); }
.ta-dialog-cap { font-size: var(--fs-xs); color: var(--text-muted); margin-bottom: var(--space-sm); }
.ta-dialog h3 { font-family: var(--font-heading); font-size: calc(var(--fs-base) + 4px); font-weight: 700; color: var(--text); margin: 0 0 var(--space-sm); line-height: 1.3; }
.ta-dialog p { margin: 0 0 var(--space-md); font-size: var(--fs-md); color: var(--text-dim); line-height: 1.55; }
.ta-dialog p b { color: var(--text); }
.ta-dialog-act { display: flex; align-items: stretch; gap: var(--space-sm); flex-wrap: wrap; margin-top: auto; padding-top: var(--space-md); }
.ta-dialog-act .tool-btn, .ta-dialog-act .ta-btn-ghost { box-sizing: border-box; height: 44px; min-height: 44px; margin: 0; padding: 0 var(--space-xl); display: inline-flex; align-items: center; justify-content: center; font-size: var(--fs-md); font-weight: 600; line-height: 1; border-radius: var(--radius-sm); }
.ta-dialog-act .ta-btn-ghost { border-color: var(--border-hover); }
.ta-modal { width: min(480px, calc(100vw - 2 * var(--space-lg))); margin: auto; }
.ta-modal:not([open]) { display: none; }
.ta-modal::backdrop { background: color-mix(in srgb, var(--bg) 70%, transparent); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.ta-stop .ta-dialog { box-shadow: none; max-width: 640px; }
.ta-check { position: relative; display: inline-flex; align-items: center; gap: var(--space-sm); min-height: 44px; font-size: var(--fs-md); color: var(--text); cursor: pointer; }
.ta-check input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.ta-check-box { width: 20px; height: 20px; flex-shrink: 0; border-radius: var(--radius-xs); border: 1.5px solid var(--border-hover); background: var(--bg-input); display: inline-flex; align-items: center; justify-content: center; color: var(--on-accent); }
.ta-check-box svg { opacity: 0; }
.ta-check input:checked + .ta-check-box { background: var(--accent); border-color: var(--accent); }
.ta-check input:checked + .ta-check-box svg { opacity: 1; }
.ta-check input:focus-visible + .ta-check-box { box-shadow: 0 0 0 3px var(--accent-glow); }
.ta-check.is-disabled { color: var(--text-dim); cursor: not-allowed; }
.ta-check.is-disabled input { cursor: not-allowed; }
.ta-check.is-disabled .ta-check-box { border-style: dashed; }
.ta-link-login { align-self: center; min-height: 44px; display: inline-flex; align-items: center; padding: 0 var(--space-sm); color: var(--accent); font-size: var(--fs-md); font-weight: 600; text-decoration: none; }
.ta-link-login:hover { text-decoration: underline; }
.ta-link-login:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-xs); }

/* ── Планшет ── */
@media (max-width: 1100px) {
  .ta-sum { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ta-grid { grid-template-columns: minmax(0, 1fr) 400px; }
}
@media (max-width: 900px) {
  .ta-grid { grid-template-columns: minmax(0, 1fr); }
  .ta-grid > .ta-side { grid-column: 1; grid-row: auto; position: static; max-height: none; }
  .ta-text { max-height: 420px; }
  .ta-next { grid-template-columns: minmax(0, 1fr); }
}

/* ── Телефон ≤480 ── */
@media (max-width: 480px) {
  .ta-page.tool-page { padding: var(--space-xl) var(--space-lg) var(--space-4xl); }
  .ta-page .tool-input-card { padding: var(--space-lg); }
  .ta-page .tool-results { padding: var(--space-lg); }
  .ta-tab { flex: 1 1 0; justify-content: center; padding: 0 var(--space-sm); }
  .ta-textarea { min-height: 160px; }
  .ta-submit-row .tool-btn { width: 100%; }
  .ta-progress-bar { flex-basis: 96px; }
  .ta-verdict { padding: var(--space-md) var(--space-lg); }
  .ta-verdict-t { font-size: var(--fs-xl); }
  .ta-verdict-was { margin-left: 0; }
  .ta-sum { grid-template-columns: minmax(0, 1fr); }
  .ta-sum .metric-value { font-size: calc(var(--fs-base) + 9px); }
  .ta-card { padding: var(--space-lg); }
  /* таблицы → карточки (§3.6, §9: без горизонтального скролла при 375 px) */
  .ta-tbl--cards { border: 0; overflow: visible; }
  .ta-tbl--cards .ta-tbl thead { display: none; }
  .ta-tbl--cards .ta-tbl, .ta-tbl--cards .ta-tbl tbody { display: block; width: 100%; }
  .ta-tbl--cards .ta-tbl tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-xs) var(--space-sm); padding: var(--space-md); margin-bottom: var(--space-sm); border: 1px solid var(--border); border-radius: var(--radius-sm); }
  .ta-tbl--cards .ta-tbl td { display: block; padding: 0; border: 0; text-align: left; height: auto; }
  .ta-tbl--cards .ta-tbl td[data-l]::before { content: attr(data-l); display: block; font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
  .ta-tbl--cards .ta-tbl td.ta-td-phrase { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: var(--space-sm); }
  .ta-tbl--cards .ta-tbl td.ta-td-status { grid-column: 1 / -1; }
  .ta-tbl--cards .ta-tbl td.ta-td-main { grid-column: 1 / -1; }
  .ta-tbl--cards .ta-tbl tbody tr.is-picked td { background: transparent; box-shadow: none; }
  .ta-tbl--cards .ta-tbl tbody tr.is-picked { background: var(--accent-glow); border-color: var(--accent); }
  .ta-bar { display: none; }
  /* текст сворачивается */
  .ta-text { max-height: 260px; overflow: hidden; -webkit-mask-image: linear-gradient(180deg, var(--bg) 70%, transparent); mask-image: linear-gradient(180deg, var(--bg) 70%, transparent); }
  .ta-side.is-expanded .ta-text { max-height: none; -webkit-mask-image: none; mask-image: none; }
  .ta-text-more { display: flex; justify-content: center; padding: 0 var(--space-lg) var(--space-sm); }
  .ta-side.is-expanded .ta-text-more svg { transform: rotate(180deg); }
  .ta-side-foot .tool-btn { width: 100%; }
  .ta-gap { grid-template-columns: minmax(0, 1fr); }
  .ta-gap-act { align-items: stretch; }
  .ta-gap-act .tool-btn, .ta-gap-act .ta-btn-ghost { width: 100%; justify-content: center; }
  .ta-dialog { padding: var(--space-lg); }
  .ta-dialog-act .tool-btn, .ta-dialog-act .ta-btn-ghost { flex: 1 1 100%; justify-content: center; }
  .ta-page .tool-results-header-utils { width: 100%; flex-wrap: nowrap; }
  .ta-page .tool-results-header-utils .tool-copy-all { flex: 1 1 0; justify-content: center; }
  .ta-page .tool-consult-btn { flex: 1 1 100%; justify-content: center; }
  .ta-kw-sub { display: none; }
  .ta-stat-l { display: block; }
  .ta-stat { font-size: var(--fs-sm); padding: var(--space-xs) var(--space-md); }
  .ta-qi { display: inline-flex; vertical-align: -4px; margin-left: var(--space-xs); }
  .ta-scale-lbl span { min-width: 0; white-space: nowrap; letter-spacing: -0.01em; }
  .ta-scale-lbl span:first-child { white-space: normal; }
  .ta-scale-lbl span:last-child { text-align: right; }
  .ta-stat-hint { padding: var(--space-sm) var(--space-md) var(--space-md); }
  /* §3.6: на телефоне блоки идут по номерам — текст с подсветкой (4) после статистики и ключевых фраз */
  .ta-grid { margin-top: var(--space-xl); }
  .ta-uniq-opts, .ta-seg { width: 100%; }
  .ta-seg { flex-direction: column; }
  .ta-seg-i { justify-content: space-between; }
  /* вкладки отчёта — три в ряд */
  .ta-rtabs .ta-tab { flex: 1 1 auto; flex-direction: column; gap: 2px; padding: var(--space-2xs); font-size: var(--fs-sm); }
  .ta-empty { padding: var(--space-lg); }
  .ta-empty .tool-btn { width: 100%; justify-content: center; }
  .ta-search { flex-basis: 100%; }
}
