* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  margin: 0;
}

body {
  font-family: 'PT Root UI', Helvetica, Arial, sans-serif;
  font-weight: 400;
  background-color: var(--background-color);
  color: var(--default-text-color);

  &.home {
    display: flex;
    flex-direction: column;

    .projectName {
      h1 {
        font-size: 90px;
        margin: 200px 0;
      }

      h2 {
        font-size: 30px;
      }
    }

    .page {
      margin-bottom: 200px;
    }
  }
}

a {
  color: var(--default-text-color);
}

.projectName {
  width: 100%;
  margin: auto;
  /* padding-bottom: 50px; */
  font-family: 'Arial Narrow', Arial, Helvetica, sans-serif;
  text-align: center;
  text-transform: uppercase;
  font-weight: 700;

  h1 {
    a {
      text-decoration: none;
    }
  }
}

.page {
  min-height: 480px;
}

/* Подвал — на всю ширину, с теми же отступами, что у меню; заголовки как пункты меню.
   Слева — кто мы и копирайт; документы и контакты рядом, их правый край — по правому краю колонки текста; ресурсы — в правый край страницы
   (docs/architecture.md, раздел 14) */
.siteFooter {
  width: 100%;
  padding: 0 20px 24px;
  font-size: 14px;
  line-height: 20px;

  h2 {
    margin-bottom: 8px;
    font-family: 'Arial Narrow', Arial, Helvetica, sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted-text-color);
  }

  li + li {
    margin-top: 4px;
  }

  a,
  .linkButton {
    color: var(--default-text-color);
    text-decoration: none;

    &:hover {
      text-decoration: underline;
    }
  }
}

.siteFooterGrid {
  --footer-columns-gap: 48px;

  display: grid;
  /* Последняя колонка — от правого края колонки текста до правого края подвала: в ней «Ресурсы», прижатые вправо */
  grid-template-columns: 1fr auto auto max(0px, calc((100% - var(--document-article-width)) / 2 - var(--footer-columns-gap)));
  column-gap: var(--footer-columns-gap);
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.siteFooterResources {
  justify-self: end;
}

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

  /* «Настройки cookie» — тем же цветом, что копирайт; при наведении подчёркивается, как остальные ссылки */
  .linkButton {
    color: inherit;
  }

  p {
    margin-top: 16px;
  }

  p + p {
    margin-top: 4px;
  }
}

@media (max-width: 1043px) {
  .siteFooter {
    font-size: 16px;
    line-height: 28px;

    li + li {
      margin-top: 0;
    }
  }

  .siteFooterGrid {
    grid-template-columns: 1fr;
    row-gap: 20px;
  }

  .siteFooterResources {
    justify-self: start;
  }

  /* На телефоне сначала документы, контакты и ресурсы, внизу — кто мы и копирайт */
  .siteFooterAbout {
    order: 1;

    p + p {
      margin-top: 0;
    }
  }
}

@media (max-width: 880px) {
  .projectName {
    h1 {
      font-size: 60px;

      a {
        font-size: 60px;
      }
    }

    h2 {
      font-size: 30px;
    }
  }
}

/* Текст страниц сайта — как в статьях zakhar.day (day-site, article.scss); меню и подвал — вне .page.
   :where — чтобы стили блоков (.productCard h3 и т. п.) перебивали общие без лишней точности.
   .richText — точнее, чем :where(.lexxy-content) у Lexxy: его стили подключаются после наших. */
.page {
  width: 100%;
  max-width: calc(var(--document-article-width) + 2 * var(--document-article-padding-horizontal));
  margin: 0 auto;
  padding: 0 var(--document-article-padding-horizontal) var(--document-article-padding-bottom);
}

:where(.page) h1,
.richText h1 {
  margin: var(--document-heading-1-margin-top) 0 0;
  font-size: var(--document-heading-1-font-size);
  line-height: var(--document-heading-1-line-height);
  font-weight: 700;
}

:where(.page) h2,
.richText h2 {
  margin: var(--document-heading-2-margin-top) 0 0;
  font-size: var(--document-heading-2-font-size);
  line-height: var(--document-heading-2-line-height);
  font-weight: 700;
}

