/* AUTO-TOKYO — оболочка админки: боковое меню, верхняя панель, попапы */

:root {
  --at-side-w: 264px;
  --at-top-h: 68px;
  --at-radius: 14px;
  --at-radius-sm: 10px;
}

/* —— Иконки —— */
.at-ic {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.at-ic use {
  pointer-events: none;
}

/* —— Каркас —— */
body.at-shell:not(.login) {
  font-family: var(--font-family-primary);
  background: var(--at-bg);
  color: var(--at-ink);
  height: auto;
  min-height: 100%;
}

/* Django задаёт #container { height: 100%; min-width: 980px } — иначе длинные
   страницы обрезаются, а sticky-шапка «разрывает» прокрутку. */
body.at-shell:not(.login) #container {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: auto;
  min-height: 100vh;
  padding-left: var(--at-side-w);
  background: var(--at-bg);
}

body.at-shell:not(.login) .main {
  display: block;
  min-width: 0;
  background: var(--at-bg);
}

/* Широкие таблицы не должны раздвигать страницу — скроллим их внутри блока */
body.at-shell:not(.login) .main > .content,
body.at-shell:not(.login) #content,
body.at-shell:not(.login) #content-main {
  min-width: 0;
}

body.at-shell:not(.login) .main > .content,
body.at-shell:not(.login) #content {
  max-width: none;
  margin: 0;
}

/* Перебиваем раскладку Django: .dashboard #content { width: 600px } и float у колонок */
body.at-shell:not(.login) #content,
body.at-shell:not(.login).dashboard #content {
  width: auto;
  box-sizing: border-box;
  padding: 22px 28px 36px;
}

body.at-shell:not(.login) #content-main {
  float: none;
  width: 100%;
  max-width: 1760px;
}

body.at-shell:not(.login) #content-related {
  float: none;
  width: auto;
  margin: 0;
}

body.at-shell:not(.login).colMS #content,
body.at-shell:not(.login).colSM #content {
  margin: 0;
}

/* —— Боковое меню —— */
.at-side {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--at-side-w);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 0 14px;
  background: var(--at-side-bg);
  color: var(--at-side-ink);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.at-side::-webkit-scrollbar {
  width: 8px;
}

.at-side::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 8px;
}

.at-side__brand {
  position: relative;
  padding: 20px 20px 16px;
}

.at-side__logo {
  display: block;
  text-decoration: none;
  color: #fff;
}

.at-side__logo img {
  display: block;
  max-width: 172px;
  max-height: 34px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.at-side__wordmark {
  font-family: var(--font-family-brand);
  font-weight: 800;
  font-size: 1.24rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: #fff;
}

.at-side__wordmark em {
  font-style: normal;
  color: var(--at-primary);
}

.at-side__tagline {
  margin: 4px 0 0;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--at-side-muted);
}

.at-side__close {
  position: absolute;
  top: 16px;
  right: 12px;
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: var(--at-side-hover);
  color: var(--at-side-ink);
  cursor: pointer;
}

.at-side__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px;
}

.at-nav__row {
  position: relative;
  display: flex;
  align-items: center;
}

.at-nav__row .at-nav__link {
  flex: 1 1 auto;
  min-width: 0;
}

.at-nav__row .at-nav__toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.at-nav__row .at-nav__toggle[aria-expanded="true"] {
  transform: translateY(-50%) rotate(180deg);
}

.at-nav__row .at-nav__link {
  padding-right: 40px;
}

.at-nav__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--at-radius-sm);
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--at-side-ink);
  text-decoration: none;
  transition: background 0.14s ease, color 0.14s ease;
}

.at-nav__link:hover {
  background: var(--at-side-hover);
  color: #fff;
  text-decoration: none;
}

.at-nav__link.is-active {
  background: var(--at-primary);
  color: #fff;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--at-primary) 35%, transparent);
}

.at-nav__link.is-active .at-ic {
  stroke-width: 1.9;
}

.at-nav__title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.at-nav__badge {
  flex: none;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--at-primary);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1;
}

.at-nav__link.is-active .at-nav__badge {
  background: #fff;
  color: var(--at-primary);
}

.at-nav__toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  opacity: 0.75;
  transition: transform 0.18s ease, opacity 0.14s ease;
}

.at-nav__toggle:hover {
  opacity: 1;
}

.at-nav__toggle[aria-expanded="true"] {
  transform: rotate(180deg);
}

.at-nav__toggle .at-ic {
  width: 16px;
  height: 16px;
}

.at-subnav {
  display: none;
  flex-direction: column;
  gap: 1px;
  margin: 2px 0 6px 22px;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.at-subnav.is-open {
  display: flex;
}

.at-subnav__link {
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--at-side-muted);
  text-decoration: none;
  transition: background 0.14s ease, color 0.14s ease;
}

