:root {
  --page: #f4f7f6;
  --surface: #ffffff;
  --surface-muted: #f8faf9;
  --ink: #172224;
  --muted: #647174;
  --line: #dce4e2;
  --line-strong: #c8d3d0;
  --teal: #0f766e;
  --teal-soft: #e6f4f1;
  --blue: #2674a5;
  --blue-soft: #e8f2f8;
  --amber: #a8640a;
  --amber-soft: #fff3df;
  --red: #b43a3a;
  --red-soft: #fceaea;
  --shadow: 0 14px 36px rgba(30, 50, 50, 0.12);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--page);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(38, 116, 165, 0.25);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 72px;
  padding: 12px max(24px, calc((100vw - 1480px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 15px;
  line-height: 1.3;
}

.brand div > span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.topbar-actions,
.period-switch {
  display: flex;
  align-items: center;
}

.topbar-actions {
  flex: 1;
  justify-content: flex-end;
  gap: 16px;
}

.topbar-commands {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-control {
  min-height: 42px;
  padding-left: 5px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-left: 1px solid var(--line);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.account-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.account-profile-link,
.viewer-account {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
}

.account-profile-link {
  padding: 4px 6px 4px 4px;
  border-radius: 5px;
}

.account-profile-link:hover {
  background: var(--surface-muted);
}

.account-control button {
  min-height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.account-control button:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

.period-switch {
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-muted);
}

.period-switch button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.period-switch button:hover {
  color: var(--ink);
}

.period-switch button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(25, 45, 45, 0.12);
}

.primary-action {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--teal);
  border-radius: 6px;
  background: var(--teal);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.danger-action {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid #c95555;
  border-radius: 6px;
  background: var(--surface);
  color: #a52f2f;
  font-size: 13px;
  font-weight: 750;
}

.danger-action:hover {
  border-color: var(--red);
  background: var(--red-soft);
  color: #8f2525;
}

.danger-action:disabled {
  cursor: wait;
  opacity: 0.65;
}

.secondary-action {
  min-height: 42px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.secondary-action:hover {
  border-color: #aab9b6;
  background: var(--surface-muted);
}

.primary-action:hover {
  background: #0b6861;
}

.primary-action:disabled {
  cursor: wait;
  opacity: 0.65;
}

main {
  width: min(1480px, calc(100% - 48px));
  margin: 24px auto 48px;
}

.run-notice {
  min-height: 44px;
  margin-bottom: 16px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #bfdad4;
  border-radius: 6px;
  background: var(--teal-soft);
  color: #295e59;
  font-size: 13px;
}

.activity-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--teal);
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  50% { opacity: 0.35; transform: scale(0.82); }
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--line);
}

.metric {
  position: relative;
  min-height: 130px;
  padding: 22px 24px;
  background: var(--surface);
}

.metric::after {
  content: "";
  position: absolute;
  top: 22px;
  right: 22px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--blue);
}

.metric-main::after,
.content-metric::after,
.health-metric::after {
  background: var(--teal);
}

.new-content-metric::after {
  background: #d29a30;
}

.metric > span,
.metric small,
.metric strong {
  display: block;
}

.metric > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.metric strong {
  margin-top: 12px;
  font-size: 36px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.metric small {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.metric .metric-explainer {
  display: grid;
  gap: 3px;
  line-height: 1.35;
}

.metric-explainer span {
  display: block;
}

.metric-explainer b {
  color: var(--ink);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.3fr) minmax(300px, 0.7fr);
  gap: 16px;
  margin-top: 16px;
}

.network-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.breakdown-panel {
  min-height: 360px;
  padding: 24px;
}

.coverage-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.breakdown-list {
  margin-top: 18px;
}

.breakdown-row + .breakdown-row {
  margin-top: 13px;
}

.breakdown-row > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
}

.breakdown-row strong {
  font-variant-numeric: tabular-nums;
}

.breakdown-bar {
  width: 100%;
  height: 5px;
  margin-top: 6px;
  display: block;
  overflow: hidden;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 3px;
  background: #e7edeb;
}

.breakdown-bar::-webkit-progress-bar {
  border-radius: inherit;
  background: #e7edeb;
}

.breakdown-bar::-webkit-progress-value {
  border-radius: inherit;
  background: var(--teal);
}

.breakdown-bar::-moz-progress-bar {
  border-radius: inherit;
  background: var(--teal);
}

.breakdown-panel + .breakdown-panel .breakdown-bar::-webkit-progress-value {
  background: var(--blue);
}

.breakdown-panel + .breakdown-panel .breakdown-bar::-moz-progress-bar {
  background: var(--blue);
}

.content-dynamics-panel {
  margin-top: 16px;
  padding: 24px;
}

.content-dynamics-summary {
  display: flex;
  gap: 20px;
  color: var(--muted);
  font-size: 12px;
}

