/* Astra — спокойный UI 2025–2026: нейтральная база, один акцент, без «кислоты» */

:root {
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  --a-r: 37;
  --a-g: 99;
  --a-b: 235;
  --color-accent: rgb(var(--a-r), var(--a-g), var(--a-b));
  --color-accent-hover: #1d4ed8;
  --color-accent-pressed: #1e40af;
  --color-accent-soft: rgba(var(--a-r), var(--a-g), var(--a-b), 0.09);
  --color-accent-muted: rgba(var(--a-r), var(--a-g), var(--a-b), 0.15);
  --color-accent-strong: rgba(var(--a-r), var(--a-g), var(--a-b), 0.5);
  --color-accent-text: #1d4ed8;
  --color-border: rgba(15, 23, 42, 0.09);
  --color-border-strong: rgba(15, 23, 42, 0.14);
  --color-surface: #ffffff;
  --color-surface-raised: #ffffff;
  --color-surface-subtle: #f8fafc;
  --color-surface-muted: #f1f5f9;
  --color-page: #eef2f6;
  --color-text: #0f172a;
  --color-text-secondary: #475569;
  --color-text-muted: #64748b;
  --color-success: #0f766e;
  --color-danger: #b91c1c;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-nav: 0 1px 0 rgba(15, 23, 42, 0.06);
  --focus-ring: 0 0 0 2px var(--color-surface), 0 0 0 4px rgba(var(--a-r), var(--a-g), var(--a-b), 0.35);
  /* Ширина контентной колонки и шапки относительно окна */
  --page-width: 90%;
  --header-bg: rgba(255, 255, 255, 0.82);
  --color-on-accent: #ffffff;
  --mdc-theme-primary: rgb(var(--a-r), var(--a-g), var(--a-b));
  --mdc-theme-on-primary: #ffffff;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --a-r: 129;
  --a-g: 140;
  --a-b: 248;
  --mdc-theme-primary: rgb(var(--a-r), var(--a-g), var(--a-b));
  --mdc-theme-on-primary: #ffffff;
  --mdc-theme-surface: #172036;
  --mdc-theme-on-surface: #e6edf7;
  --mdc-theme-text-primary-on-background: #e6edf7;
  --mdc-theme-text-secondary-on-background: #a8b7cc;
  --color-accent-hover: #a5b4fc;
  --color-accent-pressed: #818cf8;
  --color-accent-soft: rgba(129, 140, 248, 0.16);
  --color-accent-muted: rgba(129, 140, 248, 0.28);
  --color-accent-strong: rgba(129, 140, 248, 0.48);
  --color-accent-text: #bec8ff;
  --color-border: rgba(168, 183, 204, 0.16);
  --color-border-strong: rgba(168, 183, 204, 0.27);
  --color-surface: #121a2c;
  --color-surface-raised: #17233a;
  --color-surface-subtle: #1d2a44;
  --color-surface-muted: #233454;
  --color-page: #0a1020;
  --color-text: #e6edf7;
  --color-text-secondary: #c0cde0;
  --color-text-muted: #98abc5;
  --color-success: #3dd9b3;
  --color-danger: #ff8e99;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.22), 0 14px 34px rgba(0, 0, 0, 0.36);
  --shadow-nav: 0 1px 0 rgba(0, 0, 0, 0.3);
  --focus-ring: 0 0 0 2px var(--color-surface-raised), 0 0 0 4px rgba(129, 140, 248, 0.5);
  --header-bg: rgba(12, 18, 34, 0.8);
  --color-on-accent: #ffffff;
}

html[data-theme="dark"] body.app-body {
  background:
    radial-gradient(1100px 420px at 8% -12%, rgba(129, 140, 248, 0.14), transparent 60%),
    radial-gradient(920px 360px at 100% -20%, rgba(45, 212, 191, 0.08), transparent 62%),
    var(--color-page);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body.app-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  background: var(--color-page);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}


main.app-main {
  width: var(--page-width);
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
  box-sizing: border-box;
  min-width: 0;
}

@media (max-width: 720px) {
  main.app-main {
    padding: 1rem 0 2.5rem;
  }
}

/* ——— Header ——— */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-nav);
}

.app-header__inner {
  width: var(--page-width);
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;
}

.app-header__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.65rem 0 0.5rem;
  font-size: 13px;
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border);
}

.app-header__meta .header-seller-name {
  font-weight: 600;
  color: var(--color-text);
}

.app-header__meta .tm {
  font-weight: 500;
  color: var(--color-text-muted);
}

.app-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.65rem 0 0.85rem;
}

