/*
 * Roca Professionals: navigation of the cabinet and the public site.
 * Counter, bottom tab bar, top bars, the Я / Компания switch, tabs, wizard steps, bottom sheet,
 * desktop cabinet menu, site header and footer. Conventions: the head of rp-base.css.
 * Base sets a { color } and a:hover { color }, so every link-based element below sets both.
 */

/* ---- Counter ---------------------------------------------------------------------------------- */

.rp-count {
  display: inline-grid;
  place-items: center;
  flex: none;
  min-width: var(--rp-sp-5);
  height: var(--rp-sp-5);
  padding: 0 var(--rp-sp-1-5);
  border-radius: var(--rp-r-pill);
  background: var(--rp-action);
  color: var(--rp-on-accent);
  font-size: var(--rp-fs-micro);
  font-weight: var(--rp-fw-medium);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* On top of an icon: smaller, the host element places it and draws a ring of its own background. */
.rp-count--small {
  min-width: var(--rp-sp-4);
  height: var(--rp-sp-4);
  padding: 0 var(--rp-sp-1);
}

/* ---- Bottom tab bar of the cabinet ------------------------------------------------------------ */

.rp-tabbar {
  position: fixed;
  z-index: 30;
  inset: auto 0 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  padding: var(--rp-sp-1-5) var(--rp-sp-1) max(var(--rp-sp-1), var(--rp-safe-bottom));
  background: var(--rp-surface);
  box-shadow: inset 0 var(--rp-bw) 0 var(--rp-line);
}

.rp-tabbar__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--rp-sp-1);
  min-width: 0;
  min-height: var(--rp-tabbar-item);
  padding: var(--rp-sp-1) 0 0;
  border: 0;
  border-radius: var(--rp-r-md);
  background: none;
  color: var(--rp-text-secondary);
  font-size: var(--rp-fs-micro);
  font-weight: var(--rp-fw-medium);
  line-height: var(--rp-lh-snug);
  text-decoration: none;
}

.rp-tabbar__label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (hover: hover) {
  .rp-tabbar__item:hover {
    color: var(--rp-text);
  }
}

.rp-tabbar__item[aria-current="page"],
.rp-tabbar__item.is-active {
  color: var(--rp-accent);
}

.rp-tabbar__count {
  position: absolute;
  top: var(--rp-sp-0-5);
  left: calc(50% + var(--rp-sp-2));
  box-shadow: 0 0 0 var(--rp-sp-0-5) var(--rp-surface);
}

/* The + in the middle: a square of ink, not a circle, as the rest of the shapes. */
.rp-tabbar__add {
  display: grid;
  place-items: center;
  justify-self: center;
  align-self: start;
  width: var(--rp-fab);
  height: var(--rp-fab);
  margin-top: var(--rp-sp-0-5);
  padding: 0;
  border: 0;
  border-radius: var(--rp-r-lg);
  background: var(--rp-action);
  color: var(--rp-on-accent);
  box-shadow: var(--rp-sh-fab);
  transition: transform var(--rp-dur-fast) var(--rp-ease);
}

.rp-tabbar__add:hover {
  background: var(--rp-action-hover);
}

.rp-tabbar__add:active {
  background: var(--rp-action-pressed);
  transform: scale(0.96);
}

/* Component page only: in the flow, not over the screen. */
.rp-tabbar--demo {
  position: relative;
  z-index: auto;
  border-radius: var(--rp-r-lg);
  box-shadow: var(--rp-sh-1);
}

/* ---- Top bar: back, title, action; the root variant carries the logo or a big title ----------- */

.rp-topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: minmax(var(--rp-tap), auto) minmax(0, 1fr) minmax(var(--rp-tap), auto);
  align-items: center;
  gap: var(--rp-sp-1);
  min-height: calc(var(--rp-topbar-h) + var(--rp-safe-top));
  padding: var(--rp-safe-top) var(--rp-sp-1-5) 0;
  background: var(--rp-paper);
  color: var(--rp-text);
  box-shadow: inset 0 calc(-1 * var(--rp-bw)) 0 var(--rp-line);
}

