/* =========================================================
   БРИВЕР v4.2.3
   Светлая тема: главная, меню, сценарии чата и диалоги
========================================================= */

:root {
  --page-bg: #f4efe7;
  --page-bg-rgb: 244, 239, 231;
  --surface: #fbf8f3;
  --surface-strong: #ffffff;
  --ink: #17191d;
  --ink-rgb: 23, 25, 29;
  --muted: #686a6e;
  --muted-soft: #8a8b8e;
  --accent: #d83b26;
  --accent-hover: #bd301f;
  --accent-soft: rgba(216, 59, 38, 0.09);
  --accent-line: rgba(216, 59, 38, 0.32);
  --line: rgba(23, 25, 29, 0.13);
  --line-strong: rgba(23, 25, 29, 0.2);
  --white: #ffffff;
  --success: #2d7a55;
  --error: #b72e25;

  --shadow-small: 0 10px 30px rgba(32, 29, 24, 0.08);
  --shadow: 0 18px 52px rgba(32, 29, 24, 0.13);
  --shadow-large: 0 30px 90px rgba(17, 18, 20, 0.22);

  --radius-xs: 10px;
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 36px;
  --radius-pill: 999px;

  --page-width: 1180px;
  --content-width: 1080px;
  --chat-width: 860px;

  --topbar-height: 74px;
  --fast: 180ms ease;
  --normal: 300ms ease;
  --slow: 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  background: var(--page-bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  padding-bottom: calc(154px + env(safe-area-inset-bottom));
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(
      circle at 50% 11%,
      rgba(255, 255, 255, 0.9),
      transparent 33%
    ),
    var(--page-bg);
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.menu-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

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

svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[hidden] {
  display: none !important;
}

::selection {
  color: var(--white);
  background: var(--accent);
}

:focus-visible {
  outline: 3px solid rgba(216, 59, 38, 0.32);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: -80px;
  left: 18px;
  z-index: 300;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  color: var(--white);
  background: var(--ink);
  box-shadow: var(--shadow);
  transition: top var(--fast);
}

.skip-link:focus {
  top: 18px;
}

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

/* Верхняя панель */

.topbar {
  position: fixed;
  top: 30px;
  left: 0;
  z-index: 80;
  width: 100%;
  pointer-events: none;
}

.topbar::before {
  content: "";
  position: absolute;
  top: -30px;
  right: 0;
  left: 0;
  z-index: -1;
  height: 152px;
  background: linear-gradient(
    to bottom,
    rgba(var(--page-bg-rgb), 1) 0%,
    rgba(var(--page-bg-rgb), 0.98) 42%,
    rgba(var(--page-bg-rgb), 0.78) 64%,
    rgba(var(--page-bg-rgb), 0.36) 82%,
    rgba(var(--page-bg-rgb), 0) 100%
  );
  opacity: 0;
  transition: opacity 360ms ease;
}

.topbar.is-scrolled::before,
body.is-scrolled .topbar::before {
  opacity: 1;
}

.topbar__inner {
  width: min(calc(100% - 64px), var(--page-width));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.topbar__left,
.quick-actions {
  pointer-events: auto;
}

.topbar__left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.round-button {
  width: var(--topbar-height);
  height: var(--topbar-height);
  flex: 0 0 var(--topbar-height);
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--white);
  background: var(--ink);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  transition:
    transform var(--fast),
    box-shadow var(--fast),
    background var(--fast);
}

.round-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 56px rgba(23, 25, 29, 0.2);
}

.round-button:active {
  transform: scale(0.96);
}

.menu-toggle svg {
  width: 34px;
  height: 34px;
  stroke-width: 1.65;
}

.brand-text {
  border-radius: 6px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.045em;
  transition:
    opacity var(--fast),
    transform var(--fast);
}

.brand-text:hover {
  opacity: 0.64;
}

.brand-text:active {
  transform: scale(0.98);
}

.quick-actions {
  min-height: var(--topbar-height);
  padding: 0 13px;
  border-radius: var(--radius-pill);
  color: var(--white);
  background: var(--ink);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
}

.quick-actions__button {
  width: 64px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  color: inherit;
  background: transparent;
  display: grid;
  place-items: center;
  transition:
    opacity var(--fast),
    transform var(--fast),
    background var(--fast);
}

.quick-actions__button:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.quick-actions__button:active {
  transform: scale(0.94);
}

.quick-actions__button svg {
  width: 29px;
  height: 29px;
}

.quick-actions__divider {
  width: 1px;
  height: 32px;
  background: rgba(255, 255, 255, 0.17);
}

.svg-dot {
  fill: var(--accent);
  stroke: none;
}

/* Боковое меню */

.side-menu {
  position: fixed;
  inset: 0;
  z-index: 120;
  visibility: hidden;
  pointer-events: none;
}

.side-menu.is-open {
  visibility: visible;
  pointer-events: auto;
}

.side-menu__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  padding: 0;
  border: 0;
  background: rgba(13, 14, 17, 0.42);
  opacity: 0;
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  transition: opacity var(--normal);
}

.side-menu.is-open .side-menu__backdrop {
  opacity: 1;
}

.side-menu__panel {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  width: min(420px, 94vw);
  padding: 26px 24px 20px;
  background: var(--surface);
  box-shadow: 24px 0 80px rgba(17, 18, 20, 0.18);
  transform: translateX(-104%);
  transition: transform var(--slow);
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
}

.side-menu.is-open .side-menu__panel {
  transform: translateX(0);
}

.side-menu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.side-menu__brand {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.045em;
}

.side-menu__icon-button {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.48);
  display: grid;
  place-items: center;
  transition:
    color var(--fast),
    background var(--fast),
    border-color var(--fast),
    transform var(--fast);
}

