/*
 * Auto.ru Business visual system.
 *
 * This file is intentionally loaded after the legacy product stylesheet and
 * changes presentation only. Product IDs, data attributes, visibility rules,
 * event targets and workflow mechanics stay owned by index.html and app.js.
 */

:root {
  --arb-bg: #f2f3f5;
  --arb-surface: #ffffff;
  --arb-surface-muted: #e8e9eb;
  --arb-surface-soft: #f7f8f9;
  --arb-sidebar: #1f1c1f;
  --arb-sidebar-hover: #302d30;
  --arb-sidebar-active: #454245;
  --arb-text: #111012;
  --arb-muted: #777b82;
  --arb-muted-light: #aeb2b8;
  --arb-border: #c8cbd0;
  --arb-border-soft: #e3e5e8;
  --arb-blue: #1683f8;
  --arb-blue-strong: #0874e8;
  --arb-blue-soft: #dcecff;
  --arb-black-button: #2c282c;
  --arb-danger: #f01818;
  --arb-danger-soft: #ffe0df;
  --arb-success: #2f9851;
  --arb-success-soft: #dcf4e3;
  --arb-warning: #bd6500;
  --arb-warning-soft: #fff0d8;
  --arb-radius-control: 10px;
  --arb-radius-panel: 20px;
  --arb-radius-dialog: 22px;
  --arb-shadow-panel: 0 5px 18px rgba(20, 18, 20, 0.06);
  --arb-shadow-popover: 0 16px 38px rgba(20, 18, 20, 0.16);
  --arb-control-height: 40px;
}

body:not(.auth-locked) {
  --app-sidebar-width: 196px;
  --product-page-gutter: 20px;
  --product-control-height: var(--arb-control-height);
  --product-surface-radius: var(--arb-radius-panel);
  color: var(--arb-text);
  background: var(--arb-bg);
}

body.sidebar-collapsed {
  --app-sidebar-width: 64px;
}

body:not(.auth-locked) > .workspace-context,
body:not(.auth-locked) > main:not(#authView) {
  width: calc(100% - (var(--product-page-gutter) * 2));
  margin-right: var(--product-page-gutter);
  margin-left: var(--product-page-gutter);
}

/* Shell and navigation */
.app-sidebar {
  border-right: 0;
  color: #fff;
  background: var(--arb-sidebar);
}

.app-sidebar > header {
  min-height: 58px;
  padding: 16px 12px 10px;
}

.app-sidebar .header-brand-logo {
  width: 112px;
}

.sidebar-service-name {
  font-size: 0.62rem;
}

.app-sidebar .profile-trigger {
  width: calc(100% - 16px);
  min-height: 60px;
  grid-template-columns: 32px minmax(0, 1fr) 14px;
  gap: 9px;
  margin: 0 8px 7px;
  padding: 8px;
  border-radius: 12px;
}

.app-sidebar .profile-trigger:hover,
.app-sidebar .profile-trigger:focus-visible {
  background: var(--arb-sidebar-hover);
}

.app-sidebar .profile-trigger .avatar-small {
  width: 32px;
  height: 32px;
}

.app-sidebar .current-user-copy strong {
  max-width: 112px;
  font-size: 0.78rem;
  font-weight: 500;
}

.app-sidebar .current-user-copy small {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.66rem;
}

.sidebar-nav {
  padding: 8px 7px 16px;
  border-top-color: rgba(255, 255, 255, 0.08);
}

.sidebar-group {
  gap: 3px;
  padding: 14px 0 8px;
}

.sidebar-group-head {
  min-height: 24px;
  margin-bottom: 4px;
  padding: 0 5px;
}

.sidebar-group-label {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.66rem;
  font-weight: 500;
}

.sidebar-nav-row {
  grid-template-columns: minmax(0, 1fr) 36px;
  border-radius: 11px;
}

.sidebar-nav-row:hover {
  background: var(--arb-sidebar-hover);
}

.sidebar-nav-row.is-active {
  background: var(--arb-sidebar-active);
}

.app-sidebar .nav-btn,
.sidebar-item-action {
  min-height: 42px;
}

.app-sidebar .nav-btn {
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  padding: 9px 8px;
  border-radius: 11px 0 0 11px;
}

.app-sidebar .nav-btn svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.9;
}

.app-sidebar .nav-btn > span,
.sidebar-collapse span {
  font-size: 0.8rem;
  line-height: 1.2;
}

.sidebar-item-action {
  width: 36px;
  border-radius: 0 11px 11px 0;
}