/* The title keeps the middle column even without a back button; whatever follows goes right. */
.rp-topbar__title {
  grid-column: 2;
  min-width: 0;
  overflow: hidden;
  font-size: var(--rp-fs-body);
  font-weight: var(--rp-fw-medium);
  line-height: var(--rp-lh-snug);
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rp-topbar__title ~ * {
  justify-self: end;
}

.rp-topbar__btn {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--rp-tap);
  height: var(--rp-tap);
  padding: 0;
  border: 0;
  border-radius: var(--rp-r-pill);
  background: transparent;
  color: inherit;
  text-decoration: none;
}

.rp-topbar__btn--secondary {
  color: var(--rp-text-secondary);
}

.rp-topbar__action {
  display: inline-flex;
  align-items: center;
  min-height: var(--rp-tap);
  padding: 0 var(--rp-sp-2);
  border: 0;
  border-radius: var(--rp-r-control);
  background: transparent;
  color: var(--rp-accent);
  font-size: var(--rp-fs-small);
  font-weight: var(--rp-fw-medium);
  text-decoration: none;
  white-space: nowrap;
}

@media (hover: hover) {
  .rp-topbar__btn:hover {
    background: var(--rp-stone);
    color: inherit;
  }

  .rp-topbar__btn--secondary:hover {
    color: var(--rp-text);
  }

  .rp-topbar__action:hover {
    color: var(--rp-accent-hover);
  }
}

.rp-topbar__count {
  position: absolute;
  top: var(--rp-sp-2);
  right: var(--rp-sp-2);
  box-shadow: 0 0 0 var(--rp-sp-0-5) var(--rp-paper);
}

.rp-topbar--root {
  display: flex;
  padding: var(--rp-safe-top) var(--rp-sp-2) 0 var(--rp-gutter-m);
}

.rp-topbar--root > :first-child {
  margin-right: auto;
}

.rp-topbar--root .rp-topbar__title {
  font-size: var(--rp-fs-h3);
  font-weight: var(--rp-fw-heading);
  letter-spacing: var(--rp-ls-heading);
  text-align: left;
}

/* ---- Я / Компания: who acts in the cabinet, only for a company representative ----------------- */

.rp-persona {
  display: flex;
  align-items: center;
  gap: var(--rp-sp-3);
  min-width: 0;
  min-height: var(--rp-topbar-h);
}

.rp-persona__avatar,
.rp-sidenav__avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: var(--rp-avatar);
  height: var(--rp-avatar);
  border-radius: 50%;
  background: var(--rp-ph-fill);
  color: var(--rp-ph-text);
  font-size: var(--rp-fs-caption);
  font-weight: var(--rp-fw-medium);
}

.rp-persona__who {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  line-height: var(--rp-lh-snug);
}

.rp-persona__name {
  overflow: hidden;
  font-weight: var(--rp-fw-medium);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rp-persona__role {
  color: var(--rp-text-tertiary);
  font-size: var(--rp-fs-caption);
}

.rp-persona__switch {
  display: grid;
  flex: none;
  grid-auto-flow: column;
  padding: var(--rp-sp-0-5);
  border-radius: var(--rp-r-pill);
  background: var(--rp-stone);
}

.rp-persona__option {
  min-height: var(--rp-tap);
  padding: 0 var(--rp-sp-3);
  border: 0;
  border-radius: var(--rp-r-pill);
  background: transparent;
  color: var(--rp-text-secondary);
  font-size: var(--rp-fs-small);
  font-weight: var(--rp-fw-medium);
}

.rp-persona__option[aria-pressed="true"],
.rp-persona__option.is-active {
  background: var(--rp-surface);
  color: var(--rp-text);
  box-shadow: var(--rp-sh-1);
}

/* ---- Tabs with an underline ------------------------------------------------------------------- */

/* Default: a row that scrolls sideways and runs under the screen edge. */
.rp-tabs {
  position: relative;
  display: flex;
  gap: var(--rp-sp-6);
  padding: 0 var(--rp-gutter-m);
  overflow-x: auto;
  scrollbar-width: none;
  box-shadow: inset 0 calc(-1 * var(--rp-bw)) 0 var(--rp-line);
}

.rp-tabs::-webkit-scrollbar {
  display: none;
}

.rp-tabs__tab {
  position: relative;
  flex: none;
  min-width: 0;
  min-height: var(--rp-btn-h-sm);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--rp-text-secondary);
  font-size: var(--rp-fs-body);
  font-weight: var(--rp-fw-medium);
  text-decoration: none;
  white-space: nowrap;
}