.side-menu__icon-button:hover {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.side-menu__icon-button:active {
  transform: scale(0.94);
}

.side-menu__icon-button svg {
  width: 22px;
  height: 22px;
}

.side-menu__toolbar {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 228px) 46px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.new-chat-button {
  min-height: 48px;
  padding: 7px 14px 7px 8px;
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--white);
  background: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  box-shadow: var(--shadow-small);
  transition:
    opacity var(--fast),
    transform var(--fast);
}

.new-chat-button:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.new-chat-button:active {
  transform: scale(0.98);
}

.new-chat-button__icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.new-chat-button__icon svg {
  width: 19px;
  height: 19px;
}

.side-menu__search-button {
  justify-self: end;
}

.chat-search {
  margin-top: 12px;
  animation: revealDown 220ms ease both;
}

.chat-search__field {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-search__field:focus-within {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.chat-search__field svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: var(--muted);
}

.chat-search__field input {
  min-width: 0;
  width: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.chat-search__field input::placeholder {
  color: var(--muted-soft);
}

.side-menu__scroll {
  min-height: 0;
  margin-top: 17px;
  padding-right: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(23, 25, 29, 0.18) transparent;
  scrollbar-width: thin;
}

.side-menu__scroll::-webkit-scrollbar {
  width: 6px;
}

.side-menu__scroll::-webkit-scrollbar-thumb {
  border-radius: 10px;
  background: rgba(23, 25, 29, 0.16);
}

.menu-actions {
  display: grid;
  gap: 1px;
}

.menu-action {
  width: 100%;
  min-height: 48px;
  padding: 6px 9px;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: transparent;
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 15px;
  font-weight: 650;
  text-align: left;
  transition:
    padding-left var(--fast),
    color var(--fast),
    background var(--fast);
}

.menu-action:hover {
  padding-left: 13px;
  color: var(--accent);
  background: var(--accent-soft);
}

.menu-action__icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
  display: grid;
  place-items: center;
}

.menu-action__icon svg {
  width: 18px;
  height: 18px;
}

.menu-section {
  margin-top: 23px;
}

.menu-section__heading {
  padding: 0 4px 9px;
  border-bottom: 1px solid var(--line);
}

.menu-section__title {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.chat-list {
  padding-top: 7px;
}

.chat-list__empty {
  margin: 0;
  padding: 9px 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.chat-list__item {
  width: 100%;
  padding: 10px 9px;
  border: 0;
  border-radius: 11px;
  color: var(--ink);
  background: transparent;
  overflow: hidden;
  font-size: 14px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-list__item:hover,
.chat-list__item.is-active {
  background: var(--accent-soft);
}

.account-card {
  width: 100%;
  margin-top: 16px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.46);
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 11px;
  text-align: left;
  transition:
    border-color var(--fast),
    background var(--fast),
    transform var(--fast);
}

.account-card:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.account-card__avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--white);
  background: var(--ink);
  display: grid;
  place-items: center;
}

.account-card__avatar svg {
  width: 23px;
  height: 23px;
}

.account-card__content {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.account-card__content strong {
  font-size: 14px;
}

.account-card__content small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-card__arrow {
  width: 20px;
  height: 20px;
  color: var(--muted);
}

/* Главная */

main {
  padding-top: 104px;
}

.home-screen,
.chat-screen {
  animation: screenAppear 420ms ease both;
}

.hero {
  min-height: 710px;
  padding: 72px 24px 42px;
  display: grid;
  place-items: center;
  text-align: center;
}

.hero__content {
  width: 100%;
  max-width: 950px;
}

.hero__brand {
  margin: 0;
  font-size: clamp(78px, 11vw, 138px);
  line-height: 0.9;
  font-weight: 800;
  letter-spacing: -0.075em;
}

.hero__accent-line {
  display: block;
  width: 96px;
  height: 4px;
  margin: 43px auto 39px;
  border-radius: 10px;
  background: var(--accent);
}

.hero__eyebrow {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.4em;
}

.hero__headline {
  margin: 68px 0 0;
  font-size: clamp(33px, 4vw, 54px);
  line-height: 1.34;
  letter-spacing: -0.038em;
}

.status {
  width: fit-content;
  max-width: 100%;
  margin: 46px auto 0;
  padding: 10px 22px 10px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.34);
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 15px;
}

.status__icon {
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.status__icon span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  animation: statusPulse 2.4s infinite;
}

.hero__description {
  max-width: 720px;
  margin: 30px auto 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.services {
  width: min(calc(100% - 70px), var(--content-width));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.service {
  position: relative;
  min-width: 0;
  min-height: 250px;
  padding: 28px 28px 24px;
  border: 0;
  border-left: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  transition:
    color var(--normal),
    background var(--normal),
    transform var(--normal);
}

.service:first-of-type {
  border-left: 0;
}

.service::before {
  content: "";
  position: absolute;
  inset: 0 8px;
  z-index: -1;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 14px 42px rgba(32, 29, 24, 0);
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity var(--normal),
    transform var(--normal),
    box-shadow var(--normal);
}

.service:hover {
  color: var(--ink);
  transform: translateY(-5px);
}

.service:hover::before,
.service:focus-visible::before {
  opacity: 1;
  transform: translateY(0);
  box-shadow: var(--shadow-small);
}

.service__number {
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

.service__content {
  margin-top: 31px;
  display: grid;
  gap: 12px;
}

.service__title {
  font-size: 24px;
  letter-spacing: -0.03em;
}

.service__description {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.service__action {
  margin-top: auto;
  padding-top: 25px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  transition:
    color var(--fast),
    transform var(--fast);
}

.service:hover .service__action {
  color: var(--accent);
  transform: translateX(4px);
}

/* Чат и сценарий постановки задачи */

.chat-screen {
  min-height: calc(100vh - 104px);
  padding: 92px 24px 112px;
}

.chat-workspace,
.chat-step,
.conversation,
.messages {
  scroll-margin-top: 150px;
}

.chat-workspace {
  width: min(100%, var(--chat-width));
  margin: 0 auto;
}

.chat-workspace__header {
  margin-bottom: 32px;
  text-align: center;
}

.chat-workspace__eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.chat-workspace__header h1 {
  margin: 12px 0 14px;
  font-size: clamp(38px, 6vw, 64px);
  line-height: 1.08;
  letter-spacing: -0.052em;
}

.chat-workspace__header p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.messages {
  display: grid;
  gap: 18px;
}

.messages--intro {
  margin-bottom: 22px;
}

.message-row {
  width: 100%;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  animation: messageAppear 320ms ease both;
}

.message-row--assistant {
  justify-content: flex-start;
}

.message-row--user {
  justify-content: flex-end;
}

.message-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(23, 25, 29, 0.1);
}

.message-avatar--briver {
  position: relative;
  color: var(--white);
  background:
    radial-gradient(
      circle at 66% 30%,
      rgba(255, 255, 255, 0.16),
      transparent 28%
    ),
    var(--ink);
  font-size: 16px;
  font-weight: 800;
}

.message-avatar--briver::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--accent);
}

.message-avatar--user {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--line);
}

.message-avatar--user svg {
  width: 23px;
  height: 23px;
}

.message-body {
  max-width: min(76%, 640px);
  display: grid;
  gap: 6px;
}

.message-row--user .message-body {
  justify-items: end;
}

.message-author {
  padding: 0 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.message {
  padding: 14px 17px;
  border: 1px solid rgba(23, 25, 29, 0.08);
  border-radius: 20px 20px 20px 6px;
  background: rgba(255, 255, 255, 0.56);
  box-shadow: 0 10px 28px rgba(32, 29, 24, 0.06);
  line-height: 1.55;
}

.message--assistant {
  color: var(--ink);
}

.message--user {
  border-color: var(--ink);
  border-radius: 20px 20px 6px 20px;
  color: var(--white);
  background: var(--ink);
}

.chat-step {
  padding: 27px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.32);
  box-shadow: 0 16px 48px rgba(32, 29, 24, 0.07);
  animation: stepAppear 320ms ease both;
}

.chat-step__heading {
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.chat-step__heading > div {
  min-width: 0;
}

.chat-step__heading span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.chat-step__heading h2 {
  margin: 4px 0 0;
  font-size: 23px;
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.chat-step__back {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: transparent;
  display: grid;
  place-items: center;
  transition:
    color var(--fast),
    background var(--fast),
    border-color var(--fast),
    transform var(--fast);
}

.chat-step__back:hover {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.chat-step__back:active {
  transform: scale(0.94);
}

.chat-step__back svg {
  width: 22px;
  height: 22px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.choice-grid--primary {
  align-items: stretch;
}

.choice-card {
  min-width: 0;
  min-height: 134px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.46);
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 13px;
  align-content: center;
  text-align: left;
  transition:
    transform var(--fast),
    border-color var(--fast),
    background var(--fast),
    box-shadow var(--fast);
}

.choice-card:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  box-shadow: var(--shadow-small);
  transform: translateY(-3px);
}

.choice-card.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.choice-card__icon {
  width: 44px;
  height: 44px;
  grid-row: 1 / 3;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
  display: grid;
  place-items: center;
}

.choice-card__icon svg {
  width: 24px;
  height: 24px;
}

.choice-card strong {
  align-self: end;
  font-size: 18px;
}

.choice-card small {
  align-self: start;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.location-button {
  width: 100%;
  min-height: 76px;
  padding: 13px 16px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-md);
  color: var(--ink);
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  transition:
    transform var(--fast),
    border-color var(--fast),
    background var(--fast);
}

.location-button:hover {
  border-color: var(--accent);
  background: rgba(216, 59, 38, 0.13);
  transform: translateY(-2px);
}

.location-button.is-loading svg {
  animation: locationSpin 1.2s linear infinite;
}

.location-button > svg {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  color: var(--accent);
}

.location-button > span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.location-button strong {
  font-size: 15px;
}

.location-button small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.choice-label {
  margin: 24px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.choice-chip {
  min-height: 43px;
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.45);
  font-size: 13px;
  font-weight: 650;
  transition:
    color var(--fast),
    border-color var(--fast),
    background var(--fast),
    transform var(--fast);
}

.choice-chip:hover {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.choice-chip.is-selected {
  color: var(--white);
  border-color: var(--accent);
  background: var(--accent);
}

.secondary-button {
  min-height: 46px;
  padding: 11px 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--ink);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 700;
  transition:
    color var(--fast),
    border-color var(--fast),
    background var(--fast);
}

.secondary-button:hover {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.secondary-button svg {
  width: 19px;
  height: 19px;
}

.other-city-button {
  margin-top: 15px;
}

.location-status {
  min-height: 20px;
  margin: 13px 2px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.location-status.is-error {
  color: var(--error);
}

.conversation {
  animation: screenAppear 380ms ease both;
}

/* Нижняя панель и SEO-текст */

.footer {
  width: min(calc(100% - 64px), var(--page-width));
  margin: 58px auto 0;
}

.footer__controls {
  position: fixed;
  right: 0;
  bottom: calc(22px + env(safe-area-inset-bottom));
  left: 0;
  z-index: 70;
  width: min(calc(100% - 64px), var(--page-width));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 88px 1fr;
  align-items: center;
  gap: 24px;
  pointer-events: none;
}

.back-to-top,
.chat {
  pointer-events: auto;
}

.back-to-top {
  width: 72px;
  height: 62px;
  padding: 0;
  border: 1px solid rgba(23, 25, 29, 0.08);
  border-radius: var(--radius-pill);
  color: rgba(23, 25, 29, 0.56);
  background: rgba(255, 255, 255, 0.43);
  box-shadow: 0 12px 34px rgba(32, 29, 24, 0.08);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(14px) scale(0.94);
  transition:
    opacity 380ms ease,
    visibility 380ms ease,
    transform 380ms ease,
    color var(--fast),
    background var(--fast),
    box-shadow var(--fast);
}

.back-to-top.is-visible {
  opacity: 0.78;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.back-to-top:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-small);
  opacity: 1;
}

.back-to-top:active {
  transform: scale(0.96);
}

.back-to-top svg {
  width: 28px;
  height: 28px;
}

.chat {
  width: min(100%, 590px);
  min-height: 70px;
  padding: 8px 9px;
  border-radius: var(--radius-pill);
  color: var(--white);
  background: var(--ink);
  box-shadow: var(--shadow);
  justify-self: end;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 48px 52px;
  align-items: center;
}

.chat__attach,
.chat__voice,
.chat__send {
  border-radius: 50%;
  color: inherit;
  display: grid;
  place-items: center;
  transition:
    color var(--fast),
    background var(--fast),
    transform var(--fast);
}

.chat__attach {
  width: 50px;
  height: 50px;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.chat__voice,
.chat__send {
  padding: 0;
  border: 0;
  background: transparent;
}

.chat__voice {
  width: 44px;
  height: 44px;
}

.chat__send {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.06);
}

.chat__attach:hover,
.chat__voice:hover,
.chat__send:hover {
  background: rgba(255, 255, 255, 0.12);
}

.chat__attach:active,
.chat__voice:active,
.chat__send:active {
  transform: scale(0.92);
}

.chat__attach svg,
.chat__send svg {
  width: 27px;
  height: 27px;
}

.chat__voice svg {
  width: 28px;
  height: 28px;
}

.chat__voice.is-listening {
  color: #ff6954;
  animation: voicePulse 1.2s ease infinite;
}

.chat__input {
  min-width: 0;
  width: 100%;
  min-height: 24px;
  max-height: 148px;
  padding: 2px 11px;
  border: 0;
  outline: 0;
  color: var(--white);
  background: transparent;
  font: inherit;
  font-size: 16px;
  line-height: 1.45;
  resize: none;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.3) transparent;
}

.chat__input.is-scrollable {
  overflow-y: auto;
}

.chat__input::-webkit-scrollbar { width: 4px; }
.chat__input::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255,255,255,.3);
}

.chat__input::placeholder {
  color: rgba(255, 255, 255, 0.52);
}

.footer__content {
  padding: 38px 0 calc(28px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}

.footer__seo {
  max-width: 600px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.footer__meta {
  margin-top: 22px;
  color: var(--muted-soft);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer__meta a {
  transition: color var(--fast);
}

.footer__meta a:hover {
  color: var(--accent);
}

/* Диалоги */

.dialog {
  width: min(540px, calc(100% - 32px));
  max-height: min(760px, calc(100dvh - 32px));
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  overflow: visible;
  color: var(--ink);
  background: transparent;
}

.dialog[open] {
  animation: dialogAppear 260ms ease both;
}

.dialog::backdrop {
  background: rgba(13, 14, 17, 0.45);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  animation: backdropAppear 220ms ease both;
}

.dialog__card {
  position: relative;
  max-height: min(760px, calc(100dvh - 32px));
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-lg);
  overflow-y: auto;
  background: var(--surface);
  box-shadow: var(--shadow-large);
}

.dialog__close {
  position: absolute;
  top: 17px;
  right: 17px;
  width: 40px;
  height: 40px;
  padding: 0 0 2px;
  border: 0;
  border-radius: 50%;
  color: var(--white);
  background: var(--ink);
  display: grid;
  place-items: center;
  font-size: 25px;
  line-height: 1;
  transition:
    opacity var(--fast),
    transform var(--fast);
}

.dialog__close:hover {
  opacity: 0.76;
}

.dialog__close:active {
  transform: scale(0.94);
}

.dialog__label {
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.dialog h2 {
  max-width: calc(100% - 42px);
  margin: 13px 0 15px;
  font-size: 33px;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.dialog p {
  color: var(--muted);
  line-height: 1.6;
}

.dialog__input {
  width: 100%;
  min-height: 52px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: 0;
  color: var(--ink);
  background: var(--surface-strong);
  transition:
    border-color var(--fast),
    box-shadow var(--fast);
}

.dialog__input:focus {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.dialog__input::placeholder {
  color: var(--muted-soft);
}

.dialog__button {
  width: 100%;
  min-height: 51px;
  margin-top: 18px;
  padding: 13px 18px;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--white);
  background: var(--ink);
  font-weight: 700;
  transition:
    opacity var(--fast),
    transform var(--fast);
}

.dialog__button:hover {
  opacity: 0.84;
}

.dialog__button:active {
  transform: scale(0.99);
}

.site-search {
  margin-top: 22px;
}

.site-search__field {
  position: relative;
  display: block;
}

.site-search__field > svg {
  position: absolute;
  top: 50%;
  left: 16px;
  z-index: 2;
  width: 21px;
  height: 21px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.site-search__field .dialog__input {
  padding-left: 48px;
}

.site-search__results,
.city-search-results {
  min-height: 84px;
  max-height: 320px;
  margin-top: 16px;
  overflow-y: auto;
}

.site-search__results > p,
.city-search-results > p {
  margin: 0;
  padding: 14px 3px;
  color: var(--muted);
  font-size: 13px;
}

.search-result,
.city-result {
  width: 100%;
  padding: 13px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  display: grid;
  gap: 4px;
  text-align: left;
  transition:
    color var(--fast),
    background var(--fast);
}

.search-result:hover,
.city-result:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.search-result strong,
.city-result strong {
  font-size: 14px;
}

.search-result small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.auth-form__field {
  margin-top: 22px;
  display: grid;
  gap: 8px;
}

.auth-form__field > span {
  font-size: 13px;
  font-weight: 700;
}

.auth-form__hint {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

.auth-form__error {
  min-height: 19px;
  margin: 5px 0 0 !important;
  color: var(--error) !important;
  font-size: 12px;
}

.auth-form__field.is-valid .dialog__input {
  border-color: rgba(45, 122, 85, 0.5);
  box-shadow: 0 0 0 4px rgba(45, 122, 85, 0.08);
}

.auth-form__field.is-invalid .dialog__input {
  border-color: rgba(183, 46, 37, 0.55);
  box-shadow: 0 0 0 4px rgba(183, 46, 37, 0.08);
}

.auth-form__legal {
  margin: 14px 0 0 !important;
  color: var(--muted-soft) !important;
  font-size: 10px;
  line-height: 1.5 !important;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(112px + env(safe-area-inset-bottom));
  z-index: 180;
  max-width: calc(100% - 28px);
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  color: var(--white);
  background: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 22px);
  transition:
    opacity var(--normal),
    visibility var(--normal),
    transform var(--normal);
  text-align: center;
}

.toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* Состояния и анимации */

@keyframes screenAppear {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes stepAppear {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes messageAppear {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes revealDown {
  from {
    opacity: 0;
    transform: translateY(-7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes statusPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(216, 59, 38, 0.3);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(216, 59, 38, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(216, 59, 38, 0);
  }
}

@keyframes voicePulse {
  50% {
    transform: scale(1.08);
  }
}

@keyframes locationSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes dialogAppear {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes backdropAppear {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Планшеты */

@media (max-width: 980px) {
  .hero {
    min-height: 660px;
  }

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

  .service {
    border-bottom: 1px solid var(--line);
  }

  .service:nth-of-type(3) {
    border-left: 0;
  }

  .service:nth-last-of-type(-n + 2) {
    border-bottom: 0;
  }
}

/* Телефоны и небольшие планшеты */

@media (max-width: 800px) {
  :root {
    --topbar-height: 56px;
  }

  body {
    padding-bottom: calc(124px + env(safe-area-inset-bottom));
  }

  .topbar {
    top: 16px;
  }

  .topbar::before {
    top: -16px;
    height: 126px;
  }

  .topbar__inner {
    width: calc(100% - 28px);
  }

  .topbar__left {
    gap: 9px;
  }

  .round-button {
    width: var(--topbar-height);
    height: var(--topbar-height);
  }

  .menu-toggle svg {
    width: 27px;
    height: 27px;
  }

  .brand-text {
    font-size: 20px;
  }

  .quick-actions {
    min-height: var(--topbar-height);
    padding: 0 7px;
  }

  .quick-actions__button {
    width: 45px;
    height: 46px;
  }

  .quick-actions__button svg {
    width: 23px;
    height: 23px;
  }

  .quick-actions__divider {
    height: 25px;
  }

  .side-menu__panel {
    width: min(390px, 100vw);
    height: 100vh;
    height: 100dvh;
    padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
    display: block;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .side-menu__toolbar {
    grid-template-columns: minmax(0, 205px) 46px;
  }

  .side-menu__scroll {
    min-height: auto;
    padding-right: 0;
    overflow: visible;
  }

  .account-card {
    margin-top: 24px;
    margin-bottom: calc(8px + env(safe-area-inset-bottom));
  }

  main {
    padding-top: 72px;
  }

  .hero {
    min-height: auto;
    padding: 112px 18px 62px;
  }

  .hero__brand {
    font-size: clamp(58px, 18vw, 92px);
  }

  .hero__accent-line {
    width: 66px;
    height: 3px;
    margin: 28px auto 30px;
  }

  .hero__eyebrow {
    font-size: 10px;
    letter-spacing: 0.33em;
  }

  .hero__headline {
    margin-top: 43px;
    font-size: clamp(26px, 7.3vw, 38px);
    line-height: 1.42;
  }

  .hero__headline br {
    display: none;
  }

  .status {
    margin-top: 34px;
    padding: 8px 16px 8px 8px;
    gap: 9px;
    font-size: 13px;
  }

  .status__icon {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }

  .hero__description {
    margin-top: 28px;
    font-size: 14px;
  }

  .services {
    width: calc(100% - 34px);
    grid-template-columns: 1fr;
  }

  .service {
    min-height: 0;
    padding: 25px 10px 26px;
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }

  .service:first-of-type {
    border-top: 1px solid var(--line);
  }

  .service:nth-of-type(3) {
    border-bottom: 1px solid var(--line);
  }

  .service:last-of-type {
    border-bottom: 0;
  }

  .service::before {
    inset: 7px 0;
  }

  .service__content {
    margin-top: 17px;
    gap: 8px;
  }

  .service__title {
    font-size: 22px;
  }

  .service__description {
    font-size: 14px;
  }

  .service__action {
    padding-top: 17px;
  }

  .chat-screen {
    min-height: calc(100vh - 72px);
    padding: 86px 17px 96px;
  }

  .chat-workspace,
  .chat-step,
  .conversation,
  .messages {
    scroll-margin-top: 100px;
  }

  .chat-workspace__header {
    margin-bottom: 26px;
  }

  .chat-workspace__header h1 {
    font-size: clamp(34px, 10vw, 48px);
  }

  .chat-workspace__header p {
    font-size: 14px;
  }

  .chat-step {
    padding: 20px;
  }

  .chat-step__heading h2 {
    font-size: 21px;
  }

  .choice-grid {
    grid-template-columns: 1fr;
  }

  .choice-card {
    min-height: 112px;
    padding: 15px;
  }

  .message-avatar {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .message-body {
    max-width: calc(100% - 54px);
  }

  .message {
    padding: 12px 14px;
    font-size: 14px;
  }

  .footer {
    width: calc(100% - 34px);
    margin-top: 42px;
  }

  .footer__controls {
    bottom: calc(12px + env(safe-area-inset-bottom));
    width: calc(100% - 28px);
    grid-template-columns: 60px 1fr;
    gap: 10px;
  }

  .back-to-top {
    width: 58px;
    height: 54px;
  }

  .back-to-top svg {
    width: 25px;
    height: 25px;
  }

  .chat {
    min-height: 58px;
    padding: 5px 6px;
    grid-template-columns: 42px minmax(0, 1fr) 40px 44px;
  }

  .chat__attach {
    width: 42px;
    height: 42px;
  }

  .chat__voice {
    width: 38px;
    height: 38px;
  }

  .chat__send {
    width: 42px;
    height: 42px;
  }

  .chat__attach svg,
  .chat__voice svg,
  .chat__send svg {
    width: 22px;
    height: 22px;
  }

  .chat__input {
    padding: 0 8px;
    font-size: 13px;
  }

  .footer__content {
    padding-top: 29px;
  }

  .dialog__card {
    padding: 28px 22px;
  }

  .dialog h2 {
    font-size: 28px;
  }

  .toast {
    bottom: calc(88px + env(safe-area-inset-bottom));
    font-size: 13px;
  }
}

@media (max-width: 430px) {
  .brand-text {
    font-size: 18px;
  }

  .side-menu__toolbar {
    grid-template-columns: minmax(0, 190px) 46px;
  }

  .location-button {
    align-items: flex-start;
  }

  .city-list {
    gap: 7px;
  }

  .choice-chip {
    min-height: 40px;
    padding: 9px 13px;
    font-size: 12px;
  }

  .message-row {
    gap: 9px;
  }

  .footer__seo {
    font-size: 12px;
  }
}

@media (max-width: 360px) {
  .brand-text {
    display: none;
  }

  .quick-actions {
    transform: scale(0.92);
    transform-origin: top right;
  }

  .hero__brand {
    font-size: 58px;
  }

  .side-menu__toolbar {
    grid-template-columns: minmax(0, 176px) 44px;
  }

  .new-chat-button {
    min-height: 44px;
  }

  .footer__controls {
    width: calc(100% - 20px);
    grid-template-columns: 54px 1fr;
    gap: 7px;
  }

  .back-to-top {
    width: 52px;
    height: 50px;
  }

  .chat {
    grid-template-columns: 38px minmax(0, 1fr) 36px 40px;
  }

  .chat__attach,
  .chat__send {
    width: 38px;
    height: 38px;
  }

  .chat__input {
    font-size: 12px;
  }

  .dialog {
    width: calc(100% - 20px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =========================================================
   Авторизация BRiVER v4.2.3
   Изолированные стили: не влияют на остальные диалоги
========================================================= */

body.auth-modal-open {
  overflow: hidden;
}

.auth-modal {
  width: min(720px, calc(100% - 48px));
  max-height: calc(100dvh - 32px);
  border-radius: 22px;
  overflow: visible;
}

.auth-modal[open] {
  animation: authModalAppear 240ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-modal::backdrop {
  background: rgba(29, 28, 27, 0.46);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: authBackdropAppear 220ms ease both;
}

.auth-modal__panel {
  position: relative;
  max-height: calc(100dvh - 32px);
  padding: 58px 56px 52px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 22px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: #17191d;
  background: #fcfbf9;
  box-shadow:
    0 30px 90px rgba(17, 18, 20, 0.22),
    0 2px 8px rgba(17, 18, 20, 0.05);
  scrollbar-width: thin;
  scrollbar-color: rgba(23, 25, 29, 0.18) transparent;
}

.auth-modal__step {
  min-width: 0;
}

.auth-modal__close {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 2;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #a8adb5;
  background: transparent;
  opacity: 0.82;
  display: grid;
  place-items: center;
  transition:
    color 180ms ease,
    opacity 180ms ease,
    transform 180ms ease;
}

.auth-modal__close svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.6;
}

.auth-modal__close:hover {
  color: #60656d;
  opacity: 1;
}

.auth-modal__close:active {
  transform: scale(0.94);
}

.auth-modal__close:focus-visible {
  outline: 3px solid rgba(38, 41, 47, 0.13);
  outline-offset: -4px;
}

.auth-modal .auth-modal__title {
  max-width: calc(100% - 36px);
  margin: 0;
  color: #17191d;
  font-size: 46px;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.auth-modal .auth-modal__description {
  max-width: 570px;
  margin: 29px 0 0;
  color: #686d76;
  font-size: 21px;
  font-weight: 400;
  line-height: 1.55;
}

.auth-phone-field {
  height: 84px;
  margin-top: 39px;
  padding: 15px 22px 13px;
  border: 1px solid #dededb;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.32);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease;
}

.auth-phone-field:focus-within {
  border-color: #35383e;
  background: rgba(255, 255, 255, 0.52);
  box-shadow: 0 0 0 3px rgba(38, 41, 47, 0.08);
}

.auth-phone-field.has-error {
  border-color: #c83b32;
  box-shadow: 0 0 0 3px rgba(200, 59, 50, 0.08);
}

.auth-phone-field__label {
  display: block;
  color: #303339;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
}

.auth-phone-field__control {
  min-width: 0;
  margin-top: 8px;
  display: grid;
  grid-template-columns: auto 1px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
}

.auth-phone-field__prefix {
  color: #17191d;
  font-size: 25px;
  font-weight: 500;
  line-height: 1;
}

.auth-phone-field__divider {
  width: 1px;
  height: 23px;
  background: #d6d6d2;
}

.auth-phone-field__input {
  min-width: 0;
  width: 100%;
  height: 29px;
  padding: 0;
  border: 0;
  outline: 0;
  color: #17191d;
  background: transparent;
  caret-color: #17191d;
  font-size: 25px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.015em;
}

.auth-phone-field__input::placeholder {
  color: #a3a7af;
  opacity: 1;
}

.auth-modal .auth-phone-field__input:-webkit-autofill,
.auth-modal .auth-phone-field__input:-webkit-autofill:hover,
.auth-modal .auth-phone-field__input:-webkit-autofill:focus,
.auth-modal .auth-phone-field__input:-webkit-autofill:active {
  -webkit-text-fill-color: #17191d !important;
  caret-color: #17191d;
  -webkit-box-shadow: 0 0 0 1000px #fdfcfa inset !important;
  box-shadow: 0 0 0 1000px #fdfcfa inset !important;
  transition: background-color 9999s ease-out 0s;
}

.auth-modal .auth-phone-field__input:autofill {
  color: #17191d;
  background-color: #fdfcfa;
  box-shadow: 0 0 0 1000px #fdfcfa inset;
}

.auth-form__message {
  min-height: 21px;
  margin: 6px 0 0 !important;
  color: #c83b32 !important;
  font-size: 13px;
  line-height: 1.55 !important;
}

.auth-form__submit {
  width: 100%;
  min-height: 64px;
  margin-top: 19px;
  padding: 15px 22px;
  border: 0;
  border-radius: 14px;
  color: #ffffff;
  background: linear-gradient(180deg, #32363c 0%, #26292f 100%);
  box-shadow:
    0 10px 24px rgba(26, 28, 33, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 600;
  line-height: 1;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease;
}

.auth-form__submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    0 13px 28px rgba(26, 28, 33, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.auth-form__submit:active:not(:disabled) {
  transform: translateY(0);
}

.auth-form__submit:disabled {
  cursor: wait;
  opacity: 0.72;
}

.auth-form__submit:focus-visible {
  outline: 3px solid rgba(38, 41, 47, 0.2);
  outline-offset: 3px;
}

.auth-form__spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.34);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: authSpinner 700ms linear infinite;
}

.auth-form__spinner[hidden] {
  display: none;
}

.auth-consents {
  margin-top: 33px;
  display: grid;
  gap: 17px;
}

.auth-consent {
  position: relative;
}

.auth-consent__native {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.auth-consent__label {
  margin-left: -10px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: start;
  gap: 4px;
  cursor: pointer;
}

.auth-consent__hit-area {
  width: 44px;
  height: 44px;
  padding-top: 1px;
  display: grid;
  place-items: start center;
}

.auth-consent__control {
  width: 24px;
  height: 24px;
  border: 2px solid #292c31;
  border-radius: 50%;
  color: transparent;
  background: transparent;
  display: grid;
  place-items: center;
  transition:
    color 150ms ease,
    background-color 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

.auth-consent__control svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.5;
}

.auth-consent__native:checked + .auth-consent__label .auth-consent__control {
  border-color: #26292f;
  color: #ffffff;
  background: #26292f;
  transform: scale(0.96);
}

.auth-consent__native:focus-visible + .auth-consent__label .auth-consent__control {
  box-shadow: 0 0 0 4px rgba(38, 41, 47, 0.12);
}

.auth-consent.has-error .auth-consent__control {
  border-color: #c83b32;
  box-shadow: 0 0 0 4px rgba(200, 59, 50, 0.08);
}

.auth-consent__text {
  color: #686d76;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
}

.auth-consent__text a {
  color: #24272c;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 150ms ease;
}

.auth-consent__text a:hover {
  color: #000000;
  text-decoration-thickness: 1.5px;
}

.auth-consent__text a:focus-visible {
  border-radius: 2px;
  outline: 3px solid rgba(38, 41, 47, 0.13);
  outline-offset: 2px;
}

.auth-security {
  margin-top: 27px;
}

.auth-modal .auth-security__text {
  margin: 0;
  color: #6c7179;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
  text-align: center;
}

.auth-code .auth-modal__description strong {
  display: inline-block;
  color: #303339;
  font-weight: 600;
  white-space: nowrap;
}

.auth-code__form {
  margin-top: 39px;
}

.auth-code__label {
  display: block;
  margin-bottom: 9px;
  color: #303339;
  font-size: 15px;
  font-weight: 500;
}

.auth-code__input {
  width: 100%;
  min-height: 84px;
  padding: 16px 22px;
  border: 1px solid #dededb;
  border-radius: 16px;
  outline: 0;
  color: #17191d;
  background: rgba(255, 255, 255, 0.32);
  font-size: clamp(26px, 6vw, 38px);
  font-weight: 650;
  letter-spacing: 0.42em;
  text-align: center;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease;
}

.auth-code__input:focus {
  border-color: #35383e;
  background: rgba(255, 255, 255, 0.52);
  box-shadow: 0 0 0 3px rgba(38, 41, 47, 0.08);
}

.auth-code__input.has-error {
  border-color: #c83b32;
  box-shadow: 0 0 0 3px rgba(200, 59, 50, 0.08);
}

.auth-code__actions {
  margin-top: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.auth-code__link {
  min-height: 44px;
  padding: 7px 0;
  border: 0;
  color: #303339;
  background: transparent;
  font-size: 14px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.auth-code__link:hover:not(:disabled) {
  color: #000000;
  text-decoration-thickness: 1.5px;
}

.auth-code__link:disabled {
  color: #8d9198;
  cursor: default;
  text-decoration: none;
}

@keyframes authModalAppear {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes authBackdropAppear {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes authSpinner {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 767px) {
  .auth-modal {
    width: calc(100% - 32px);
  }

  .auth-modal__panel {
    padding: 44px 36px 40px;
  }

  .auth-modal .auth-modal__title {
    font-size: 38px;
  }
}

@media (max-width: 479px) {
  .auth-modal {
    width: calc(100% - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 20px;
  }

  .auth-modal__panel {
    max-height: calc(100dvh - 24px);
    padding:
      34px
      22px
      calc(28px + env(safe-area-inset-bottom));
    border-radius: 20px;
  }

  .auth-modal__close {
    top: 6px;
    right: 7px;
  }

  .auth-modal .auth-modal__title {
    font-size: clamp(32px, 9vw, 40px);
    line-height: 1.08;
  }

  .auth-modal .auth-modal__description {
    margin-top: 20px;
    font-size: 18px;
    line-height: 1.5;
  }

  .auth-phone-field {
    min-height: 78px;
    height: auto;
    margin-top: 30px;
    padding: 14px 17px 12px;
  }

  .auth-phone-field__control {
    gap: 10px;
  }

  .auth-phone-field__prefix,
  .auth-phone-field__input {
    font-size: 22px;
  }

  .auth-form__submit {
    min-height: 60px;
    font-size: 17px;
  }

  .auth-consents {
    margin-top: 27px;
    gap: 15px;
  }

  .auth-consent__text {
    font-size: 13px;
    line-height: 1.55;
  }

  .auth-security {
    margin-top: 22px;
  }

  .auth-modal .auth-security__text {
    font-size: 13px;
  }

  .auth-code__form {
    margin-top: 30px;
  }

  .auth-code__input {
    min-height: 76px;
    padding-right: 14px;
    padding-left: 14px;
    letter-spacing: 0.32em;
  }

  .auth-code__actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }
}

@media (max-width: 359px) {
  .auth-modal__panel {
    padding-right: 18px;
    padding-left: 18px;
  }

  .auth-phone-field__prefix,
  .auth-phone-field__input {
    font-size: 20px;
  }

  .auth-consent__label {
    margin-left: -8px;
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .auth-consent__hit-area {
    width: 40px;
  }
}

@media (max-height: 720px) {
  .auth-modal__panel {
    padding-top: 38px;
    padding-bottom: 34px;
  }

  .auth-modal .auth-modal__description {
    margin-top: 20px;
  }

  .auth-phone-field,
  .auth-code__form {
    margin-top: 28px;
  }

  .auth-consents {
    margin-top: 25px;
    gap: 14px;
  }

  .auth-security {
    margin-top: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-modal[open],
  .auth-modal::backdrop,
  .auth-form__spinner {
    animation-duration: 0.01ms !important;
  }
}


/* =========================================================
   BRiVER v4.2.6.2 — живой текст голосового ввода
========================================================= */
.voice-recording {
  min-width: 0;
  width: 100%;
  min-height: 44px;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 42px 68px minmax(0, 1fr) 46px;
  align-items: center;
  gap: 9px;
}

.voice-recording[hidden] { display: none !important; }

.chat.is-voice-recording {
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  gap: 6px;
  padding: 10px;
  border-radius: 28px;
}

.chat.is-voice-recording > .chat__attach,
.chat.is-voice-recording > .chat__voice,
.chat.is-voice-recording > .chat__send {
  display: none !important;
}

.chat.is-voice-recording > .chat__input {
  display: block;
  width: 100%;
  grid-column: 1 / -1;
  min-height: 28px;
  max-height: 148px;
  padding: 5px 8px 3px;
}

.voice-recording__cancel,
.voice-recording__stop {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--white);
  display: grid;
  place-items: center;
  transition: transform var(--fast), background var(--fast), opacity var(--fast);
}

.voice-recording__cancel {
  color: rgba(255,255,255,.74);
  background: rgba(255,255,255,.08);
}

.voice-recording__cancel:hover { background: rgba(255,255,255,.15); }
.voice-recording__cancel svg { width: 22px; height: 22px; }

.voice-recording__stop {
  background: var(--accent, #d83b26);
  box-shadow: 0 0 0 5px rgba(216,59,38,.13);
}

.voice-recording__stop:hover { opacity: .9; }
.voice-recording__cancel:active,
.voice-recording__stop:active { transform: scale(.92); }

.voice-recording__stop-mark {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  background: currentColor;
}

.voice-recording__time {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.voice-recording__time::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #ef4f39;
  animation: briverVoicePulse 1.2s ease-in-out infinite;
}

.voice-recording__time.is-warning { color: #ff8e7f; }

.voice-recording__label {
  min-width: 0;
  overflow: hidden;
  color: rgba(255,255,255,.52);
  font-size: 12px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes briverVoicePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(239,79,57,.34); }
  50% { opacity: .62; box-shadow: 0 0 0 7px rgba(239,79,57,0); }
}

@media (max-width: 800px) {
  .chat.is-voice-recording {
    gap: 4px;
    padding: 8px;
    border-radius: 24px;
  }

  .voice-recording {
    grid-template-columns: 40px 60px minmax(0, 1fr) 42px;
    gap: 6px;
  }

  .voice-recording__cancel,
  .voice-recording__stop { width: 40px; height: 40px; }
  .voice-recording__time { gap: 6px; font-size: 13px; }
  .voice-recording__label { font-size: 11px; }
}

@media (max-width: 390px) {
  .voice-recording {
    grid-template-columns: 38px 56px minmax(0, 1fr) 40px;
    gap: 4px;
  }
  .voice-recording__label { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .voice-recording__time::before { animation: none; }
}