.sidebar-item-action:hover,
.sidebar-item-action:focus-visible {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-footer {
  padding: 7px;
  background: var(--arb-sidebar);
}

.sidebar-collapse {
  min-height: 42px;
  padding: 9px 8px;
  border-radius: 11px;
}

.sidebar-collapse:hover {
  background: var(--arb-sidebar-hover);
}

body.sidebar-collapsed .app-sidebar .profile-trigger {
  width: 50px;
  margin-inline: 7px;
}

/* Page composition and typography */
body:not(.auth-locked) > .workspace-context {
  margin-top: 18px;
  margin-bottom: 22px;
}

.colors-page-head,
.photobank-page-head,
.knowledge-page-head,
.feeds-page-head,
.dealers-page-head,
.audit-page-head,
.users-page-head,
.feed-detail-head,
.dealer-detail-head {
  min-height: 72px;
  align-items: center;
  margin-bottom: 20px;
}

:is(
  .colors-page-head,
  .photobank-page-head,
  .knowledge-page-head,
  .feeds-page-head,
  .dealers-page-head,
  .audit-page-head,
  .users-page-head,
  .feed-detail-head,
  .dealer-detail-head,
  .feed-flow-intro
) h1 {
  color: #000;
  font-size: clamp(2rem, 2.5vw, 2.65rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

:is(
  .colors-page-head,
  .photobank-page-head,
  .knowledge-page-head,
  .feeds-page-head,
  .dealers-page-head,
  .audit-page-head,
  .users-page-head,
  .feed-detail-head,
  .dealer-detail-head,
  .feed-flow-intro
) p {
  margin-top: 8px;
  color: var(--arb-muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.section-kicker,
.workflow-kicker {
  margin-bottom: 7px;
  color: var(--arb-muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

h2,
.colors-list-head h2,
.audit-list-head h2 {
  color: #000;
  letter-spacing: -0.02em;
}

/* Buttons and interactive controls */
body:not(.auth-locked) :is(.btn-primary, .btn-secondary, .btn-danger) {
  min-height: 42px;
  padding: 9px 18px;
  border-radius: 11px;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.15;
}

body:not(.auth-locked) .btn-primary {
  border-color: var(--arb-black-button);
  background: var(--arb-black-button);
  color: #fff;
}

body:not(.auth-locked) .btn-primary:hover:not(:disabled) {
  border-color: #171517;
  background: #171517;
}

body:not(.auth-locked) .btn-secondary {
  border-color: transparent;
  background: #e4e5e7;
  color: var(--arb-text);
}

body:not(.auth-locked) .btn-secondary:hover:not(:disabled) {
  border-color: transparent;
  background: #d8dade;
}

body:not(.auth-locked) .btn-danger {
  border-color: var(--arb-danger);
  background: var(--arb-danger);
  color: #fff;
}

body:not(.auth-locked) :is(button, a, summary, input, select, textarea):focus-visible {
  outline: 2px solid var(--arb-blue);
  outline-offset: 2px;
}

/* Shared white surfaces */
:is(
  .section-filter-menu,
  .feeds-list-card,
  .colors-list-card,
  .audit-list-card,
  .dealers-list-card,
  .photobank-card,
  .photobank-result,
  .knowledge-upload-card,
  .knowledge-evidence-card,
  .knowledge-samples-card,
  .knowledge-rules-card,
  .users-page,
  .feed-flow-card,
  .card,
  .dealer-flow-column,
  .feed-detail-section,
  .color-learning-mode
) {
  border-color: var(--arb-border-soft);
  border-radius: var(--arb-radius-panel);
  background: var(--arb-surface);
  box-shadow: var(--arb-shadow-panel);
}

.section-filter-menu {
  margin-bottom: 20px;
  overflow: visible;
  border: 0;
}

/* Filter panels, chips and popovers */
.section-filter-bar,
.dealers-filter-bar {
  min-height: 64px;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border-radius: var(--arb-radius-panel);
  background: var(--arb-surface);
}

.section-filter-fields,
.dealers-filter-fields,
.audit-filter-fields,
.feeds-filter-fields {
  gap: 10px;
}

.section-filter-primary,
.dealers-all-filters {
  min-height: var(--arb-control-height);
  padding: 9px 14px;
  border: 1px solid var(--arb-blue);
  border-radius: var(--arb-radius-control);
  background: var(--arb-blue);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
}

.section-filter-primary:hover,
.dealers-all-filters:hover {
  border-color: var(--arb-blue-strong);
  background: var(--arb-blue-strong);
}

.section-filter-control,
.dealer-filter-control,
.section-filter-chip,
.feed-filter-menu > summary,
.dealers-reset-filters,
.section-filter-reset {
  min-height: var(--arb-control-height);
  border: 1px solid var(--arb-border);
  border-radius: var(--arb-radius-control);
  background: #fff;
  color: var(--arb-text);
  font-size: 0.76rem;
}

.section-filter-control,
.dealer-filter-control {
  padding-right: 12px;
  padding-left: 12px;
}

.section-filter-control input,
.dealer-filter-control input {
  min-height: 38px;
  font-size: 0.76rem;
}

.section-filter-chip,
.feed-filter-menu > summary,
.dealers-reset-filters,
.section-filter-reset {
  padding: 9px 12px;
  font-weight: 500;
}

.section-filter-control:focus-within,
.dealer-filter-control:focus-within,
.section-filter-control.has-value,
.dealer-filter-control.has-value,
.section-filter-chip.is-active,
.feed-filter-menu.has-value > summary,
.feed-filter-menu[open] > summary {
  border-color: var(--arb-blue);
  background: var(--arb-blue-soft);
  color: var(--arb-text);
  box-shadow: none;
}

.feed-filter-menu[open] > summary {
  background: #fff;
}

.feed-filter-menu > summary:hover,
.section-filter-chip:hover {
  border-color: #9ca1a8;
}

.feed-filter-popover,
.context-select-popover,
.workspace-menu-popover,
.mapping-profile-popover,
.mapping-select-popover,
.review-select-popover,
.color-canonical-popover {
  border: 0;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--arb-shadow-popover);
}

.feed-filter-popover {
  top: calc(100% + 6px);
  width: 300px;
  padding: 12px;
}

.feed-choice-list {
  gap: 2px;
}

.feed-choice-list label,
.feed-filter-suggestions button,
.audit-actor-search-results label {
  min-height: 42px;
  padding: 9px 11px;
  border-radius: 0;
  font-size: 0.78rem;
}

.feed-choice-list label:hover,
.feed-choice-list label:has(input:checked),
.feed-filter-suggestions button:hover,
.feed-filter-suggestions button.is-selected {
  background: #e7e8ea;
  color: var(--arb-text);
}

.feed-filter-field select,
.feed-filter-field input,
.feed-vehicle-columns input {
  min-height: 46px;
  padding: 10px 12px;
  border-color: var(--arb-border);
  border-radius: var(--arb-radius-control);
  font-size: 0.78rem;
}

.feed-filter-popover-actions {
  margin: 12px -12px -12px;
  border-top-color: var(--arb-border-soft);
}

.feed-filter-popover-actions button {
  min-height: 54px;
  border-right-color: var(--arb-border-soft);
  font-size: 0.8rem;
}

.feed-filter-popover-actions button:hover {
  background: var(--arb-surface-soft);
}

.feed-filter-chevron {
  width: 8px;
  height: 8px;
}

/* General form language */
body:not(.auth-locked) :where(
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  select,
  textarea
) {
  min-height: 46px;
  padding: 10px 13px;
  border: 1px solid var(--arb-border);
  border-radius: 11px;
  background: #fff;
  color: var(--arb-text);
  font-size: 0.82rem;
}

body:not(.auth-locked) :where(input, select, textarea)::placeholder {
  color: #8a8e94;
}

body:not(.auth-locked) :where(input, select, textarea):disabled {
  border-color: var(--arb-border);
  background: #e7e8ea;
  color: #858990;
}

body:not(.auth-locked) :where(input, select, textarea):focus {
  border-color: var(--arb-blue);
  box-shadow: 0 0 0 1px var(--arb-blue);
}

body:not(.auth-locked) :where(input, select, textarea).field-error {
  border-color: var(--arb-danger);
  background: #fff;
  box-shadow: 0 0 0 1px var(--arb-danger);
}

/* Tables and directory lists */
.feeds-list-card,
.colors-list-card,
.audit-list-card,
.dealers-list-card {
  overflow: hidden;
  border: 0;
}

:is(.feeds-table, .dealers-table, .knowledge-rules-table) thead th {
  padding: 15px 16px;
  border-bottom: 1px solid var(--arb-border-soft);
  color: var(--arb-muted);
  background: #fff;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.25;
}

:is(.feeds-table, .dealers-table, .knowledge-rules-table) tbody td {
  padding: 17px 16px;
  border-bottom: 1px solid var(--arb-border-soft);
  background: #fff;
  font-size: 0.78rem;
  line-height: 1.35;
}

:is(.feeds-table, .dealers-table, .knowledge-rules-table) tbody tr:hover td {
  background: #fafbfc;
}

.feeds-list-footer,
.colors-list-footer,
.audit-list-footer,
.dealers-list-footer,
.users-page-footer {
  min-height: 52px;
  padding: 13px 16px;
  border-top: 1px solid var(--arb-border-soft);
  color: var(--arb-muted);
  background: #fff;
  font-size: 0.72rem;
}

.colors-list-head,
.audit-list-head,
.feeds-list-head {
  padding: 19px 20px;
  border-bottom-color: var(--arb-border-soft);
}

.colors-list-head h2,
.audit-list-head h2,
.feeds-list-head h2 {
  font-size: 1.2rem;
  font-weight: 600;
}

/* Tabs, status pills and compact tags */
.feeds-lifecycle-tabs,
.review-filter-tabs {
  gap: 22px;
  border-bottom: 1px solid var(--arb-border-soft);
}

.feeds-lifecycle-tabs button,
.review-filter-tabs button {
  min-height: 46px;
  border-radius: 0;
  color: var(--arb-muted);
  background: transparent;
  font-size: 0.8rem;
  font-weight: 500;
}

.feeds-lifecycle-tabs button.is-active,
.review-filter-tabs button.active {
  color: var(--arb-text);
  box-shadow: inset 0 -2px 0 var(--arb-blue);
}

:is(
  .role-chip,
  .status-pill,
  .color-history-method,
  .knowledge-status-pill,
  .mapping-state-badge,
  .settings-state-badge,
  .upload-state-badge,
  .feed-status-pill,
  .review-status-pill
) {
  border-radius: 8px;
  font-weight: 500;
}

/* Creation workflow, knowledge and content cards */
.feed-flow-intro {
  margin-bottom: 20px;
}

.feed-flow-deck {
  gap: 14px;
}

.feed-flow-card {
  border: 0;
}

.feed-stage-toggle {
  min-height: 72px;
  padding: 16px 18px;
}

.feed-stage-marker,
.color-learning-number {
  border-radius: 10px;
  background: var(--arb-blue-soft);
  color: var(--arb-blue-strong);
}

.feed-stage-copy strong,
.color-learning-mode strong {
  color: #000;
  font-size: 0.9rem;
  font-weight: 600;
}

.feed-stage-copy small,
.color-learning-mode p {
  color: var(--arb-muted);
}

.color-learning-modes {
  gap: 16px;
  margin-bottom: 20px;
}

.color-learning-mode {
  min-height: 148px;
  padding: 22px;
  border: 0;
}

.mapping-note-card,
.price-decision-card,
.import-question-card,
.review-resolution-panel,
.validation-panel,
.result-summary-card,
.result-link-card,
.result-acceptance-card {
  border-radius: 16px;
}

/* Empty states */
:is(
  .colors-empty-state,
  .feeds-empty-state,
  .audit-empty-cell,
  .dealers-empty-state,
  .review-empty,
  .users-directory-loading
) {
  color: var(--arb-muted);
}

:is(.colors-empty-state, .feeds-empty-state, .dealers-empty-state) strong {
  color: var(--arb-text);
  font-size: 0.9rem;
  font-weight: 600;
}

/* Dialogs and drawers */
.modal-backdrop {
  padding: 24px;
  background: rgba(17, 16, 18, 0.36);
  backdrop-filter: blur(2px);
}

:is(
  .profile-panel,
  .password-change-panel,
  .logout-confirm-panel,
  .user-editor-modal-card,
  .workspace-modal,
  .color-delete-panel,
  .feed-lifecycle-panel,
  .operation-confirm-panel
) {
  border: 0;
  border-radius: var(--arb-radius-dialog);
  background: #fff;
  box-shadow: 0 28px 80px rgba(17, 16, 18, 0.24);
}

:is(
  .password-change-panel,
  .logout-confirm-panel,
  .workspace-modal,
  .color-delete-panel,
  .feed-lifecycle-panel,
  .operation-confirm-panel
) {
  padding: 30px;
}

:is(
  .password-change-panel,
  .logout-confirm-panel,
  .workspace-modal,
  .color-delete-panel,
  .feed-lifecycle-panel,
  .operation-confirm-panel
) h2 {
  color: #000;
  font-size: 1.55rem;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.modal-actions,
.operation-confirm-actions,
.feed-lifecycle-actions {
  gap: 12px;
}

.modal-close {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #e8e9eb;
}

.feed-filter-drawer {
  border: 0;
  border-radius: 22px 0 0 22px;
  box-shadow: -18px 0 48px rgba(17, 16, 18, 0.18);
}

/* Profile is a Feed Generator-only feature, but follows the same form language. */
.profile-panel {
  overflow: hidden;
  color: var(--arb-text);
  background: #fff;
}

.profile-head,
.profile-section-head {
  border-color: var(--arb-border-soft);
}

.profile-head {
  background: #fff;
  backdrop-filter: none;
}

.profile-head .section-kicker {
  color: var(--arb-muted);
}

.profile-head h2 {
  color: #000;
}

.profile-panel .modal-close {
  border-color: transparent;
  color: var(--arb-text);
  background: #e8e9eb;
}

.profile-panel .modal-close:hover {
  border-color: transparent;
  color: #000;
  background: #dfe1e4;
}

.profile-summary {
  color: #fff;
  background: var(--arb-sidebar);
  backdrop-filter: none;
}

.profile-form {
  background: #fff;
}

.profile-section {
  color: var(--arb-text);
  background: transparent;
}

.profile-section + .profile-section {
  border-top-color: var(--arb-border-soft);
}

.profile-section-head > div > span {
  color: var(--arb-blue-strong);
  background: var(--arb-blue-soft);
}

.profile-section-head h3,
.profile-admin-tools h3 {
  color: #000;
}

.profile-fields label,
.profile-email-field > label {
  color: var(--arb-text);
}

.profile-fields input {
  border-color: var(--arb-border);
  background: #fff;
}

.profile-fields input:disabled {
  background: #e7e8ea;
}

.users-filters {
  gap: 10px;
  padding: 14px;
  border: 0;
  border-radius: var(--arb-radius-panel);
  background: #fff;
  box-shadow: var(--arb-shadow-panel);
}

.users-directory {
  border-radius: var(--arb-radius-panel);
}

.users-add-button {
  min-height: 42px;
  padding: 9px 18px;
  border-radius: 11px;
  background: var(--arb-black-button);
  font-size: 0.82rem;
}

/* Tooltips use the compact black Auto.ru Business pattern. */
[data-tooltip]::after,
[data-info-tooltip]::after {
  border-radius: 10px;
  background: #080808;
  color: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

/* Keep the existing dark-theme feature usable without forcing light tokens. */
body[data-theme="dark"]:not(.auth-locked) {
  --arb-surface: #292629;
  --arb-surface-muted: #353235;
  --arb-surface-soft: #312e31;
  --arb-text: #f6f6f6;
  --arb-muted: #b8b5b8;
  --arb-border: rgba(255, 255, 255, 0.16);
  --arb-border-soft: rgba(255, 255, 255, 0.1);
  --arb-blue-soft: rgba(22, 131, 248, 0.2);
  --arb-shadow-panel: 0 5px 18px rgba(0, 0, 0, 0.2);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .section-filter-menu,
  .section-filter-bar,
  .dealers-filter-bar,
  .feeds-list-card,
  .colors-list-card,
  .audit-list-card,
  .dealers-list-card,
  .users-filters,
  .feed-flow-card,
  .color-learning-mode
) {
  background: var(--arb-surface);
}

/* Responsive rules retain all existing mechanics and only reflow visuals. */
@media (max-width: 1100px) {
  body:not(.auth-locked) {
    --product-page-gutter: 14px;
  }

  :is(
    .colors-page-head,
    .photobank-page-head,
    .knowledge-page-head,
    .feeds-page-head,
    .dealers-page-head,
    .audit-page-head,
    .users-page-head
  ) {
    min-height: 64px;
  }

  :is(
    .colors-page-head,
    .photobank-page-head,
    .knowledge-page-head,
    .feeds-page-head,
    .dealers-page-head,
    .audit-page-head,
    .users-page-head,
    .feed-flow-intro
  ) h1 {
    font-size: 2rem;
  }
}

@media (max-width: 700px) {
  body:not(.auth-locked) {
    --product-page-gutter: 10px;
  }

  body:not(.auth-locked) > .workspace-context {
    margin-top: 10px;
    margin-bottom: 16px;
  }

  .section-filter-bar,
  .dealers-filter-bar {
    min-height: 0;
    gap: 8px;
    padding: 10px;
    border-radius: 16px;
  }

  .section-filter-primary,
  .dealers-all-filters,
  .section-filter-fields,
  .dealers-filter-fields,
  .feed-filter-menu,
  .feed-filter-menu > summary {
    width: 100%;
  }

  .feed-filter-popover,
  .feed-filter-menu-wide .feed-filter-popover {
    width: 100%;
    border: 1px solid var(--arb-border-soft);
    box-shadow: none;
  }

  .color-learning-mode {
    min-height: 0;
    padding: 18px;
  }

  :is(
    .colors-page-head,
    .photobank-page-head,
    .knowledge-page-head,
    .feeds-page-head,
    .dealers-page-head,
    .audit-page-head,
    .users-page-head,
    .feed-flow-intro
  ) h1 {
    font-size: 1.75rem;
  }

  .modal-backdrop {
    padding: 10px;
  }

  :is(
    .password-change-panel,
    .logout-confirm-panel,
    .workspace-modal,
    .color-delete-panel,
    .feed-lifecycle-panel,
    .operation-confirm-panel
  ) {
    padding: 22px;
    border-radius: 18px;
  }
}

/* Dark theme correction layer.
   It deliberately comes last: every light presentation rule above must have a
   dark counterpart so the theme never depends on stylesheet order. */
body[data-theme="dark"]:not(.auth-locked) {
  --arb-bg: #1c1a1c;
  --arb-surface: #292629;
  --arb-surface-muted: #353235;
  --arb-surface-soft: #312e31;
  --arb-sidebar: #1f1c1f;
  --arb-sidebar-hover: #302d30;
  --arb-sidebar-active: #454245;
  --arb-text: #f5f2ef;
  --arb-muted: #b8b4b8;
  --arb-muted-light: #8f8a8f;
  --arb-border: rgba(255, 255, 255, 0.16);
  --arb-border-soft: rgba(255, 255, 255, 0.1);
  --arb-blue-soft: rgba(22, 131, 248, 0.2);
  --arb-black-button: #1683f8;
  --arb-success: #7ed5b8;
  --arb-success-soft: rgba(126, 213, 184, 0.14);
  --arb-warning: #f4c777;
  --arb-warning-soft: rgba(244, 199, 119, 0.14);
  --arb-danger: #ff8e87;
  --arb-danger-soft: rgba(255, 142, 135, 0.14);
  --arb-shadow-panel: 0 8px 24px rgba(0, 0, 0, 0.22);
  --arb-shadow-popover: 0 18px 44px rgba(0, 0, 0, 0.42);
  color: var(--arb-text);
  color-scheme: dark;
  background:
    radial-gradient(circle at 78% 24%, rgba(22, 131, 248, 0.25), transparent 30%),
    linear-gradient(145deg, #1c1a1c 0%, #292629 58%, #151415 100%);
  background-attachment: fixed;
}

body[data-theme="dark"]:not(.auth-locked)::before {
  right: -110px;
  bottom: -210px;
  z-index: -1;
  width: min(720px, 62vw);
  height: min(720px, 62vw);
  aspect-ratio: auto;
  background: url("/static/assets/brand/arb-car-sand.svg") center / contain no-repeat;
  opacity: 0.045;
  transform: rotate(-6deg);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .colors-page-head,
  .photobank-page-head,
  .knowledge-page-head,
  .feeds-page-head,
  .dealers-page-head,
  .audit-page-head,
  .users-page-head,
  .feed-detail-head,
  .dealer-detail-head,
  .feed-flow-intro
) h1,
body[data-theme="dark"]:not(.auth-locked) :is(
  .colors-list-head,
  .audit-list-head,
  .feeds-list-head,
  .knowledge-upload-card,
  .knowledge-evidence-card,
  .knowledge-samples-card,
  .knowledge-rules-card,
  .feed-flow-card,
  .color-learning-mode,
  .users-directory,
  .photobank-card,
  .photobank-result
) :is(h2, h3, strong),
body[data-theme="dark"]:not(.auth-locked) .users-title-row h1 {
  color: var(--arb-text);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .colors-page-head,
  .photobank-page-head,
  .knowledge-page-head,
  .feeds-page-head,
  .dealers-page-head,
  .audit-page-head,
  .users-page-head,
  .feed-detail-head,
  .dealer-detail-head,
  .feed-flow-intro
) p,
body[data-theme="dark"]:not(.auth-locked) :is(.hint, small),
body[data-theme="dark"]:not(.auth-locked) .section-kicker,
body[data-theme="dark"]:not(.auth-locked) .workflow-kicker {
  color: var(--arb-muted);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .section-filter-menu,
  .section-filter-bar,
  .dealers-filter-bar,
  .feeds-list-card,
  .colors-list-card,
  .audit-list-card,
  .dealers-list-card,
  .photobank-card,
  .photobank-result,
  .knowledge-upload-card,
  .knowledge-evidence-card,
  .knowledge-samples-card,
  .knowledge-rules-card,
  .feed-flow-card,
  .card,
  .dealer-flow-column,
  .feed-detail-section,
  .color-learning-mode,
  .users-filters,
  .users-directory,
  .users-page-footer
) {
  border-color: var(--arb-border-soft);
  color: var(--arb-text);
  background: var(--arb-surface);
  box-shadow: var(--arb-shadow-panel);
}

body[data-theme="dark"]:not(.auth-locked) .users-page {
  color: var(--arb-text);
  background: transparent;
  box-shadow: none;
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .section-filter-control,
  .dealer-filter-control,
  .section-filter-chip,
  .feed-filter-menu > summary,
  .dealers-reset-filters,
  .section-filter-reset,
  .users-search > input,
  .users-filters select
) {
  border-color: var(--arb-border);
  color: var(--arb-text);
  background: var(--arb-surface-soft);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .section-filter-control,
  .dealer-filter-control,
  .users-search
) > input,
body[data-theme="dark"]:not(.auth-locked) :is(
  .section-filter-control,
  .dealer-filter-control,
  .users-search
) > input:focus {
  color: var(--arb-text);
  background: transparent;
}

body[data-theme="dark"]:not(.auth-locked) .users-search > input,
body[data-theme="dark"]:not(.auth-locked) .users-search > input:focus {
  border-color: var(--arb-border);
  background: var(--arb-surface-soft);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .section-filter-control:focus-within,
  .dealer-filter-control:focus-within,
  .section-filter-control.has-value,
  .dealer-filter-control.has-value,
  .section-filter-chip.is-active,
  .feed-filter-menu.has-value > summary,
  .feed-filter-menu[open] > summary
) {
  border-color: var(--arb-blue);
  color: #dcecff;
  background: var(--arb-blue-soft);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .feed-filter-popover,
  .context-select-popover,
  .workspace-menu-popover,
  .mapping-profile-popover,
  .mapping-select-popover,
  .review-select-popover,
  .color-canonical-popover,
  .feed-actions-popover,
  .color-actions-popover,
  .user-actions-popover,
  .feed-filter-drawer,
  .feed-filter-drawer > header,
  .feed-filter-drawer > footer
) {
  border-color: var(--arb-border);
  color: var(--arb-text);
  background: var(--arb-surface-soft);
  box-shadow: var(--arb-shadow-popover);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .feed-choice-list label,
  .feed-filter-suggestions button,
  .audit-actor-search-results label,
  .platform-choice,
  .mapping-profile-option,
  .mapping-select-option,
  .feed-actions-popover button,
  .feed-actions-popover a,
  .user-actions-popover button
) {
  color: var(--arb-text);
  background: transparent;
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .feed-choice-list label:hover,
  .feed-choice-list label:has(input:checked),
  .feed-filter-suggestions button:hover,
  .feed-filter-suggestions button.is-selected,
  .platform-choice:hover,
  .mapping-profile-option:hover,
  .mapping-select-option:hover,
  .feed-actions-popover button:hover,
  .feed-actions-popover a:hover,
  .user-actions-popover button:hover
) {
  color: #fff;
  background: var(--arb-surface-muted);
}

body[data-theme="dark"]:not(.auth-locked) :where(
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  select,
  textarea
) {
  border-color: var(--arb-border);
  color: var(--arb-text);
  background: var(--arb-surface-soft);
}

body[data-theme="dark"]:not(.auth-locked) :where(input, select, textarea)::placeholder {
  color: #aaa6aa;
}

body[data-theme="dark"]:not(.auth-locked) :where(input, select, textarea):disabled {
  border-color: var(--arb-border-soft);
  color: #9d999d;
  background: var(--arb-surface-muted);
}

body[data-theme="dark"]:not(.auth-locked) .btn-primary {
  border-color: var(--arb-blue);
  color: #fff;
  background: var(--arb-blue);
}

body[data-theme="dark"]:not(.auth-locked) .btn-primary:hover:not(:disabled) {
  border-color: var(--arb-blue-strong);
  background: var(--arb-blue-strong);
}

body[data-theme="dark"]:not(.auth-locked) :is(.btn-secondary, .btn-quiet) {
  border-color: var(--arb-border);
  color: var(--arb-text);
  background: var(--arb-surface-muted);
}

body[data-theme="dark"]:not(.auth-locked) :is(.btn-secondary, .btn-quiet):hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.24);
  background: #403c40;
}

body[data-theme="dark"]:not(.auth-locked) .btn-primary:disabled {
  border-color: var(--arb-border-soft);
  color: #9d999d;
  background: var(--arb-surface-muted);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .feeds-table,
  .dealers-table,
  .knowledge-rules-table,
  .colors-product-table,
  .audit-product-table
) thead th,
body[data-theme="dark"]:not(.auth-locked) .feeds-product-table th {
  border-color: var(--arb-border-soft);
  color: var(--arb-muted);
  background: var(--arb-surface);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .feeds-table,
  .dealers-table,
  .knowledge-rules-table,
  .colors-product-table,
  .audit-product-table
) tbody td,
body[data-theme="dark"]:not(.auth-locked) .feeds-product-table td {
  border-color: var(--arb-border-soft);
  color: var(--arb-text);
  background: var(--arb-surface);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .feeds-table,
  .dealers-table,
  .knowledge-rules-table,
  .colors-product-table,
  .audit-product-table
) tbody tr:hover td,
body[data-theme="dark"]:not(.auth-locked) .feeds-product-table tbody tr:hover td {
  background: var(--arb-surface-soft);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .feeds-list-footer,
  .colors-list-footer,
  .audit-list-footer,
  .dealers-list-footer,
  .users-page-footer
) {
  border-color: var(--arb-border-soft);
  color: var(--arb-muted);
  background: var(--arb-surface-soft);
}

body[data-theme="dark"]:not(.auth-locked) .feeds-lifecycle-tabs {
  border-bottom-color: var(--arb-border-soft);
  background: transparent;
}

body[data-theme="dark"]:not(.auth-locked) .feeds-lifecycle-tabs button,
body[data-theme="dark"]:not(.auth-locked) .feeds-lifecycle-tabs button.is-active {
  color: var(--arb-muted);
  background: transparent;
  box-shadow: none;
}

body[data-theme="dark"]:not(.auth-locked) .feeds-lifecycle-tabs button.is-active {
  color: var(--arb-text);
}

body[data-theme="dark"]:not(.auth-locked) .feeds-lifecycle-tabs strong {
  color: var(--arb-muted);
  background: var(--arb-surface-muted);
}

body[data-theme="dark"]:not(.auth-locked) .feeds-lifecycle-tabs button.is-active strong {
  color: #8fc5ff;
  background: var(--arb-blue-soft);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .feed-stage-copy strong,
  .color-learning-mode strong,
  .colors-empty-state strong,
  .feeds-empty-state strong,
  .dealers-empty-state strong,
  .users-directory-main > strong,
  .users-directory-meta > strong
) {
  color: var(--arb-text);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .feed-stage-copy small,
  .color-learning-mode p,
  .colors-empty-state,
  .feeds-empty-state,
  .audit-empty-cell,
  .dealers-empty-state,
  .users-directory-main > span,
  .users-directory-meta > small
) {
  color: var(--arb-muted);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .feed-stage-body,
  .feed-stage-navigation,
  .mapping-note-card,
  .price-decision-card,
  .import-question-card,
  .review-resolution-panel,
  .validation-panel,
  .result-summary-card,
  .result-link-card,
  .result-acceptance-card,
  .photobank-form,
  .photobank-entity-card,
  .photobank-source-card
) {
  border-color: var(--arb-border-soft);
  color: var(--arb-text);
  background: var(--arb-surface-soft);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .profile-panel,
  .password-change-panel,
  .logout-confirm-panel,
  .user-editor-modal-card,
  .workspace-modal,
  .color-delete-panel,
  .feed-lifecycle-panel,
  .operation-confirm-panel
) {
  border-color: var(--arb-border);
  color: var(--arb-text);
  background: var(--arb-surface);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.48);
}

/* Profile intentionally keeps the exact shared login background in both themes. */
body[data-theme="dark"]:not(.auth-locked) .profile-panel {
  color: #fff;
  background:
    radial-gradient(circle at 78% 24%, rgba(22, 131, 248, 0.25), transparent 30%),
    linear-gradient(145deg, #1c1a1c 0%, #292629 58%, #151415 100%);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .password-change-panel,
  .logout-confirm-panel,
  .workspace-modal,
  .color-delete-panel,
  .feed-lifecycle-panel,
  .operation-confirm-panel
) h2,
body[data-theme="dark"]:not(.auth-locked) .user-editor-head h3 {
  color: var(--arb-text);
}

body[data-theme="dark"]:not(.auth-locked) .modal-close {
  border-color: var(--arb-border);
  color: var(--arb-text);
  background: var(--arb-surface-muted);
}

body[data-theme="dark"]:not(.auth-locked) .user-role-segments {
  background: var(--arb-surface-soft);
}

body[data-theme="dark"]:not(.auth-locked) .user-role-segments button {
  color: var(--arb-muted);
}

body[data-theme="dark"]:not(.auth-locked) .user-role-segments button.is-active {
  color: var(--arb-text);
  background: var(--arb-surface-muted);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.28);
}

body[data-theme="dark"]:not(.auth-locked) .users-directory-item + .users-directory-item {
  border-top-color: var(--arb-border-soft);
}

body[data-theme="dark"]:not(.auth-locked) .users-help summary,
body[data-theme="dark"]:not(.auth-locked) .users-help > div {
  border-color: var(--arb-border);
  color: var(--arb-text);
  background: var(--arb-surface-soft);
}

body[data-theme="dark"]:not(.auth-locked) .users-help summary > span {
  color: #fff;
  background: var(--arb-blue);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .role-chip,
  .status-pill,
  .color-history-method,
  .knowledge-status-pill,
  .mapping-state-badge,
  .settings-state-badge,
  .upload-state-badge,
  .feed-status-pill,
  .review-status-pill,
  .feed-file-icon,
  .feed-car-count,
  .color-history-event-icon,
  .audit-event-icon
) {
  border-color: var(--arb-border-soft);
  color: var(--arb-text);
  background: var(--arb-surface-muted);
}

body[data-theme="dark"]:not(.auth-locked) .section-filter-primary,
body[data-theme="dark"]:not(.auth-locked) .dealers-all-filters {
  border-color: var(--arb-blue);
  color: #fff;
  background: var(--arb-blue);
}

/* Final scale calibration after comparison with the supplied Auto.ru Business
   screens. Legacy views used 10–12 px product copy; the reference system keeps
   controls and operational data comfortably readable. */
body:not(.auth-locked) :is(.btn-primary, .btn-secondary, .btn-danger) {
  font-size: 0.875rem;
}

.app-sidebar .header-brand-logo {
  width: 102px;
}

.sidebar-service-name {
  font-size: 0.58rem;
}

.app-sidebar .current-user-copy strong {
  font-size: 0.84rem;
}

.app-sidebar .current-user-copy small,
.sidebar-group-label {
  font-size: 0.72rem;
}

.app-sidebar .nav-btn > span,
.sidebar-collapse span {
  font-size: 0.875rem;
}

:is(
  .colors-page-head,
  .photobank-page-head,
  .knowledge-page-head,
  .feeds-page-head,
  .dealers-page-head,
  .audit-page-head,
  .users-page-head,
  .feed-detail-head,
  .dealer-detail-head,
  .feed-flow-intro
) h1 {
  font-size: clamp(2.25rem, 3vw, 2.7rem);
}

:is(
  .colors-page-head,
  .photobank-page-head,
  .knowledge-page-head,
  .feeds-page-head,
  .dealers-page-head,
  .audit-page-head,
  .users-page-head,
  .feed-detail-head,
  .dealer-detail-head,
  .feed-flow-intro
) p {
  font-size: 0.9rem;
}

.section-kicker,
.workflow-kicker {
  font-size: 0.72rem;
}

.section-filter-primary,
.dealers-all-filters,
.section-filter-control,
.dealer-filter-control,
.section-filter-chip,
.feed-filter-menu > summary,
.dealers-reset-filters,
.section-filter-reset {
  font-size: 0.82rem;
}

.section-filter-control input,
.dealer-filter-control input {
  font-size: 0.82rem;
}

.feed-choice-list label,
.feed-filter-suggestions button,
.audit-actor-search-results label,
.feed-filter-field select,
.feed-filter-field input,
.feed-vehicle-columns input {
  font-size: 0.82rem;
}

.feed-filter-popover :is(small, p, .hint) {
  font-size: 0.72rem;
}

:is(.feeds-table, .dealers-table, .knowledge-rules-table) thead th {
  font-size: 0.76rem;
}

:is(.feeds-table, .dealers-table, .knowledge-rules-table) tbody td {
  font-size: 0.83rem;
}

.feeds-list-footer,
.colors-list-footer,
.audit-list-footer,
.dealers-list-footer,
.users-page-footer {
  font-size: 0.76rem;
}

.feed-stage-copy strong,
.color-learning-mode strong {
  font-size: 0.96rem;
}

.feed-stage-copy small,
.color-learning-mode p {
  font-size: 0.78rem;
}

/* Users is a Feed Generator-only section. Its functions remain unchanged, but
   its composition follows the same heading / filter panel / data surface rhythm. */
body:not(.auth-locked) > main#view-users.users-view {
  width: calc(100% - (var(--product-page-gutter) * 2));
  max-width: none;
  margin: 24px var(--product-page-gutter) 0;
}

.users-page {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.users-page-head {
  min-height: 88px;
  align-items: center;
  padding: 0 2px 20px;
  border: 0;
}

.users-title-row h1 {
  color: #000;
  font-size: clamp(2.25rem, 3vw, 2.7rem);
  font-weight: 700;
}

.users-help summary {
  min-height: 40px;
  padding: 8px 13px;
  border-radius: 10px;
  font-size: 0.78rem;
}

.users-help > div strong {
  font-size: 0.84rem;
}

.users-help > div p {
  font-size: 0.76rem;
}

.users-filters {
  margin-bottom: 16px;
  padding: 16px;
}

.users-filters select,
.users-search input {
  min-height: 46px;
  font-size: 0.84rem;
}

.users-directory {
  padding: 4px 20px 0;
  border: 1px solid var(--arb-border-soft);
  border-bottom: 0;
  border-radius: var(--arb-radius-panel) var(--arb-radius-panel) 0 0;
  background: #fff;
  box-shadow: var(--arb-shadow-panel);
}

.users-directory-item {
  padding: 17px 4px 18px;
}

.users-directory-item + .users-directory-item {
  border-top: 1px solid var(--arb-border-soft);
}

.users-directory-main > strong {
  font-size: 0.94rem;
}

.users-directory-main > span,
.users-directory-meta > small {
  font-size: 0.75rem;
}

.users-directory-meta > strong {
  font-size: 0.78rem;
}

.users-page-footer {
  margin: 0;
  padding: 13px 24px;
  border: 1px solid var(--arb-border-soft);
  border-top-color: var(--arb-border-soft);
  border-radius: 0 0 var(--arb-radius-panel) var(--arb-radius-panel);
  box-shadow: var(--arb-shadow-panel);
}

.user-editor-modal-card {
  width: min(820px, 100%);
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px 30px;
  padding: 32px;
}

.user-editor-icon {
  width: 46px;
  height: 46px;
  font-size: 0.75rem;
}

.user-editor-head h3 {
  margin-top: 4px;
  font-size: 1.25rem;
}

.user-editor-head p {
  margin-top: 7px;
  font-size: 0.78rem;
  line-height: 1.45;
}

.user-editor-fields {
  gap: 15px 12px;
}

.user-editor-fields label,
.user-role-fieldset,
.user-password-panel label,
.user-role-fieldset legend {
  font-size: 0.78rem;
}

.user-editor-fields input,
.user-password-panel input {
  min-height: 46px;
  font-size: 0.84rem;
}

.user-role-segments {
  min-height: 46px;
}

.user-role-segments button {
  font-size: 0.76rem;
}

.user-editor-actions {
  gap: 12px;
  padding-top: 18px;
}

.user-editor-actions :is(.btn-primary, .btn-quiet) {
  min-height: 46px;
  font-size: 0.84rem;
}

@media (max-width: 860px) {
  body:not(.auth-locked) > main#view-users.users-view {
    width: calc(100% - 20px);
    margin: 12px 10px 0;
  }

  .users-page-head {
    min-height: 0;
  }
}

/* Reference correction pass — typography, nested filters and Feed History. */
.sidebar-knowledge-menu > summary {
  min-height: 42px;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  padding: 9px 8px;
  border-radius: 11px 0 0 11px;
}

.sidebar-knowledge-menu > summary > svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.9;
}

.sidebar-knowledge-menu > summary > span {
  font-size: 0.875rem;
  line-height: 1.2;
}

/* A filter shell owns its border. Inputs inside it must stay visually flat. */
body:not(.auth-locked) :is(
  .section-filter-control,
  .dealer-filter-control,
  .users-search
) > input,
body:not(.auth-locked) :is(
  .section-filter-control,
  .dealer-filter-control,
  .users-search
) > input:focus {
  min-height: 38px;
  padding-top: 0;
  padding-bottom: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: 0;
}

body:not(.auth-locked) .users-search > input,
body:not(.auth-locked) .users-search > input:focus {
  min-height: 46px;
  padding-right: 14px;
  padding-left: 44px;
  border: 1px solid var(--arb-border);
  border-radius: 11px;
  background: #fff;
}

body:not(.auth-locked) .users-search > input:focus {
  border-color: var(--arb-blue);
  box-shadow: 0 0 0 1px var(--arb-blue);
}

.users-search svg {
  left: 15px;
  width: 19px;
  height: 19px;
  pointer-events: none;
}

/* Feed history follows the flat Auto.ru Business tabs and table language. */
.feeds-list-card {
  min-height: 520px;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 5px 18px rgba(20, 18, 20, 0.06);
}

.feeds-list-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  padding: 24px 24px 0;
}

.feeds-list-head h2 {
  margin-bottom: 5px;
  font-size: 1.45rem;
  font-weight: 600;
}

.feeds-list-head .hint {
  color: var(--arb-muted);
  font-size: 0.82rem;
}

.feeds-lifecycle-tabs {
  width: 100%;
  display: flex;
  gap: 26px;
  margin-top: 20px;
  padding: 0;
  border-bottom: 1px solid var(--arb-border-soft);
  border-radius: 0;
  background: transparent;
}

.feeds-lifecycle-tabs button {
  position: relative;
  min-height: 48px;
  gap: 7px;
  padding: 0 0 13px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--arb-muted);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: none;
}

.feeds-lifecycle-tabs button::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: transparent;
  content: "";
}

.feeds-lifecycle-tabs button:hover {
  color: var(--arb-text);
}

.feeds-lifecycle-tabs button.is-active {
  color: var(--arb-text);
  background: transparent;
  box-shadow: none;
}

.feeds-lifecycle-tabs button.is-active::after {
  background: var(--arb-blue);
}

.feeds-lifecycle-tabs strong,
.feeds-lifecycle-tabs button.is-active strong {
  min-width: 22px;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--arb-muted);
  background: #e7e8ea;
  font-size: 0.7rem;
  font-weight: 600;
}