:where(.page) h3,
.richText h3 {
  margin: var(--document-heading-3-margin-top) 0 0;
  font-size: var(--document-heading-3-font-size);
  line-height: var(--document-heading-3-line-height);
  font-weight: 700;
}

:where(.page) :is(h1, h2, h3) a {
  text-decoration: none;
}

:where(.page) p,
.richText p {
  margin: var(--document-paragraph-margin-top) 0 0;
  font-size: var(--document-paragraph-font-size);
  line-height: var(--document-paragraph-line-height);
}

:where(.page) p.descriptor {
  margin-top: var(--document-descriptor-margin-top);
  font-size: var(--document-descriptor-font-size);
  line-height: var(--document-descriptor-line-height);
}

:where(.page) b,
:where(.page) strong {
  font-weight: 700;
}

:where(.page) li,
.richText li {
  margin-top: var(--document-li-margin-top);
  font-size: var(--document-li-font-size);
  line-height: var(--document-li-line-height);
}

:where(.page) :is(ul, ol),
.richText :is(ul, ol) {
  margin: 0;
  padding: 0;
  list-style: none;
}

:where(.page) ol,
.richText ol {
  padding-left: var(--list-bullet-left);
  list-style: decimal;
}

:where(.page) ul > li,
.richText ul > li:not(.lexxy-nested-listitem) {
  position: relative;
  padding-left: var(--list-bullet-left);
}

/* Не вложенным «&::before»: вложенный селектор берёт вес самого сильного из списка (.richText …),
   и маркер в .page нельзя было бы убрать у отдельных списков (ссылки под формой входа, ошибки) */
:where(.page) ul > li::before,
.richText ul > li:not(.lexxy-nested-listitem)::before {
  content: '•';
  position: absolute;
  top: 0;
  left: 0;
  font-size: var(--list-bullet-font-size);
}

:where(.page) :is(ul, ol) :is(ul, ol),
.richText :is(ul, ol) :is(ul, ol) {
  margin: var(--document-list-list-margin-top) 0 var(--document-list-list-margin-bottom) var(--document-list-list-margin-left);
}

:where(.page) :is(p, h1, h2, h3) + :is(ul, ol),
.richText p + :is(ul, ol) {
  margin-top: var(--document-p-list-margin-top);
}

:where(.page) :is(ul, ol) + :is(p, ul, ol),
.richText :is(ul, ol) + :is(p, ul, ol) {
  margin-top: var(--document-list-p-margin-top);
}

:where(.page) :is(input, select, textarea, button) {
  font: inherit;
}

:where(.page) .danger {
  color: var(--text-danger);
}

/* На компьютере пункты — в той же строке, что «Хаб Дня»; кнопка «Меню» — только на телефоне */
.siteMenuItems {
  display: contents;
}

.siteMenuToggle {
  display: none;
  padding: 0;
  border: 0;
  background: none;
  color: var(--default-text-color);
  font: inherit;
  text-transform: inherit;
  cursor: pointer;
}

@media (max-width: 760px) {
  .siteMenu {
    justify-content: space-between;
  }

  .siteMenuToggle {
    display: block;
    position: relative;
    z-index: 21;
  }

  /* Открытое меню — на весь экран, пункты крупно, как на мобильной версии zakhar.day */
  .siteMenuItems {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 20;
    flex-direction: column;
    gap: 4px;
    padding: 76px 20px 32px;
    overflow-y: auto;
    background: var(--background-color);
    font-size: 40px;
    line-height: 44px;

    /* Точнее, чем .siteMenu .siteMenuAccount ниже: на телефоне «Кабинет» — внизу слева */
    .siteMenu & .siteMenuAccount {
      margin: auto 0 0;
    }
  }

  .siteMenu.isOpen .siteMenuItems {
    display: flex;
  }

  /* «Хаб Дня» остаётся видна поверх открытого меню */
  .siteMenu > a:first-child {
    position: relative;
    z-index: 21;
  }
}

html.siteMenuOpen {
  overflow: hidden;
}

/* Подпись над блоком — как заголовки колонок подвала: мелко, заглавными, приглушённо */
:where(.page) .sectionLabel {
  margin-top: 24px;
  font-family: 'Arial Narrow', Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 20px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-text-color);

  & + .productCards {
    margin-top: 16px;
  }
}