/* Tabs of different widths: the line of the new tab grows, the old one shrinks. */
.rp-tabs__tab::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: var(--rp-bw-strong);
  background: var(--rp-accent);
  transform: scaleX(0);
  transition: transform var(--rp-dur) var(--rp-ease);
}

.rp-tabs__tab:hover {
  color: var(--rp-text);
}

.rp-tabs__tab[aria-selected="true"],
.rp-tabs__tab[aria-current="page"],
.rp-tabs__tab.is-active {
  color: var(--rp-text);
}

.rp-tabs__tab[aria-selected="true"]::after,
.rp-tabs__tab[aria-current="page"]::after,
.rp-tabs__tab.is-active::after {
  transform: none;
}

/* Two to four tabs sharing the width equally. */
.rp-tabs--fill {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 0;
  overflow: visible;
}

.rp-tabs--fill .rp-tabs__tab {
  overflow: hidden;
  padding: 0 var(--rp-sp-1);
  text-overflow: ellipsis;
}

/*
 * Equal tabs: one line slides to the selected tab. :has() reads the count and the index from the
 * markup, so no script measures anything; tabs must be elements of one type (nth-of-type).
 */
@supports selector(:has(*)) {
  .rp-tabs--fill {
    --rp-tabs-n: 2;
    --rp-tabs-i: 0;
  }

  .rp-tabs--fill:has(> .rp-tabs__tab:nth-of-type(3)) { --rp-tabs-n: 3; }
  .rp-tabs--fill:has(> .rp-tabs__tab:nth-of-type(4)) { --rp-tabs-n: 4; }
  .rp-tabs--fill:has(> .rp-tabs__tab:nth-of-type(2):is([aria-selected="true"], [aria-current="page"], .is-active)) { --rp-tabs-i: 1; }
  .rp-tabs--fill:has(> .rp-tabs__tab:nth-of-type(3):is([aria-selected="true"], [aria-current="page"], .is-active)) { --rp-tabs-i: 2; }
  .rp-tabs--fill:has(> .rp-tabs__tab:nth-of-type(4):is([aria-selected="true"], [aria-current="page"], .is-active)) { --rp-tabs-i: 3; }

  .rp-tabs--fill .rp-tabs__tab::after {
    content: none;
  }

  .rp-tabs--fill::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: var(--rp-gutter-m);
    width: calc((100% - 2 * var(--rp-gutter-m)) / var(--rp-tabs-n));
    height: var(--rp-bw-strong);
    background: var(--rp-accent);
    transform: translateX(calc(var(--rp-tabs-i) * 100%));
    transition: transform var(--rp-dur) var(--rp-ease);
  }
}

/* ---- Wizard steps: name, 02 / 04, a bar of segments, a caption under each --------------------- */

.rp-steps {
  display: grid;
  gap: var(--rp-sp-3);
}

.rp-steps__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--rp-sp-3);
  font-size: var(--rp-fs-small);
  line-height: var(--rp-lh-snug);
}

.rp-steps__name {
  font-weight: var(--rp-fw-medium);
}

.rp-steps__count {
  flex: none;
  color: var(--rp-text-tertiary);
  font-family: var(--rp-font-mono);
  font-size: var(--rp-fs-caption);
  letter-spacing: 0;
}