.feeds-lifecycle-tabs button.is-active strong {
  color: var(--arb-blue-strong);
  background: var(--arb-blue-soft);
}

.feeds-table-wrap {
  overflow: auto;
}

.feeds-product-table {
  font-size: 0.84rem;
}

.feeds-product-table th {
  height: 54px;
  padding: 13px 18px;
  color: var(--arb-muted);
  background: #fff;
  font-size: 0.78rem;
  font-weight: 500;
}

.feeds-product-table td {
  height: 86px;
  padding: 15px 18px;
  border-bottom-color: var(--arb-border-soft);
  background: #fff;
  font-size: 0.84rem;
}

.feeds-product-table tbody tr:hover td {
  background: #fafbfc;
}

.feed-file-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.feed-primary-action {
  min-height: 42px;
  padding: 9px 15px;
  border: 0;
  border-radius: 11px;
  background: #e4e5e7;
  color: var(--arb-text);
  font-size: 0.82rem;
  font-weight: 600;
}

.feeds-list-footer {
  min-height: 52px;
  padding: 13px 20px;
  border-top: 1px solid var(--arb-border-soft);
  border-radius: 0 0 18px 18px;
}

/* The personal account is one branded surface, not a split dark/light layout. */
.profile-panel {
  position: relative;
  isolation: isolate;
  color: #fff;
  background:
    radial-gradient(circle at 78% 24%, rgba(22, 131, 248, 0.25), transparent 30%),
    linear-gradient(145deg, #1c1a1c 0%, #292629 58%, #151415 100%);
}

.profile-panel::before {
  right: -160px;
  bottom: -250px;
  z-index: -1;
  width: 720px;
  height: 720px;
  aspect-ratio: auto;
  background: url("/static/assets/brand/arb-car-sand.svg") center / contain no-repeat;
  opacity: 0.23;
  transform: rotate(-6deg);
}

.profile-head,
.profile-summary,
.profile-form,
.profile-section {
  color: #fff;
  background: transparent;
  backdrop-filter: none;
}

.profile-head {
  border-bottom-color: rgba(255, 255, 255, 0.2);
}

.profile-head .section-kicker,
.profile-head h2,
.profile-section-head h3,
.profile-admin-tools h3 {
  color: #fff;
}

.profile-head .section-kicker {
  opacity: 0.74;
}

.profile-summary {
  border-right: 0;
}

.profile-section + .profile-section {
  border-top-color: rgba(255, 255, 255, 0.24);
}

.profile-section-head > div > span {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
}

.profile-fields label,
.profile-email-field > label {
  color: rgba(255, 255, 255, 0.9);
}

.profile-fields input,
.profile-fields input:disabled {
  border-color: rgba(255, 255, 255, 0.5);
  color: var(--arb-text);
  background: rgba(255, 255, 255, 0.94);
}

.profile-panel .modal-close {
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.profile-panel .modal-close:hover {
  border-color: rgba(255, 255, 255, 0.36);
  color: #fff;
  background: rgba(255, 255, 255, 0.24);
}

.profile-save,
.profile-logout {
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
  background: rgba(19, 42, 78, 0.34);
}

.profile-save:hover,
.profile-logout:hover {
  background: rgba(19, 42, 78, 0.5);
}

.profile-password-action,
.theme-save-status {
  color: rgba(255, 255, 255, 0.84);
}

.profile-panel .avatar-option small,
.profile-panel .avatar-option.selected small {
  color: rgba(255, 255, 255, 0.86);
}

.profile-panel .avatar-option.selected small {
  color: #fff;
}

.profile-panel :is(.profile-stats, .profile-stats > div) {
  border-color: rgba(255, 255, 255, 0.2);
}

@media (max-width: 700px) {
  .feeds-list-head {
    padding: 18px 16px 0;
  }

  .feeds-lifecycle-tabs {
    gap: 18px;
    overflow-x: auto;
  }

  .feeds-product-table th,
  .feeds-product-table td {
    padding-right: 13px;
    padding-left: 13px;
  }
}

/* Dark theme final priority.
   Keep this block at EOF: the feed, users and profile calibration rules above
   are shared with the light theme and otherwise win by source order. */
body[data-theme="dark"]:not(.auth-locked) :is(
  .colors-page-head,
  .photobank-page-head,
  .knowledge-page-head,
  .feeds-page-head,
  .dealers-page-head,
  .audit-page-head,
  .users-page-head,
  .feed-detail-head,
  .dealer-detail-head,
  .feed-flow-intro
) h1,
body[data-theme="dark"]:not(.auth-locked) .users-title-row h1,
body[data-theme="dark"]:not(.auth-locked) :is(
  .feeds-list-head,
  .colors-list-head,
  .audit-list-head,
  .color-learning-mode,
  .users-directory
) :is(h2, h3, strong) {
  color: var(--arb-text);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .feeds-list-card,
  .colors-list-card,
  .audit-list-card,
  .dealers-list-card,
  .users-filters,
  .users-directory,
  .users-page-footer,
  .color-learning-mode
) {
  border-color: var(--arb-border-soft);
  color: var(--arb-text);
  background: var(--arb-surface);
  box-shadow: var(--arb-shadow-panel);
}

body[data-theme="dark"]:not(.auth-locked) .users-page {
  background: transparent;
  box-shadow: none;
}

body[data-theme="dark"]:not(.auth-locked) .users-search > input,
body[data-theme="dark"]:not(.auth-locked) .users-search > input:focus,
body[data-theme="dark"]:not(.auth-locked) .users-filters select {
  border-color: var(--arb-border);
  color: var(--arb-text);
  background: var(--arb-surface-soft);
}

body[data-theme="dark"]:not(.auth-locked) .users-directory-item + .users-directory-item {
  border-top-color: var(--arb-border-soft);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .users-directory-main > span,
  .users-directory-meta > small,
  .users-page-footer
) {
  color: var(--arb-muted);
}

body[data-theme="dark"]:not(.auth-locked) .feeds-list-head .hint {
  color: var(--arb-muted);
}

body[data-theme="dark"]:not(.auth-locked) .feeds-lifecycle-tabs {
  border-bottom-color: var(--arb-border-soft);
  background: transparent;
}

body[data-theme="dark"]:not(.auth-locked) .feeds-lifecycle-tabs button,
body[data-theme="dark"]:not(.auth-locked) .feeds-lifecycle-tabs button.is-active {
  color: var(--arb-muted);
  background: transparent;
  box-shadow: none;
}

body[data-theme="dark"]:not(.auth-locked) .feeds-lifecycle-tabs button.is-active {
  color: var(--arb-text);
}

body[data-theme="dark"]:not(.auth-locked) .feeds-lifecycle-tabs strong {
  color: var(--arb-muted);
  background: var(--arb-surface-muted);
}

body[data-theme="dark"]:not(.auth-locked) .feeds-lifecycle-tabs button.is-active strong {
  color: #8fc5ff;
  background: var(--arb-blue-soft);
}

body[data-theme="dark"]:not(.auth-locked) .feeds-product-table th {
  border-color: var(--arb-border-soft);
  color: var(--arb-muted);
  background: var(--arb-surface);
}

body[data-theme="dark"]:not(.auth-locked) .feeds-product-table td {
  border-color: var(--arb-border-soft);
  color: var(--arb-text);
  background: var(--arb-surface);
}

body[data-theme="dark"]:not(.auth-locked) .feeds-product-table tbody tr:hover td {
  background: var(--arb-surface-soft);
}

body[data-theme="dark"]:not(.auth-locked) .feed-primary-action {
  border-color: var(--arb-border);
  color: var(--arb-text);
  background: var(--arb-surface-muted);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .feeds-list-footer,
  .colors-list-footer,
  .audit-list-footer,
  .dealers-list-footer,
  .users-page-footer
) {
  border-color: var(--arb-border-soft);
  color: var(--arb-muted);
  background: var(--arb-surface-soft);
}

body[data-theme="dark"]:not(.auth-locked) .profile-panel {
  color: #fff;
  background:
    radial-gradient(circle at 78% 24%, rgba(22, 131, 248, 0.25), transparent 30%),
    linear-gradient(145deg, #1c1a1c 0%, #292629 58%, #151415 100%);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .profile-head,
  .profile-summary,
  .profile-form,
  .profile-section
) {
  color: #fff;
  background: transparent;
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .profile-head h2,
  .profile-section-head h3,
  .profile-fields label,
  .profile-email-field > label
) {
  color: #fff;
}

body[data-theme="dark"]:not(.auth-locked) .profile-fields input,
body[data-theme="dark"]:not(.auth-locked) .profile-fields input:disabled {
  border-color: rgba(255, 255, 255, 0.5);
  color: #1c1a1c;
  background: rgba(255, 255, 255, 0.94);
}

body[data-theme="dark"]:not(.auth-locked) .color-editor-card {
  border-color: rgba(22, 131, 248, 0.46);
  color: var(--arb-text);
  background: var(--arb-surface);
  box-shadow: var(--arb-shadow-panel);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .color-editor-intro h2,
  .color-editor-field > span
) {
  color: var(--arb-text);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .color-editor-intro p,
  .color-editor-field > small,
  .color-canonical-trigger,
  .color-canonical-chevron
) {
  color: var(--arb-muted);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .color-editor-field input,
  .color-editor-field input[readonly],
  .color-canonical-trigger
) {
  border-color: var(--arb-border);
  color: var(--arb-text);
  background: var(--arb-surface-soft);
}

body[data-theme="dark"]:not(.auth-locked) .color-editor-actions {
  border-top-color: var(--arb-border-soft);
}

body[data-theme="dark"]:not(.auth-locked) .color-canonical-option {
  color: var(--arb-text);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .color-canonical-option:hover,
  .color-canonical-option.is-selected
) {
  background: var(--arb-surface-muted);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .feeds-empty-state,
  .colors-empty-state,
  .audit-empty-state,
  .dealers-empty-state
) > span {
  border-color: var(--arb-border-soft);
  color: var(--arb-muted);
  background: var(--arb-surface-muted);
}

/* Theme selector previews the current visual systems, not the retired red skin. */
.theme-preview-dark {
  background:
    radial-gradient(circle at 78% 24%, rgba(22, 131, 248, 0.34), transparent 32%),
    linear-gradient(145deg, #1c1a1c 0%, #292629 58%, #151415 100%);
}

.theme-preview-dark::before {
  opacity: 0.42;
}

.theme-option[data-theme-option="dark"] .theme-option-footer {
  background: rgba(21, 20, 21, 0.78);
}

/* Avatar artwork is displayed as a cutout; selection follows the silhouette. */
.avatar {
  overflow: visible;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.avatar img {
  background: transparent;
  filter: none;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.avatar-option:hover .avatar {
  box-shadow: none;
}

.avatar-option:hover .avatar img {
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.28));
}

.avatar-option.selected .avatar,
.avatar-option:focus-visible .avatar {
  box-shadow: none;
}

.avatar-option.selected .avatar img,
.avatar-option:focus-visible .avatar img {
  filter:
    drop-shadow(1px 0 0 var(--arb-blue))
    drop-shadow(-1px 0 0 var(--arb-blue))
    drop-shadow(0 1px 0 var(--arb-blue))
    drop-shadow(0 -1px 0 var(--arb-blue))
    drop-shadow(0 4px 8px rgba(22, 131, 248, 0.3));
}

.avatar-option:focus-visible {
  outline: 2px solid rgba(22, 131, 248, 0.78);
  outline-offset: 3px;
  border-radius: 10px;
}

/* Typography and filter standardization.
 *
 * Auto.ru Business uses a small, repeatable type scale instead of isolated
 * component sizes. Twelve pixels is the lower bound for meaningful copy;
 * icons may still use a smaller glyph box. Filter popovers share one anatomy:
 * 36px closed chips, 44px form controls and rows, a 14px panel radius,
 * one surface and one interaction model.
 */
:root {
  --arb-font-caption: 0.75rem;
  --arb-font-meta: 0.8125rem;
  --arb-font-body: 0.875rem;
  --arb-font-control: 0.875rem;
  --arb-font-action: 0.9375rem;
  --arb-font-section: 1.25rem;
  --arb-line-caption: 1.35;
  --arb-line-body: 1.45;
  --arb-filter-chip-height: 36px;
  --arb-filter-row-height: 44px;
  --arb-filter-popover-width: 300px;
  --arb-filter-popover-radius: 14px;
}

/* Product shell */
.sidebar-service-name,
.app-sidebar .current-user-copy small,
.sidebar-group-label,
.sidebar-knowledge-group-title,
.sidebar-knowledge-item small {
  font-size: var(--arb-font-caption);
  line-height: var(--arb-line-caption);
}

.app-sidebar .current-user-copy strong,
.sidebar-knowledge-item strong {
  font-size: var(--arb-font-meta);
}

.app-sidebar .nav-btn > span,
.sidebar-collapse span,
.sidebar-knowledge-menu > summary > span {
  font-size: var(--arb-font-body);
}

/* Page hierarchy */
.section-kicker,
.workflow-kicker,
.profile-kicker {
  font-size: var(--arb-font-caption);
  line-height: var(--arb-line-caption);
}

:is(
  .colors-page-head,
  .photobank-page-head,
  .knowledge-page-head,
  .feeds-page-head,
  .dealers-page-head,
  .audit-page-head,
  .users-page-head,
  .feed-detail-head,
  .dealer-detail-head,
  .feed-flow-intro
) p {
  font-size: var(--arb-font-body);
  line-height: var(--arb-line-body);
}

:is(
  .feeds-list-head,
  .colors-list-head,
  .audit-list-head,
  .dealers-list-head,
  .knowledge-card-head,
  .photobank-card-head
) h2 {
  font-size: var(--arb-font-section);
  line-height: 1.2;
}

:is(
  .feeds-list-head,
  .colors-list-head,
  .audit-list-head,
  .dealers-list-head,
  .knowledge-card-head,
  .photobank-card-head
) :is(p, .hint) {
  font-size: var(--arb-font-meta);
  line-height: var(--arb-line-body);
}

/* Shared actions and form copy */
body:not(.auth-locked) :is(
  .btn-primary,
  .btn-secondary,
  .btn-danger,
  .feed-primary-action,
  .color-edit-action,
  .users-reset-filters,
  .user-editor-actions button,
  .operation-confirm-actions button
) {
  font-size: var(--arb-font-action);
}

body:not(.auth-locked) :is(
  .field-help,
  .field-optional,
  .mode-soon,
  .mapping-field-code,
  .mapping-source-pill,
  .mapping-note-badge,
  .mapping-textarea-counter,
  .settings-status,
  .status-badge,
  .feed-stage-status,
  .feed-status-badge,
  .feed-retention-badge,
  .user-current-badge,
  .user-current-note
) {
  font-size: var(--arb-font-caption);
  line-height: var(--arb-line-caption);
}

body:not(.auth-locked) :is(
  .update-mode-option small,
  .upload-photo-option small,
  .upload-photobank-link small,
  .upload-photo-recommendation p,
  .upload-photo-recommendation small,
  .mapping-diagnostics > summary small,
  .mapping-profile-status div > span,
  .mapping-source,
  .mapping-group-head p,
  .mapping-note-copy p,
  .settings-section-head p,
  .settings-side-head p,
  .settings-defaults p,
  .settings-next p,
  .processing-steps small,
  .processing-progress-card span,
  .processing-stop-confirm p,
  .stopped-progress-summary span,
  .feed-stage-placeholder p,
  .result-summary-head > span,
  .result-sidebar p,
  .result-error-help p,
  .review-context-bar small,
  .review-issues-head > div > span,
  .validation-global-card small,
  .field-decision-evidence,
  .review-inline-editor span,
  .resolution-source small,
  .catalog-vehicle small,
  .catalog-vehicle span,
  .review-catalog-option small
) {
  font-size: var(--arb-font-caption);
  line-height: var(--arb-line-body);
}

/* One filter bar and one closed-control language in every directory. */
.section-filter-bar,
.dealers-filter-bar {
  min-height: 72px;
  gap: 10px;
  padding: 14px;
}

.section-filter-fields,
.dealers-filter-fields,
.audit-filter-fields,
.feeds-filter-fields,
.section-filter-chip-group {
  gap: 10px;
}

.section-filter-primary,
.dealers-all-filters,
.section-filter-control,
.dealer-filter-control,
.section-filter-chip,
.feed-filter-menu > summary,
.dealers-reset-filters,
.section-filter-reset,
.users-filters select,
.users-search {
  border-radius: 10px;
  font-size: var(--arb-font-control);
  line-height: 1.2;
}

body:not(.auth-locked) .section-filter-primary,
body:not(.auth-locked) .dealers-all-filters,
body:not(.auth-locked) .section-filter-chip,
body:not(.auth-locked) .feed-filter-menu > summary,
body:not(.auth-locked) .dealers-reset-filters,
body:not(.auth-locked) .section-filter-reset {
  min-height: var(--arb-filter-chip-height);
  padding: 7px 12px;
}

body:not(.auth-locked) .section-filter-control,
body:not(.auth-locked) .dealer-filter-control,
body:not(.auth-locked) .users-filters select,
body:not(.auth-locked) .users-search {
  min-height: var(--arb-filter-chip-height);
}

.section-filter-control,
.dealer-filter-control,
.users-search {
  padding-right: 13px;
  padding-left: 13px;
}

body:not(.auth-locked) .section-filter-control input,
body:not(.auth-locked) .dealer-filter-control input,
body:not(.auth-locked) .users-search input,
body:not(.auth-locked) .users-filters select {
  min-height: 34px;
  font-size: var(--arb-font-control);
  line-height: 1.2;
}

.section-filter-control > span,
.dealer-filter-control > span {
  font-size: var(--arb-font-caption);
  line-height: var(--arb-line-caption);
}

.feed-filter-menu > summary strong {
  font-size: var(--arb-font-control);
  font-weight: 500;
}

.feed-filter-clear {
  width: 18px;
  height: 18px;
  font-size: 1rem;
}

.filter-active-count {
  min-width: 20px;
  min-height: 20px;
  padding: 2px 6px;
  font-size: var(--arb-font-caption);
}

/* Shared Auto.ru Business dropdown panel. */
.feed-filter-popover,
.context-select-popover,
.workspace-menu-popover,
.mapping-profile-popover,
.mapping-select-popover,
.review-select-popover,
.color-canonical-popover {
  border: 1px solid var(--arb-border-soft);
  border-radius: var(--arb-filter-popover-radius);
  background: var(--arb-surface);
  box-shadow: var(--arb-shadow-popover);
}

.feed-filter-popover {
  top: calc(100% + 7px);
  width: var(--arb-filter-popover-width);
  max-width: calc(100vw - 32px);
  padding: 8px;
  transform: translateX(var(--feed-filter-popover-shift-x, 0px));
}

.feed-date-popover {
  width: 320px;
  padding: 12px;
}

.feed-organization-popover {
  padding: 0;
  overflow: hidden;
}

.feed-organization-popover .feed-filter-field {
  gap: 0;
}

.feed-organization-popover .feed-filter-field > span {
  display: none;
}

.feed-organization-popover .feed-filter-field input {
  min-height: 52px;
  padding: 0 14px;
  border: 0;
  border-bottom: 1px solid var(--arb-border-soft);
  border-radius: 0;
  box-shadow: none;
}

.feed-organization-popover .feed-filter-field input:focus {
  border-color: var(--arb-blue);
  box-shadow: inset 0 -1px 0 var(--arb-blue);
}

.feed-organization-popover .feed-filter-suggestions {
  max-height: min(360px, calc(100vh - 160px));
  margin: 0;
  padding: 6px;
}

.feed-organization-popover .feed-filter-suggestions button {
  min-height: 54px;
}

.feed-organization-popover .feed-filter-empty {
  margin: 0;
  padding: 18px 14px;
}

.feed-filter-menu-wide .feed-filter-popover {
  width: min(640px, calc(100vw - 32px));
}

@media (min-width: 781px) {
  .feeds-filter-fields > .feed-filter-menu.feed-filter-menu-wide > .feed-filter-popover {
    right: auto;
    left: 0;
  }
}

@media (max-width: 780px) {
  .feed-filter-popover,
  .feed-filter-menu-wide .feed-filter-popover {
    max-width: 100%;
    transform: none;
  }
}

.audit-section-filters [data-audit-filter-menu="event"] .feed-filter-popover {
  width: 340px;
}

.audit-section-filters [data-audit-filter-menu="actor"] .feed-filter-popover {
  width: 380px;
}

.feed-filter-field {
  gap: 7px;
}

.feed-filter-field > span,
.color-history-actor-kicker,
.color-history-date-filter > span {
  font-size: var(--arb-font-caption);
  line-height: var(--arb-line-caption);
}

.feed-filter-field select,
.feed-filter-field input,
.feed-vehicle-columns input,
.audit-actor-search {
  min-height: var(--arb-filter-row-height);
  border-color: var(--arb-border);
  border-radius: 10px;
  background: var(--arb-surface);
  color: var(--arb-text);
  font-size: var(--arb-font-control);
}

.feed-choice-list {
  gap: 2px;
}

.feed-choice-list label,
.feed-filter-suggestions button,
.feed-vehicle-options button,
.audit-actor-search-results label,
.platform-choice,
.color-history-actor-options button {
  min-height: var(--arb-filter-row-height);
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--arb-text);
  font-size: var(--arb-font-control);
  line-height: 1.25;
}

.feed-choice-list label:hover,
.feed-choice-list label:has(input:checked),
.feed-filter-suggestions button:hover,
.feed-filter-suggestions button.is-selected,
.feed-vehicle-options button:hover,
.feed-vehicle-options button.is-selected,
.audit-actor-result:hover,
.platform-choice:hover,
.platform-choice.is-selected,
.color-history-actor-options button:hover,
.color-history-actor-options button.is-selected {
  background: var(--arb-surface-muted);
  color: var(--arb-text);
}

.feed-choice-list input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.feed-filter-suggestions {
  gap: 2px;
  margin: 8px 0 0;
}

.feed-filter-suggestions button strong,
.platform-choice-copy strong,
.color-history-actor-options strong,
.audit-actor-result strong,
.audit-actor-search-hint strong {
  font-size: var(--arb-font-control);
  line-height: 1.25;
}

.feed-filter-suggestions button small,
.platform-choice-copy small,
.color-history-actor-options small,
.audit-actor-result small,
.audit-actor-search-hint span,
.feed-filter-more,
.feed-filter-empty,
.feed-vehicle-group-label,
.feed-filter-popover :is(small, p, .hint) {
  font-size: var(--arb-font-caption);
  line-height: var(--arb-line-body);
}

.platform-choice {
  min-height: 56px;
}

.platform-choice-state,
.audit-actor-result em {
  font-size: var(--arb-font-caption);
}

.feed-vehicle-popover,
.audit-actor-popover {
  padding: 0;
  overflow: hidden;
}

.feed-vehicle-columns > div,
.audit-actor-fixed-options {
  border-color: var(--arb-border-soft);
}

.feed-vehicle-columns > div:last-child {
  background: var(--arb-surface-soft);
}

.feed-vehicle-options {
  height: 304px;
  padding: 6px;
}

.audit-actor-fixed-options {
  padding: 8px;
}

.audit-actor-search {
  margin: 12px;
  padding: 0 12px;
}

.audit-actor-search-results {
  padding: 0 8px 8px;
}

.audit-actor-result {
  min-height: 60px;
  border-radius: 8px;
}

.feed-filter-popover-actions {
  margin: 12px -12px -12px;
  overflow: hidden;
  border-top: 1px solid var(--arb-border-soft);
  border-radius: 0 0 var(--arb-filter-popover-radius) var(--arb-filter-popover-radius);
}

.feed-vehicle-popover .feed-filter-popover-actions {
  margin: 0;
}

.feed-filter-popover-actions button {
  min-height: 52px;
  border-color: var(--arb-border-soft);
  background: var(--arb-surface);
  color: var(--arb-text);
  font-size: var(--arb-font-action);
  font-weight: 600;
}

.feed-filter-popover-actions button:hover {
  background: var(--arb-surface-soft);
}

.feed-filter-drawer > header p,
.feed-filter-drawer-option small,
.feed-filter-drawer-empty p,
.feed-filter-drawer > footer span {
  font-size: var(--arb-font-caption);
  line-height: var(--arb-line-body);
}

.feed-filter-drawer-search input,
.feed-filter-drawer-list h3,
.feed-filter-drawer-option strong,
.feed-filter-drawer-empty strong {
  font-size: var(--arb-font-body);
}

.feed-filter-drawer-option {
  min-height: 52px;
  border-radius: 8px;
}

/* Tables and history lists */
:is(
  .feeds-product-table,
  .colors-product-table,
  .audit-product-table,
  .users-product-table,
  .dealers-table,
  .knowledge-rules-table
) {
  font-size: var(--arb-font-body);
}

:is(
  .feeds-product-table,
  .colors-product-table,
  .audit-product-table,
  .users-product-table,
  .dealers-table,
  .knowledge-rules-table
) th {
  font-size: var(--arb-font-meta);
  line-height: var(--arb-line-caption);
}

:is(
  .feeds-product-table,
  .colors-product-table,
  .audit-product-table,
  .users-product-table,
  .dealers-table,
  .knowledge-rules-table
) td {
  font-size: var(--arb-font-body);
  line-height: var(--arb-line-body);
}

:is(
  .feed-name-cell,
  .feed-org-cell,
  .feed-date-cell,
  .color-history-event,
  .color-history-subject,
  .color-history-actor,
  .color-history-date,
  .color-raw-cell,
  .color-updated-cell,
  .color-canonical-cell,
  .audit-time-cell,
  .audit-object-cell,
  .audit-actor-cell,
  .audit-event-cell,
  .user-created-cell
) strong {
  font-size: var(--arb-font-body);
  line-height: 1.3;
}

:is(
  .feed-name-cell,
  .feed-org-cell,
  .feed-date-cell,
  .feed-status-cell,
  .color-history-subject,
  .color-history-actor,
  .color-history-date,
  .color-raw-cell,
  .color-updated-cell,
  .audit-time-cell,
  .audit-object-cell,
  .audit-actor-cell,
  .audit-event-cell,
  .user-created-cell
) small,
.audit-detail-list small,
.color-use-cell small {
  font-size: var(--arb-font-caption);
  line-height: var(--arb-line-caption);
}

.feed-status-cell > span,
.color-history-method,
.color-history-amount,
.color-import-confidence,
.color-canonical-status,
.audit-event-code,
.audit-object-type,
.user-role-badge,
.user-status-badge {
  font-size: var(--arb-font-caption);
}

.audit-detail-list code,
.audit-detail-list strong,
.feed-id-badge,
.color-id-badge {
  font-size: var(--arb-font-caption);
}

:is(
  .feeds-empty-state,
  .colors-empty-state,
  .audit-empty-state,
  .dealers-empty-state,
  .users-directory-empty
) p {
  font-size: var(--arb-font-meta);
  line-height: var(--arb-line-body);
}

:is(
  .feeds-list-footer,
  .colors-list-footer,
  .audit-list-footer,
  .dealers-list-footer,
  .users-page-footer
) {
  font-size: var(--arb-font-caption);
}

/* Workflow, colour learning and account dialogs */
.feed-stage-copy strong,
.color-learning-mode strong,
.processing-progress-card strong,
.result-sidebar-help strong,
.result-error-help strong,
.vehicle-issue-copy strong,
.vehicle-ready-note strong {
  font-size: var(--arb-font-action);
}

.feed-stage-copy small,
.color-learning-mode p,
.feed-stage-placeholder p,
.feed-detail-title p,
.feed-detail-metrics :is(span, small),
.feed-detail-facts dt,
.feed-detail-note-card footer > span,
.feed-detail-save-status,
.feed-detail-next-step p {
  font-size: var(--arb-font-meta);
  line-height: var(--arb-line-body);
}

.color-editor-intro p,
.color-editor-field > small,
.color-delete-panel p,
.color-import-review-head p,
.color-import-review > footer p,
.color-import-source small,
.color-import-review-row label > span {
  font-size: var(--arb-font-caption);
  line-height: var(--arb-line-body);
}

.color-editor-field input,
.color-canonical-trigger,
.color-canonical-option,
.color-import-review-row select {
  font-size: var(--arb-font-body);
}

.users-help summary,
.users-help > div strong,
.user-editor-head p,
.user-editor-fields label,
.user-role-fieldset legend,
.operation-confirm-note strong {
  font-size: var(--arb-font-meta);
}

.users-help > div p,
.users-summary small,
.operation-confirm-panel > p,
.operation-confirm-note span {
  font-size: var(--arb-font-caption);
  line-height: var(--arb-line-body);
}

.users-directory-main > strong {
  font-size: 1rem;
}

.users-directory-main > span,
.users-directory-meta > strong,
.users-directory-meta > small {
  font-size: var(--arb-font-meta);
  line-height: var(--arb-line-caption);
}

.user-editor-fields input,
.user-password-panel input {
  font-size: var(--arb-font-body);
}

/* Knowledge base and photobank use the same readable floor. */
.knowledge-platform-title p,
.knowledge-readiness > span,
.knowledge-mode-switch button small,
.knowledge-file-action,
.knowledge-upload-note,
.knowledge-acceptance-note,
.knowledge-acceptance-note > span,
.knowledge-technical-details > summary div > span,
.knowledge-source-link,
.knowledge-metrics small,
.knowledge-samples-card header p,
.knowledge-dropzone span,
.knowledge-upload-actions > span,
.knowledge-evidence-item p,
.knowledge-sample-row p,
.knowledge-sample-meta,
.knowledge-samples-empty p {
  font-size: var(--arb-font-caption);
  line-height: var(--arb-line-body);
}

.knowledge-technical-details > summary strong,
.knowledge-evidence-item strong,
.knowledge-sample-row strong,
.knowledge-samples-empty strong,
.knowledge-dropzone strong,
.knowledge-rules-table {
  font-size: var(--arb-font-body);
}

.photobank-type-switch small,
.photobank-field > small,
.photobank-detection small,
.photobank-contract-note span,
.photobank-enabled small,
.photobank-form > footer > span,
.photobank-guide li small,
.photobank-current > span,
.photobank-current > p,
.photobank-coverage li span,
.photobank-next > span,
.photobank-safety p,
.photobank-next p,
.photobank-result p {
  font-size: var(--arb-font-caption);
  line-height: var(--arb-line-body);
}

.photobank-field > span,
.photobank-detection strong,
.photobank-guide li strong {
  font-size: var(--arb-font-body);
}

/* Dark dropdowns retain exactly the same hierarchy and states. */
body[data-theme="dark"]:not(.auth-locked) :is(
  .feed-filter-popover,
  .context-select-popover,
  .workspace-menu-popover,
  .mapping-profile-popover,
  .mapping-select-popover,
  .review-select-popover,
  .color-canonical-popover
) {
  border-color: var(--arb-border);
  color: var(--arb-text);
  background: var(--arb-surface);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .feed-filter-field select,
  .feed-filter-field input,
  .feed-vehicle-columns input,
  .audit-actor-search
) {
  border-color: var(--arb-border);
  color: var(--arb-text);
  background: var(--arb-surface-soft);
}

body[data-theme="dark"]:not(.auth-locked) .feed-organization-popover .feed-filter-field input {
  border-bottom-color: var(--arb-border);
  background: var(--arb-surface);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .feed-choice-list label:hover,
  .feed-choice-list label:has(input:checked),
  .feed-filter-suggestions button:hover,
  .feed-filter-suggestions button.is-selected,
  .feed-vehicle-options button:hover,
  .feed-vehicle-options button.is-selected,
  .audit-actor-result:hover,
  .platform-choice:hover,
  .platform-choice.is-selected,
  .color-history-actor-options button:hover,
  .color-history-actor-options button.is-selected
) {
  color: var(--arb-text);
  background: var(--arb-surface-muted);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .feed-filter-suggestions button,
  .feed-vehicle-options button,
  .platform-choice,
  .color-history-actor-options button,
  .feed-filter-popover-actions button
) {
  color: var(--arb-text);
  background-color: transparent;
}

body[data-theme="dark"]:not(.auth-locked) .feed-vehicle-columns > div:last-child {
  background: var(--arb-surface-soft);
}

body[data-theme="dark"]:not(.auth-locked) .feed-filter-popover-actions button:hover {
  background: var(--arb-surface-muted);
}

/* Strict Auto.ru Business filter-menu identity.
 *
 * A dropdown is one flat surface: a borderless search row, full-width list
 * rows and a fixed two-action footer. Option rows never become inset cards and
 * selection is communicated by the same neutral fill in every directory.
 */
.feed-filter-popover {
  max-height: min(520px, calc(100vh - 120px));
}

.feed-filter-popover:is(
  .feed-choice-list,
  .platform-choice-popover,
  .feed-organization-popover,
  .color-history-actor-popover
) {
  padding: 0;
  overflow-y: auto;
}

.feed-choice-list,
.feed-filter-suggestions,
.color-history-actor-options,
.audit-actor-fixed-options,
.audit-actor-search-results {
  gap: 0;
}

.feed-organization-popover .feed-filter-field input {
  min-height: 52px;
  padding: 0 14px;
  border: 0;
  border-bottom: 1px solid var(--arb-border-soft);
  border-radius: 0;
  outline: 0;
  box-shadow: none;
}

.feed-organization-popover .feed-filter-field input:focus {
  border-bottom-color: var(--arb-border-soft);
  box-shadow: none;
}

body:not(.auth-locked) .feed-organization-popover .feed-filter-field input:focus-visible {
  border-bottom-color: var(--arb-border-soft) !important;
  outline: 0 !important;
  box-shadow: none !important;
}

.feed-organization-popover .feed-filter-suggestions {
  max-height: min(364px, calc(100vh - 230px));
  padding: 0;
}

.feed-choice-list > label,
.feed-choice-list > .feed-filter-select-all,
.feed-filter-suggestions > button,
.feed-vehicle-options > button,
.platform-choice-popover > .platform-choice,
.color-history-actor-options > label,
.audit-actor-search-results > .audit-actor-result {
  min-height: 52px;
  margin: 0;
  padding: 12px 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--arb-text);
  font-size: var(--arb-font-control);
  font-weight: 400;
  line-height: 1.3;
}

.feed-choice-list > label > input[type="checkbox"],
.feed-choice-list > label > input[type="radio"],
.audit-actor-result > input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.feed-choice-list > label:hover,
.feed-choice-list > label:has(input:checked),
.feed-choice-list > .feed-filter-select-all:hover,
.feed-filter-suggestions > button:hover,
.feed-filter-suggestions > button.is-selected,
.feed-vehicle-options > button:hover,
.feed-vehicle-options > button.is-selected,
.platform-choice-popover > .platform-choice:hover,
.platform-choice-popover > .platform-choice.is-selected,
.color-history-actor-options > label:hover,
.color-history-actor-options > label.is-selected,
.audit-actor-search-results > .audit-actor-result:hover,
.audit-actor-search-results > .audit-actor-result:has(input:checked) {
  background: var(--arb-surface-muted);
  color: var(--arb-text);
}

.feed-filter-suggestions > button strong,
.platform-choice-copy strong,
.color-history-actor-options strong,
.audit-actor-result strong {
  color: inherit;
  font-size: var(--arb-font-control);
  font-weight: 400;
  line-height: 1.3;
}

.feed-filter-suggestions > button small,
.platform-choice-copy small,
.color-history-actor-options small,
.audit-actor-result small {
  margin-top: 2px;
  color: var(--arb-muted);
  font-size: var(--arb-font-caption);
  line-height: 1.3;
}

.feed-filter-suggestions > button[data-feed-organization-option="company"] {
  display: flex;
  align-items: center;
}

.platform-choice-popover > .platform-choice {
  display: flex;
  grid-template-columns: none;
}

.platform-choice-popover .platform-choice-copy small,
.platform-choice-popover .platform-choice-state {
  display: none;
}

.feed-filter-select-all {
  border-bottom: 1px solid var(--arb-border-soft) !important;
}

.feed-filter-multiselect-field {
  display: block;
}

.feed-organization-popover .feed-filter-multiselect-input {
  display: flex;
  min-height: 52px;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--arb-border-soft);
  background: var(--arb-surface);
}

.feed-filter-selection-chips {
  display: contents;
}

.feed-filter-selection-chip {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border: 0;
  border-radius: 6px;
  background: var(--arb-surface-muted);
  color: var(--arb-text);
  font: inherit;
  font-size: var(--arb-font-control);
  font-weight: 400;
  line-height: 1.2;
  cursor: pointer;
}

.feed-filter-selection-chip:hover {
  background: var(--arb-border);
}

.feed-filter-selection-chip > span {
  color: var(--arb-muted-light);
  font-size: 1.1rem;
  line-height: 1;
}

.feed-organization-popover .feed-filter-multiselect-input > input,
.feed-organization-popover .feed-filter-multiselect-input > input:focus,
body:not(.auth-locked) .feed-organization-popover .feed-filter-multiselect-input > input:focus-visible {
  width: auto;
  min-width: 92px;
  min-height: 32px;
  flex: 1 1 92px;
  padding: 0;
  border: 0 !important;
  border-radius: 0;
  outline: 0 !important;
  background: transparent;
  box-shadow: none !important;
}

.standard-filter-popover-actions,
.feed-filter-popover > .feed-filter-popover-actions:last-child {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: auto;
  margin: 8px -8px -8px;
  border-top: 1px solid var(--arb-border-soft);
  border-radius: 0 0 var(--arb-filter-popover-radius) var(--arb-filter-popover-radius);
  background: var(--arb-surface);
}

.feed-filter-popover:is(
  .feed-choice-list,
  .platform-choice-popover,
  .feed-organization-popover,
  .color-history-actor-popover,
  .feed-vehicle-popover,
  .audit-actor-popover
) > .feed-filter-popover-actions:last-child {
  margin: 0;
}

.feed-date-popover > .feed-filter-popover-actions:last-child {
  margin: 12px -12px -12px;
}

.feed-filter-popover-actions button {
  min-height: 56px;
  padding: 0 14px;
  border: 0;
  border-right: 1px solid var(--arb-border-soft);
  border-radius: 0;
  background: var(--arb-surface);
  color: var(--arb-text);
  font-size: var(--arb-font-control);
  font-weight: 500;
}

.feed-filter-popover-actions button:last-child {
  border-right: 0;
}

.feed-filter-popover-actions button:hover {
  background: var(--arb-surface-soft);
}

/* The vehicle filter follows the Auto.ru Business two-level multiselect.
 * Marks and models share one flat panel; configuration is intentionally absent.
 */
.feed-vehicle-search-shell {
  position: relative;
  min-height: 68px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 8px 82px 8px 14px;
  border-bottom: 1px solid var(--arb-border-soft);
  background: var(--arb-surface);
}

.feed-vehicle-search-shell.has-selections {
  background: var(--arb-blue-soft);
}

.feed-vehicle-search-shell > span:first-child {
  display: none;
  color: var(--arb-muted);
  font-size: var(--arb-font-caption);
  line-height: 1.2;
}

.feed-vehicle-search-shell.has-selections > span:first-child {
  display: block;
}

.feed-vehicle-search-shell > input,
.feed-vehicle-search-shell > input:focus,
body:not(.auth-locked) .feed-vehicle-search-shell > input:focus-visible {
  min-height: 28px;
  padding: 0;
  border: 0 !important;
  border-radius: 0;
  outline: 0 !important;
  background: transparent;
  box-shadow: none !important;
  color: var(--arb-text);
  font-size: var(--arb-font-control);
}

.feed-vehicle-search-shell > input::placeholder {
  color: var(--arb-text);
  opacity: 1;
}

.feed-vehicle-search-shell:not(.has-selections) > input::placeholder {
  color: var(--arb-muted-light);
}

.feed-vehicle-selection-count,
.feed-vehicle-selection-clear {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.feed-vehicle-selection-count {
  right: 48px;
  min-width: 32px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--arb-surface);
  color: var(--arb-text);
  font-size: var(--arb-font-control);
  font-weight: 500;
}

.feed-vehicle-selection-clear {
  right: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--arb-muted);
  cursor: pointer;
  font: inherit;
  font-size: 1.65rem;
  line-height: 1;
}