/* На главной подпись над карточками — по центру, под крупной надписью «Хаб Дня» */
body.home .sectionLabel {
  text-align: center;
}

/* Меню и продающие страницы (docs/architecture.md, раздел 6.3) */
.siteMenu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  padding: 16px 20px;
  font-family: 'Arial Narrow', Arial, Helvetica, sans-serif;
  font-size: 20px;
  line-height: 28px;
  font-weight: 700;
  text-transform: uppercase;

  /* Как меню zakhar.day: пункты приглушены, наведённый и текущий раздел — обычным цветом */
  a {
    color: var(--muted-text-color);
    text-decoration: none;

    &:hover,
    &.active {
      color: var(--default-text-color);
    }
  }

  .siteMenuAccount {
    margin-left: auto;
  }
}

/* Каталог — карточки как банковские карты, вертикально (54 × 85,6 мм): чёрная, серая, почти белая.
   Наклон за курсором и блик — card_tilt_controller.js; вся карта — ссылка */
.productCards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

/* На странице раздела без заголовка — отступ сверху, как у заголовка страницы */
.visuallyHidden + .productCards {
  margin-top: var(--document-heading-1-margin-top);
}

.productCard {
  --card-bg: linear-gradient(150deg, #3a3a3a 0%, #151515 45%, #050505 100%);
  --card-ink: #f2f2f2;
  --card-muted: rgba(255, 255, 255, 0.55);
  --card-edge: rgba(255, 255, 255, 0.12);
  --card-glare: rgba(255, 255, 255, 0.22);

  perspective: 900px;

  /* Цвет — ProductsHelper#product_card_tone: dark, gray, light */
  &[data-tone="gray"] {
    --card-bg: linear-gradient(150deg, #b4b4b4 0%, #8c8c8c 50%, #6f6f6f 100%);
    --card-ink: #ffffff;
    --card-muted: rgba(255, 255, 255, 0.72);
    --card-edge: rgba(255, 255, 255, 0.25);
    --card-glare: rgba(255, 255, 255, 0.35);
  }

  &[data-tone="light"] {
    --card-bg: linear-gradient(150deg, #ffffff 0%, #f3f3f1 50%, #e3e3df 100%);
    --card-ink: #1a1a1a;
    --card-muted: rgba(0, 0, 0, 0.5);
    --card-edge: rgba(0, 0, 0, 0.08);
    --card-glare: rgba(255, 255, 255, 1);
  }

  p {
    margin: 0;
  }
}

.productCardFace {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  aspect-ratio: 54 / 85.6;
  padding: 20px;
  overflow: hidden;
  border-radius: 14px;
  background: var(--card-bg);
  color: var(--card-ink);
  box-shadow:
    inset 0 0 0 1px var(--card-edge),
    0 1px 2px rgba(0, 0, 0, 0.12),
    0 14px 28px -14px rgba(0, 0, 0, 0.45);
  transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.6s ease;

  .isTilted & {
    transition: transform 0.12s linear, box-shadow 0.3s ease;
    box-shadow:
      inset 0 0 0 1px var(--card-edge),
      0 2px 4px rgba(0, 0, 0, 0.12),
      0 30px 50px -20px rgba(0, 0, 0, 0.55);
  }
}

.productCardBrand {
  font-family: 'Arial Narrow', Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 20px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.productCardBottom {
  .productCardSection {
    font-family: 'Arial Narrow', Arial, Helvetica, sans-serif;
    font-size: 12px;
    line-height: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--card-muted);
  }

  .productCardTitle {
    margin-top: 6px;
    font-size: 20px;
    line-height: 26px;

    a {
      color: inherit;
      text-decoration: none;

      /* Ссылка растянута на всю карту */
      &::after {
        content: '';
        position: absolute;
        inset: 0;
        z-index: 2;
      }
    }
  }

  .productCardMeta {
    margin-top: 6px;
    font-size: 13px;
    line-height: 18px;
    color: var(--card-muted);
  }

  .productPrice {
    margin-top: 16px;
    font-size: 22px;
    line-height: 28px;
    letter-spacing: 0.02em;
  }
}

/* Блик — следует за курсором */
.productCardGlare {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(circle at var(--glare-x, 50%) var(--glare-y, 0%), var(--card-glare) 0%, transparent 60%);
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;

  .isTilted & {
    opacity: 1;
  }
}

.productCard:focus-within .productCardFace {
  outline: 2px solid var(--default-text-color);
  outline-offset: 3px;
}

/* Телефон: карты листаются по одной */
@media (max-width: 700px) {
  .productCards {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 68%;
    gap: 16px;
    margin-right: calc(-1 * var(--document-article-padding-horizontal));
    margin-left: calc(-1 * var(--document-article-padding-horizontal));
    padding: 0 var(--document-article-padding-horizontal) 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 var(--document-article-padding-horizontal);
    /* Полоса прокрутки не нужна: следующая карта выглядывает справа */
    scrollbar-width: none;
  }

  .productCard {
    scroll-snap-align: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .productCardFace,
  .productCardGlare {
    transition: none;
  }
}

.visuallyHidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.productPrice {
  font-size: 24px;
  font-weight: 700;
}

/* Страница продукта: сверху карточка и главное о продукте, ниже текст и расписание */
/* Справа от карточки: сверху хлебная крошка, внизу — главное и кнопка. На телефоне крошка над карточкой */
.productHero {
  display: grid;
  grid-template-columns: 240px 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "card crumbs"
    "card info";
  column-gap: 40px;
  margin-top: 52px;

  .breadcrumbs {
    grid-area: crumbs;
    margin: 0;
  }

  .productCard {
    grid-area: card;
  }

  .productHeroInfo {
    grid-area: info;
    align-self: end;
  }
}

.productFacts {
  border-top: 1px solid var(--border-color);

  div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
  }

  dt {
    font-family: 'Arial Narrow', Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 24px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted-text-color);
  }

  dd {
    font-size: 18px;
    line-height: 24px;
    text-align: right;
  }
}

/* Кнопка и подпись к ней — в одну строку; не помещаются — подпись переносится под кнопку */
.productBuy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin-top: 24px;

  p {
    margin: 0;
  }

  .productNote {
    flex: 1 1 160px;
  }
}

/* Заголовок из текста редакции — как заголовок раздела: главный заголовок страницы — на карточке */
.productText h1 {
  margin-top: var(--document-heading-2-margin-top);
  font-size: var(--document-heading-2-font-size);
  line-height: var(--document-heading-2-line-height);
}

.productScheduleSection .productNote {
  margin-top: 4px;
}

.productSchedule {
  margin-top: 16px;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border-color);

  li {
    display: grid;
    grid-template-columns: 40px 180px 1fr;
    gap: 16px;
    margin: 0;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 18px;
    line-height: 26px;
  }

  .productScheduleNumber {
    font-family: 'Arial Narrow', Arial, Helvetica, sans-serif;
    font-weight: 700;
    color: var(--muted-text-color);
  }

  .productScheduleWhen {
    display: flex;
    flex-direction: column;

    span {
      font-size: 14px;
      line-height: 20px;
      color: var(--muted-text-color);
    }
  }

  .isPast {
    .productScheduleWhen strong,
    .productScheduleTopic {
      color: var(--muted-text-color);
    }
  }
}