.at-subnav__link:hover {
  background: var(--at-side-hover);
  color: #fff;
  text-decoration: none;
}

.at-subnav__link.is-active {
  color: #fff;
  background: var(--at-side-hover);
}

.at-side__section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.at-side__caption {
  margin: 0 0 6px;
  padding: 0 24px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--at-side-muted);
}

.at-side__promo {
  margin: auto 12px 0;
  padding: 16px;
  border-radius: var(--at-radius);
  background: linear-gradient(145deg, #23262d 0%, #15171c 60%),
    radial-gradient(120% 80% at 80% 0%, color-mix(in srgb, var(--at-primary) 40%, transparent) 0%, transparent 60%);
  background-blend-mode: normal, screen;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.at-side__promo-title {
  margin: 0 0 10px;
  font-family: var(--font-family-brand);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
}

.at-side__promo-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--at-primary);
  text-decoration: none;
}

.at-side__promo-link .at-ic {
  width: 15px;
  height: 15px;
}

.at-side__promo-link:hover {
  color: #fff;
  text-decoration: none;
}

.at-side__scrim {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: none;
  border: 0;
  padding: 0;
  background: rgba(10, 12, 16, 0.5);
  backdrop-filter: blur(2px);
  cursor: pointer;
}

/* —— Верхняя панель —— */
.at-top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--at-top-h);
  padding: 0 24px;
  background: var(--at-surface);
  border-bottom: 1px solid var(--at-line);
}

.at-top__burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: none;
  padding: 0;
  border: 1px solid var(--at-line);
  border-radius: var(--at-radius-sm);
  background: var(--at-surface);
  color: var(--at-ink);
  cursor: pointer;
}

.at-search {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 540px;
  display: flex;
  align-items: center;
}

.at-search__icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--at-muted);
  pointer-events: none;
}

.at-search__input {
  width: 100%;
  height: 42px;
  padding: 0 64px 0 42px;
  border: 1px solid var(--at-line);
  border-radius: 999px;
  background: var(--at-surface-2);
  color: var(--at-ink);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.at-search__input::placeholder {
  color: var(--at-muted);
}

.at-search__input:focus {
  outline: none;
  background: var(--at-surface);
  border-color: color-mix(in srgb, var(--at-primary) 55%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--at-primary) 12%, transparent);
}

.at-search__kbd {
  position: absolute;
  right: 12px;
  padding: 3px 7px;
  border: 1px solid var(--at-line);
  border-radius: 6px;
  background: var(--at-surface);
  color: var(--at-muted);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  pointer-events: none;
}

.at-top__tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.at-top__icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--at-radius-sm);
  background: transparent;
  color: var(--at-muted);
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.at-top__icon-btn:hover,
.at-top__icon-btn[aria-expanded="true"] {
  background: var(--at-surface-2);
  border-color: var(--at-line);
  color: var(--at-ink);
}

.at-top__icon-btn.has-dot::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--at-primary);
  box-shadow: 0 0 0 2px var(--at-surface);
}

/* —— Профиль и попапы —— */
.at-pop {
  position: relative;
}

.at-user__btn {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--at-radius-sm);
  background: transparent;
  color: var(--at-ink);
  font-family: inherit;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.at-user__btn:hover,
.at-user__btn[aria-expanded="true"] {
  background: var(--at-surface-2);
  border-color: var(--at-line);
}

.at-user__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  background: var(--at-side-bg);
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
}

.at-user__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
  text-align: left;
}

.at-user__name {
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.at-user__role {
  font-size: 0.74rem;
  color: var(--at-muted);
}

.at-user__chevron {
  width: 16px;
  height: 16px;
  color: var(--at-muted);
}

.at-pop__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  min-width: 232px;
  padding: 6px;
  border: 1px solid var(--at-line);
  border-radius: var(--at-radius);
  background: var(--at-surface);
  box-shadow: var(--at-shadow-lg);
}

.at-pop__panel[hidden] {
  display: none;
}

.at-pop__panel--notes {
  width: min(380px, calc(100vw - 32px));
  padding: 0;
}

.at-pop__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--at-radius-sm);
  background: transparent;
  color: var(--at-ink);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.at-pop__item:hover {
  background: var(--at-surface-2);
  color: var(--at-ink);
  text-decoration: none;
}

.at-pop__item .at-ic {
  width: 17px;
  height: 17px;
  color: var(--at-muted);
}

.at-pop__item--danger {
  color: var(--at-primary);
}

.at-pop__item--danger .at-ic {
  color: var(--at-primary);
}