.content-dynamics-summary strong {
  margin-left: 5px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.content-chart {
  height: 230px;
  margin-top: 18px;
  overflow: hidden;
}

.content-chart svg {
  width: 100%;
  height: 100%;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.chart-panel,
.plugin-panel {
  min-height: 390px;
  padding: 24px;
}

.panel-heading,
.sites-header,
.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.panel-heading h1,
.panel-heading h2,
.sites-header h2,
.drawer-header h2 {
  margin: 3px 0 0;
  font-size: 20px;
  line-height: 1.25;
}

.eyebrow {
  margin: 0;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.chart-legend {
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.chart-legend i {
  width: 18px;
  height: 3px;
  border-radius: 2px;
}

.legend-pageviews { background: var(--teal); }
.legend-visitors { background: var(--blue); }

.chart-wrap {
  width: 100%;
  height: 290px;
  margin-top: 22px;
  overflow: hidden;
}

.chart-wrap svg {
  display: block;
  width: 100%;
  height: 100%;
}

.chart-grid-line {
  stroke: #e7eceb;
  stroke-width: 1;
}

.chart-label {
  fill: #7a8789;
  font-size: 11px;
}

.chart-empty {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}

.plugin-distribution {
  margin-top: 24px;
  display: grid;
  gap: 16px;
}

.plugin-row {
  display: grid;
  gap: 7px;
}

.plugin-row > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.plugin-row strong {
  font-variant-numeric: tabular-nums;
}

.plugin-bar {
  display: block;
  width: 100%;
  height: 7px;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 3px;
  background: #edf1f0;
}

.plugin-bar::-webkit-progress-bar {
  border-radius: 3px;
  background: #edf1f0;
}

.plugin-bar::-webkit-progress-value {
  border-radius: 3px;
  background: var(--teal);
}

.plugin-bar::-moz-progress-bar {
  border-radius: 3px;
  background: var(--teal);
}

.plugin-row:nth-child(2) .plugin-bar::-webkit-progress-value { background: var(--blue); }
.plugin-row:nth-child(3) .plugin-bar::-webkit-progress-value { background: #7d6a9b; }
.plugin-row:nth-child(4) .plugin-bar::-webkit-progress-value { background: #bd7615; }
.plugin-row:nth-child(2) .plugin-bar::-moz-progress-bar { background: var(--blue); }
.plugin-row:nth-child(3) .plugin-bar::-moz-progress-bar { background: #7d6a9b; }
.plugin-row:nth-child(4) .plugin-bar::-moz-progress-bar { background: #bd7615; }

.last-run {
  margin-top: 24px;
  padding-top: 18px;
  display: grid;
  gap: 5px;
  border-top: 1px solid var(--line);
}

.last-run span {
  color: var(--muted);
  font-size: 12px;
}

.last-run strong {
  font-size: 13px;
  line-height: 1.45;
}

.sites-panel {
  margin-top: 16px;
  overflow: hidden;
}

.sites-header {
  padding: 22px 24px 18px;
  align-items: center;
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.filters input,
.filters select {
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
}

.filters input {
  width: 220px;
  padding: 0 12px;
}

.filters select {
  min-width: 150px;
  padding: 0 32px 0 10px;
}

.table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--line);
}

table {
  width: 1576px;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

/* Сумма ширин col-* в таблице сайтов: 1636 базовых, колонка органики и топ-10. */
.sites-panel table {
  width: 1850px;
}

/* Ширину таблицы позиций считает скрипт: колонок столько, сколько было проверок. */
.ranks-panel table {
  width: auto;
}

/* Строка итогов: держится первой при любой сортировке, поэтому отделяем ее от данных. */
.total-row td {
  background: var(--surface-muted);
  border-bottom: 2px solid var(--line-strong);
  font-weight: 750;
  color: var(--ink);
}

.total-row .domain-cell strong {
  color: var(--ink);
}

.total-row .domain-cell small {
  color: var(--muted);
  font-weight: 600;
}

.total-row .country-code,
.total-row .status {
  background: var(--surface);
}

.total-row:hover td {
  background: var(--surface-muted);
}

.col-domain { width: 270px; }
.col-country { width: 76px; }
.col-group { width: 180px; }
.col-source { width: 180px; }
.col-pageviews { width: 104px; }
.col-visitors { width: 112px; }
.col-sessions { width: 96px; }
.col-organic { width: 110px; }
.col-published { width: 124px; }
.col-new-urls { width: 112px; }
.col-indexed { width: 116px; }
.col-top10 { width: 104px; }
.col-status { width: 136px; }
.col-updated { width: 130px; }

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid #e8edec;
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

th {
  overflow: hidden;
  color: var(--muted);
  background: var(--surface-muted);
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.sort-button {
  display: inline-flex;
  max-width: 100%;
  padding: 5px 16px 5px 0;
  position: relative;
  align-items: center;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: inherit;
  text-transform: inherit;
  white-space: nowrap;
}

th.numeric .sort-button {
  justify-content: flex-end;
}

.sort-button::after {
  content: "";
  width: 6px;
  height: 6px;
  position: absolute;
  right: 2px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  opacity: 0.35;
  transform: rotate(45deg) translateY(-2px);
}

.sort-button.active::after {
  opacity: 1;
}

th[aria-sort="ascending"] .sort-button::after {
  transform: rotate(225deg) translate(-1px, -1px);
}

.sort-button:hover,
.sort-button:focus-visible {
  color: var(--ink);
}

.sort-button:focus-visible {
  outline: 2px solid rgba(15, 118, 110, 0.35);
  outline-offset: 2px;
  border-radius: 2px;
}

th:first-child,
td:first-child { padding-left: 24px; }
th:last-child,
td:last-child { padding-right: 24px; }

tbody tr {
  transition: background-color 120ms ease;
}

tbody tr[data-domain] {
  cursor: pointer;
}

tbody tr[data-domain]:hover {
  background: #f5faf8;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.domain-cell strong,
.domain-cell small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.domain-cell a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.domain-cell a:hover strong {
  color: var(--teal);
}

.domain-cell strong {
  color: #172a2c;
  font-size: 13px;
}

.domain-cell small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.country-code,
.source-label {
  color: #4f5c5f;
  font-size: 12px;
}

.site-type-badge {
  display: inline-flex;
  max-width: 100%;
  min-width: 0;
  min-height: 24px;
  padding: 4px 8px;
  align-items: center;
  border: 1px solid #bfd9d4;
  border-radius: 4px;
  background: #edf7f4;
  color: #17665e;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.muted-dash { color: var(--muted); }

.drawer-status-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.source-label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.new-url-cell {
  color: #8a5b0a;
  font-weight: 750;
}

.status {
  max-width: 100%;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #98a4a4;
}

.status-healthy { color: #1d6b60; }
.status-healthy::before { background: #218c7e; }
.status-error { color: var(--red); }
.status-error::before { background: var(--red); }
.status-pending { color: #7d6c4d; }
.status-pending::before { background: #bb8736; }
.status-stale { color: #865d1b; }
.status-stale::before { background: #c78a2b; }

.updated-cell {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loading-row td,
.empty-row td {
  height: 120px;
  text-align: center;
  color: var(--muted);
}

.table-footer {
  min-height: 48px;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(18, 32, 33, 0.32);
}

.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 50;
  width: min(540px, 100%);
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: translateX(105%);
  transition: transform 180ms ease;
}

.detail-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  min-height: 92px;
  padding: 22px 24px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
}

.drawer-header h2 {
  max-width: 420px;
  overflow-wrap: anywhere;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.icon-button:hover {
  background: var(--surface-muted);
}

.drawer-content {
  padding: 24px;
  overflow-y: auto;
}

.drawer-status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.site-link {
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.site-link:hover { text-decoration: underline; }

.drawer-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.drawer-metric {
  min-width: 0;
  padding: 14px;
  border-right: 1px solid var(--line);
}

.drawer-metric:last-child { border-right: 0; }
.drawer-metric span,
.drawer-metric strong { display: block; }
.drawer-metric span { color: var(--muted); font-size: 11px; }
.drawer-metric strong {
  margin-top: 7px;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-chart {
  height: 150px;
  margin: 24px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.mini-chart svg { width: 100%; height: 100%; }

.detail-section {
  margin-top: 24px;
}

.detail-section h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.content-overview {
  margin-top: 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-muted);
}

.content-overview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.content-overview h3 {
  margin: 0;
  font-size: 14px;
}

.content-overview p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.index-state {
  padding: 4px 7px;
  border-radius: 4px;
  background: var(--amber-soft);
  color: #7a561e;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.index-state-ok {
  background: var(--teal-soft);
  color: #1d6b60;
}

.content-counts {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.content-counts span,
.content-counts strong {
  display: block;
}

.content-counts span {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.content-counts strong {
  margin-top: 4px;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.url-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.url-list li {
  padding: 9px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  border-bottom: 1px solid #edf1f0;
}

.url-list a {
  display: block;
  overflow: hidden;
  color: #3e4c4e;
  font-size: 12px;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.url-list a:hover {
  color: var(--blue);
  text-decoration: underline;
}

.url-verdict {
  align-self: center;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.url-verdict-pass { color: var(--teal); }
.url-verdict-fail,
.url-verdict-neutral { color: var(--red); }

.url-statuses {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 4px;
}

.ranked-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.ranked-list li {
  min-height: 42px;
  padding: 9px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid #edf1f0;
  font-size: 12px;
}

.ranked-list span {
  overflow-wrap: anywhere;
  color: #3e4c4e;
}

.ranked-list strong {
  font-variant-numeric: tabular-nums;
}

.detail-empty,
.detail-error {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.detail-error {
  border-color: #efc7c7;
  background: var(--red-soft);
  color: #8d3434;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 80;
  max-width: min(420px, calc(100% - 32px));
  padding: 12px 16px;
  transform: translateX(-50%);
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 13px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(18, 32, 33, 0.28);
  backdrop-filter: blur(2px);
}

.confirm-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 70;
  width: min(500px, calc(100% - 32px));
  padding: 24px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 16px;
  transform: translate(-50%, -50%);
  border: 1px solid #e6c3c3;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.confirm-dialog-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
  font-size: 18px;
  font-weight: 850;
}

.confirm-dialog h2 {
  margin: 5px 0 10px;
  font-size: 20px;
}

.confirm-dialog p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.confirm-dialog p strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.confirm-dialog-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.manage-modal {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 70;
  width: min(1120px, calc(100% - 32px));
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  grid-template-rows: 88px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-width: 0 0 0 1px;
  border-radius: 8px 0 0 8px;
  background: var(--surface);
  box-shadow: -18px 0 48px rgba(30, 50, 50, 0.14);
}

.manage-header {
  grid-column: 1 / -1;
  min-height: 88px;
  padding: 20px 28px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.site-group-editor {
  min-height: 58px;
  padding: 10px 0;
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.site-group-editor label,
.site-group-editor input {
  width: 100%;
}

.site-group-editor input {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.site-group-editor input:focus {
  border-color: var(--teal);
  outline: 2px solid var(--teal-soft);
  outline-offset: 0;
}

.site-group-count {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

@media (max-width: 560px) {
  .site-group-editor {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .site-group-editor label {
    grid-column: 1 / -1;
  }
}

.manage-header h2 {
  margin: 4px 0 0;
  font-size: 19px;
}

.manage-tabs {
  min-width: 0;
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--surface-muted);
}

.manage-tabs button {
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  display: grid;
  align-content: center;
  gap: 3px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

.manage-tabs button span,
.manage-tabs button small {
  display: block;
}

.manage-tabs button span {
  color: var(--ink);
  font-size: 13px;
}

.manage-tabs button small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 550;
}

.manage-tabs button.active {
  background: var(--surface);
  box-shadow: inset 3px 0 0 var(--teal), 0 1px 3px rgba(25, 45, 45, 0.08);
}

.manage-body {
  min-width: 0;
  padding: 28px 30px 36px;
  overflow: auto;
}

.manage-form {
  display: grid;
  gap: 16px;
}

#domain-form {
  max-width: 720px;
}

.manage-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.manage-form input,
.manage-form select,
.all-urls-panel input {
  width: 100%;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
}

.manage-form input[type="file"] {
  padding: 8px 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-actions {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.form-status {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.gsc-list {
  margin-bottom: 22px;
  display: grid;
  border-top: 1px solid var(--line);
}

.gsc-account {
  min-height: 62px;
  padding: 11px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.gsc-account > div:last-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gsc-account strong,
.gsc-account span {
  display: block;
}

.gsc-account strong {
  font-size: 13px;
}

.gsc-account span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.gsc-account .icon-button {
  width: 32px;
  height: 32px;
  font-size: 19px;
}

.gsc-health {
  color: var(--teal) !important;
  font-weight: 700;
}

.gsc-health.is-error {
  color: var(--red) !important;
}

.group-assignments {
  margin-top: 24px;
  border-top: 1px solid var(--line);
}

.group-assignment-heading,
.group-assignment-row {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.group-assignment-heading span,
.group-assignment-row span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-assignment-row select {
  width: 150px;
  min-height: 36px;
  padding: 0 30px 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
}

.ga4-account-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.ga4-account-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.compact-action {
  min-height: 32px;
  padding: 0 10px;
  font-size: 11px;
}

.manage-modal.speedy-open {
  width: min(1120px, calc(100% - 32px));
}

.speedy-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.speedy-summary > div {
  min-height: 94px;
  padding: 14px 16px;
  border-right: 1px solid var(--line);
}

.speedy-summary > div:last-child { border-right: 0; }

.speedy-summary span,
.speedy-summary strong,
.speedy-summary small {
  display: block;
}

.speedy-summary span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.speedy-summary strong {
  margin-top: 6px;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.speedy-summary small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.speedy-toolbar,
.speedy-actionbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.speedy-toolbar {
  margin-top: 16px;
}

.speedy-search {
  flex: 1;
}

.speedy-toolbar input,
.speedy-toolbar select {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
}

.speedy-toolbar select { width: 170px; }

.speedy-actionbar {
  min-height: 62px;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.speedy-actionbar > div {
  display: flex;
  gap: 8px;
}

.speedy-confirm {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 62px;
  padding: 12px 14px;
  border: 1px solid #d8c58f;
  border-top: 0;
  background: #fffaf0;
}

.speedy-confirm[hidden] {
  display: none;
}

.speedy-confirm > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.speedy-confirm strong {
  font-size: 13px;
}

.speedy-confirm span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.speedy-confirm.is-success {
  border-color: #9ccbc3;
  background: #f1faf8;
}

.speedy-confirm.is-error {
  border-color: #e0aaa4;
  background: #fff5f3;
}

.speedy-confirm-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.speedy-select-all {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
}

.speedy-selected-count {
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
}

.speedy-table-wrap {
  max-height: 390px;
  overflow: auto;
  border: 1px solid var(--line);
  border-top: 0;
}

.speedy-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.speedy-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 10px;
  text-align: left;
  text-transform: uppercase;
}

.speedy-table th:nth-child(1) { width: 40px; }
.speedy-table th:nth-child(2) { width: 34%; }
.speedy-table th:nth-child(3) { width: 90px; }
.speedy-table th:nth-child(4) { width: 140px; }
.speedy-table th:nth-child(5) { width: 150px; }
.speedy-table th:nth-child(6) { width: 130px; }

.speedy-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 12px;
}

.speedy-table tbody tr:last-child td { border-bottom: 0; }

.speedy-table a {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.speedy-table a:hover { color: var(--blue); }

.speedy-table td > small,
.speedy-task-row small,
.speedy-task-row span {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.speedy-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.speedy-sources span {
  padding: 3px 5px;
  border: 1px solid #b9d1e2;
  border-radius: 4px;
  background: #edf6fb;
  color: #285f80;
  font-size: 9px;
  font-weight: 800;
}

.speedy-state {
  display: inline-block;
  padding: 4px 6px;
  border-radius: 4px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.speedy-state.is-indexed { background: var(--teal-soft); color: #1d6b60; }
.speedy-state.is-unindexed { background: var(--amber-soft); color: #7a561e; }
.speedy-state.is-running { background: #eaf3f9; color: #286488; }
.speedy-state.is-blocked { background: var(--red-soft); color: #8d3434; }
.speedy-muted { color: var(--muted); font-size: 11px; }

.speedy-tasks {
  margin-top: 22px;
}

.speedy-section-heading,
.speedy-task-row {
  display: grid;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.speedy-section-heading {
  grid-template-columns: 1fr auto;
  min-height: 42px;
}

.speedy-section-heading span {
  color: var(--muted);
  font-size: 11px;
}

.speedy-task-row {
  grid-template-columns: minmax(0, 1.4fr) minmax(160px, 0.8fr) 130px;
  min-height: 62px;
}

.speedy-task-row > div:last-child { text-align: right; }

.speedy-settings {
  margin-top: 22px;
  border-top: 1px solid var(--line);
}

.speedy-settings summary {
  padding: 16px 0;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.speedy-settings .manage-form {
  padding-top: 4px;
}

.ga4-property-list {
  margin: 18px 0 22px;
  display: grid;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.ga4-property-heading,
.ga4-property {
  display: grid;
  align-items: center;
  gap: 12px;
}

.ga4-property-heading {
  grid-template-columns: 1fr auto;
  padding: 11px 14px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.ga4-property {
  grid-template-columns: minmax(0, 1fr) 190px 104px;
  min-height: 70px;
  padding: 11px 14px;
  border-top: 1px solid var(--line);
}

.ga4-property > div,
.ga4-property strong,
.ga4-property span {
  min-width: 0;
}

.ga4-property strong,
.ga4-property span {
  display: block;
}

.ga4-property strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ga4-property span {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ga4-property select {
  width: 100%;
  min-height: 36px;
  padding: 0 28px 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
}

.ga4-property-state {
  margin: 0 !important;
  color: var(--teal) !important;
  font-weight: 700;
  text-align: right;
  white-space: normal !important;
}

.ga4-property-state.is-error {
  color: var(--red) !important;
}

.ga4-empty-properties {
  padding: 18px;
}

.access-list {
  margin-bottom: 22px;
  display: grid;
  border-top: 1px solid var(--line);
}

.access-user {
  min-height: 64px;
  padding: 11px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.access-user strong,
.access-user span {
  display: block;
}

.access-user strong {
  font-size: 13px;
}

.access-user span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.access-user-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.access-role {
  margin: 0 !important;
  padding: 4px 7px;
  border-radius: 4px;
  background: var(--surface-muted);
  color: var(--muted) !important;
  font-weight: 700;
}

.access-role.owner {
  background: var(--teal-soft);
  color: var(--teal) !important;
}

.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.password-field button {
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface-muted);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
}

.created-access {
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #b9ddd6;
  border-radius: 6px;
  background: var(--teal-soft);
}

.created-access strong,
.created-access span {
  display: block;
}

.created-access strong {
  color: var(--teal);
  font-size: 12px;
}

.created-access span {
  margin-top: 4px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.auth-page {
  background: #e8eeec;
}

.auth-shell {
  width: 100%;
  min-height: 100vh;
  padding: 28px;
  margin: 0;
  display: grid;
  place-items: center;
}

.auth-frame {
  width: min(920px, 100%);
  min-height: 570px;
  display: grid;
  grid-template-columns: minmax(330px, 0.92fr) minmax(420px, 1.08fr);
  overflow: hidden;
  border: 1px solid #cbd5d2;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(31, 49, 47, 0.14);
}

.auth-visual {
  position: relative;
  min-height: 570px;
  overflow: hidden;
  background: #182322;
}

.auth-visual::before,
.auth-visual::after {
  content: "";
  position: absolute;
  background: #293635;
}

.auth-visual::before {
  top: 0;
  right: 76px;
  width: 1px;
  height: 100%;
}

.auth-visual::after {
  right: 0;
  bottom: 92px;
  width: 100%;
  height: 1px;
}

.auth-geometry {
  position: absolute;
  inset: 50% auto auto 50%;
  width: min(270px, calc(100% - 76px));
  aspect-ratio: 0.78;
  transform: translate(-50%, -50%);
}

.geometry-outline,
.geometry-block,
.geometry-line {
  position: absolute;
  display: block;
}

.geometry-outline {
  inset: 0 12% 7% 0;
  border: 1px solid #64716f;
}

.geometry-block-a {
  top: 13%;
  left: 10%;
  width: 48%;
  height: 37%;
  border: 1px solid #52605e;
  background: #24302f;
}

.geometry-block-b {
  right: 0;
  bottom: 0;
  width: 54%;
  height: 42%;
  background: #167c72;
}

.geometry-block-c {
  right: 12%;
  top: 0;
  width: 28%;
  height: 22%;
  background: #d35e45;
}

.geometry-line-a {
  left: 17%;
  bottom: 0;
  width: 1px;
  height: 43%;
  background: #9ba8a6;
}

.geometry-line-b {
  right: 0;
  top: 33%;
  width: 45%;
  height: 1px;
  background: #9ba8a6;
}

.auth-form-panel {
  width: 100%;
  min-height: 570px;
  padding: 72px clamp(40px, 6vw, 76px);
  display: flex;
  align-items: center;
}

.login-form {
  width: 100%;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 21px;
}

.login-form header {
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.login-form h1 {
  margin: 0;
  font-size: 42px;
  line-height: 1;
  letter-spacing: 0;
}

.form-index {
  order: 2;
  padding-top: 5px;
  color: #879390;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.login-form input {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid #c7d1ce;
  border-radius: 4px;
  background: #f7f9f8;
  color: var(--ink);
}

.login-form input:hover {
  border-color: #aebbb8;
}

.login-form input:focus {
  border-color: #55716d;
  background: #fff;
}

.login-form .primary-action {
  width: 100%;
  min-height: 52px;
  margin-top: 8px;
  padding: 0 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-color: #172224;
  background: #172224;
  border-radius: 4px;
  font-size: 13px;
}

.login-form .primary-action:hover {
  border-color: #263332;
  background: #263332;
}

.login-form .primary-action span:last-child {
  font-size: 18px;
  font-weight: 400;
}

.login-error {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #edcaca;
  border-radius: 5px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
  line-height: 1.45;
}

.brand-link {
  color: inherit;
  text-decoration: none;
}

.site-main {
  width: min(1480px, calc(100% - 48px));
}

.site-identity {
  min-height: 118px;
  padding: 8px 0 22px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.site-identity h1 {
  margin: 5px 0 0;
  font-size: 32px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.site-identity .site-type-badge {
  margin-top: 10px;
}

.site-identity p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.site-identity-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.link-action {
  text-decoration: none;
}

.site-metrics {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.site-metrics article {
  min-width: 0;
  min-height: 118px;
  padding: 18px;
  background: var(--surface);
}

.site-metrics span,
.site-metrics strong,
.site-metrics small {
  display: block;
}

.site-metrics span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.site-metrics strong {
  margin-top: 12px;
  overflow: hidden;
  font-size: 27px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
}

.site-metrics small {
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
}

.site-metrics .accent-metric {
  background: #fff9ee;
}

.site-metrics .accent-metric strong {
  color: #8a5b0a;
}

.site-dashboard-grid,
.site-list-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.site-chart-panel,
.index-panel,
.list-panel,
.all-urls-panel {
  padding: 22px;
}

.site-chart-panel .chart-wrap {
  height: 260px;
}

.legend-added { background: #d29a30; }
.legend-total { background: #5a6578; }

.index-panel {
  margin-top: 16px;
}

.index-details {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--line);
}

.index-details > div {
  min-width: 0;
  min-height: 86px;
  padding: 14px;
  background: var(--surface-muted);
}

.index-details span,
.index-details strong {
  display: block;
}

.index-details span {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.index-details strong {
  margin-top: 8px;
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
}

.index-panel .detail-error {
  margin-top: 14px;
}

.index-chart-heading {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.index-chart-wrap {
  height: 190px;
  margin-top: 10px;
}

.index-chart-wrap svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.legend-indexed { background: #0f766e; }
.legend-pending { background: #d29a30; }

.list-panel {
  min-height: 330px;
}

.site-list-content {
  margin-top: 16px;
}

.detailed-url-list li > div {
  min-width: 0;
}

.detailed-url-list small {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.url-verdict-removed { color: var(--red); }

.all-urls-panel {
  margin-top: 16px;
}

.all-urls-panel input {
  width: min(300px, 100%);
}

.owner-main {
  padding-bottom: 48px;
}

.owner-identity {
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.owner-identity h1 {
  margin: 5px 0 6px;
  font-size: 32px;
  letter-spacing: 0;
}

.owner-identity > div > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.owner-role {
  padding: 8px 10px;
  border: 1px solid #b8d9d4;
  border-radius: 4px;
  color: var(--teal);
  background: var(--teal-soft);
  font-size: 11px;
  font-weight: 800;
}

.owner-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.owner-summary-grid article {
  min-width: 0;
  min-height: 134px;
  padding: 22px;
  background: var(--surface);
}

.owner-summary-grid span,
.owner-summary-grid strong,
.owner-summary-grid small {
  display: block;
}

.owner-summary-grid span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.owner-summary-grid strong {
  margin-top: 15px;
  overflow: hidden;
  color: var(--ink);
  font-size: 31px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
}

.owner-summary-grid small {
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
}

.owner-account-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 16px;
}

.owner-account-panel,
.owner-health-panel {
  min-height: 205px;
  padding: 22px;
}

.owner-account-details {
  margin: 20px 0 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--line);
}

.owner-account-details div {
  min-width: 0;
  min-height: 82px;
  padding: 14px;
  background: var(--surface-muted);
}

.owner-account-details dt {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.owner-account-details dd {
  margin: 9px 0 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owner-health-value {
  margin-top: 22px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.owner-health-value strong {
  font-size: 34px;
  line-height: 1;
}

.owner-health-value span,
.owner-health-panel > p {
  color: var(--muted);
  font-size: 12px;
}

.owner-health-panel > p {
  margin: 18px 0 0;
  overflow-wrap: anywhere;
}

.owner-sites-panel {
  margin-top: 16px;
  overflow: hidden;
}

.owner-search-field input {
  width: 240px;
}

.owner-sites-table {
  width: 1246px;
}

.owner-col-domain { width: 280px; }
.owner-col-country { width: 76px; }
.owner-col-published { width: 120px; }
.owner-col-estimate { width: 120px; }
.owner-col-results { width: 120px; }
.owner-col-checked { width: 120px; }
.owner-col-found { width: 110px; }
.owner-col-status { width: 130px; }
.owner-col-updated { width: 170px; }

.owner-estimate {
  color: var(--blue);
  font-weight: 800;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-nav a {
  min-height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.main-nav a:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

.main-nav a.active {
  background: var(--teal-soft);
  color: var(--teal);
}

.links-main {
  padding-bottom: 48px;
}

.links-identity {
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.links-identity h1 {
  margin: 5px 0 6px;
  font-size: 32px;
  letter-spacing: 0;
}

.links-identity > div > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.links-sources {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.links-source-chip {
  padding: 8px 12px;
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.links-source-chip strong {
  font-size: 12px;
}

.links-source-chip small {
  color: var(--muted);
  font-size: 11px;
}

.links-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

/* У клиента карточки бюджета нет, иначе в сетке остается пустая ячейка. */
.links-summary-grid.no-budget { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.links-summary-grid article {
  min-width: 0;
  min-height: 134px;
  padding: 22px;
  background: var(--surface);
}

.links-summary-grid span,
.links-summary-grid strong,
.links-summary-grid small {
  display: block;
}

.links-summary-grid span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.links-summary-grid strong {
  margin-top: 15px;
  overflow: hidden;
  font-size: 31px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
}

.links-summary-grid small {
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
}

.links-import-panel {
  margin-top: 16px;
  padding: 22px;
}

.links-import-panel .manage-form {
  margin-top: 18px;
  max-width: 720px;
}

.links-table-panel {
  margin-top: 16px;
  overflow: hidden;
}

.links-table {
  width: 1630px;
}

.links-col-type { width: 118px; }
.links-col-source { width: 300px; }
.links-col-target { width: 320px; }
.links-col-anchor { width: 260px; }
.links-col-date { width: 124px; }
.links-col-status { width: 170px; }
.links-col-index { width: 192px; }
.links-col-price { width: 100px; }

.links-index-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.links-index-cell small {
  color: var(--muted);
  font-size: 11px;
}

.links-index-action {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.links-index-action:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.links-index-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* Line up with .sites-header above and .table-footer below, both at 24px. */
  padding: 0 24px 18px;
}

/* Borrowed from the SpeedyIndex modal, where the bar divides two stacked
   toolbars. Here the filters above and the table below draw their own edges,
   so the divider doubles up and the 62px floor just adds dead space. */
.links-index-actions {
  min-height: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  border-bottom: 0;
}

.links-index-actions > div {
  align-items: center;
}

/* Same story: in the modal this callout hangs off the bar above it, so it ships
   without a top edge. Standalone here it needs all four. Width and style only —
   the colour has to keep coming from .is-success / .is-error. */
.links-index-panel .speedy-confirm {
  border-top-width: 1px;
  border-top-style: solid;
  border-radius: 6px;
}

.links-index-info {
  position: relative;
  display: inline-flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  font-style: italic;
  cursor: help;
}

.links-index-info:hover,
.links-index-info:focus-visible {
  border-color: var(--blue);
  color: var(--blue);
  outline: none;
}

.links-index-tip {
  /* Anchored downward on purpose: .links-table-panel clips overflow, and the
     table below always leaves room where the space above may not. */
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  min-width: 260px;
  padding: 10px 12px;
  border-radius: 6px;
  background: #24302f;
  color: #f2f6f5;
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
  line-height: 1.6;
  white-space: pre-line;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transition: opacity 120ms ease;
}

.links-index-info:hover .links-index-tip,
.links-index-info:focus-visible .links-index-tip {
  opacity: 1;
  visibility: visible;
}

.links-url-cell a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.links-url-cell strong,
.links-url-cell small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.links-url-cell strong {
  color: #172a2c;
  font-size: 13px;
}

.links-url-cell a:hover strong {
  color: var(--teal);
}

.links-url-cell small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.links-type-badge {
  padding: 4px 8px;
  display: inline-flex;
  border: 1px solid #cbe0f0;
  border-radius: 4px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 750;
}

.links-anchor-cell {
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.links-empty-anchor {
  color: var(--muted);
  font-weight: 400;
}

.links-status-cell {
  overflow: hidden;
  color: #4f5c5f;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.links-rel {
  font-weight: 600;
}

.links-rel-dofollow { color: var(--teal); }
.links-rel-nofollow { color: var(--amber); }
.links-rel-missing { color: var(--red); }
.links-rel-unknown { color: var(--muted); font-weight: 400; }

/* Заголовок и переключатель вида держим в одной строке, фильтры с календарем
   уходят отдельной строкой под ними: иначе кнопки и фильтры встают уступом. */
.links-table-panel .sites-header {
  flex-wrap: wrap;
  row-gap: 14px;
}

.links-view-switch {
  flex: 0 0 auto;
  margin-left: auto;
}

.links-table-panel .filters {
  flex: 1 0 100%;
}

.links-graph-view {
  border-top: 1px solid var(--line);
}

.links-graph-toolbar {
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
}

.links-graph-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.links-graph-tools select {
  height: 38px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
}

.links-graph-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
}

.links-graph-canvas {
  position: relative;
  min-height: 700px;
  overflow: hidden;
  background:
    radial-gradient(circle at 1px 1px, #dde5e3 1px, transparent 0) 0 0 / 26px 26px,
    var(--surface);
}

.links-graph-svg {
  display: block;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  cursor: grab;
  touch-action: none;
}

.links-graph-svg.is-panning {
  cursor: grabbing;
}

.links-graph-edge {
  stroke-opacity: 0.42;
  transition: stroke-opacity 120ms ease;
}

.links-graph-svg.is-focused .links-graph-edge.is-dim {
  stroke-opacity: 0.07;
}

.links-graph-edge.is-active {
  stroke-opacity: 0.95;
}

/* Fill and rim come from custom properties the graph sets per node (the heatmap
   step for acceptors), so the hover/selection rules below can still take over. */
.links-graph-node {
  fill: var(--node-fill, #b9c9c7);
  stroke: var(--node-stroke, var(--surface));
  stroke-width: 1.5;
  cursor: pointer;
  transition: opacity 120ms ease;
}

.links-graph-node.role-donor { --node-fill: #b9c9c7; }
.links-graph-node.role-target,
.links-graph-node.role-transit { --node-fill: #fcc851; }
.links-graph-node.role-transit { stroke-width: 3; stroke-dasharray: 3 2; }
.links-graph-node.is-service { stroke-width: 2.5; }

.links-graph-node.is-dim { opacity: 0.22; }
.links-graph-node.is-active { stroke: var(--ink); stroke-width: 3; stroke-dasharray: none; }
.links-graph-node.is-selected { stroke: var(--ink); stroke-width: 3; stroke-dasharray: none; }

.links-graph-label {
  fill: #3d4a4c;
  font-size: 11px;
  font-weight: 650;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 3.5px;
  stroke-linejoin: round;
  pointer-events: none;
}

.links-graph-tooltip {
  position: absolute;
  z-index: 5;
  max-width: 280px;
  padding: 10px 12px;
  display: grid;
  gap: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--muted);
  font-size: 12px;
  pointer-events: none;
}

.links-graph-tooltip strong {
  color: var(--ink);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.links-graph-tooltip b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.links-graph-empty {
  position: absolute;
  inset: 0;
  margin: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

.links-graph-side {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  max-height: 700px;
  border-left: 1px solid var(--line);
  background: var(--surface-muted);
}

.links-graph-legend {
  display: grid;
  gap: 8px;
}

.links-graph-legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: var(--muted);
  font-size: 12px;
}

.links-graph-legend-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.links-graph-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.links-graph-dot.role-donor { background: #b9c9c7; }
.links-graph-dot.role-target { background: #ef7524; }
.links-graph-dot.role-transit { background: #f9a13a; box-shadow: 0 0 0 2px #c16c27; }
.links-graph-dot.role-service {
  border-radius: 3px;
  background: linear-gradient(90deg, #2674a5 50%, #a8640a 50%);
}

.links-graph-heat {
  display: grid;
  gap: 4px;
}

.links-graph-heat-bar {
  height: 9px;
  border-radius: 5px;
  border: 1px solid var(--line);
}

.links-graph-heat-ticks {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.links-graph-edge-key {
  width: 16px;
  height: 3px;
  border-radius: 2px;
  flex: 0 0 auto;
}

.links-graph-hint {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.links-graph-caption {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.links-graph-detail {
  display: grid;
  gap: 10px;
  align-content: start;
}

.links-graph-detail-head h3 {
  margin: 4px 0 0;
  font-size: 17px;
  overflow-wrap: anywhere;
}

.links-graph-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--line);
}

.links-graph-stats div {
  min-width: 0;
  padding: 10px 12px;
  background: var(--surface);
}

.links-graph-stats span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.links-graph-stats strong {
  margin-top: 6px;
  display: block;
  font-size: 20px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.links-graph-stats .links-graph-budget {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.links-graph-stats small {
  margin-top: 6px;
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.links-graph-services,
.links-graph-top {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 2px;
}

.links-graph-services li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px 34px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.links-graph-services li > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.links-graph-services i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.links-graph-services strong,
.links-graph-top strong {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.links-graph-bar {
  height: 6px;
  border-radius: 3px;
  background: #e3eae8;
  overflow: hidden;
}

.links-graph-bar b {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--teal);
}

.links-graph-top button {
  width: 100%;
  padding: 5px 6px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 62px 34px;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.links-graph-top button:hover {
  background: var(--surface);
}

.links-graph-top-name {
  overflow: hidden;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.links-graph-direction {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.links-graph-detail-actions {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* --- Позиции по запросам ------------------------------------------------- */

.rank-summary {
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.rank-summary > div {
  min-height: 94px;
  padding: 14px 18px;
  border-right: 1px solid var(--line);
}

.rank-summary > div:last-child { border-right: 0; }

.rank-summary span,
.rank-summary strong,
.rank-summary small {
  display: block;
}

.rank-summary span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.rank-summary strong {
  margin-top: 6px;
  font-size: 26px;
  font-variant-numeric: tabular-nums;
}

.rank-summary small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.ranks-panel .sites-header h1 {
  margin: 3px 0 0;
  font-size: 20px;
  line-height: 1.25;
}

.rank-table-wrap {
  max-height: calc(100vh - 340px);
  min-height: 320px;
  overflow: auto;
}

.rank-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
}

/* Домен, гео и запрос остаются на месте: колонок дат со временем становится
   больше ширины экрана, и без закрепления строка теряет подпись. */
.rank-table .rank-sticky {
  position: sticky;
  z-index: 2;
  background: var(--surface);
}

.rank-table thead .rank-sticky {
  z-index: 4;
  background: var(--surface-muted);
}

.rank-table .rank-sticky-1 { left: 0; }
.rank-table .rank-sticky-2 { left: 230px; }
.rank-table .rank-sticky-3 {
  left: 294px;
  box-shadow: 1px 0 0 var(--line);
}

.rank-table tbody tr:hover .rank-sticky {
  background: #f5faf8;
}

.rank-table .rank-sticky-1 a {
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
}

.rank-table .rank-sticky-1 a:hover {
  color: var(--teal);
  text-decoration: underline;
}

.rank-query {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  vertical-align: middle;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-day-head { white-space: nowrap; }

/* Распорка справа: ширины не имеет, забирает остаток и не рисует ничего. */
.rank-spacer {
  padding: 0;
  width: auto;
}

.rank-empty-head {
  color: var(--muted);
  text-transform: none;
}

.rank-cell {
  white-space: nowrap;
}

.rank-pos {
  display: inline-flex;
  min-width: 26px;
  height: 22px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 750;
}

.rank-pos-top3 {
  background: var(--teal-soft);
  color: #12655c;
}

.rank-pos-top10 {
  background: var(--blue-soft);
  color: var(--blue);
}

/* Позиция глубже десятки — уже не витрина, но и не «нет в выдаче». */
.rank-pos-deep {
  background: var(--surface-muted);
  color: var(--muted);
}

.rank-blank {
  color: #c2cdcb;
}

/* Прочерк проверки, которая не смотрела на всю сотню: пунктир отличает
   «не искали глубже» от «в выдаче нет». */
.rank-shallow {
  border-bottom: 1px dotted currentColor;
  cursor: help;
}

.rank-day-depth {
  display: block;
  font-size: 10px;
  font-weight: 650;
  color: var(--muted);
}

.rank-failed {
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
}

.rank-delta {
  margin-left: 5px;
  font-size: 10px;
  font-weight: 750;
}

.rank-delta-up { color: #1d7a4c; }
.rank-delta-down { color: var(--red); }

.rank-picker {
  padding: 16px 24px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-muted);
}

.rank-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.rank-picker-head span {
  color: var(--muted);
  font-size: 12px;
}

.rank-select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 650;
}

.rank-select-all span { color: var(--ink); }

.rank-picker-list {
  margin-top: 12px;
  max-height: 220px;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 4px 12px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.rank-picker-item {
  min-height: 32px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 13px;
}

.rank-picker-item:hover { background: var(--surface-muted); }

.rank-picker-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-picker-item small {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.rank-picker-actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.rank-picker-actions .form-status {
  margin-right: auto;
}

.rank-progress {
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.rank-progress.is-error {
  background: #fdf3f3;
  color: var(--red);
}

.rank-progress-bar {
  flex: 1;
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--line);
}

.rank-progress-bar i {
  display: block;
  height: 100%;
  background: var(--teal);
  transition: width 400ms ease;
}

@media (max-width: 1450px) {
  .summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .summary-grid .metric:last-child { grid-column: span 2; }
}

@media (max-width: 1200px) {
  .summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .summary-grid .metric:last-child { grid-column: 1 / -1; }
  .site-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .index-details { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .topbar-actions { flex-wrap: wrap; justify-content: flex-end; }
  .links-summary-grid,
  .links-summary-grid.no-budget { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* Пять фильтров с календарем перестают помещаться рядом с заголовком. */
  .sites-panel .sites-header,
  .ranks-panel .sites-header { flex-wrap: wrap; row-gap: 14px; }
  .sites-panel .filters,
  .ranks-panel .filters { flex: 1 0 100%; }
}

@media (max-width: 1050px) {
  .rank-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rank-summary > div { border-bottom: 1px solid var(--line); }
  .overview-grid { grid-template-columns: 1fr; }
  .network-breakdown-grid { grid-template-columns: 1fr; }
  .plugin-panel { min-height: 0; }
  .plugin-distribution { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .owner-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .owner-account-grid { grid-template-columns: 1fr; }
  .links-summary-grid,
  .links-summary-grid.no-budget { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .links-identity { align-items: flex-start; flex-direction: column; gap: 14px; }
  .links-sources { justify-content: flex-start; }
  .links-graph-body { grid-template-columns: minmax(0, 1fr); }
  .links-graph-canvas { min-height: 480px; }
  .links-graph-side { max-height: none; border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 760px) {
  .manage-modal,
  .manage-modal.speedy-open {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 78px auto minmax(0, 1fr);
    border: 0;
    border-radius: 0;
  }
  .manage-header {
    grid-column: 1;
    min-height: 78px;
    padding: 16px 18px;
  }
  .manage-tabs {
    padding: 8px 12px;
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .manage-tabs button {
    width: auto;
    min-width: 148px;
    min-height: 52px;
    flex: 0 0 auto;
  }
  .manage-tabs button.active {
    box-shadow: inset 0 -3px 0 var(--teal), 0 1px 3px rgba(25, 45, 45, 0.08);
  }
  .manage-body { padding: 22px 18px 30px; }
  .speedy-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .speedy-summary > div:nth-child(2) { border-right: 0; }
  .speedy-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .speedy-toolbar { align-items: stretch; flex-direction: column; }
  .speedy-toolbar select { width: 100%; }
  .speedy-actionbar { align-items: stretch; flex-wrap: wrap; padding: 10px 0; }
  .speedy-actionbar > div { width: 100%; }
  .speedy-actionbar button { flex: 1; }
  .speedy-confirm { align-items: stretch; flex-direction: column; }
  .speedy-confirm-actions { width: 100%; }
  .speedy-confirm-actions button { flex: 1; }
  .speedy-table { width: 900px; }
  .speedy-task-row { grid-template-columns: 1fr 1fr; padding: 10px 0; }
  .speedy-task-row > div:last-child { grid-column: 1 / -1; text-align: left; }
  .topbar {
    position: static;
    padding: 14px 16px;
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }
  .topbar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    justify-content: stretch;
    gap: 10px;
  }
  .period-switch { grid-column: 1 / -1; }
  .period-switch button { flex: 1; padding: 0 8px; }
  .main-nav { width: 100%; }
  .main-nav a { flex: 1; justify-content: center; }
  .topbar-commands { min-width: 0; }
  main { width: calc(100% - 24px); margin-top: 12px; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-grid .metric:last-child { grid-column: 1 / -1; }
  .metric { min-height: 112px; padding: 18px; }
  .metric strong { font-size: 27px; }
  .chart-panel,
  .plugin-panel { padding: 18px; }
  .chart-panel { min-height: 340px; }
  .chart-wrap { height: 240px; }
  .panel-heading { flex-direction: column; gap: 12px; }
  .sites-header { align-items: stretch; flex-direction: column; padding: 18px; }
  .filters { display: grid; grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .filters input,
  .filters select { width: 100%; min-width: 0; }
  .ga4-property { grid-template-columns: 1fr; }
  .ga4-property-state { text-align: left; }
  .table-footer { padding: 10px 18px; }
  .links-index-panel { padding: 0 18px 14px; }
  .content-dynamics-panel { padding: 18px; }
  .breakdown-panel { min-height: 0; padding: 18px; }
  .content-dynamics-summary { flex-wrap: wrap; }
  .content-chart { height: 210px; }
  .site-main { width: calc(100% - 24px); }
  .owner-main { width: calc(100% - 24px); }
  .owner-identity { align-items: flex-start; }
  .owner-account-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .owner-sites-panel .sites-header { align-items: stretch; }
  .owner-search-field input { width: 100%; }
  .site-identity { align-items: flex-start; flex-direction: column; }
  .site-identity h1 { font-size: 26px; }
  .site-dashboard-grid,
  .site-list-grid { grid-template-columns: 1fr; }
  .site-chart-panel,
  .index-panel,
  .list-panel,
  .all-urls-panel { padding: 18px; }
  .all-urls-panel .panel-heading { align-items: stretch; }
  .all-urls-panel input { width: 100%; }
  .auth-shell { padding: 18px; }
  .auth-frame {
    min-height: 0;
    grid-template-columns: 1fr;
  }
  .auth-visual {
    min-height: 168px;
  }
  .auth-visual::before { right: 58px; }
  .auth-visual::after { bottom: 44px; }
  .auth-geometry {
    width: 126px;
    aspect-ratio: 1.35;
  }
  .auth-form-panel {
    min-height: 390px;
    padding: 38px 30px 42px;
  }
  .login-form { gap: 17px; }
  .login-form header { margin-bottom: 8px; }
  .login-form h1 { font-size: 34px; }
}

@media (max-width: 520px) {
  .topbar-actions { grid-template-columns: 1fr; }
  .topbar-commands {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .topbar-commands .primary-action,
  .topbar-commands .secondary-action { width: 100%; }
  .account-control {
    width: 100%;
    justify-content: space-between;
  }
  .primary-action { width: 100%; }
  .summary-grid { grid-template-columns: 1fr; }
  .summary-grid .metric:last-child { grid-column: auto; }
  .plugin-distribution { grid-template-columns: 1fr; }
  .chart-legend { flex-wrap: wrap; }
  .drawer-header,
  .drawer-content { padding-left: 18px; padding-right: 18px; }
  .drawer-metric { padding: 11px 8px; }
  .drawer-metric strong { font-size: 17px; }
  .run-notice { align-items: flex-start; flex-wrap: wrap; }
  .form-grid { grid-template-columns: 1fr; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .manage-body,
  .manage-header { padding-left: 16px; padding-right: 16px; }
  .site-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .index-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .index-chart-heading { align-items: flex-start; flex-direction: column; }
  .owner-summary-grid { grid-template-columns: 1fr; }
  .owner-account-details { grid-template-columns: 1fr; }
  .owner-identity { flex-direction: column; }
  .site-identity-actions { width: 100%; justify-content: space-between; }
  .account-control { padding-left: 0; border-left: 0; }
  .password-field { grid-template-columns: 1fr; }
  .created-access { align-items: stretch; flex-direction: column; }
  .created-access .secondary-action { width: 100%; }
  .auth-shell { padding: 0; }
  .auth-frame {
    width: 100%;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }
  .auth-form-panel { padding: 34px 22px 40px; }
}

/* Произвольный период (календарь) */
.date-range {
  position: relative;
  display: inline-flex;
}

.date-range-trigger {
  height: 38px;
  min-width: 150px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.date-range-trigger:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.date-range-trigger.is-active {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal);
}

/* Позиция считается в JS: панели таблиц обрезают потомков через overflow. */
.date-range-popover {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  width: max-content;
  max-width: min(620px, calc(100vw - 32px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.date-range-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.date-range-preset {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.date-range-preset:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.date-range-preset.is-active {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal);
}

.date-range-preset.is-calendar {
  border-style: dashed;
}

.date-range-months {
  position: relative;
}

.date-range-nav {
  position: absolute;
  top: -2px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}

.date-range-nav:hover:not(:disabled) {
  border-color: var(--line-strong);
  color: var(--ink);
}

.date-range-nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.date-range-prev { left: 0; }
.date-range-next { right: 0; }

.date-range-grids {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.date-range-month-title {
  margin-bottom: 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 750;
  color: var(--ink);
}

.date-range-weekdays,
.date-range-grid {
  display: grid;
  grid-template-columns: repeat(7, 30px);
  gap: 2px;
}

.date-range-weekdays span {
  height: 22px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.date-range-day {
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.date-range-day:hover:not(:disabled) {
  background: var(--surface-muted);
}

.date-range-day:disabled {
  color: var(--line-strong);
  cursor: default;
}

.date-range-day.is-today {
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.date-range-day.in-range {
  border-radius: 0;
  background: var(--teal-soft);
  color: var(--teal);
}

.date-range-day.is-start,
.date-range-day.is-end {
  background: var(--teal);
  color: #fff;
}

.date-range-day.is-start:not(.is-end) { border-radius: 6px 0 0 6px; }
.date-range-day.is-end:not(.is-start) { border-radius: 0 6px 6px 0; }

.date-range-footer {
  margin-top: 12px;
  padding-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
}

.date-range-hint {
  color: var(--muted);
  font-size: 12px;
}

.date-range-reset {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.date-range-reset:hover {
  border-color: var(--red);
  color: var(--red);
}

/* Идёт после базовых правил календаря: иначе порядок источника перебьёт переопределения. */
@media (max-width: 700px) {
  .period-range { flex: 1 1 100%; }
  .date-range,
  .date-range-trigger { width: 100%; }
  .date-range-popover { width: min(330px, calc(100vw - 24px)); }
  .date-range-grids { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