.feed-vehicle-options {
  height: 344px;
  padding: 8px 0;
}

.feed-vehicle-options > .feed-vehicle-group-label {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 8px 20px;
  color: var(--arb-muted);
  font-size: var(--arb-font-control);
}

.feed-vehicle-options > button {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
}

.feed-vehicle-option-check {
  width: 18px;
  flex: 0 0 18px;
  color: var(--arb-text);
  font-size: 1.15rem;
  opacity: 0;
}

.feed-vehicle-options > button.is-selected .feed-vehicle-option-check {
  opacity: 1;
}

.feed-vehicle-option-action {
  margin-left: auto;
  color: var(--arb-muted);
  font-size: 1.65rem;
  font-weight: 300;
  line-height: 1;
}

.feed-vehicle-options > button.is-selected .feed-vehicle-option-action {
  color: var(--arb-text);
  font-size: 1.05rem;
}

.feed-vehicle-empty {
  min-height: 100%;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 24px;
  text-align: center;
}

.feed-vehicle-popover > .feed-filter-popover-actions:last-child {
  position: sticky;
  bottom: 0;
  gap: 12px;
  padding: 12px;
  border-top: 1px solid var(--arb-border-soft);
  background: var(--arb-surface);
}

.feed-vehicle-popover > .feed-filter-popover-actions:last-child button {
  min-height: 52px;
  border: 0;
  border-radius: 11px;
  background: var(--arb-surface-muted);
  color: var(--arb-text);
  font-weight: 500;
}