.at-pop__form {
  margin: 0;
}

.at-pop__loading {
  margin: 0;
  padding: 18px;
  color: var(--at-muted);
  font-size: 0.86rem;
}

/* —— Уведомления —— */
.at-notes__head {
  margin: 0;
  padding: 13px 16px;
  border-bottom: 1px solid var(--at-line);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--at-muted);
}

.at-notes__list {
  margin: 0;
  padding: 6px;
  list-style: none;
  max-height: 340px;
  overflow-y: auto;
}

.at-notes__item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: var(--at-radius-sm);
  color: var(--at-ink);
  text-decoration: none;
}

.at-notes__item:hover {
  background: var(--at-surface-2);
  text-decoration: none;
}

.at-notes__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 9px;
  background: var(--at-info-bg);
  color: var(--at-info);
}

.at-notes__icon .at-ic {
  width: 17px;
  height: 17px;
}

.at-notes__icon--order {
  background: color-mix(in srgb, var(--at-primary) 12%, transparent);
  color: var(--at-primary);
}

.at-notes__icon--contact {
  background: var(--at-warn-bg);
  color: var(--at-warn);
}

.at-notes__body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.at-notes__title {
  font-size: 0.86rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.at-notes__meta {
  font-size: 0.78rem;
  color: var(--at-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.at-notes__time {
  flex: none;
  font-size: 0.74rem;
  color: var(--at-muted);
  white-space: nowrap;
}

.at-notes__empty {
  margin: 0;
  padding: 22px 16px;
  color: var(--at-muted);
  font-size: 0.86rem;
  text-align: center;
}

.at-notes__foot {
  display: flex;
  gap: 16px;
  padding: 11px 16px;
  border-top: 1px solid var(--at-line);
}

.at-notes__foot a {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--at-primary);
  text-decoration: none;
}

.at-notes__foot a:hover {
  text-decoration: underline;
}

/* —— Хлебные крошки —— */
body.at-shell:not(.login) div.breadcrumbs {
  padding: 16px 28px 0;
  background: transparent;
  border: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--at-muted);
}

body.at-shell:not(.login) div.breadcrumbs a {
  color: var(--at-muted);
  text-decoration: none;
}

body.at-shell:not(.login) div.breadcrumbs a:hover {
  color: var(--at-primary);
}

/* —— Подвал —— */
.at-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 28px;
  border-top: 1px solid var(--at-line);
  background: var(--at-surface);
  color: var(--at-muted);
  font-size: 0.8rem;
}

.at-foot__right {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.at-foot__ver {
  padding: 2px 8px;
  border: 1px solid var(--at-line);
  border-radius: 999px;
  font-weight: 700;
}

/* —— Общие элементы новой админки —— */
.at-card {
  background: var(--at-surface);
  border: 1px solid var(--at-line);
  border-radius: var(--at-radius);
  box-shadow: var(--at-shadow);
}

.at-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--at-line-strong);
  border-radius: var(--at-radius-sm);
  background: var(--at-surface);
  color: var(--at-ink);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease, transform 0.1s ease;
}

.at-btn:hover {
  background: var(--at-surface-2);
  color: var(--at-ink);
  text-decoration: none;
}

.at-btn:active {
  transform: translateY(1px);
}

.at-btn .at-ic {
  width: 17px;
  height: 17px;
}

.at-btn--primary {
  background: var(--at-primary);
  border-color: var(--at-primary);
  color: #fff;
}

.at-btn--primary:hover {
  background: var(--at-primary-dark);
  border-color: var(--at-primary-dark);
  color: #fff;
}

.at-btn--ghost {
  background: transparent;
}

.at-btn--soft {
  background: color-mix(in srgb, var(--at-primary) 8%, transparent);
  border-color: color-mix(in srgb, var(--at-primary) 22%, transparent);
  color: var(--at-primary);
}

.at-btn--soft:hover {
  background: color-mix(in srgb, var(--at-primary) 14%, transparent);
  color: var(--at-primary-dark);
}

.at-btn--block {
  width: 100%;
}

.at-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.5;
}

.at-chip--new {
  background: color-mix(in srgb, var(--at-primary) 12%, transparent);
  color: var(--at-primary);
}

.at-chip--done {
  background: var(--at-ok-bg);
  color: var(--at-ok);
}

.at-chip--progress {
  background: var(--at-warn-bg);
  color: var(--at-warn);
}

.at-chip--info {
  background: var(--at-info-bg);
  color: var(--at-info);
}