.app-header__tools {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.theme-toggle:hover {
  background: var(--color-surface-subtle);
  color: var(--color-text);
}

.theme-toggle:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.theme-toggle__icon {
  display: block;
  pointer-events: none;
}

.theme-toggle__icon--moon {
  display: none;
}

.theme-toggle.is-dark .theme-toggle__icon--sun {
  display: none;
}

.theme-toggle.is-dark .theme-toggle__icon--moon {
  display: block;
}

.nav-burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.nav-burger:hover {
  background: var(--color-surface-subtle);
}

.nav-burger:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.nav-burger__bars,
.nav-burger__bars::before,
.nav-burger__bars::after {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
}

.nav-burger__bars {
  position: relative;
}

.nav-burger__bars::before,
.nav-burger__bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-burger__bars::before {
  top: -7px;
}

.nav-burger__bars::after {
  top: 7px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.03em;
}

.brand:hover {
  color: var(--color-accent-text);
}

.app-nav {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.app-nav .mdc-button {
  border-radius: 10px !important;
  letter-spacing: 0.01em;
  font-weight: 500 !important;
  min-height: 38px !important;
  padding: 0 14px !important;
}

.nav-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-icon {
  font-size: 19px;
  line-height: 1;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 20;
}

.app-nav .mdc-button--unelevated:not(:disabled) {
  background-color: var(--color-accent) !important;
  box-shadow: var(--shadow-sm) !important;
}

.app-nav .mdc-button--unelevated:not(:disabled) .mdc-button__label {
  color: var(--color-on-accent) !important;
}

.app-nav .mdc-button--unelevated:not(:disabled):hover {
  background-color: var(--color-accent-hover) !important;
}

.app-nav .mdc-button--outlined:not(:disabled) {
  border-color: var(--color-border-strong) !important;
  color: var(--color-text) !important;
}

.app-nav .mdc-button--outlined:not(:disabled):hover {
  background: var(--color-surface-subtle) !important;
}

.app-nav .mdc-button.is-active {
  background: var(--color-accent-soft) !important;
  border-color: var(--color-accent-strong) !important;
  color: var(--color-accent-text) !important;
  box-shadow: inset 0 0 0 1px var(--color-accent-muted);
}

.app-nav .mdc-button.is-active .mdc-button__label {
  color: var(--color-accent-text) !important;
  font-weight: 600 !important;
}

.app-nav .mdc-button.mdc-button--unelevated.is-active:not(:disabled) {
  background: var(--color-accent) !important;
}

.app-nav .mdc-button.mdc-button--unelevated.is-active:not(:disabled) .mdc-button__label {
  color: var(--color-on-accent) !important;
}

@media (max-width: 768px) {
  .app-header__meta {
    font-size: 12px;
    padding: 0.5rem 0 0.4rem;
    gap: 0.5rem 0.75rem;
  }

  .app-header__row {
    flex-wrap: wrap;
    padding: 0.5rem 0 0.65rem;
  }

  .brand {
    order: 1;
    min-width: 0;
    flex: 1;
  }

  .app-header__tools {
    order: 2;
  }

  .nav-burger {
    display: inline-flex;
  }

  .app-nav {
    order: 3;
    flex: none;
    display: none;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 4px;
    width: 100%;
    flex-basis: 100%;
    padding: 10px 0 6px;
    margin-top: 4px;
    border-top: 1px solid var(--color-border);
  }

  .app-nav.is-open {
    display: flex;
  }

  .app-nav .mdc-button {
    width: 100%;
    justify-content: flex-start !important;
  }

  .nav-label {
    justify-content: flex-start;
  }

  .app-nav form {
    width: 100%;
  }

  .app-nav form .mdc-button {
    width: 100%;
  }
}

.scroll-top-btn {
  position: fixed;
  right: 18px;
  bottom: 20px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  background: var(--color-surface-raised);
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  z-index: 1200;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.scroll-top-btn .material-symbols-outlined {
  font-size: 24px;
  line-height: 1;
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24;
}

.scroll-top-btn:hover {
  background: var(--color-surface-subtle);
}

.scroll-top-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.scroll-top-btn.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.select-native {
  font: inherit;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-text);
  min-height: 38px;
}

.select-native:focus {
  outline: none;
  box-shadow: var(--focus-ring);
  border-color: var(--color-accent);
}

/* ——— Material cards ——— */
.mdc-card.card {
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-md) !important;
  border: 1px solid var(--color-border) !important;
  background: var(--color-surface-raised) !important;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
}

.mdc-card.card.ad-priority-report {
  overflow: visible;
}

.surface-spaced {
  margin-top: 1.25rem;
}

.surface-narrow {
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.page-card {
  padding: 1.35rem 1.5rem;
  min-width: 0;
}

@media (max-width: 720px) {
  .page-card {
    padding: 1.1rem 1.15rem;
  }
}

.stack {
  display: grid;
  gap: 0.85rem;
  min-width: 0;
}

.row2 {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: 1fr;
}

@media (min-width: 860px) {
  .row2 {
    grid-template-columns: 1fr 1fr;
  }
}

/* ——— Typography ——— */
.h1-page {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.2;
  color: var(--color-text);
}

.h2-section {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.h3-block {
  margin: 0 0 0.65rem;
  font-size: 1rem;
  font-weight: 600;
}

.text-lead {
  margin-top: 0.45rem;
  line-height: 1.55;
}

.link-back-row {
  margin-bottom: 0.5rem;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  min-width: 0;
}

.page-head > div:first-child {
  min-width: 0;
  flex: 1 1 12rem;
}

.page-head__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
}

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

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: 1.15rem 0;
}

code {
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
  font-size: 0.88em;
  background: var(--color-surface-muted);
  padding: 0.15em 0.45em;
  border-radius: 6px;
  border: 1px solid var(--color-border);
}

main.app-main a:not([class*="mdc-button"]):not(.brand):not(.product-card-link):not(.admin-module) {
  color: var(--color-accent-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

main.app-main a:not([class*="mdc-button"]):not(.brand):not(.product-card-link):not(.admin-module):hover {
  color: var(--color-accent);
}

/* ——— Alerts ——— */
.alerts {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.alert {
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: 14px;
}

.alert.error {
  border-color: rgba(185, 28, 28, 0.35);
  background: rgba(185, 28, 28, 0.06);
  color: var(--color-text);
}

.alert.success {
  border-color: rgba(15, 118, 110, 0.35);
  background: rgba(15, 118, 110, 0.07);
  color: var(--color-text);
}

html[data-theme="dark"] .alert.error {
  border-color: rgba(255, 142, 153, 0.34);
  background: rgba(255, 142, 153, 0.11);
}

html[data-theme="dark"] .alert.success {
  border-color: rgba(61, 217, 179, 0.32);
  background: rgba(61, 217, 179, 0.1);
}

/* ——— Forms ——— */
.form-grid {
  display: grid;
  gap: 1rem;
  max-width: 680px;
}

.form-grid > label:not(.mdc-text-field) {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

form .actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  align-items: center;
}

.mdc-text-field {
  width: 100%;
}

.mdc-button.mdc-button--unelevated:not(:disabled) {
  background-color: var(--color-accent) !important;
}

.mdc-button.mdc-button--unelevated:not(:disabled) .mdc-button__label {
  color: var(--color-on-accent) !important;
}

/* ——— Tables (generic) ——— */
.table-app {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table-app th,
.table-app td {
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--color-border);
  text-align: left;
}

.table-app thead th {
  background: var(--color-surface-muted);
  font-weight: 600;
  color: var(--color-text-secondary);
  font-size: 13px;
}

.table-app tbody tr:nth-child(even) {
  background: var(--color-surface-subtle);
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  width: 100%;
  max-width: 100%;
}

.table-scroll > table {
  width: max-content;
  min-width: 100%;
}

/* ——— Home / KPI ——— */
.home-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  margin-top: 0.5rem;
}

.home-kpi-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  background: var(--color-surface-subtle);
}

.home-kpi-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

.home-kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.home-kpi-unit {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.home-kpi-sub {
  margin-top: 0.35rem;
  font-size: 14px;
  color: var(--color-text-secondary);
}

.home-kpi-delta {
  margin-top: 0.5rem;
  font-size: 12px;
  font-weight: 500;
}

.home-kpi-delta--good {
  color: var(--color-success);
}

.home-kpi-delta--bad {
  color: var(--color-danger);
}

.home-kpi-muted {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
}

.home-note-wb {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0.75rem 0 0;
  line-height: 1.5;
}

.home-articles-wrap {
  margin-top: 0.65rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  width: 100%;
  max-width: 100%;
  padding: 10px;
  background: var(--color-surface-subtle);
}

.home-articles-list {
  display: grid;
  gap: 10px;
}

.home-articles-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.home-articles-toolbar label {
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.home-articles-toolbar input[type="search"],
.home-articles-toolbar select {
  font: inherit;
  padding: 8px 11px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  min-width: 200px;
  background: var(--color-surface);
}

.home-articles-toolbar input:focus,
.home-articles-toolbar select:focus {
  outline: none;
  box-shadow: var(--focus-ring);
  border-color: var(--color-accent);
}

.home-articles-status {
  font-size: 13px;
  color: var(--color-text-muted);
  min-height: 1.2em;
}

.home-art-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  display: flex;
  gap: 10px;
  padding: 10px;
  overflow-x: auto;
}

.home-art-card--summary {
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.04);
}

.home-art-card__media {
  width: 52px;
  flex: 0 0 52px;
}

.home-art-summary-badge {
  width: 48px;
  height: 64px;
  border-radius: var(--radius-sm);
  background: rgba(37, 99, 235, 0.15);
  color: #1e40af;
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-art-card__main {
  min-width: 0;
  flex: 1;
}

.home-art-card__head {
  margin-bottom: 8px;
  font-size: 13px;
}

.home-art-title {
  margin-top: 2px;
  font-size: 12px;
}

.home-art-grid-wrap {
  min-width: 860px;
}

.home-art-grid-head,
.home-art-grid-row {
  display: grid;
  align-items: center;
}

.home-art-grid-head {
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 6px;
}

.home-art-day-head,
.home-art-day-cell {
  text-align: center;
  font-size: 11px;
  border-left: 1px solid var(--color-border);
  padding: 4px 2px;
}

.home-art-grid-row {
  min-height: 34px;
  border-top: 1px solid var(--color-border);
}

.home-art-metric-title {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.home-art-period-val {
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.home-art-spark-wrap {
  padding: 0 8px;
  min-width: 150px;
}

.home-art-spark {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 30px;
  width: 100%;
}

.home-art-spark__bar {
  width: 6px;
  display: inline-block;
  border-radius: 2px;
  background: #6da8ff;
  cursor: pointer;
}

.home-art-day-cell {
  font-weight: 500;
}

.home-art-tooltip {
  position: fixed;
  z-index: 1000;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  padding: 10px 12px;
  min-width: 132px;
  pointer-events: none;
}

.home-art-tooltip__date {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
  font-weight: 600;
}

.home-art-tooltip__row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.home-art-tooltip__swatch {
  width: 12px;
  height: 2px;
  background: #6da8ff;
  border-radius: 1px;
}

.home-art-tooltip__metric {
  color: var(--color-text-secondary);
}

.home-art-tooltip__value {
  margin-left: auto;
  color: var(--color-text-primary);
}

.campaigns-metrics-period {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 1rem;
  margin: 10px 0 4px;
}

.campaigns-metrics-period .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.campaigns-metrics-period .field label {
  font-size: 12px;
  color: var(--color-text-muted);
}

.campaigns-metrics-period input[type="date"] {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}

.home-articles-more-row {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.home-art-thumb {
  width: 48px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--color-surface-muted);
  display: block;
}

.home-art-thumb--ph {
  width: 48px;
  height: 64px;
  border-radius: var(--radius-sm);
  background: linear-gradient(145deg, var(--color-surface-muted), var(--color-surface-raised));
}

/* ——— Catalog cards ——— */
.cards-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.product-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.product-card img {
  width: 100%;
  aspect-ratio: 246 / 328;
  object-fit: cover;
  background: var(--color-surface-muted);
  display: block;
}

.product-card .meta {
  padding: 10px 12px;
  font-size: 13px;
  flex: 1;
}

.product-card .nm {
  font-weight: 600;
  color: var(--color-accent-text);
}

.product-card .title {
  margin-top: 4px;
  line-height: 1.35;
}

.product-card .sub {
  margin-top: 6px;
  color: var(--color-text-muted);
  font-size: 12px;
}

a.product-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  border-radius: var(--radius-md);
}

a.product-card-link:hover .product-card {
  box-shadow: var(--shadow-md);
  border-color: rgba(var(--a-r), var(--a-g), var(--a-b), 0.28);
}

a.product-card-link:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.cards-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
  margin-top: 0.75rem;
}

.cards-filters .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 200px;
  flex: 1 1 220px;
}

.cards-filters label {
  font-size: 12px;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.cards-filters input[type="search"],
.cards-filters select {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  width: 100%;
}

.cards-filters input[type="search"]:focus,
.cards-filters select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: var(--focus-ring);
}

.card-item-wrapper {
  min-width: 0;
}

.card-item-wrapper[hidden] {
  display: none !important;
}

/* ——— Campaigns list ——— */
.campaigns-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
  margin-top: 0.85rem;
}

.campaigns-toolbar .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 160px;
  flex: 1 1 200px;
}