@media (max-width: 700px) {
  .productHero {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-template-areas:
      "crumbs"
      "card"
      "info";
    row-gap: 24px;
    margin-top: 24px;

    .productCard {
      max-width: 260px;
    }
  }

  .productSchedule li {
    grid-template-columns: 32px 1fr;

    .productScheduleTopic {
      grid-column: 2;
    }
  }
}

.productNote,
.productEdition,
.breadcrumbs {
  opacity: 0.6;
  font-size: 14px;
  line-height: 20px;
}

.breadcrumbs {
  margin-top: 24px;
}

/* Главное действие страницы: «Купить», «Записаться», «Материалы потока» */
.button {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 10px;
  background: var(--default-text-color);
  color: var(--background-color);
  text-decoration: none;
  font-weight: 700;
  transition: transform 0.2s ease, opacity 0.2s ease;

  &:hover {
    opacity: 0.85;
    transform: translateY(-1px);
  }
}

.previewBanner {
  padding: 12px 16px;
  background: var(--text-danger, #b00);
  color: #fff;

  a {
    color: #fff;
  }
}

/* Текст ActionText на тёмном фоне сайта: Lexxy по умолчанию рассчитан на светлый */
.richText {
  --lexxy-color-ink: var(--default-text-color);
  --lexxy-color-link: var(--default-text-color);
}

/* Плеер Kinescope в тексте (app/javascript/kinescope.js) */
/* Стили Lexxy подключаются после наших и делают вложение строчным — нужен более точный селектор */
.richText action-text-attachment:has(.kinescopePlayer, .kinescopePoster) {
  display: block;
  width: 100%;
}

.kinescopePlayer {
  position: relative;
  width: 100%;
  margin: 16px 0;
  aspect-ratio: 16 / 9;

  iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
  }
}