.at-chip--dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* —— Планшет и телефон —— */
@media (max-width: 1100px) {
  body.at-shell:not(.login) #container {
    padding-left: 0;
  }

  .at-side {
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: none;
  }

  body.at-side-open .at-side {
    transform: translateX(0);
    box-shadow: var(--at-shadow-lg);
  }

  body.at-side-open .at-side__scrim {
    display: block;
  }

  .at-side__close {
    display: inline-flex;
  }

  .at-side__brand {
    padding-right: 60px;
  }

  .at-top__burger {
    display: inline-flex;
  }

  .at-search__kbd {
    display: none;
  }

  .at-search__input {
    padding-right: 16px;
  }
}

@media (max-width: 720px) {
  :root {
    --at-top-h: 62px;
  }

  .at-top {
    padding: 0 12px;
    gap: 8px;
  }

  body.at-shell:not(.login) #content {
    padding: 14px 12px 28px;
  }

  body.at-shell:not(.login) div.breadcrumbs {
    padding: 12px 12px 0;
    font-size: 0.78rem;
  }

  .at-user__meta {
    display: none;
  }

  .at-user__btn {
    padding: 0 4px;
    gap: 4px;
  }

  .at-user__chevron {
    display: none;
  }

  .at-top__icon-btn {
    width: 38px;
    height: 38px;
  }

  .at-search__input {
    height: 40px;
    font-size: 16px; /* iOS не зумит поле при фокусе */
  }

  .at-pop__panel {
    position: fixed;
    top: calc(var(--at-top-h) + 6px);
    right: 8px;
    left: 8px;
    width: auto;
    min-width: 0;
  }

  .at-pop__panel--notes {
    width: auto;
  }

  .at-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 14px 12px;
  }
}

@media (max-width: 420px) {
  .at-search__input::placeholder {
    color: transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .at-side,
  .at-btn,
  .at-nav__link,
  .at-nav__toggle {
    transition: none;
  }
}

/* —— Стандартные страницы Django внутри новой оболочки —— */
body.at-shell:not(.login) .changelist-form-container {
  min-width: 0;
  max-width: 100%;
}

body.at-shell:not(.login) #changelist .results {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

body.at-shell:not(.login) #changelist-filter {
  border-radius: var(--at-radius);
  overflow: hidden;
}

body.at-shell:not(.login) .object-tools {
  margin-bottom: 12px;
}

body.at-shell:not(.login) #content h1 {
  font-family: var(--font-family-brand);
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 4px 0 16px;
}

/* —— Django красит ссылки внутри #content селектором с id: возвращаем цвета компонентам —— */
body.at-shell:not(.login) #content a.at-btn:link,
body.at-shell:not(.login) #content a.at-btn:visited {
  color: var(--at-ink);
}

body.at-shell:not(.login) #content a.at-btn--primary:link,
body.at-shell:not(.login) #content a.at-btn--primary:visited {
  color: #fff;
}

body.at-shell:not(.login) #content a.at-btn--soft:link,
body.at-shell:not(.login) #content a.at-btn--soft:visited {
  color: var(--at-primary);
}

body.at-shell:not(.login) #content a.at-tile__main:link,
body.at-shell:not(.login) #content a.at-tile__main:visited {
  color: inherit;
}

body.at-shell:not(.login) #content a.at-tile__cta:link,
body.at-shell:not(.login) #content a.at-tile__cta:visited,
body.at-shell:not(.login) #content a.at-table__link:link,
body.at-shell:not(.login) #content a.at-table__link:visited,
body.at-shell:not(.login) #content a.at-table__phone:link,
body.at-shell:not(.login) #content a.at-table__phone:visited,
body.at-shell:not(.login) #content .at-dl dd a:link,
body.at-shell:not(.login) #content .at-dl dd a:visited {
  color: var(--at-ink);
}

body.at-shell:not(.login) #content a.at-table__id:link,
body.at-shell:not(.login) #content a.at-table__id:visited {
  color: var(--at-muted);
}

body.at-shell:not(.login) #content a.at-tile__cta:hover,
body.at-shell:not(.login) #content a.at-table__link:hover,
body.at-shell:not(.login) #content a.at-table__phone:hover,
body.at-shell:not(.login) #content a.at-table__id:hover,
body.at-shell:not(.login) #content .at-dl dd a:hover {
  color: var(--at-primary);
}

/* —— Страница поиска —— */
.at-search-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 900px;
}

.at-search-page__title {
  margin: 0 0 6px;
  font-family: var(--font-family-brand);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.at-search-page__lead {
  margin: 0;
  color: var(--at-muted);
  font-size: 0.9rem;
}

.at-search-page__form {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.at-search-page__icon {
  position: absolute;
  left: 16px;
  width: 18px;
  height: 18px;
  color: var(--at-muted);
  pointer-events: none;
}

.at-search-page__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 48px;
  padding: 0 16px 0 46px;
  border: 1px solid var(--at-line-strong);
  border-radius: var(--at-radius-sm);
  background: var(--at-surface);
  color: var(--at-ink);
  font-family: inherit;
  font-size: 0.95rem;
  -webkit-appearance: none;
  appearance: none;
}

.at-search-page__input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--at-primary) 55%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--at-primary) 12%, transparent);
}