.campaigns-toolbar .field--search {
  flex: 2 1 280px;
  min-width: 220px;
}

.campaigns-toolbar label {
  font-size: 12px;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.campaigns-toolbar input[type="search"],
.campaigns-toolbar select {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  width: 100%;
}

.campaigns-toolbar input[type="search"]:focus,
.campaigns-toolbar select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: var(--focus-ring);
}

.sort-btn {
  font: inherit;
  font-weight: 600;
  border: none;
  background: none;
  cursor: pointer;
  padding: 6px 8px;
  margin: -6px -8px;
  border-radius: var(--radius-sm);
  color: inherit;
  text-align: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.sort-btn:hover {
  background: var(--color-accent-soft);
}

.sort-btn .sort-arrow {
  font-size: 11px;
  opacity: 0.45;
  font-weight: 700;
}

.sort-btn.sorted-asc .sort-arrow,
.sort-btn.sorted-desc .sort-arrow {
  opacity: 1;
}

th {
  vertical-align: bottom;
}

tr.campaign-row[hidden] {
  display: none;
}

.camp-st-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  cursor: help;
}

.camp-st-svg {
  width: 22px;
  height: 22px;
  display: block;
}

.camp-st--empty {
  color: #94a3b8;
}

.camp-st--del {
  color: #64748b;
}

.camp-st--ready {
  color: #0369a1;
}

.camp-st--done {
  color: #b91c1c;
}

.camp-st--cancel {
  color: #b91c1c;
}

.camp-st--active {
  color: #15803d;
}

.camp-st--pause {
  color: #c2410c;
}

.camp-st--unknown {
  color: #64748b;
}

.campaign-status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  margin-top: 0.85rem;
  line-height: 1.4;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.campaign-status-legend .item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.campaign-wb-link {
  color: var(--color-accent-text);
  font-weight: 600;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.campaign-wb-link__icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.88;
  fill: currentColor;
}

.campaign-wb-link:hover {
  text-decoration: underline;
}

.campaign-wb-link:hover .campaign-wb-link__icon {
  opacity: 1;
}

.campaign-wb-link:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 4px;
}

@keyframes stats-spin {
  to {
    transform: rotate(360deg);
  }
}

.stats-refresh-spin {
  display: none;
  width: 16px;
  height: 16px;
  margin-left: 8px;
  border: 2px solid var(--color-accent-soft);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: stats-spin 0.65s linear infinite;
  vertical-align: middle;
  box-sizing: border-box;
}

.stats-refresh-spin.visible {
  display: inline-block;
}

/* ——— Funnel chart widget (shared) ——— */
.funnel-layout {
  display: flex;
  gap: 1.15rem;
  align-items: stretch;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.metric-nav {
  flex: 0 0 260px;
  max-width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-subtle);
  padding: 8px;
  max-height: 420px;
  overflow-y: auto;
}