.rp-steps__list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: var(--rp-sp-1);
}

.rp-steps__step {
  position: relative;
  padding-top: calc(var(--rp-progress-h) + var(--rp-sp-2));
  color: var(--rp-text-tertiary);
  font-size: var(--rp-fs-micro);
  line-height: var(--rp-lh-snug);
  overflow-wrap: anywhere;
}

/* Track and fill are two layers: the fill scales in, so only transform animates. */
.rp-steps__step::before,
.rp-steps__step::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: var(--rp-progress-h);
  border-radius: var(--rp-r-pill);
  background: var(--rp-stone);
}

.rp-steps__step::after {
  background: var(--rp-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--rp-dur) var(--rp-ease);
}

.rp-steps__step.is-done::after,
.rp-steps__step.is-active::after,
.rp-steps__step[aria-current="step"]::after {
  transform: none;
}

.rp-steps__step.is-active,
.rp-steps__step[aria-current="step"] {
  color: var(--rp-text);
}

/* ---- Bottom sheet ----------------------------------------------------------------------------- */

.rp-sheet {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: none;
}

.rp-sheet.is-open {
  display: block;
}

.rp-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: var(--rp-overlay);
  animation: rp-fade-in var(--rp-dur) var(--rp-ease);
}

.rp-sheet__panel {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  flex-direction: column;
  gap: var(--rp-sp-2);
  max-width: var(--rp-w-text);
  max-height: calc(100% - var(--rp-safe-top) - var(--rp-topbar-h));
  margin: 0 auto;
  padding: var(--rp-sp-2) var(--rp-gutter-m) calc(var(--rp-sp-3) + var(--rp-safe-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: var(--rp-r-xl) var(--rp-r-xl) 0 0;
  background: var(--rp-surface);
  box-shadow: var(--rp-sh-3);
  animation: rp-sheet-in var(--rp-dur-slow) var(--rp-ease);
}

.rp-sheet__handle {
  flex: none;
  align-self: center;
  width: var(--rp-sheet-handle-w);
  height: var(--rp-sheet-handle-h);
  border-radius: var(--rp-r-pill);
  background: var(--rp-line-strong);
}

.rp-sheet__title {
  padding: var(--rp-sp-3) 0 var(--rp-sp-2);
  font-size: var(--rp-fs-h4);
  font-weight: var(--rp-fw-heading);
  line-height: var(--rp-lh-snug);
  letter-spacing: var(--rp-ls-heading);
}

.rp-sheet__item {
  display: flex;
  align-items: center;
  gap: var(--rp-sp-4);
  width: 100%;
  min-height: var(--rp-sp-20);
  padding: var(--rp-sp-3) var(--rp-sp-4);
  border: 0;
  border-radius: var(--rp-r-lg);
  background: var(--rp-paper);
  color: var(--rp-text);
  text-align: left;
  text-decoration: none;
}

.rp-sheet__item:hover {
  background: var(--rp-stone);
  color: var(--rp-text);
}

.rp-sheet__item-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: var(--rp-sp-12);
  height: var(--rp-sp-12);
  border-radius: var(--rp-r-md);
  background: var(--rp-surface);
  color: var(--rp-accent);
  box-shadow: var(--rp-sh-1);
}

.rp-sheet__item-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--rp-sp-0-5);
  min-width: 0;
}

.rp-sheet__item-title {
  font-weight: var(--rp-fw-medium);
  line-height: var(--rp-lh-snug);
}

.rp-sheet__item-text {
  color: var(--rp-text-secondary);
  font-size: var(--rp-fs-small);
  line-height: var(--rp-lh-snug);
}

.rp-sheet__item-arrow {
  color: var(--rp-text-tertiary);
}

/* Component page only: the sheet covers its own box instead of the screen. */
.rp-sheet--demo {
  position: relative;
  z-index: auto;
  min-height: calc(var(--rp-sp-30) * 4);
  overflow: hidden;
  border-radius: var(--rp-r-lg);
  background: var(--rp-paper);
  box-shadow: var(--rp-sh-1);
}