.at-search-page__form .at-btn {
  height: 48px;
  flex: none;
}

.at-search-page__count,
.at-search-page__empty {
  margin: 0;
  color: var(--at-muted);
  font-size: 0.9rem;
}

.at-search-page__empty {
  padding: 28px;
  text-align: center;
  border: 1px dashed var(--at-line-strong);
  border-radius: var(--at-radius);
  background: var(--at-surface);
}

.at-search-page__groups {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.at-search-group {
  overflow: hidden;
}

.at-search-group__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--at-line);
}

.at-search-group__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--at-primary) 10%, transparent);
  color: var(--at-primary);
}

.at-search-group__icon .at-ic {
  width: 17px;
  height: 17px;
}

.at-search-group__title {
  margin: 0;
  font-family: var(--font-family-brand);
  font-size: 1rem;
  font-weight: 800;
}

.at-search-group__count {
  margin-left: auto;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--at-surface-2);
  color: var(--at-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.at-search-group__list {
  margin: 0;
  padding: 6px;
  list-style: none;
}

.at-search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--at-radius-sm);
  text-decoration: none;
}

.at-search-row:hover {
  background: var(--at-surface-2);
  text-decoration: none;
}

.at-search-row__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.at-search-row__title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--at-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.at-search-row__meta {
  font-size: 0.8rem;
  color: var(--at-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.at-search-row__arrow {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--at-muted);
}

body.at-shell:not(.login) #content a.at-search-row:link,
body.at-shell:not(.login) #content a.at-search-row:visited {
  color: var(--at-ink);
}

@media (max-width: 720px) {
  .at-search-page__form {
    flex-wrap: wrap;
  }

  .at-search-page__input {
    font-size: 16px;
  }

  .at-search-page__form .at-btn {
    width: 100%;
  }
}

/* —— Цвета ссылок оболочки не должны зависеть от :visited —— */
.at-side .at-nav__link:link,
.at-side .at-nav__link:visited {
  color: var(--at-side-ink);
}

.at-side .at-nav__link.is-active:link,
.at-side .at-nav__link.is-active:visited,
.at-side .at-nav__link:hover {
  color: #fff;
}

.at-side .at-subnav__link:link,
.at-side .at-subnav__link:visited {
  color: var(--at-side-muted);
}

.at-side .at-subnav__link.is-active:link,
.at-side .at-subnav__link.is-active:visited,
.at-side .at-subnav__link:hover {
  color: #fff;
}

.at-side__promo-link:link,
.at-side__promo-link:visited {
  color: var(--at-primary);
}

.at-side__promo-link:hover {
  color: #fff;
}

.at-pop__item:link,
.at-pop__item:visited {
  color: var(--at-ink);
}

.at-pop__item--danger:link,
.at-pop__item--danger:visited {
  color: var(--at-primary);
}

.at-notes__item:link,
.at-notes__item:visited {
  color: var(--at-ink);
}

.at-notes__foot a:link,
.at-notes__foot a:visited {
  color: var(--at-primary);
}

.at-top .at-search__input {
  color: var(--at-ink);
}

/* ====== Формы и списки Django в новом оформлении ====== */

/* Блоки-карточки */
body.at-shell:not(.login) .module,
body.at-shell:not(.login) fieldset.module,
body.at-shell:not(.login) .inline-group {
  border: 1px solid var(--at-line);
  border-radius: var(--at-radius);
  background: var(--at-surface);
  box-shadow: var(--at-shadow);
  overflow: hidden;
}

body.at-shell:not(.login) .module:hover {
  box-shadow: var(--at-shadow);
}

/* Заголовки блоков — вместо красной заливки */
body.at-shell:not(.login) .module h2,
body.at-shell:not(.login) .module caption,
body.at-shell:not(.login) fieldset.module h2,
body.at-shell:not(.login) .inline-group h2,
body.at-shell:not(.login) #changelist-filter h2 {
  padding: 13px 16px;
  background: var(--at-surface-2);
  border-bottom: 1px solid var(--at-line);
  color: var(--at-muted);
  font-family: var(--font-family-primary);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 0;
}

body.at-shell:not(.login) .module caption a,
body.at-shell:not(.login) .module h2 a {
  color: var(--at-ink);
}