.feed-vehicle-popover > .feed-filter-popover-actions:last-child button:last-child {
  background: var(--arb-text);
  color: var(--arb-surface);
}

.feed-vehicle-popover > .feed-filter-popover-actions:last-child button:hover {
  filter: brightness(0.96);
}

@media (max-width: 780px) {
  .feed-vehicle-options {
    height: 220px;
  }
}

body[data-theme="dark"]:not(.auth-locked) .feed-organization-popover .feed-filter-field input:focus {
  border-bottom-color: var(--arb-border);
  box-shadow: none;
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .feed-choice-list > label:hover,
  .feed-choice-list > label:has(input:checked),
  .feed-choice-list > .feed-filter-select-all:hover,
  .feed-filter-suggestions > button:hover,
  .feed-filter-suggestions > button.is-selected,
  .platform-choice-popover > .platform-choice:hover,
  .platform-choice-popover > .platform-choice.is-selected,
  .color-history-actor-options > label:hover,
  .color-history-actor-options > label.is-selected,
  .audit-actor-search-results > .audit-actor-result:hover,
  .audit-actor-search-results > .audit-actor-result:has(input:checked)
) {
  background: var(--arb-surface-muted);
  color: var(--arb-text);
}

body[data-theme="dark"]:not(.auth-locked) .feed-filter-popover-actions {
  background: var(--arb-surface);
}