.rp-sheet--demo.is-open {
  display: grid;
  align-content: start;
  gap: var(--rp-sp-4);
  padding: var(--rp-sp-5) var(--rp-gutter-m);
}

/* ---- Cabinet menu on a computer --------------------------------------------------------------- */

.rp-sidenav {
  display: flex;
  flex-direction: column;
  gap: var(--rp-sp-6);
  width: var(--rp-w-sidebar);
  max-width: 100%;
  padding: var(--rp-sp-6) var(--rp-sp-4);
  background: var(--rp-surface);
  box-shadow: inset calc(-1 * var(--rp-bw)) 0 0 var(--rp-line);
}

.rp-sidenav__logo {
  align-self: flex-start;
  padding: 0 var(--rp-sp-2);
}

.rp-sidenav__profile {
  display: flex;
  align-items: center;
  gap: var(--rp-sp-3);
  padding: var(--rp-sp-3);
  border-radius: var(--rp-r-lg);
  background: var(--rp-paper);
  color: var(--rp-text);
  text-decoration: none;
}

.rp-sidenav__profile:hover {
  color: var(--rp-text);
}

.rp-sidenav__who {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: var(--rp-lh-snug);
}

.rp-sidenav__name {
  overflow: hidden;
  font-size: var(--rp-fs-small);
  font-weight: var(--rp-fw-medium);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rp-sidenav__level {
  color: var(--rp-text-tertiary);
  font-size: var(--rp-fs-caption);
}

.rp-sidenav__list {
  display: flex;
  flex-direction: column;
  gap: var(--rp-sp-0-5);
}

.rp-sidenav__item {
  display: flex;
  align-items: center;
  gap: var(--rp-sp-3);
  min-height: var(--rp-tap);
  padding: 0 var(--rp-sp-3);
  border-radius: var(--rp-r-control);
  color: var(--rp-text-secondary);
  font-size: var(--rp-fs-small);
  font-weight: var(--rp-fw-medium);
  text-decoration: none;
}

.rp-sidenav__item:hover {
  background: var(--rp-stone);
  color: var(--rp-text);
}

.rp-sidenav__item[aria-current="page"],
.rp-sidenav__item.is-active {
  background: var(--rp-accent-soft);
  color: var(--rp-ink);
}

.rp-sidenav__label {
  flex: 1;
  min-width: 0;
}

/* ---- Public site header ----------------------------------------------------------------------- */

/*
 * Modes: on paper with a line (default), --over the photo of the first screen, is-scrolled (narrow,
 * veil), is-open (phone menu panel). Classes is-scrolled and is-open come from the page script;
 * without it the links stay hidden on a phone, Войти stays visible.
 * The header is its own container: it switches to the desktop row by its width, not the screen.
 */
.rp-site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  container-type: inline-size;
  padding-top: var(--rp-safe-top);
  background: var(--rp-paper);
  color: var(--rp-text);
  box-shadow: inset 0 calc(-1 * var(--rp-bw)) 0 var(--rp-line);
}

.rp-site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--rp-sp-2);
  max-width: var(--rp-w-content);
  height: var(--rp-site-header-h);
  margin: 0 auto;
  padding: 0 var(--rp-sp-2) 0 var(--rp-site-gutter);
}

.rp-site-header__logo,
.rp-site-header__logo:hover {
  color: inherit;
}

.rp-site-header__nav {
  display: none;
  gap: var(--rp-sp-1);
  margin-left: auto;
}