/* Подсказки под полями */
body.at-shell:not(.login) .form-row .help,
body.at-shell:not(.login) .form-row div.help,
body.at-shell:not(.login) .help,
body.at-shell:not(.login) div.help,
body.at-shell:not(.login) p.help {
  padding: 6px 0 0;
  background: transparent;
  border: 0;
  color: var(--at-muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

body.at-shell:not(.login) .aligned .help,
body.at-shell:not(.login) .aligned div.help {
  margin-left: 0;
  padding-left: 0;
}

/* Поля ввода */
body.at-shell:not(.login) input[type="text"],
body.at-shell:not(.login) input[type="password"],
body.at-shell:not(.login) input[type="email"],
body.at-shell:not(.login) input[type="url"],
body.at-shell:not(.login) input[type="number"],
body.at-shell:not(.login) input[type="tel"],
body.at-shell:not(.login) input[type="search"],
body.at-shell:not(.login) textarea,
body.at-shell:not(.login) select,
body.at-shell:not(.login) .vTextField {
  border-radius: var(--at-radius-sm);
  border: 1px solid var(--at-line-strong);
  background: var(--at-surface);
  color: var(--at-ink);
  padding: 9px 12px;
  font-family: inherit;
}

body.at-shell:not(.login) input:focus,
body.at-shell:not(.login) textarea:focus,
body.at-shell:not(.login) select:focus {
  border-color: color-mix(in srgb, var(--at-primary) 55%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--at-primary) 12%, transparent);
  outline: none;
}

/* Кнопки сохранения */
body.at-shell:not(.login) .submit-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 16px;
  margin-top: 16px;
  border: 1px solid var(--at-line);
  border-radius: var(--at-radius);
  background: var(--at-surface);
  box-shadow: var(--at-shadow);
}

body.at-shell:not(.login) .button,
body.at-shell:not(.login) input[type="submit"],
body.at-shell:not(.login) input[type="button"],
body.at-shell:not(.login) .submit-row input,
body.at-shell:not(.login) a.button {
  border-radius: var(--at-radius-sm) !important;
  padding: 11px 16px;
  font-size: 0.88rem;
  border: 1px solid var(--at-line-strong);
  background: var(--at-surface);
  color: var(--at-ink);
}

body.at-shell:not(.login) .button.default,
body.at-shell:not(.login) input[type="submit"].default,
body.at-shell:not(.login) .submit-row input.default {
  border-color: var(--at-primary);
  color: #fff;
}

body.at-shell:not(.login) .submit-row a.deletelink {
  border-radius: var(--at-radius-sm);
  background: color-mix(in srgb, var(--at-primary) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--at-primary) 25%, transparent);
  color: var(--at-primary);
}

/* Кнопки над списком */
body.at-shell:not(.login) .object-tools a,
body.at-shell:not(.login) .object-tools a:link,
body.at-shell:not(.login) .object-tools a:visited {
  border-radius: var(--at-radius-sm);
  padding: 9px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  background: var(--at-side-bg);
  color: #fff;
}

body.at-shell:not(.login) .object-tools a.addlink,
body.at-shell:not(.login) .object-tools a.addlink:link,
body.at-shell:not(.login) .object-tools a.addlink:visited {
  background: var(--at-primary);
}

/* Таблица списка */
body.at-shell:not(.login) #result_list {
  border: 0;
}

body.at-shell:not(.login) #result_list thead th {
  padding: 11px 12px;
  background: var(--at-surface-2);
  border-bottom: 1px solid var(--at-line);
  color: var(--at-muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

body.at-shell:not(.login) #result_list tbody td,
body.at-shell:not(.login) #result_list tbody th {
  padding: 11px 12px;
  border-bottom: 1px solid var(--at-line);
  font-size: 0.85rem;
}

body.at-shell:not(.login) #result_list tbody tr:nth-child(even) {
  background: transparent;
}

body.at-shell:not(.login) #result_list tbody tr:hover td,
body.at-shell:not(.login) #result_list tbody tr:hover th {
  background: var(--at-surface-2);
}

body.at-shell:not(.login) .paginator {
  padding: 12px 16px;
  border-top: 1px solid var(--at-line);
  font-size: 0.85rem;
  color: var(--at-muted);
}

/* Сообщения */
body.at-shell:not(.login) ul.messagelist li {
  border-radius: var(--at-radius-sm);
  border: 1px solid var(--at-line);
  background-color: var(--at-ok-bg);
  color: var(--at-ok);
  font-weight: 600;
}

body.at-shell:not(.login) ul.messagelist li.warning {
  background-color: var(--at-warn-bg);
  color: var(--at-warn);
}

body.at-shell:not(.login) ul.messagelist li.error {
  background-color: color-mix(in srgb, var(--at-primary) 12%, transparent);
  color: var(--at-primary);
}