.metric-nav button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  margin: 0 0 4px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  font: inherit;
  cursor: pointer;
  color: var(--color-text);
}

.metric-nav button:hover {
  background: var(--color-accent-soft);
}

.metric-nav button.active {
  background: var(--color-accent-muted);
  font-weight: 600;
  color: var(--color-accent-pressed);
}

.chart-panel {
  flex: 1 1 400px;
  min-width: 280px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  padding: 14px 16px 8px;
}

.chart-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.chart-toolbar .periods {
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-text-secondary);
}

.chart-toolbar .granularity {
  font-size: 13px;
  color: var(--color-text-muted);
}

.compare-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  user-select: none;
  color: var(--color-text-secondary);
}

.compare-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--color-accent);
}

.chart-wrap {
  position: relative;
  height: 320px;
  width: 100%;
}

.stat-date-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 10px;
}

.stat-date-filter label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.stat-date-filter input[type="date"] {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}

.stat-date-filter input[type="date"]:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: var(--focus-ring);
}

.nq-day-hidden {
  display: none !important;
}

.campaign-chart-spoiler {
  margin-top: 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  overflow: hidden;
}

.campaign-chart-spoiler__summary {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 600;
  user-select: none;
  color: var(--color-text);
}

.campaign-chart-spoiler__summary::-webkit-details-marker {
  display: none;
}

.campaign-chart-spoiler__icon {
  font-size: 22px;
  color: var(--color-accent);
}

.campaign-chart-spoiler__hint {
  font-weight: 400;
  font-size: 13px;
  margin-left: auto;
}

.campaign-chart-spoiler__body {
  padding: 0 12px 12px;
  border-top: 1px solid var(--color-border);
}

.campaign-chart-spoiler .funnel-layout {
  margin-top: 12px;
}

.section-title {
  margin: 1.25rem 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
}

.note-wb {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 8px;
  line-height: 1.5;
}

/* ——— Campaign stat page ——— */
.totals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.totals-grid .cell {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  background: var(--color-surface-subtle);
  font-size: 13px;
}

.totals-grid .cell .lbl {
  color: var(--color-text-muted);
  font-size: 12px;
}

.totals-grid .cell .val {
  font-weight: 600;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.campaign-good {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-subtle);
}

.campaign-good-photo {
  flex: 0 0 auto;
  width: 120px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface-muted);
}

.campaign-good-photo img {
  width: 100%;
  aspect-ratio: 246 / 328;
  object-fit: cover;
  display: block;
}

.campaign-good-photo--empty {
  aspect-ratio: 246 / 328;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--color-text-muted);
  text-align: center;
  padding: 8px;
}

.campaign-good-meta {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  line-height: 1.45;
}

.campaign-good-meta .nm-line {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.campaign-good-meta .title-line {
  margin-top: 6px;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.campaign-good-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

/* ——— Ad priority dashboard (сводка + графики) ——— */
.ad-dash {
  margin: 1rem 0 1.75rem;
  padding: 1.15rem 1.25rem 1.35rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(
    165deg,
    var(--color-accent-soft) 0%,
    var(--color-surface-subtle) 38%,
    var(--color-surface) 100%
  );
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.ad-dash__intro {
  margin-bottom: 1rem;
}

.ad-dash__title {
  margin: 0 0 0.25rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text);
}

.ad-dash__subtitle {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  max-width: 52rem;
}

.ad-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 12px;
  margin-bottom: 1.25rem;
}

.ad-kpi-card {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.ad-kpi-card--target {
  border-color: var(--color-accent-strong);
  box-shadow: 0 0 0 1px var(--color-accent-muted);
  background: linear-gradient(180deg, var(--color-accent-soft) 0%, var(--color-surface) 72%);
}

.ad-kpi-card__label {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
  line-height: 1.3;
}

.ad-kpi-card__value {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
  word-break: break-word;
}

.ad-kpi-card__hint {
  margin: 6px 0 0;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  line-height: 1.35;
}

.ad-chart-panel {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  padding: 12px 14px 10px;
  margin-bottom: 12px;
}

.ad-chart-panel__head {
  margin-bottom: 8px;
}

.ad-chart-panel__title {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 700;
}

.ad-chart-panel__legend-hint {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.4;
}

.ad-chart-canvas-wrap {
  position: relative;
  width: 100%;
  height: min(340px, 52vh);
  min-height: 220px;
}

.ad-bar-grid {
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(22px, 1fr));
  gap: 4px 3px;
  align-items: end;
  min-height: 100px;
  padding: 10px 4px 4px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-subtle);
  border: 1px dashed var(--color-border);
}

.ad-bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-height: 92px;
  gap: 4px;
}

.ad-bar-item__fill {
  width: 100%;
  max-width: 28px;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, var(--color-accent-text), var(--color-accent));
  opacity: 0.85;
}

.ad-bar-item__lab {
  font-size: 9px;
  color: var(--color-text-muted);
  writing-mode: horizontal-tb;
  text-align: center;
  line-height: 1.1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ad-priority-table-heading {
  font-size: 15px;
  margin: 1.5rem 0 0;
  line-height: 1.4;
  max-width: 100%;
}

.ad-priority-focus-hint {
  font-size: 13px;
  margin: 6px 0 0;
}

.ad-priority-table tr.ad-priority-metric-row--focus td.lbl {
  border-left: 3px solid var(--color-accent);
  padding-left: calc(8px - 3px);
  font-weight: 600;
  color: var(--color-text);
}

.ad-priority-table tr.ad-priority-metric-row--focus td {
  font-weight: 700;
  border-top: 2px solid var(--color-accent-strong);
  border-bottom: 2px solid var(--color-accent-strong);
}

.ad-priority-table tr.ad-priority-metric-row--focus td:first-child {
  border-left: 2px solid var(--color-accent-strong);
}

.ad-priority-table tr.ad-priority-metric-row--focus td:last-child {
  border-right: 2px solid var(--color-accent-strong);
}


@media (max-width: 720px) {
  .ad-dash {
    padding: 1rem 12px 1.15rem;
  }

  .ad-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 400px) {
  .ad-kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* ——— Ad priority: панель дельт / аномалий / сводки ——— */
.ad-priority-view-bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  margin: 0 0 1rem;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.ad-priority-view-bar__main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
}

.ad-priority-view-bar__sep {
  width: 1px;
  height: 22px;
  background: var(--color-border-strong);
  margin: 0 2px;
}

.ad-priority-view-bar__thresh {
  font-size: 12px;
}

.ad-priority-anomaly-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  width: 100%;
  padding: 8px 0 2px;
  margin-top: 8px;
  border-top: 1px dashed var(--color-border);
}

.ad-priority-anomaly-controls[hidden] {
  display: none !important;
}

.ad-anomaly-threshold {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  cursor: default;
}

.ad-anomaly-threshold__label {
  white-space: nowrap;
}