body[data-theme="dark"]:not(.auth-locked) .feed-organization-popover .feed-filter-multiselect-input {
  border-bottom-color: var(--arb-border);
  background: var(--arb-surface);
}

/* Shared product calendar. Native select/date popovers stay hidden because
 * their platform-dependent UI conflicts with the Auto.ru Business language. */
.native-filter-control {
  display: none !important;
}

.standard-date-popover {
  width: min(900px, calc(100vw - 32px));
  max-height: min(640px, calc(100vh - 96px));
  padding: 0;
  overflow: auto;
}

.standard-date-popover.is-list-only {
  width: 300px;
}

.standard-date-popover.is-single-calendar,
.dealer-date-popover {
  width: min(580px, calc(100vw - 32px));
}

.audit-section-filters .feed-filter-popover.standard-date-popover {
  width: min(900px, calc(100vw - 32px));
}

.audit-section-filters .feed-filter-popover.standard-date-popover.is-list-only {
  width: 300px;
}

.audit-section-filters .feed-filter-popover.standard-date-popover.is-single-calendar {
  width: min(580px, calc(100vw - 32px));
}

.color-history-date-popover {
  width: min(680px, calc(100vw - 32px));
}

.arb-date-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 390px;
  background: var(--arb-surface);
}

.arb-date-layout.is-list-only {
  display: block;
  min-height: 0;
}