/* Фильтры справа */
body.at-shell:not(.login) #changelist-filter li.selected a {
  color: var(--at-primary);
  font-weight: 700;
}

body.at-shell:not(.login) #toolbar {
  padding: 12px 16px;
  background: var(--at-surface);
  border-bottom: 1px solid var(--at-line);
}

body.at-shell:not(.login) #toolbar form#changelist-search input[type="submit"] {
  margin-left: 8px;
}

/* Поля оболочки не должны получать общие отступы Django-форм */
body.at-shell:not(.login) .at-top .at-search__input {
  height: 42px;
  padding: 0 64px 0 42px;
}

body.at-shell:not(.login) .at-search-page__input {
  height: 48px;
  padding: 0 16px 0 46px;
}

body.at-shell:not(.login) .at-note__field {
  padding: 12px 14px;
}

/* Селекты: текст не должен обрезаться */
body.at-shell:not(.login) select {
  height: auto;
  min-height: 40px;
  line-height: 1.3;
  padding: 8px 12px;
  background-position: right 10px center;
}

body.at-shell:not(.login) input[type="text"],
body.at-shell:not(.login) input[type="password"],
body.at-shell:not(.login) input[type="email"],
body.at-shell:not(.login) input[type="url"],
body.at-shell:not(.login) input[type="number"],
body.at-shell:not(.login) input[type="tel"] {
  min-height: 40px;
  line-height: 1.3;
}


/* ====== Общие компоненты страниц админки ====== */

/* —— Шапка страницы —— */
.at-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 1760px;
}

.at-page__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.at-page__eyebrow {
  margin: 0 0 6px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--at-primary);
}

.at-page__title {
  margin: 0 0 6px;
  font-family: var(--font-family-brand);
  font-size: clamp(1.4rem, 1.1rem + 1vw, 1.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--at-ink);
}

.at-page__lead {
  margin: 0;
  max-width: 78ch;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--at-muted);
}

.at-page__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.at-page__section-title {
  margin: 0 0 12px;
  font-family: var(--font-family-brand);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--at-ink);
}

@media (max-width: 720px) {
  .at-page__actions {
    width: 100%;
  }

  .at-page__actions .at-btn {
    flex: 1 1 140px;
  }
}

/* —— Метрики —— */
.at-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(186px, 1fr));
  gap: 14px;
}

.at-metric {
  position: relative;
  padding: 16px 18px 14px;
  min-width: 0;
}

.at-metric__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-bottom: 12px;
  border-radius: 11px;
  background: var(--at-info-bg);
  color: var(--at-info);
}

.at-metric--published .at-metric__icon {
  background: var(--at-ok-bg);
  color: var(--at-ok);
}

.at-metric--hidden .at-metric__icon {
  background: color-mix(in srgb, var(--at-muted) 14%, transparent);
  color: var(--at-muted);
}

.at-metric--orders .at-metric__icon {
  background: color-mix(in srgb, var(--at-primary) 12%, transparent);
  color: var(--at-primary);
}

.at-metric__label {
  margin: 0 0 4px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--at-muted);
}

.at-metric__value {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  font-family: var(--font-family-brand);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--at-ink);
}

.at-metric__note {
  font-family: var(--font-family-primary);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0;
  padding: 2px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--at-muted) 12%, transparent);
  color: var(--at-muted);
  white-space: nowrap;
}

.at-metric__note--up {
  background: var(--at-ok-bg);
  color: var(--at-ok);
}

.at-metric__note--down {
  background: var(--at-warn-bg);
  color: var(--at-warn);
}

.at-metric__link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--at-primary);
  text-decoration: none;
}

.at-metric__link .at-ic {
  width: 15px;
  height: 15px;
}

.at-metric__link:hover {
  color: var(--at-primary-dark);
  text-decoration: none;
}

.at-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
  gap: 14px;
}

.at-tiles--compact {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.at-tile {
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.at-tile:hover {
  border-color: color-mix(in srgb, var(--at-primary) 40%, var(--at-line));
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.09);
  transform: translateY(-2px);
}

.at-tile__main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
  padding: 18px 18px 14px;
  color: inherit;
  text-decoration: none;
}

.at-tile__main:hover {
  text-decoration: none;
  color: inherit;
}

.at-tile__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--at-primary) 10%, transparent);
  color: var(--at-primary);
}

.at-tile__icon .at-ic {
  width: 22px;
  height: 22px;
}

.at-tile__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.at-tile__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-family-brand);
  font-size: 1rem;
  font-weight: 800;
  color: var(--at-ink);
}

.at-tile__badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--at-primary);
  color: #fff;
  font-family: var(--font-family-primary);
  font-size: 0.72rem;
  font-weight: 800;
}