.ad-anomaly-threshold input[type="range"] {
  width: min(160px, 42vw);
  margin: 0;
  accent-color: var(--color-accent);
  cursor: pointer;
  touch-action: pan-x;
}

.ad-anomaly-threshold__value {
  min-width: 3.2rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--color-accent-text);
}

.ad-anomaly-mode-hint {
  font-size: 12px;
  white-space: nowrap;
}

.ad-view-toggle--inline {
  margin-left: 4px;
}

.ad-view-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.ad-view-switch {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  line-height: 0;
  -webkit-tap-highlight-color: transparent;
}

.ad-view-switch:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 12px;
}

.ad-view-switch__track {
  position: relative;
  display: block;
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: var(--color-border-strong);
  transition: background 0.15s ease;
}

.ad-view-switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease;
}

.ad-view-switch.is-on .ad-view-switch__track {
  background: var(--color-accent);
}

.ad-view-switch.is-on .ad-view-switch__track::after {
  transform: translateX(18px);
}

.ad-pri-delta-pct {
  display: none;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.ad-priority-report--deltas-on .ad-pri-delta-pct:not(:empty) {
  display: block;
}

.ad-pri-delta-pct--up {
  color: #0d7a3f;
}

.ad-pri-delta-pct--down {
  color: #c62828;
}

.ad-priority-report--anomalies-on td.ad-priority-num-cell.ad-pri-anomaly--drop:not(.plan-good):not(.plan-bad) {
  box-shadow: inset 0 0 0 2px #c62828;
  background-color: rgba(198, 40, 40, 0.08);
}

.ad-priority-report--anomalies-on td.ad-priority-num-cell.ad-pri-anomaly--rise:not(.plan-good):not(.plan-bad) {
  box-shadow: inset 0 0 0 2px #0d7a3f;
  background-color: rgba(13, 122, 63, 0.08);
}

.ad-priority-row--brief-hidden {
  display: none !important;
}

.ad-priority-chart-spoiler {
  margin-bottom: 12px;
}

.ad-priority-table td.num .ad-priority-num-val {
  display: block;
}

/* ——— Ad priority report ——— */
.ad-priority-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.ad-nm-blocks-toolbar {
  margin: 16px 0;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 8px;
}

.ad-priority-wrap {
  display: block;
  position: relative;
  inline-size: 100%;
  max-inline-size: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  margin-top: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  width: 100%;
  max-width: 100%;
  scrollbar-gutter: stable both-edges;
}

.ad-priority-table {
  border-collapse: collapse;
  font-size: 12px;
  min-width: 100%;
  width: auto;
}

/* Склейки: визуально отделить блок fullstats от воронки в одной таблице */
.glue-funnel-tbody-ad tr:first-child td {
  border-top: 2px solid var(--color-border, rgba(0, 0, 0, 0.12));
}

.ad-priority-wrap > .ad-priority-table {
  width: auto !important;
  min-width: 100%;
}

.ad-priority-table--wide {
  /* Ширина задаётся скриптом: max(ширина контейнера, расчёт по колонкам). */
  min-width: 100%;
}

.ad-priority-report,
.ad-priority-report .page-card,
.ad-priority-report .nm-block,
.ad-priority-report .type-block,
.ad-priority-report .nm-article-inner,
.ad-priority-report .type-block-collapsible-body {
  min-width: 0;
  max-width: 100%;
}

.ad-priority-report .page-card {
  overflow-x: visible;
}

.ad-priority-table--wide th:not(.lbl),
.ad-priority-table--wide td:not(.lbl) {
  min-width: 6.1rem;
  white-space: nowrap;
}

.ad-priority-table--wide th.spark-col,
.ad-priority-table--wide td.spark-col {
  min-width: 150px;
  width: 150px;
  max-width: 168px;
  white-space: normal;
  text-align: center;
  vertical-align: middle;
  background: var(--color-surface-subtle);
}

.ad-priority-spark-inner {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 30px;
  width: 100%;
  justify-content: center;
}

.ad-priority-spark__bar {
  width: 6px;
  min-width: 6px;
  display: inline-block;
  border-radius: 2px;
  background: #6da8ff;
  cursor: pointer;
}

.ad-priority-table th,
.ad-priority-table td {
  border: 1px solid var(--color-border);
  padding: 6px 8px;
  vertical-align: middle;
}

.ad-priority-table th.plan-col,
.ad-priority-table td.plan-col {
  min-width: 6.5rem;
  width: 6.5rem;
  text-align: right;
  font-weight: 700;
  background: var(--color-surface-subtle);
}

.ad-priority-table th.period-col,
.ad-priority-table td.period-col {
  min-width: 7.4rem;
  width: 7.4rem;
  text-align: right;
  font-weight: 700;
  background: var(--color-surface-subtle);
  white-space: nowrap;
}

.ad-priority-table th.plan-col {
  text-align: center;
  background: var(--color-surface-muted);
}

.ad-priority-table th.period-col {
  text-align: center;
  background: var(--color-surface-muted);
}

.plan-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--color-border-strong);
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 12px;
  padding: 4px 6px;
  text-align: right;
  font-weight: 700;
}

.plan-input:focus {
  outline: none;
  box-shadow: var(--focus-ring);
  border-color: var(--color-accent);
}

.ad-priority-table th.lbl {
  text-align: left;
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
  vertical-align: middle;
  position: sticky;
  left: 0;
  z-index: 5;
  background: var(--color-surface-muted);
  box-shadow: 2px 0 4px rgba(15, 23, 42, 0.06);
}

.ad-priority-table th {
  background: var(--color-surface-muted);
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  color: var(--color-text-secondary);
}

.ad-priority-table td.lbl {
  text-align: left;
  background: var(--color-surface-subtle);
  font-weight: 500;
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 11rem;
  max-width: min(52vw, 34rem);
  width: max(12rem, 26%);
  box-shadow: 2px 0 4px rgba(15, 23, 42, 0.04);
}

.ad-priority-table thead tr:nth-child(2) th.lbl {
  background: var(--color-surface-muted);
  z-index: 6;
}

.ad-priority-table tbody td.lbl {
  z-index: 4;
}

.ad-priority-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ad-priority-num-cell {
  white-space: nowrap;
}

.ad-priority-table td.ad-priority-num-cell--up_good,
.ad-priority-table td.ad-priority-num-cell--down_good {
  background-color: rgba(13, 122, 63, 0.06);
}

.ad-priority-table td.ad-priority-num-cell--up_bad,
.ad-priority-table td.ad-priority-num-cell--down_bad {
  background-color: rgba(198, 40, 40, 0.06);
}

.ad-priority-table td.ad-priority-num-cell.plan-good,
.ad-priority-report--anomalies-on td.ad-priority-num-cell.plan-good {
  background-color: rgba(13, 122, 63, 0.13);
  box-shadow: inset 0 0 0 1px rgba(13, 122, 63, 0.45);
}