.postCard {
  margin-top: 48px;
}

/* Теги поста Медиатеки — плашки под постом и на карточке (раздел 11.2a) */
.postTags {
  :where(.page) & {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
  }

  li {
    :where(.page) & {
      margin: 0;
      padding: 0;
      font-size: 14px;
      line-height: 20px;

      &::before {
        content: none;
      }
    }
  }

  a {
    display: inline-block;
    padding: 4px 12px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--default-text-color);
    text-decoration: none;
    transition: border-color 0.2s ease;

    &:hover {
      border-color: var(--default-text-color);
    }
  }
}

.postMeeting {
  opacity: 0.6;
  font-size: 14px;
  line-height: 20px;

  /* Дата над заголовком поста — подпись к нему */
  & + :is(h1, h2) {
    margin-top: 4px;
  }
}

/* Медиатека для гостя: приглашение зарегистрироваться */
.libraryInvite {
  margin-top: 32px;
  padding: 24px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--default-text-color) 6%, transparent);

  .sectionLabel {
    margin-top: 0;
  }

  .libraryInviteActions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
    margin-top: 20px;
    font-size: 15px;
  }
}

/* Под тизером гостю: «Войдите или зарегистрируйтесь, чтобы посмотреть материал» */
.libraryLogin {
  :where(.page) & {
    margin-top: 32px;
    padding: 16px 20px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--default-text-color) 6%, transparent);
  }

  a {
    color: var(--default-text-color);
    font-weight: 700;
  }
}

.postLocked {
  margin-top: 24px;
  padding: 16px;
  border: 1px solid currentColor;
  border-radius: 8px;
}

/* Треугольник «play» в SVG (белый): на постере — картинкой, в «Смотреть видео» — маской цвета текста */
:root {
  --play-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 4.5v15a1 1 0 0 0 1.5.86l12.5-7.5a1 1 0 0 0 0-1.72L8.5 3.64A1 1 0 0 0 7 4.5z' fill='%23fff'/%3E%3C/svg%3E");
}

/* Постер видео в списке: картинка 16:9 с кнопкой «play» поверх, по нажатию — плеер (раздел 11.2) */
.kinescopePoster {
  position: relative;
  display: block;
  width: 100%;
  margin: 12px 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: color-mix(in srgb, var(--default-text-color) 8%, transparent);
  cursor: pointer;

  /* Lexxy задаёт картинкам во вложениях размер значка — нужен более точный селектор */
  .richText action-text-attachment & img,
  img {
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
    border-radius: 0;
    aspect-ratio: 16 / 9;
    object-fit: cover;
  }

  /* Кнопка «play» — треугольник в SVG, а не символ «▶»: iPhone рисует его эмодзи */
  &::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    /* По центру тяжести треугольника, а не по рамке: так он выглядит по центру круга */
    background: rgba(0, 0, 0, 0.6) var(--play-icon) no-repeat 51% 50% / 26px 26px;
    transform: translate(-50%, -50%);
    transition: background-color 0.2s ease;
  }

  &:hover::after {
    background-color: rgba(0, 0, 0, 0.8);
  }
}

/* Гостю — постер закрытого видео под тизером, без плеера */
.postLockedPoster {
  display: block;
  width: 100%;
  margin-top: 24px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
}

.kinescopePlay {
  margin: 12px 0;
  padding: 10px 20px;
  border: 1px solid currentColor;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;

  /* Тот же треугольник, цвет — как у текста кнопки */
  &::before {
    content: "";
    display: inline-block;
    width: 0.75em;
    height: 0.75em;
    margin-right: 8px;
    background: currentColor;
    mask: var(--play-icon) no-repeat center / contain;
  }
}