.rp-site-header__link {
  display: flex;
  align-items: center;
  min-height: var(--rp-tap);
  padding: 0 var(--rp-sp-3);
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.rp-site-header__link:hover,
.rp-site-header__link[aria-current="page"] {
  color: inherit;
  text-decoration: underline;
}

/* The second Стать участником lives in the phone panel; the row has its own in __actions. */
.rp-site-header__nav .rp-site-header__nav-join {
  display: none;
}

.rp-site-header__actions {
  display: flex;
  align-items: center;
  gap: var(--rp-sp-2);
  margin-left: auto;
}

.rp-site-header__login {
  display: inline-flex;
  align-items: center;
  gap: var(--rp-sp-2);
  min-height: var(--rp-tap);
  padding: 0 var(--rp-sp-3);
  border: 0;
  border-radius: var(--rp-r-control);
  background: transparent;
  color: inherit;
  font-weight: var(--rp-fw-medium);
  text-decoration: none;
  white-space: nowrap;
}

.rp-site-header__login:hover {
  color: inherit;
  text-decoration: underline;
}

/* Logo, Войти and the menu button fit 360 px only without the user icon. */
.rp-site-header__login > .rp-icon {
  display: none;
}

.rp-site-header__actions .rp-site-header__join {
  display: none;
}

.rp-site-header__menu {
  display: grid;
  place-items: center;
  width: var(--rp-tap);
  height: var(--rp-tap);
  padding: 0;
  border: 0;
  border-radius: var(--rp-r-pill);
  background: transparent;
  color: inherit;
}

/* Over the photo of the first screen: no ground, white text and mark. */
.rp-site-header--over {
  background: transparent;
  color: var(--rp-text-inverse);
  box-shadow: none;
}

/* After scrolling: a narrow bar on a veil of paper with a line below. */
.rp-site-header.is-scrolled {
  background: var(--rp-veil);
  color: var(--rp-text);
  box-shadow: inset 0 calc(-1 * var(--rp-bw)) 0 var(--rp-line);
}

.rp-site-header.is-scrolled .rp-site-header__inner {
  height: var(--rp-topbar-h);
}

/* Phone menu: the links drop as a panel under the bar, the menu icon turns into a cross. */
.rp-site-header.is-open {
  background: var(--rp-paper);
  color: var(--rp-text);
  box-shadow: inset 0 calc(-1 * var(--rp-bw)) 0 var(--rp-line);
}

.rp-site-header.is-open .rp-site-header__menu .rp-icon {
  --rp-i: var(--rp-ic-x);
}

.rp-site-header.is-open .rp-site-header__nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: calc(100vh - var(--rp-site-header-h) - var(--rp-safe-top));
  max-height: calc(100dvh - var(--rp-site-header-h) - var(--rp-safe-top));
  margin: 0;
  padding: var(--rp-sp-2) var(--rp-site-gutter) calc(var(--rp-sp-6) + var(--rp-safe-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--rp-paper);
  box-shadow: var(--rp-sh-4);
  animation: rp-fade-in var(--rp-dur) var(--rp-ease);
}

.rp-site-header.is-open .rp-site-header__link {
  justify-content: space-between;
  min-height: var(--rp-btn-h);
  padding: 0;
  box-shadow: inset 0 calc(-1 * var(--rp-bw)) 0 var(--rp-line);
  font-weight: var(--rp-fw-medium);
}

.rp-site-header.is-open .rp-site-header__link::after {
  content: "";
  width: var(--rp-icon-sm);
  height: var(--rp-icon-sm);
  background: var(--rp-text-tertiary);
  -webkit-mask: var(--rp-ic-right);
  mask: var(--rp-ic-right);
}

.rp-site-header.is-open .rp-site-header__link[aria-current="page"] {
  color: var(--rp-accent);
  text-decoration: none;
}

.rp-site-header.is-open .rp-site-header__nav .rp-site-header__nav-join {
  display: flex;
  margin-top: var(--rp-sp-6);
}

/* Component page only: the open panel goes into the flow instead of covering the page. */
.rp-site-header--demo {
  position: relative;
  z-index: auto;
}

.rp-site-header--demo.is-open .rp-site-header__inner {
  flex-wrap: wrap;
  row-gap: 0;
  height: auto;
}

.rp-site-header--demo.is-open .rp-site-header__actions {
  min-height: var(--rp-site-header-h);
}

.rp-site-header--demo.is-open .rp-site-header__nav {
  position: static;
  order: 1;
  flex: 0 0 calc(100% + var(--rp-sp-2) + var(--rp-site-gutter));
  max-height: none;
  margin: 0 calc(-1 * var(--rp-sp-2)) 0 calc(-1 * var(--rp-site-gutter));
}

/*
 * Container queries take no var(), so the two widths are written here. Phone row (logo, Войти, menu)
 * measured 353 px: under 360 px the word goes, the mark stays. Full row (logo, five links, Войти,
 * Стать участником) measured 1 167 px at this width, so it starts at 1200 px.
 */
@container (max-width: 359px) {
  .rp-site-header__logo .rp-logo__word {
    display: none;
  }
}

@container (min-width: 1200px) {
  .rp-site-header__inner {
    gap: var(--rp-sp-8);
    padding-right: var(--rp-site-gutter);
  }

  .rp-site-header__login > .rp-icon {
    display: inline-block;
  }

  .rp-site-header__nav,
  .rp-site-header.is-open .rp-site-header__nav {
    position: static;
    display: flex;
    flex-direction: row;
    gap: var(--rp-sp-1);
    max-height: none;
    margin-left: auto;
    padding: 0;
    overflow: visible;
    background: none;
    box-shadow: none;
    animation: none;
  }

  .rp-site-header.is-open .rp-site-header__link {
    min-height: var(--rp-tap);
    padding: 0 var(--rp-sp-3);
    box-shadow: none;
    font-weight: inherit;
  }

  .rp-site-header.is-open .rp-site-header__link::after {
    content: none;
  }

  .rp-site-header.is-open .rp-site-header__nav .rp-site-header__nav-join {
    display: none;
  }

  .rp-site-header__actions {
    margin-left: 0;
  }

  .rp-site-header__actions .rp-site-header__join {
    display: inline-flex;
  }

  .rp-site-header__menu {
    display: none;
  }
}

/* ---- Public site footer ----------------------------------------------------------------------- */

.rp-site-footer {
  display: flex;
  flex-direction: column;
  gap: var(--rp-sp-10);
  width: 100%;
  max-width: var(--rp-w-content);
  margin: 0 auto;
  padding: var(--rp-sp-16) var(--rp-site-gutter) var(--rp-sp-12);
  color: var(--rp-text);
}

.rp-site-footer__top {
  display: flex;
  flex-wrap: wrap;
  gap: var(--rp-sp-10) var(--rp-sp-16);
}

.rp-site-footer__about {
  display: flex;
  flex: 2 1 calc(var(--rp-sp-30) * 2.4);
  flex-direction: column;
  align-items: flex-start;
  gap: var(--rp-sp-4);
}

.rp-site-footer__text {
  max-width: 24em;
  color: var(--rp-text-secondary);
  font-size: var(--rp-fs-small);
  line-height: var(--rp-lh-body);
}

.rp-site-footer__col {
  display: flex;
  flex: 1 1 calc(var(--rp-sp-30) * 1.6);
  flex-direction: column;
  gap: var(--rp-sp-1);
}

.rp-site-footer__head {
  display: flex;
  align-items: center;
  gap: var(--rp-sp-2);
  padding-bottom: var(--rp-sp-1);
  color: var(--rp-text-tertiary);
  font-size: var(--rp-fs-caption);
  line-height: var(--rp-lh-snug);
}

.rp-site-footer__link,
.rp-site-footer__note {
  display: flex;
  align-items: center;
  min-height: var(--rp-tap);
  color: var(--rp-text);
  text-decoration: none;
}

.rp-site-footer__link:hover {
  color: var(--rp-text);
  text-decoration: underline;
}

.rp-site-footer__note {
  color: var(--rp-text-secondary);
}

.rp-site-footer__lang {
  display: flex;
  flex-direction: column;
  gap: var(--rp-sp-2);
}

.rp-site-footer__lang-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--rp-sp-2);
}