.ad-priority-table td.ad-priority-num-cell.plan-bad,
.ad-priority-report--anomalies-on td.ad-priority-num-cell.plan-bad {
  background-color: rgba(198, 40, 40, 0.13);
  box-shadow: inset 0 0 0 1px rgba(198, 40, 40, 0.45);
}

.ad-priority-table tr.section td.ad-priority-num-cell--up_good,
.ad-priority-table tr.section td.ad-priority-num-cell--down_good {
  background-color: color-mix(in srgb, rgba(var(--a-r), var(--a-g), var(--a-b), 0.12) 78%, rgb(13, 122, 63) 22%);
}

.ad-priority-table tr.section td.ad-priority-num-cell--up_bad,
.ad-priority-table tr.section td.ad-priority-num-cell--down_bad {
  background-color: color-mix(in srgb, rgba(var(--a-r), var(--a-g), var(--a-b), 0.12) 78%, rgb(198, 40, 40) 22%);
}

.ad-priority-num-val {
  vertical-align: middle;
}

.ad-pri-trend {
  display: inline-block;
  margin-left: 5px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}

.ad-pri-trend--up_good,
.ad-pri-trend--down_good {
  color: #0d7a3f;
}

.ad-pri-trend--up_bad,
.ad-pri-trend--down_bad {
  color: #c62828;
}

.ad-priority-table tr.section td {
  background: rgba(var(--a-r), var(--a-g), var(--a-b), 0.11);
  font-weight: 600;
  color: var(--color-accent-pressed);
}

.ad-priority-table tr.subhead td {
  background: var(--color-accent-soft);
  font-size: 11px;
}

.nm-block {
  margin-top: 32px;
  padding-top: 8px;
  border-top: 1px solid var(--color-border);
}

.nm-block h2 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.35;
  max-width: 100%;
  word-wrap: break-word;
}

.nm-meta {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 12px;
  max-width: 100%;
  line-height: 1.45;
  word-wrap: break-word;
}

.nm-article-inner {
  padding: 16px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.nm-article-top {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 8px;
  width: 100%;
  max-width: 100%;
}

.nm-hero-photo {
  flex: 0 0 auto;
  width: 108px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
}

.nm-hero-photo img {
  width: 100%;
  aspect-ratio: 246 / 328;
  object-fit: cover;
  display: block;
}

.nm-hero-photo--empty {
  aspect-ratio: 246 / 328;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--color-text-muted);
  text-align: center;
  padding: 8px;
}

.nm-common-wrap {
  width: 100%;
  min-width: 0;
}

.nm-common-wrap .ad-priority-wrap {
  margin-top: 0;
}

.type-block {
  margin-top: 16px;
  padding: 14px 14px 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--color-accent-soft) 0%, var(--color-surface) 48px);
}

.nm-summary-title {
  margin: 14px 0 8px;
  font-size: 15px;
  color: var(--color-text-secondary);
}

.normquery-cluster-name-copy {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  color: inherit;
}

.normquery-cluster-name-copy:hover {
  color: var(--color-accent-pressed, var(--color-text));
}

.normquery-cluster-name-copy:focus {
  outline: 2px solid var(--color-accent, #2563eb);
  outline-offset: 2px;
}

.normquery-cluster-name-copy--done {
  opacity: 0.75;
}

/* Заголовок кластера normquery: ссылка на поиск WB + копирование */
.normquery-cluster-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}

.normquery-wb-search-link {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.02em;
  color: var(--color-accent, #2563eb);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--color-accent, #2563eb) 28%, transparent);
}

.normquery-wb-search-link:hover {
  border-bottom-color: var(--color-accent, #2563eb);
}

.campaign-normquery-report .normquery-cluster-name-copy.material-symbols-outlined {
  font-size: 20px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm, 6px);
  text-decoration: none;
  color: var(--color-text-muted);
  vertical-align: middle;
  flex-shrink: 0;
}

.campaign-normquery-report .normquery-cluster-name-copy.material-symbols-outlined:hover {
  background: var(--color-surface-subtle);
  color: var(--color-accent);
}

.campaign-normquery-report .normquery-cluster-name-copy.material-symbols-outlined.normquery-cluster-name-copy--done {
  color: var(--color-success, #0f766e);
  opacity: 1;
}

.type-block--collapsible {
  padding: 0;
  overflow: visible;
}

.type-block-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  list-style: none;
  cursor: pointer;
}

.type-block-summary::-webkit-details-marker {
  display: none;
}

.type-block-summary__title {
  font-weight: 700;
  color: var(--color-accent-pressed);
}

.type-block-summary__meta {
  font-size: 12px;
}

.type-block-summary__meta-opened {
  display: none;
}

.type-block--collapsible[open] .type-block-summary__meta-closed {
  display: none;
}

.type-block--collapsible[open] .type-block-summary__meta-opened {
  display: inline;
}

.type-block--collapsible[open] .type-block-summary__meta {
  opacity: 0.85;
}

.type-block-collapsible-body {
  padding: 0 12px 12px;
}

.type-block-head {
  margin-bottom: 10px;
  width: 100%;
  max-width: 100%;
}

.type-block-titles {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.type-block-titles h3 {
  margin: 0 0 6px;
  font-size: 16px;
  color: var(--color-accent-pressed);
  font-weight: 700;
}

.type-block-titles .type-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin: 0;
  max-width: 100%;
  line-height: 1.45;
}

.type-block .ad-priority-wrap {
  margin-top: 0;
}

.camp-links {
  font-size: 12px;
  margin-top: 8px;
  line-height: 1.5;
  width: 100%;
  max-width: 100%;
}

.camp-links a {
  margin-right: 12px;
  white-space: normal;
}

.camp-links--astra a {
  margin-right: 0;
}

.camp-links--astra .camp-link-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  margin-bottom: 6px;
}

.camp-links--astra .camp-link-row:last-child {
  margin-bottom: 0;
}

.camp-links--astra .camp-link-row__sep {
  user-select: none;
}

.camp-links--astra .camp-link-astra {
  font-weight: 600;
  margin-right: 0;
}

.camp-link-wb-mark {
  font-weight: 400;
  opacity: 0.85;
}

.ad-priority-lead {
  max-width: 100%;
}

.ad-priority-lead-compact {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.4;
  max-width: 100%;
}

.ad-priority-report .nm-article-inner {
  padding: 12px 14px 16px;
}

.ad-priority-report .type-block {
  padding: 12px 14px 14px;
}

.ad-priority-report h2.muted {
  max-width: 100%;
}

.ad-priority-dates {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin: 12px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface-subtle);
  width: 100%;
  max-width: 100%;
}