.at-tile__desc {
  font-size: 0.83rem;
  line-height: 1.45;
  color: var(--at-muted);
}

.at-tile__lock {
  position: absolute;
  top: 16px;
  right: 16px;
  color: var(--at-muted);
  opacity: 0.6;
}

.at-tile__lock .at-ic {
  width: 16px;
  height: 16px;
}

.at-tile {
  position: relative;
}

.at-tile__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--at-line);
}

.at-tile__cta,
.at-tile__add {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.at-tile__cta {
  color: var(--at-ink);
}

.at-tile__cta .at-ic {
  width: 15px;
  height: 15px;
  color: var(--at-muted);
}

.at-tile__cta:hover {
  color: var(--at-primary);
  text-decoration: none;
}

.at-tile__add {
  color: var(--at-primary);
}

.at-tile__add .at-ic {
  width: 14px;
  height: 14px;
}

.at-tile__add:hover {
  color: var(--at-primary-dark);
  text-decoration: none;
}

/* Вид «Список» */
.at-tiles.is-list {
  grid-template-columns: 1fr;
  gap: 8px;
}

.at-tiles.is-list .at-tile {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.at-tiles.is-list .at-tile__main {
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
}

.at-tiles.is-list .at-tile__icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}

.at-tiles.is-list .at-tile__foot {
  border-top: 0;
  padding: 12px 16px;
  flex: none;
}

.at-tiles.is-list .at-tile:hover {
  transform: none;
}

/* —— Таблицы «последние …» —— */
.at-recent {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
}

.at-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.at-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--at-line);
}

.at-panel__more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--at-primary);
  text-decoration: none;
  white-space: nowrap;
}

.at-panel__more .at-ic {
  width: 15px;
  height: 15px;
}

.at-panel__more:hover {
  color: var(--at-primary-dark);
  text-decoration: none;
}

.at-panel__empty {
  margin: 0;
  padding: 28px 18px;
  text-align: center;
  color: var(--at-muted);
  font-size: 0.88rem;
}

.at-table-wrap {
  overflow-x: auto;
}

.at-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.at-table th {
  padding: 10px 12px;
  text-align: left;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--at-muted);
  background: var(--at-surface-2);
  border-bottom: 1px solid var(--at-line);
  white-space: nowrap;
}

.at-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--at-line);
  color: var(--at-ink);
  vertical-align: middle;
  white-space: nowrap;
}

.at-table td:nth-child(2) {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.at-table tbody tr:last-child td {
  border-bottom: 0;
}

.at-table tbody tr:hover td {
  background: var(--at-surface-2);
}

.at-table__id {
  font-weight: 800;
  color: var(--at-muted);
  text-decoration: none;
}

.at-table__link {
  font-weight: 700;
  color: var(--at-ink);
  text-decoration: none;
}

.at-table__link:hover,
.at-table__id:hover {
  color: var(--at-primary);
  text-decoration: none;
}

.at-table__phone {
  color: var(--at-ink);
  text-decoration: none;
  white-space: nowrap;
}

.at-table__phone:hover {
  color: var(--at-primary);
}


/* —— Компактные метрики и панель наценки на списке товаров —— */
.at-metrics--compact {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.at-metric--markup {
  grid-column: span 2;
}

.at-markup {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 0;
}

.at-markup input {
  width: 110px;
  min-height: 40px;
}

.at-metric__hint {
  margin: 8px 0 0;
  font-size: 0.78rem;
  color: var(--at-muted);
}

.at-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.at-page--list #changelist {
  margin-top: 4px;
}

@media (max-width: 720px) {
  .at-metric--markup {
    grid-column: span 1;
  }
}

/* Лента журнала занимает всю доступную ширину */
body.at-shell:not(.login) .audit-timeline--page,
body.at-shell:not(.login) .at-page--list .audit-timeline {
  max-width: none;
  width: 100%;
}

@media (max-width: 720px) {
  .at-metrics--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .at-metrics--compact .at-metric {
    padding: 14px;
  }

  .at-metrics--compact .at-metric__value {
    font-size: 1.3rem;
  }
}

@media (max-width: 720px) {
  .at-markup {
    flex-wrap: wrap;
  }

  .at-markup input {
    flex: 1 1 100px;
    width: auto;
  }

  .at-markup .at-btn {
    flex: 1 1 100%;
  }
}

/* На широких экранах лента журнала идёт в две колонки — иначе строки полупустые */
@media (min-width: 1500px) {
  body.at-shell:not(.login) .audit-timeline--page .audit-timeline__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(430px, 1fr));
    gap: 10px;
    align-items: start;
  }
}