/* Кабинет — в стиле форм входа (.authPage): колонка, подписи разделов капителью, разделы через линию */
.account {
  max-width: 640px;
  margin: 0 auto;

  h1 {
    margin-top: var(--document-heading-1-margin-top);
  }

  p {
    font-size: 16px;
    line-height: 24px;
  }

  table {
    width: 100%;
    margin-top: 4px;
    border-collapse: collapse;
  }

  tr + tr td {
    border-top: 1px solid var(--border-color);
  }

  td {
    padding: 12px 12px 12px 0;
    font-size: 15px;
    line-height: 22px;
    vertical-align: top;

    &:last-child {
      padding-right: 0;
    }
  }

  /* Второстепенные действия — контурная кнопка, как в баннере cookie; главное — .button */
  button:not(.button) {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: transparent;
    color: var(--default-text-color);
    font: inherit;
    font-size: 14px;
    line-height: 20px;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.2s ease;

    &:hover {
      border-color: var(--default-text-color);
    }
  }

  .button {
    margin-top: 16px;
    border: 0;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
  }

  /* Пароль — поля как у входа, но не шире формы входа */
  .authForm {
    max-width: 400px;
    margin-top: 8px;

    .button {
      margin-top: 4px;
    }

    & + p,
    & + .accountRow {
      margin-top: 16px;
    }
  }
}

.accountHeader {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-top: 12px;
  font-size: 16px;
  line-height: 24px;
  color: var(--muted-text-color);
}

.accountSection {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);

  > h2 {
    margin: 0 0 12px;
    font-family: 'Arial Narrow', Arial, Helvetica, sans-serif;
    font-size: 13px;
    line-height: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted-text-color);
  }

  > p:first-of-type {
    margin-top: 0;
  }
}

/* Строка списка: название и подробности слева, действие справа */
.accountRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;

  & + & {
    border-top: 1px solid var(--border-color);
  }

  p {
    margin: 0;
  }

  .accountMuted {
    margin-top: 2px;
  }
}

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

.account p.accountMuted {
  font-size: 15px;
  line-height: 22px;
}

.accountAction {
  width: 1%;
  text-align: right;
  white-space: nowrap;
}

.account td .accountMuted {
  margin-top: 2px;

  a {
    color: inherit;
  }
}

.accountDanger {
  color: var(--text-danger);
}

/* На телефоне строка таблицы — блок, ячейки друг под другом: таблица не шире экрана */
@media (max-width: 760px) {
  .account {
    table,
    tbody,
    tr,
    td {
      display: block;
    }

    /* Ячейки строки — в поток с переносом: короткие («№1», дата, сумма) встают рядом, длинные — на всю ширину */
    tr {
      display: flex;
      flex-wrap: wrap;
      align-items: baseline;
      gap: 4px 12px;
      padding: 12px 0;
    }

    tr + tr {
      border-top: 1px solid var(--border-color);
    }

    tr + tr td {
      border-top: 0;
    }

    td {
      padding: 0;
    }

    .accountAction {
      width: auto;
      text-align: left;
    }
  }

  .accountRow {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}

.inlineForm {
  display: inline;
}

/* Важное в кабинете: подтвердите email, нет согласия на запись, удаление назначено — мягкая плашка, как .flash */
.accountNotice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--text-danger) 12%, transparent);
  font-size: 15px;
  line-height: 22px;
}

/* Уведомления после действий: «Вход выполнен», «Неверный email или пароль» */
.flash {
  margin-top: 24px;
  padding: 12px 16px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--default-text-color) 8%, transparent);
  font-size: 15px;
  line-height: 22px;

  &.flash-alert {
    background: color-mix(in srgb, var(--text-danger) 12%, transparent);
  }

  /* Над формой входа — в ширину формы */
  .page:has(.authPage) & {
    max-width: 400px;
    margin-right: auto;
    margin-left: auto;
  }
}