.ad-priority-dates label {
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ad-priority-dates input[type="date"] {
  padding: 6px 8px;
  border: 1px solid var(--color-border-strong);
  border-radius: 6px;
  font-size: 14px;
  background: var(--color-surface);
}

.ad-priority-dates input[type="date"]:focus {
  outline: none;
  box-shadow: var(--focus-ring);
  border-color: var(--color-accent);
}

/* ——— Settings / admin nm picker ——— */
.ad-report-nm-list {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  background: var(--color-surface-subtle);
}

.ad-report-nm-block {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 6px;
  margin-bottom: 6px;
}

.ad-report-nm-block:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.ad-report-nm-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 6px 6px;
  border: none;
}

.ad-report-nm-row input {
  margin-top: 3px;
  flex-shrink: 0;
}

.ad-report-nm-row .meta {
  font-size: 13px;
  line-height: 1.35;
  min-width: 0;
}

.ad-report-nm-row .meta .title {
  font-weight: 500;
}

.ad-report-nm-row .meta .sub {
  color: var(--color-text-muted);
  font-size: 12px;
  margin-top: 2px;
}

.ad-report-nm-thumb {
  width: 40px;
  height: 53px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  background: var(--color-surface-muted);
}

.ad-report-nm-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.ad-report-nm-toolbar input[type="search"] {
  width: 100%;
  max-width: 420px;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}

.ad-report-nm-toolbar input[type="search"]::placeholder {
  color: var(--color-text-muted);
}

.ad-report-nm-search-hint {
  font-size: 12px;
  margin: 0;
  min-height: 1.2em;
}

.ad-report-nm-picked-wrap {
  margin-bottom: 4px;
}

.ad-report-nm-picked {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow: auto;
  padding: 10px 12px;
  border: 1px solid rgba(var(--a-r), var(--a-g), var(--a-b), 0.22);
  border-radius: var(--radius-md);
  background: var(--color-accent-soft);
}

.ad-report-nm-picked-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 4px;
  border-bottom: 1px solid var(--color-border);
}

.ad-report-nm-picked-row:last-child {
  border-bottom: none;
}

.ad-report-nm-picked-row[draggable="true"] {
  cursor: grab;
}

.ad-report-nm-picked-row[draggable="true"]:active {
  cursor: grabbing;
}

.ad-report-nm-picked-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin: 0 0 8px;
}

.ad-report-nm-picked-row .meta {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  line-height: 1.35;
}

.ad-report-nm-picked-row .meta .title {
  font-weight: 500;
  display: block;
}

.ad-report-nm-picked-row .meta .sub {
  color: var(--color-text-muted);
  font-size: 12px;
  margin-top: 2px;
}

.ad-report-nm-picked-remove {
  flex-shrink: 0;
  margin-top: 2px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--color-text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.ad-report-nm-picked-remove:hover {
  background: rgba(185, 28, 28, 0.12);
  color: var(--color-danger);
}

.ad-report-nm-subhead {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-accent-pressed);
}

.ad-report-nm-camps {
  margin: 0 4px 8px 30px;
  padding: 8px 10px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
}

.ad-report-nm-camps-title {
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-text-secondary);
}

.ad-report-camp-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 5px 0;
  cursor: pointer;
  line-height: 1.35;
}

.ad-report-camp-row input {
  margin-top: 2px;
  flex-shrink: 0;
}

/* ——— Admin module tiles ——— */
.admin-hero {
  margin-bottom: 0.5rem;
}

.admin-hero h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.admin-hero p {
  margin: 0.5rem 0 0;
  color: var(--color-text-secondary);
  max-width: 640px;
  line-height: 1.5;
}

.admin-hero .admin-hero__links {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-modules {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
  margin-top: 1.35rem;
}

@media (min-width: 720px) {
  .admin-modules {
    grid-template-columns: 1fr 1fr;
  }
}

.admin-module {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.35rem;
  min-height: 150px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
}

.admin-module:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(var(--a-r), var(--a-g), var(--a-b), 0.28);
  transform: translateY(-1px);
}

.admin-module:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.admin-module h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.admin-module p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text-secondary);
}

.admin-module .hint {
  margin-top: 0.85rem;
  font-size: 13px;
  color: var(--color-accent-text);
  font-weight: 600;
}

/* ——— Bulk refresh ——— */
.bulk-refresh-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.bulk-refresh-bar form {
  margin: 0;
}

.bulk-refresh-note {
  font-size: 12px;
  margin: 6px 0 0;
  color: var(--color-text-muted);
}

/* ——— Admin list pages ——— */
.admin-page-head {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
}

.admin-access-user-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: var(--color-surface-subtle);
}

.admin-access-user-card + .admin-access-user-card {
  margin-top: 12px;
}

.input-inline {
  width: 100%;
  max-width: 100%;
  padding: 8px 11px;
  font: inherit;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}

.input-inline:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: var(--focus-ring);
}

/* ——— Mobile / narrow viewports ——— */
.campaigns-table-wrap {
  margin-top: 12px;
}