.arb-date-layout.without-modes {
  display: block;
  min-height: 0;
}

.arb-date-mode-list {
  border-right: 1px solid var(--arb-border-soft);
  background: var(--arb-surface);
}

.arb-date-mode-list > button {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--arb-text);
  cursor: pointer;
  font: inherit;
  font-size: var(--arb-font-control);
  text-align: left;
}

.arb-date-mode-list > button:hover {
  background: var(--arb-surface-muted);
}

.arb-date-mode-list > button.is-selected {
  background: var(--arb-blue);
  color: #fff;
}

.arb-date-calendar-panel {
  min-width: 0;
  background: var(--arb-surface);
}

.arb-date-value-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid var(--arb-border-soft);
}

.arb-date-value-row.is-single {
  grid-template-columns: minmax(0, 1fr);
}

.arb-date-value {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 0;
  border-right: 1px solid var(--arb-border-soft);
  border-bottom: 2px solid transparent;
  background: var(--arb-surface);
  color: var(--arb-text);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.arb-date-value:last-child {
  border-right: 0;
}

.arb-date-value.is-active {
  border-bottom-color: var(--arb-blue);
}

.arb-date-value > span {
  color: var(--arb-muted);
  font-size: var(--arb-font-control);
}

.arb-date-value > strong {
  font-size: var(--arb-font-control);
  font-weight: 500;
}

.arb-date-calendars {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  padding: 14px 16px 8px;
}

.arb-date-calendars.is-range {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.arb-calendar-month > header {
  position: static;
  min-height: 42px;
  height: auto;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  align-items: center;
  margin-bottom: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--arb-text);
  box-shadow: none;
  backdrop-filter: none;
  z-index: auto;
}

.arb-calendar-month > header strong {
  font-size: var(--arb-font-control);
  font-weight: 500;
  text-align: center;
}

.arb-calendar-nav {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--arb-text);
  cursor: pointer;
  font: inherit;
  font-size: 1.7rem;
  font-weight: 300;
  line-height: 1;
}