.rp-site-footer__lang-option {
  display: inline-flex;
  align-items: center;
  min-height: var(--rp-tap);
  padding: 0 var(--rp-sp-4);
  border-radius: var(--rp-r-pill);
  background: var(--rp-surface);
  color: var(--rp-text);
  box-shadow: inset 0 0 0 var(--rp-bw) var(--rp-line-strong);
  font-size: var(--rp-fs-small);
  font-weight: var(--rp-fw-medium);
  text-decoration: none;
}

.rp-site-footer__lang-option:hover {
  color: var(--rp-text);
  box-shadow: inset 0 0 0 var(--rp-bw) var(--rp-text);
}

.rp-site-footer__lang-option[aria-current="true"],
.rp-site-footer__lang-option.is-active {
  background: var(--rp-text);
  color: var(--rp-text-inverse);
  box-shadow: none;
}

.rp-site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--rp-sp-2);
  padding-top: var(--rp-sp-5);
  box-shadow: inset 0 var(--rp-bw) 0 var(--rp-line);
  color: var(--rp-text-tertiary);
  font-size: var(--rp-fs-caption);
  line-height: var(--rp-lh-snug);
}

/* ---- The + that grows into a card of actions (Skiper: Expandable tabs navigation) -------------- */

/* The card rises from the + over the bar, without darkening the whole screen; the + turns into a cross. */
.rp-tabbar__panel {
  position: absolute;
  left: var(--rp-gutter-m);
  right: var(--rp-gutter-m);
  bottom: calc(100% + var(--rp-sp-2));
  display: grid;
  gap: var(--rp-sp-1);
  padding: var(--rp-sp-2);
  border-radius: var(--rp-r-lg);
  background: var(--rp-surface);
  box-shadow: var(--rp-sh-2);
  transform: translateY(var(--rp-sp-2)) scale(0.96);
  transform-origin: 50% 100%;
  opacity: 0;
  pointer-events: none;
  transition: transform var(--rp-dur) var(--rp-ease), opacity var(--rp-dur-fast) var(--rp-ease);
}