@media (max-width: 768px) {
  :root {
    --page-width: 100%;
  }

  .app-header__inner,
  main.app-main {
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
    width: 100%;
    max-width: 100%;
  }

  main.app-main {
    padding-top: 0.85rem;
    padding-bottom: 2.25rem;
  }

  .page-card {
    padding: 1rem 0.9rem;
  }

  .h1-page {
    font-size: 1.25rem;
  }

  .text-lead {
    word-wrap: break-word;
  }

  .page-head {
    flex-direction: column;
    align-items: stretch;
  }

  .page-head__actions {
    width: 100%;
    justify-content: flex-start;
  }

  .home-kpi-grid {
    grid-template-columns: 1fr;
  }

  .home-articles-toolbar input[type="search"],
  .home-articles-toolbar select {
    min-width: 0;
    width: 100%;
  }

  .cards-filters .field {
    min-width: 0;
    flex: 1 1 100%;
  }

  .campaigns-toolbar .field,
  .campaigns-toolbar .field--search {
    min-width: 0;
    flex: 1 1 100%;
  }

  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
  }

  .campaign-good {
    flex-direction: column;
    align-items: stretch;
  }

  .campaign-good-photo {
    width: 100%;
    max-width: 200px;
    margin-inline: auto;
  }

  .funnel-layout {
    flex-direction: column;
  }

  .metric-nav {
    flex: 1 1 auto;
    max-width: none;
    width: 100%;
    max-height: min(40vh, 280px);
  }

  .chart-panel {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    padding: 12px;
  }

  .chart-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .chart-toolbar .periods {
    width: 100%;
  }

  .chart-toolbar > div:last-child {
    align-items: flex-start !important;
  }

  .chart-wrap {
    height: 260px;
    max-width: 100%;
  }

  .stat-date-filter {
    flex-direction: column;
    align-items: flex-start;
  }

  .table-app th,
  .table-app td {
    padding: 0.45rem 0.5rem;
    font-size: 13px;
  }

  .campaigns-data-table th,
  .campaigns-data-table td {
    padding: 8px !important;
    font-size: 12px;
  }

  .ad-priority-table td.lbl {
    min-width: 7.5rem;
    max-width: min(42vw, 12rem);
    width: auto;
  }

  .admin-module {
    padding: 1.15rem 1rem;
    min-height: 0;
  }

  .admin-page-head {
    flex-direction: column;
    align-items: stretch;
  }

  .ad-priority-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .ad-priority-dates {
    flex-direction: column;
    align-items: stretch;
  }

  .bulk-refresh-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .totals-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .form-grid {
    max-width: 100% !important;
  }

  .ad-report-nm-toolbar input[type="search"] {
    max-width: 100%;
  }

  .nm-article-inner {
    padding: 12px;
  }

  .ad-priority-report .nm-article-inner {
    padding: 10px 12px 14px;
  }

  .type-block {
    padding: 12px;
  }

  /* Отчёт «Реклама приоритет»: без тяжёлого графика, компактные таблицы */
  .ad-priority-report .ad-chart-canvas-wrap--desktop {
    display: none !important;
  }

  .ad-priority-report .ad-chart-panel {
    padding: 10px 12px 8px;
    margin-bottom: 10px;
  }

  .ad-priority-report .ad-bar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18px, 1fr));
    gap: 3px 2px;
    min-height: 72px;
    padding: 8px 4px 4px;
  }

  .ad-priority-report .ad-bar-item {
    min-height: 56px;
  }

  .ad-priority-report .ad-bar-item__fill {
    max-width: 22px;
  }

  .ad-priority-report .ad-bar-item__lab {
    font-size: 8px;
  }

  .ad-priority-report .ad-dash {
    padding: 0.85rem 10px 1rem;
    margin: 0.75rem 0 1rem;
  }

  .ad-priority-report .ad-kpi-grid {
    gap: 8px;
    margin-bottom: 0.85rem;
  }

  .ad-priority-report .ad-kpi-card {
    padding: 10px 11px;
  }

  .ad-priority-report .ad-kpi-card__label {
    font-size: 0.65rem;
  }

  .ad-priority-report .ad-kpi-card__value {
    font-size: 1.02rem;
  }

  .ad-priority-report .ad-priority-table {
    font-size: 11px;
  }

  .ad-priority-report .ad-priority-table th,
  .ad-priority-report .ad-priority-table td {
    padding: 4px 5px;
  }

  .ad-priority-report .ad-priority-table--wide th:not(.lbl),
  .ad-priority-report .ad-priority-table--wide td:not(.lbl) {
    min-width: 4.25rem;
  }

  /* На телефоне: без «План» и «Мини-график» — больше места под дни */
  .ad-priority-report .ad-priority-table th.plan-col,
  .ad-priority-report .ad-priority-table td.plan-col,
  .ad-priority-report .ad-priority-table th.spark-col,
  .ad-priority-report .ad-priority-table td.spark-col {
    display: none !important;
  }

  .ad-priority-report .nm-block {
    margin-top: 22px;
  }

  .ad-priority-report .nm-block h2 {
    font-size: 15px;
  }

  .ad-priority-report .nm-meta {
    font-size: 12px;
  }

  .ad-priority-report .nm-hero-photo {
    width: 72px;
  }

  .ad-priority-report .nm-summary-title {
    font-size: 14px;
  }

  .ad-priority-report .ad-priority-table-heading {
    font-size: 14px;
    margin-top: 1.1rem;
  }

  .ad-priority-report .ad-priority-dates {
    padding: 10px 12px;
  }

  .ad-priority-report .ad-priority-dates .mdc-button {
    width: 100%;
    justify-content: center;
  }

  .ad-priority-report .ad-nm-blocks-toolbar {
    margin: 12px 0;
    padding: 10px 12px;
  }
}

/* ——— Data refresh (per cabinet) ——— */
.data-refresh-hero {
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: linear-gradient(
    135deg,
    var(--color-accent-soft) 0%,
    var(--color-surface-subtle) 48%,
    var(--color-surface) 100%
  );
  margin-top: 0.35rem;
}

.data-refresh-hero h2 {
  margin: 0 0 0.35rem;
  font-size: 1.125rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.data-refresh-hero p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text-secondary);
  max-width: 720px;
}

.data-refresh-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.data-refresh-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.2rem;
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 100%;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.data-refresh-card:hover {
  border-color: rgba(var(--a-r), var(--a-g), var(--a-b), 0.22);
  box-shadow: var(--shadow-md);
}

.data-refresh-card h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.data-refresh-card .hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-text-secondary);
  flex: 1;
}

.data-refresh-card .meta {
  font-size: 12px;
  color: var(--color-text-muted);
}

.data-refresh-card form {
  margin-top: auto;
}

.data-refresh-card--all {
  border-color: rgba(var(--a-r), var(--a-g), var(--a-b), 0.35);
  background: linear-gradient(180deg, var(--color-accent-soft) 0%, var(--color-surface) 72px);
}

.admin-auto-refresh-box {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  background: var(--color-surface-subtle);
  margin-top: 0.75rem;
}

.admin-auto-refresh-box pre {
  margin: 0.5rem 0 0;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--color-text-secondary);
}

/* ——— Подсветка строк таблиц (main): hover + выбор по клику ——— */
main.app-main table:not([data-no-row-track]) tbody > tr {
  transition: background-color 0.12s ease, box-shadow 0.12s ease;
}

main.app-main table:not([data-no-row-track]) tbody > tr:hover {
  background-color: rgba(var(--a-r), var(--a-g), var(--a-b), 0.07);
}

html[data-theme="dark"] main.app-main table:not([data-no-row-track]) tbody > tr:hover {
  background-color: rgba(var(--a-r), var(--a-g), var(--a-b), 0.12);
}

main.app-main table:not([data-no-row-track]) tbody > tr.astra-row-selected {
  background-color: var(--color-accent-soft);
  box-shadow: inset 3px 0 0 var(--color-accent);
}

main.app-main table:not([data-no-row-track]) tbody > tr.astra-row-selected:hover {
  background-color: var(--color-accent-muted);
}

/* ——— HTTP 404 ——— */
.error-page-404 {
  max-width: 520px;
  margin: 2.5rem auto 3rem;
  padding: 2.25rem 1.75rem 2rem;
  text-align: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: linear-gradient(
    165deg,
    var(--color-accent-soft) 0%,
    var(--color-surface) 42%,
    var(--color-surface-subtle) 100%
  );
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .error-page-404 {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.error-page-404__visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  margin-bottom: 0.5rem;
}

.error-page-404__icon {
  font-size: 88px;
  color: var(--color-accent-pressed);
  opacity: 0.35;
  line-height: 1;
}

.error-page-404__code {
  position: absolute;
  font-size: 3.25rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--color-text);
  line-height: 1;
  text-shadow: 0 1px 0 var(--color-surface);
}

.error-page-404__title {
  margin: 0.75rem 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.error-page-404__lead {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.error-page-404__countdown {
  margin: 1.25rem 0 0;
  font-size: 14px;
}

.error-page-404__countdown strong {
  color: var(--color-accent-pressed);
  font-weight: 700;
}

.error-page-404__actions {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}