.arb-calendar-nav:hover {
  background: var(--arb-surface-muted);
}

.arb-calendar-nav.is-placeholder {
  visibility: hidden;
}

.arb-calendar-weekdays,
.arb-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.arb-calendar-weekdays > span {
  min-height: 32px;
  display: grid;
  place-items: center;
  color: var(--arb-muted);
  font-size: var(--arb-font-caption);
}

.arb-calendar-day {
  position: relative;
  min-width: 34px;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--arb-text);
  cursor: pointer;
  font: inherit;
  font-size: var(--arb-font-control);
}

.arb-calendar-day:hover {
  background: var(--arb-surface-muted);
}

.arb-calendar-day.is-outside {
  color: var(--arb-muted-light);
}

.arb-calendar-day.is-in-range {
  border-radius: 0;
  background: var(--arb-blue-soft);
  color: var(--arb-text);
}

.arb-calendar-day.is-selected {
  background: var(--arb-blue);
  color: #fff;
}

.arb-calendar-day.is-today:not(.is-selected)::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--arb-blue);
  transform: translateX(-50%);
}

.arb-date-reset {
  min-height: 44px;
  margin: 4px 16px 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--arb-blue);
  cursor: pointer;
  font: inherit;
  font-size: var(--arb-font-control);
  text-align: left;
}

body:not(.auth-locked) .feed-filter-popover .feed-filter-field > input[type="number"],
body:not(.auth-locked) .feed-filter-popover .feed-filter-field > input[type="number"]:focus,
body:not(.auth-locked) .feed-filter-popover .feed-filter-field > input[type="number"]:focus-visible {
  border: 1px solid var(--arb-border) !important;
  outline: 0 !important;
  box-shadow: none !important;
}

.users-filter-menu {
  min-width: 180px;
}

.users-filter-menu > summary {
  width: 100%;
}

.users-filter-menu > .feed-filter-popover {
  width: 100%;
  min-width: 220px;
  padding: 0;
}

.standard-single-choice {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--arb-text);
  cursor: pointer;
  font: inherit;
  font-size: var(--arb-font-control);
  text-align: left;
}

.standard-single-choice:hover,
.standard-single-choice.is-selected {
  background: var(--arb-surface-muted);
}

@media (max-width: 760px) {
  .standard-date-popover,
  .standard-date-popover.is-single-calendar,
  .color-history-date-popover,
  .dealer-date-popover {
    width: calc(100vw - 28px);
  }

  .arb-date-layout {
    display: block;
  }

  .arb-date-mode-list {
    max-height: 230px;
    overflow-y: auto;
    border-right: 0;
    border-bottom: 1px solid var(--arb-border-soft);
  }

  .arb-date-calendars.is-range {
    grid-template-columns: 1fr;
  }

  .arb-date-calendars.is-range .arb-calendar-month:last-child {
    display: none;
  }
}

/* Dealers directory typography calibration.
 *
 * The legacy dealers table used isolated 9-11px values inside otherwise
 * standard 13-14px product tables. Keep one Auto.ru Business hierarchy:
 * 14px for controls and primary row data, 13px for column headings and
 * 12px for supporting copy and statuses.
 */
body:not(.auth-locked) .dealers-filter-bar :is(
  .dealers-all-filters,
  .feed-filter-menu > summary,
  .dealer-filter-control,
  .dealer-filter-control > span,
  .dealer-filter-control input,
  .dealers-reset-filters
) {
  font-size: 14px;
  line-height: 20px;
}

body:not(.auth-locked) .dealers-filter-bar .dealer-filter-control > span {
  font-weight: 500;
}

body:not(.auth-locked) .dealers-table {
  font-size: 14px;
  line-height: 20px;
}

body:not(.auth-locked) .dealers-table thead th {
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
}

body:not(.auth-locked) .dealers-table tbody td {
  font-size: 14px;
  line-height: 20px;
}

body:not(.auth-locked) :is(
  .dealer-name-cell strong,
  .dealer-latest-feed strong,
  .dealer-creator-cell strong,
  .dealer-feed-count strong
) {
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}

body:not(.auth-locked) :is(
  .dealer-name-cell small,
  .dealer-latest-feed small,
  .dealer-creator-cell small,
  .dealer-feed-count small,
  .dealer-status-summary span
) {
  font-size: 12px;
  line-height: 16px;
}

body:not(.auth-locked) .dealer-status-summary span {
  font-weight: 500;
}

body:not(.auth-locked) .dealer-open-feeds {
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}

body:not(.auth-locked) .dealers-list-footer {
  font-size: 12px;
  line-height: 16px;
}

/* Feed history typography calibration.
 *
 * Filters keep the shared 14px control contract. The history below uses the
 * same hierarchy as other Auto.ru Business directories: 14px primary data,
 * 13px column headings and 12px metadata, statuses and compact counters.
 */
body:not(.auth-locked) .feeds-filter-bar :is(
  .section-filter-primary,
  .feed-filter-menu > summary,
  .feed-filter-menu > summary > span:not(.feed-filter-clear):not(.feed-filter-chevron),
  .feed-filter-menu > summary strong,
  .section-filter-control,
  .section-filter-control input,
  .section-filter-reset
) {
  font-size: 14px;
  line-height: 20px;
}

body:not(.auth-locked) .feeds-lifecycle-tabs button {
  font-size: 14px;
  line-height: 20px;
}

body:not(.auth-locked) .feeds-lifecycle-tabs strong {
  font-size: 12px;
  line-height: 16px;
}

body:not(.auth-locked) .feeds-product-table {
  font-size: 14px;
  line-height: 20px;
}

body:not(.auth-locked) .feeds-product-table thead th {
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
}

body:not(.auth-locked) .feeds-product-table tbody td {
  font-size: 14px;
  line-height: 20px;
}

body:not(.auth-locked) :is(
  .feed-name-cell strong,
  .feed-org-cell strong,
  .feed-status-cell strong,
  .feed-date-cell strong
) {
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}

body:not(.auth-locked) :is(
  .feed-name-cell small,
  .feed-org-cell small,
  .feed-status-cell small,
  .feed-date-cell small,
  .feed-review-note,
  .feed-file-icon
) {
  font-size: 12px;
  line-height: 16px;
}

body:not(.auth-locked) .feed-review-note {
  font-weight: 500;
}

body:not(.auth-locked) .feed-car-count {
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}

body:not(.auth-locked) .feeds-product-table .feed-primary-action {
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}

body:not(.auth-locked) .feeds-list-footer {
  font-size: 12px;
  line-height: 16px;
}