/* Вход, регистрация, пароль: узкая колонка, крупные поля, сплошная кнопка */
.authPage {
  max-width: 400px;
  margin: 0 auto;

  h1 {
    margin-top: var(--document-heading-1-margin-top);
  }

  .authLead {
    margin-top: 12px;
    font-size: 16px;
    line-height: 24px;
    color: var(--muted-text-color);
  }

  .authHint {
    margin-top: 20px;
    font-size: 15px;
    line-height: 22px;
    color: var(--muted-text-color);

    a {
      color: var(--default-text-color);
    }
  }
}

.authForm {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 32px;

  .button {
    width: 100%;
    margin-top: 4px;
    padding: 16px;
    border: 0;
    font-size: 17px;
    cursor: pointer;
  }
}

.authField {
  display: flex;
  flex-direction: column;
  gap: 8px;

  label {
    font-family: 'Arial Narrow', Arial, Helvetica, sans-serif;
    font-size: 13px;
    line-height: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted-text-color);
  }

  /* 18px: меньше 16px iPhone приближает страницу при вводе */
  input {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: color-mix(in srgb, var(--default-text-color) 5%, var(--background-color));
    color: var(--default-text-color);
    font-size: 18px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;

    &:focus {
      outline: none;
      border-color: var(--default-text-color);
      box-shadow: 0 0 0 4px color-mix(in srgb, var(--default-text-color) 15%, transparent);
    }
  }

  small {
    font-size: 13px;
    line-height: 18px;
    color: var(--muted-text-color);
  }
}

.authChecks {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.authCheck {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 15px;
  line-height: 22px;

  input {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin: 1px 0 0;
    accent-color: var(--default-text-color);
    cursor: pointer;
  }

  label {
    cursor: pointer;
  }
}

/* Подпись раздела на технической странице («Как это работает») — как подписи полей */
.authSectionLabel {
  :where(.page) & {
    margin-top: 28px;
    font-family: 'Arial Narrow', Arial, Helvetica, sans-serif;
    font-size: 13px;
    line-height: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted-text-color);
  }
}

/* Шаги по порядку: номера — счётчиком, у ol на сайте маркеров нет */
.authSteps {
  margin-top: 12px;
  padding: 0;
  list-style: none;
  counter-reset: step;

  li {
    position: relative;
    margin-top: 10px;
    padding-left: 28px;
    font-size: 16px;
    line-height: 24px;
    counter-increment: step;

    &::before {
      content: counter(step);
      position: absolute;
      top: 0;
      left: 0;
      color: var(--muted-text-color);
      font-weight: 700;
    }
  }
}

/* Необратимое действие — удаление аккаунта */
.button.buttonDanger {
  background: var(--text-danger);
  color: #fff;
}

/* Второстепенное действие формой («Отправить новый код») — выглядит как ссылки под формой входа */
.authLinks .linkButton {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted-text-color);
  font: inherit;
  font-size: 15px;
  line-height: 22px;
  text-decoration: none;
  cursor: pointer;

  &:hover {
    color: var(--default-text-color);
  }
}

.authPage .accountNotice {
  margin-top: 32px;
}

.authErrors {
  padding: 14px 16px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--text-danger) 12%, transparent);
  font-size: 15px;
  line-height: 22px;

  ul {
    margin: 0;
    padding: 0;
  }

  li {
    margin: 0;
    padding: 0;
    font-size: inherit;
    line-height: inherit;

    &::before {
      content: none;
    }
  }
}

.authLinks {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);

  li {
    margin: 0;
    padding: 0;
    font-size: 15px;
    line-height: 22px;

    &::before {
      content: none;
    }
  }

  a {
    color: var(--muted-text-color);
    text-decoration: none;

    &:hover {
      color: var(--default-text-color);
    }
  }
}

/* Cookie-баннер (раздел 17, политика п. 5.2): «Принять» и «Отклонить» равнозначны */
.cookieBanner {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 10;
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
  border: 1px solid currentColor;
  border-radius: 8px;
  background: var(--background-color);

  &[hidden] {
    display: none;
  }

  .cookieBannerButtons {
    display: flex;
    gap: 12px;
    margin-top: 12px;

    button {
      flex: 1;
      padding: 10px 16px;
      border: 1px solid currentColor;
      border-radius: 8px;
      background: transparent;
      color: inherit;
      font: inherit;
      cursor: pointer;
    }
  }
}

.linkButton {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