.rp-tabbar.is-expanded .rp-tabbar__panel {
  transform: none;
  opacity: 1;
  pointer-events: auto;
}

.rp-tabbar__add .rp-icon {
  transition: transform var(--rp-dur) var(--rp-ease);
}

.rp-tabbar.is-expanded .rp-tabbar__add .rp-icon {
  transform: rotate(45deg);
}

.rp-tabbar__panel-title {
  padding: var(--rp-sp-2) var(--rp-sp-3) var(--rp-sp-1);
  font-size: var(--rp-fs-rubric);
  font-weight: var(--rp-fw-strong);
  color: var(--rp-text-tertiary);
}

/* A transparent layer that closes the card on a tap outside it. */
.rp-tabbar__catcher {
  position: fixed;
  inset: 0;
  z-index: 25;
  border: 0;
  background: transparent;
}

/* Rows of the card appear one after another, 40 ms apart. */
.rp-tabbar.is-expanded .rp-tabbar__panel > * {
  animation: rp-rise-in var(--rp-dur) var(--rp-ease) both;
}

.rp-tabbar.is-expanded .rp-tabbar__panel > :nth-child(3) {
  animation-delay: calc(var(--rp-dur-fast) / 4);
}

.rp-tabbar.is-expanded .rp-tabbar__panel > :nth-child(4) {
  animation-delay: calc(var(--rp-dur-fast) / 2);
}

/* ---- Tabs with counters (Watermelon: Notification, Tabs 4) ------------------------------------ */

.rp-tabs__count {
  display: inline-grid;
  place-items: center;
  min-width: var(--rp-sp-5);
  height: var(--rp-sp-5);
  margin-left: var(--rp-sp-1-5);
  padding: 0 var(--rp-sp-1-5);
  border-radius: var(--rp-r-pill);
  background: var(--rp-stone);
  color: var(--rp-text-secondary);
  font-size: var(--rp-fs-micro);
  font-weight: var(--rp-fw-medium);
  vertical-align: middle;
}
