:root {
  color-scheme: light;
  --primary: #d32f2f;
  --primary-dark: #b71c1c;
  --surface: #ffffff;
  --surface-card: #f2f2f2;
  --page-bg: #ffffff;
  --text: #212121;
  --muted: #616161;
  --border: #e0e0e0;
  --shadow: 0 18px 48px rgba(33, 33, 33, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
  color: var(--text);
  background: var(--page-bg);
  display: flex;
  flex-direction: column;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

body.layout-chat {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

body.layout-chat .footer {
  flex-shrink: 0;
}

body.layout-chat .footer--chat {
  padding: 10px 16px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  font-size: 0.82rem;
}

.page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.equipment-root {
  width: min(100%, 1200px);
}

body.page-mode-detail .equipment-root {
  width: 100%;
  display: flex;
  justify-content: center;
}

.catalog-header {
  margin: 0 auto 28px;
  max-width: 760px;
  text-align: center;
}

.site-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 4px 12px 0;
}

.site-hero__title {
  margin: 0;
  font-size: clamp(1.35rem, 3.6vw, 2rem);
  line-height: 1.25;
  font-weight: 700;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  line-height: 0;
}

.site-logo__img {
  display: block;
  width: min(100%, 260px);
  height: auto;
  max-height: 80px;
  object-fit: contain;
}

.site-logo--compact .site-logo__img {
  width: min(100%, 180px);
  max-height: 52px;
}

.card-brand {
  margin-bottom: 16px;
}

.card-brand--compact {
  margin-bottom: 12px;
}

.login-brand {
  margin-bottom: 18px;
}

.login-brand .site-logo__img {
  width: min(100%, 220px);
  max-height: 72px;
}

.chat-header-logo {
  margin: 0 auto 4px;
}

.footer-brand {
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--primary);
}

.catalog-subtitle {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.equipment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 560px));
  gap: 24px;
  align-items: start;
  justify-content: center;
}

.equipment-carousel__dots {
  display: none;
}

.equipment-carousel__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 0;
  padding: 0;
  background: rgba(97, 97, 97, 0.28);
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    transform 0.2s ease;
}

.equipment-carousel__dot.is-active {
  background: var(--primary);
  transform: scale(1.15);
}

.card {
  width: min(100%, 760px);
  background: var(--surface-card);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(224, 224, 224, 0.75);
  text-align: center;
}

.equipment-grid .card,
.card--catalog-item {
  width: 100%;
}

.card--catalog-item {
  max-width: 560px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card--catalog-item {
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease;
}

.card--catalog-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 54px rgba(33, 33, 33, 0.14);
}

.card--catalog-item .actions {
  margin-top: auto;
  margin-bottom: 0;
}

.card--detail {
  position: relative;
  padding-top: 88px;
}

.card-back-link {
  position: absolute;
  top: 24px;
  left: 24px;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(211, 47, 47, 0.1);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.card-back-link__label--short {
  display: none;
  align-items: center;
  gap: 4px;
  line-height: 1;
}

.card-back-link__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transform: translateY(-0.5px);
}

.card-back-link__text {
  line-height: 1;
}

.card-back-link:hover,
.card-back-link:focus-visible {
  background: var(--primary);
  color: #fff;
  transform: translateY(-1px);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1 {
  margin: 0 0 20px;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  line-height: 1.2;
}

.equipment-card-title {
  margin: 0 0 20px;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  line-height: 1.3;
}

.equipment-image {
  width: 100%;
  max-height: min(46vh, 380px);
  object-fit: contain;
  object-position: center;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  margin-bottom: 16px;
  background: #fff;
  padding: 0;
}

.card--detail h1 {
  margin-bottom: 14px;
  font-size: clamp(1.35rem, 3.2vw, 2rem);
  line-height: 1.25;
}

.card--detail .card-brand--compact {
  margin-bottom: 10px;
}

.card--detail .actions {
  margin-bottom: 12px;
}

.equipment-summary {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.6;
}

.account-serials {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: left;
  background: rgba(255, 255, 255, 0.72);
}

.account-serials--collapsible {
  padding: 12px 14px;
}

.account-serials__title {
  margin: 0 0 10px;
  font-size: 1rem;
  line-height: 1.3;
}

.account-serials__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.account-serials__toggle-meta {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.account-serials__toggle::after {
  content: "▾";
  color: var(--primary);
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

.account-serials__toggle.is-open::after {
  transform: rotate(180deg);
}

.account-serials__panel {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-height 0.28s ease,
    opacity 0.2s ease,
    margin-top 0.2s ease;
}

.account-serials__panel.is-open {
  max-height: min(42vh, 260px);
  opacity: 1;
  margin-top: 10px;
}

.account-serials__scroll {
  max-height: min(40vh, 240px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}

.account-serials__scroll::-webkit-scrollbar {
  width: 6px;
}

.account-serials__scroll::-webkit-scrollbar-thumb {
  background: rgba(97, 97, 97, 0.28);
  border-radius: 999px;
}

.account-serials__list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  color: var(--text);
  line-height: 1.45;
}

.account-serials__list li {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 4px 0;
}

.account-serials__list li + li {
  border-top: 1px solid rgba(224, 224, 224, 0.65);
}

.account-serials__index {
  flex-shrink: 0;
  min-width: 1.8rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

.actions {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
}

.action-button {
  width: 100%;
  border: 0;
  border-radius: 16px;
  padding: 16px 18px;
  background: var(--primary);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
  box-shadow: 0 10px 24px rgba(211, 47, 47, 0.24);
}

.action-button:hover,
.action-button:focus-visible {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.action-button,
.chat-submit-button,
.card-back-link,
.chat-back-link {
  touch-action: manipulation;
}

.accordion {
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  text-align: left;
}

.accordion-panel {
  max-height: 0;
  padding: 0 18px;
  opacity: 0;
  overflow: hidden;
  color: var(--muted);
  line-height: 1.65;
  transition:
    max-height 0.35s ease,
    opacity 0.25s ease,
    padding 0.25s ease;
}

.accordion-panel.is-open {
  max-height: 720px;
  padding: 0 18px 18px;
  opacity: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.accordion-panel p {
  margin: 16px 0 0;
}

.equipment-specs__intro {
  margin: 16px 0 0;
}

.equipment-specs-table {
  width: 100%;
  margin-top: 16px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.95rem;
}

.equipment-specs-table th,
.equipment-specs-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  text-align: left;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.equipment-specs-table tr:last-child th,
.equipment-specs-table tr:last-child td {
  border-bottom: none;
}

.equipment-specs-table th {
  width: 38%;
  color: var(--text);
  font-weight: 600;
  line-height: 1.45;
}

.equipment-specs-table td {
  color: var(--muted);
  line-height: 1.55;
}

.page--chat {
  width: 100%;
  align-items: stretch;
  justify-content: flex-start;
  padding: 28px 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.card--chat {
  width: min(100%, 960px);
  padding: 32px 32px 20px;
  text-align: left;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  margin-inline: auto;
}

.chat-header {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  text-align: center;
  flex-shrink: 0;
}

.chat-back-link--topbar {
  display: none;
  align-items: center;
  flex-shrink: 0;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.88rem;
  gap: 4px;
  width: auto;
}

.chat-back-link__icon {
  font-size: 1.15rem;
  line-height: 1;
}

.chat-back-link__label {
  font-weight: 700;
}

.chat-header-toggle {
  display: none;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: rgba(211, 47, 47, 0.1);
  color: var(--primary);
  cursor: pointer;
  touch-action: manipulation;
}

.chat-header-toggle__icon {
  display: block;
  width: 10px;
  height: 10px;
  margin: auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(225deg) translate(-1px, -1px);
  transition: transform 0.2s ease;
}

.chat-header--collapsed .chat-header-toggle__icon {
  transform: rotate(45deg) translate(-1px, -1px);
}

.chat-header__details {
  display: grid;
  gap: 10px;
}

.chat-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(211, 47, 47, 0.1);
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.chat-back-link:hover,
.chat-back-link:focus-visible {
  background: var(--primary);
  color: #fff;
  transform: translateY(-1px);
}

.chat-title {
  margin: 0;
  font-size: clamp(1.3rem, 2.8vw, 1.8rem);
  line-height: 1.2;
}

.equipment-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(211, 47, 47, 0.12);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 0.92rem;
  white-space: normal;
  justify-self: center;
}

.chat-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
  max-width: 720px;
  margin-inline: auto;
  text-align: center;
}

.chat-subtitle:empty {
  display: none;
}

.chat-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.35),
    rgba(255, 255, 255, 0)
  );
  border-radius: 18px;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  min-height: 0;
  padding: 14px 8px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.chat-messages::-webkit-scrollbar {
  width: 10px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(97, 97, 97, 0.26);
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

.message {
  max-width: min(100%, 720px);
  padding: 16px 18px;
  border-radius: 18px;
  line-height: 1.65;
  word-break: break-word;
  box-shadow: 0 10px 24px rgba(33, 33, 33, 0.06);
}

.message-body.md-body {
  white-space: normal;
}

.message-body.md-body > :first-child {
  margin-top: 0;
}

.message-body.md-body > :last-child {
  margin-bottom: 0;
}

.message-body.md-body p {
  margin: 0.55em 0;
}

.message-body.md-body ul,
.message-body.md-body ol {
  margin: 0.45em 0;
  padding-left: 1.35em;
}

.message-body.md-body li {
  margin: 0.2em 0;
}

.message-body.md-body h1,
.message-body.md-body h2,
.message-body.md-body h3 {
  margin: 0.65em 0 0.4em;
  font-size: 1.05em;
  line-height: 1.35;
}

.message-body.md-body a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.message-body.md-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88em;
  padding: 0.12em 0.38em;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.06);
}

.message-body.md-body pre {
  margin: 0.55em 0;
  padding: 12px 14px;
  border-radius: 12px;
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.05);
  font-size: 0.88em;
}

.message-body.md-body pre code {
  padding: 0;
  background: none;
}

.message-body.md-body blockquote {
  margin: 0.5em 0;
  padding-left: 12px;
  border-left: 3px solid rgba(211, 47, 47, 0.35);
  color: rgba(31, 41, 51, 0.85);
}

.message--user .message-body.md-body code {
  background: rgba(255, 255, 255, 0.18);
}

.message--user .message-body.md-body pre {
  background: rgba(255, 255, 255, 0.12);
}

.message--user .message-body.md-body blockquote {
  border-left-color: rgba(255, 255, 255, 0.45);
  color: rgba(255, 255, 255, 0.92);
}

.message--user .message-body.md-body a {
  color: #fff;
}

.message--assistant {
  align-self: flex-start;
  background: #fff;
  border: 1px solid rgba(224, 224, 224, 0.8);
}

.message--user {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 8px;
}

.message-meta {
  margin-bottom: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

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

.message--user .message-meta {
  color: rgba(255, 255, 255, 0.82);
}

.message--thinking {
  opacity: 0.95;
}

.chat-thinking {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.4;
}

.chat-thinking__label {
  font-weight: 600;
  color: var(--primary-dark);
}

.chat-thinking__dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 1em;
}

.chat-thinking__dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.35;
  animation: chat-thinking-dot 1.1s ease-in-out infinite;
}

.chat-thinking__dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.chat-thinking__dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes chat-thinking-dot {
  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.chat-form {
  display: grid;
  gap: 14px;
  padding: 0;
  background: transparent;
  flex-shrink: 0;
}

.chat-compose {
  display: grid;
  gap: 10px;
}

.chat-support-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  align-self: flex-start;
  min-height: 36px;
  padding: 7px 14px;
  border: 1px solid rgba(211, 47, 47, 0.24);
  border-radius: 999px;
  background: rgba(211, 47, 47, 0.06);
  color: var(--primary);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    transform 0.15s ease,
    box-shadow 0.2s ease;
}

.chat-support-button[hidden] {
  display: none !important;
}

.chat-support-button__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.chat-support-button__label {
  white-space: nowrap;
}

.chat-support-button:hover,
.chat-support-button:focus-visible {
  background: rgba(211, 47, 47, 0.12);
  border-color: rgba(211, 47, 47, 0.42);
  outline: none;
  box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

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

.chat-input-wrap {
  position: relative;
}

.chat-input {
  width: 100%;
  min-height: 88px;
  max-height: 220px;
  resize: none;
  border: 1px solid rgba(211, 47, 47, 0.24);
  border-radius: 16px;
  padding: 16px 64px 16px 18px;
  font: inherit;
  color: var(--text);
  background: #fff;
  box-shadow: 0 8px 22px rgba(33, 33, 33, 0.05);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.chat-input:focus {
  outline: none;
  border-color: rgba(211, 47, 47, 0.55);
  box-shadow: 0 0 0 4px rgba(211, 47, 47, 0.12);
}

.chat-submit-button {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(211, 47, 47, 0.24);
  transition:
    background-color 0.2s ease,
    transform 0.2s ease,
    opacity 0.2s ease;
}

.chat-submit-icon {
  width: 18px;
  height: 18px;
}

.chat-submit-button:hover,
.chat-submit-button:focus-visible {
  background: var(--primary-dark);
  transform: translateY(calc(-50% - 1px));
}

.chat-submit-button:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: translateY(-50%);
}

.footer {
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.01em;
}

/* ПК: чат тянется до низа области main (над футером), список сообщений заполняет высоту */
@media (min-width: 641px) {
  .page--chat {
    align-self: stretch;
    padding: 20px 16px 12px;
  }

  .card--chat {
    flex: 1;
    min-height: 0;
    width: min(100%, 960px);
    max-width: min(100%, 960px);
    margin-inline: auto;
  }

  .chat-header {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
    text-align: center;
    flex-shrink: 0;
  }

  .chat-header-logo {
    margin-bottom: 2px;
  }

  .chat-title {
    margin-bottom: 8px;
    font-size: clamp(1.25rem, 2.5vw, 1.6rem);
  }

  .chat-back-link--topbar,
  .chat-header-toggle {
    display: none;
  }

  .chat-header__details {
    display: grid;
    gap: 10px;
  }

  .chat-shell {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .chat-messages {
    flex: 1;
    min-height: 0;
    max-height: none;
  }

  .chat-form {
    flex-shrink: 0;
  }

}

@media (max-width: 900px) {
  .equipment-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    justify-content: stretch;
  }

  .equipment-grid .card--catalog-item {
    max-width: none;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 16px 12px;
  }

  .card {
    padding: 16px;
    border-radius: 20px;
  }

  .card--detail {
    padding-top: 52px;
  }

  .card--detail h1 {
    margin-bottom: 10px;
    font-size: clamp(1.15rem, 4.8vw, 1.45rem);
  }

  .card--detail .card-brand--compact {
    margin-bottom: 6px;
  }

  .card--detail .card-brand--compact .site-logo__img {
    max-height: 44px;
    width: min(72vw, 160px);
  }

  .equipment-image {
    max-height: min(44vh, 280px);
    margin-bottom: 10px;
    border-radius: 12px;
  }

  .card--catalog-item .equipment-image {
    max-height: min(38vh, 240px);
    margin-bottom: 12px;
  }

  .card--catalog-item .equipment-card-title {
    margin-bottom: 12px;
    font-size: clamp(1.15rem, 4.5vw, 1.45rem);
  }

  .card--catalog-item .equipment-summary {
    margin-bottom: 14px;
  }

  .actions {
    gap: 10px;
    margin-bottom: 10px;
  }

  .card-back-link {
    top: 12px;
    left: 12px;
    min-height: 32px;
    padding: 5px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 999px;
    line-height: 1;
    justify-content: center;
  }

  .card-back-link__label--full {
    display: none;
  }

  .card-back-link__label--short {
    display: inline-flex;
    align-items: center;
  }

  .equipment-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  body.page-mode-catalog .equipment-root {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  body.page-mode-catalog .page {
    flex: 1 0 auto;
    padding-bottom: 28px;
  }

  body.page-mode-catalog .footer {
    position: relative;
    flex: 0 0 auto;
    margin-top: 0;
  }

  .equipment-carousel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    padding-bottom: 12px;
  }

  .equipment-grid.equipment-grid--multi {
    display: grid;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 100%;
    align-items: stretch;
    justify-content: start;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    gap: 12px;
    padding: 0;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
  }

  .equipment-grid--multi::-webkit-scrollbar {
    display: none;
  }

  .equipment-grid--multi .card--catalog-item {
    width: 100%;
    min-width: 0;
    max-width: none;
    margin: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .equipment-grid--multi .card--catalog-item:hover {
    transform: none;
  }

  .equipment-carousel__dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    min-height: 12px;
    margin: 14px 0 8px;
  }

  .site-hero {
    gap: 8px;
    padding-inline: 4px;
    margin-bottom: 14px;
  }

  .site-logo__img {
    width: min(88vw, 220px);
    max-height: 68px;
  }

  .site-hero__title {
    font-size: 1.35rem;
  }

  .catalog-header {
    margin-bottom: 14px;
  }

  .login-brand .site-logo__img {
    width: min(86vw, 200px);
    max-height: 64px;
  }

  .action-button {
    padding: 14px 16px;
    font-size: 0.98rem;
  }

  .accordion-panel {
    padding: 0 12px;
  }

  .accordion-panel.is-open {
    max-height: min(72dvh, 640px);
    padding: 0 12px 16px;
  }

  .equipment-specs__intro {
    margin-top: 14px;
    font-size: 0.94rem;
    line-height: 1.6;
  }

  .equipment-specs-table {
    margin-top: 14px;
    font-size: 0.92rem;
  }

  .equipment-specs-table,
  .equipment-specs-table tbody,
  .equipment-specs-table tr,
  .equipment-specs-table th,
  .equipment-specs-table td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  .equipment-specs-table tr {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
  }

  .equipment-specs-table tr:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .equipment-specs-table th,
  .equipment-specs-table td {
    padding: 0;
    border: none;
  }

  .equipment-specs-table th {
    width: auto;
    margin-bottom: 6px;
    font-size: 0.86rem;
    line-height: 1.35;
  }

  .equipment-specs-table td {
    font-size: 0.94rem;
    line-height: 1.55;
  }

  .accordion-panel.is-open::-webkit-scrollbar {
    width: 8px;
  }

  .accordion-panel.is-open::-webkit-scrollbar-thumb {
    background: rgba(97, 97, 97, 0.28);
    border-radius: 999px;
  }

  body.layout-chat .footer--chat {
    display: none;
  }

  .page--chat {
    padding: 0;
    align-items: stretch;
    flex: 1;
    min-height: 0;
  }

  .card--chat {
    width: 100%;
    max-width: none;
    flex: 1;
    min-height: 0;
    padding: calc(8px + env(safe-area-inset-top)) 10px 8px;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
  }

  .chat-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "back badge toggle"
      "details details details";
    gap: 8px 8px;
    margin-bottom: 8px;
    flex-shrink: 0;
    text-align: left;
    align-items: center;
  }

  .chat-back-link--topbar {
    display: inline-flex;
    grid-area: back;
  }

  .chat-header-toggle {
    display: block;
    grid-area: toggle;
  }

  .chat-header__details {
    display: contents;
  }

  .chat-header .equipment-badge {
    grid-area: badge;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.25;
    text-align: center;
    width: auto;
    justify-self: stretch;
  }

  .chat-title {
    display: none;
  }

  .chat-header-logo {
    display: none;
  }

  .chat-subtitle {
    grid-area: details;
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.35;
    text-align: left;
  }

  .chat-subtitle:empty {
    display: none;
  }

  .chat-header--collapsed .chat-subtitle {
    display: none;
  }

  .chat-header--collapsed {
    margin-bottom: 4px;
    grid-template-areas: "back badge toggle";
  }

  .chat-shell {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-radius: 14px;
  }

  .chat-messages {
    flex: 1;
    min-height: 0;
    max-height: none;
    padding: 6px 2px 10px;
    gap: 10px;
  }

  .message {
    max-width: 100%;
    padding: 12px 14px;
    border-radius: 16px;
  }

  .message-meta {
    font-size: 0.72rem;
    margin-bottom: 6px;
  }

  .chat-form {
    position: sticky;
    bottom: 0;
    gap: 8px;
    flex-shrink: 0;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    margin-top: auto;
    background: linear-gradient(
      to top,
      #fff 78%,
      rgba(255, 255, 255, 0)
    );
    backdrop-filter: blur(6px);
  }

  .chat-support-button {
    align-self: stretch;
    width: 100%;
    min-height: 40px;
    font-size: 0.9rem;
  }

  .chat-submit-button {
    right: 8px;
    top: 50%;
    width: 36px;
    height: 36px;
  }

  .chat-input {
    min-height: 52px;
    max-height: 140px;
    padding: 12px 52px 12px 14px;
    font-size: 16px;
    border-radius: 14px;
  }

  .message-meta {
    font-size: 0.68rem;
  }

  .message {
    padding: 10px 12px;
    line-height: 1.55;
  }
}

@media (max-width: 380px) {
  .page {
    padding: 12px 8px;
  }

  .page--chat {
    padding: 0;
  }

  .card--chat {
    padding-inline: 10px;
  }
}

body.layout-login {
  min-height: 100dvh;
}

.page--login {
  align-items: center;
}

.card--login {
  width: min(100%, 420px);
  margin: 0 auto;
}

.login-hint {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.5;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.login-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
}

.login-input:focus {
  outline: 2px solid rgba(211, 47, 47, 0.35);
  border-color: var(--primary);
}

.login-password-wrap {
  position: relative;
  display: block;
}

.login-input--password {
  padding-right: 96px;
}

.login-password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.login-password-toggle:hover {
  background: rgba(211, 47, 47, 0.08);
}

.login-password-toggle:focus-visible {
  outline: 2px solid rgba(211, 47, 47, 0.35);
  outline-offset: 1px;
}

.login-error {
  margin: 0;
  color: var(--primary-dark);
  font-size: 0.92rem;
  line-height: 1.4;
}

.login-submit {
  width: 100%;
  margin-top: 4px;
}

/* Форма техподдержки */
html.support-modal-open,
body.support-modal-open {
  overflow: hidden;
  overscroll-behavior: none;
}

.support-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  overscroll-behavior: contain;
}

.support-modal[hidden] {
  display: none;
}

.support-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(33, 33, 33, 0.45);
}

.support-modal__panel {
  position: relative;
  width: min(100%, 520px);
  max-height: min(92vh, 900px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 28px 24px 24px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(33, 33, 33, 0.2);
}

.support-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.support-modal__close:hover,
.support-modal__close:focus-visible {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
}

.support-modal__title {
  margin: 0 48px 20px 0;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  line-height: 1.2;
}

.support-form {
  display: grid;
  gap: 14px;
}

.support-field {
  display: grid;
  gap: 6px;
  text-align: left;
}

.support-field__label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.support-field__input {
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  background: #ececec;
  font: inherit;
  color: var(--text);
  scroll-margin-block: 72px;
}

.support-field__input:focus {
  outline: 2px solid rgba(211, 47, 47, 0.35);
  background: #f5f5f5;
}

.support-field__textarea {
  min-height: 120px;
  resize: vertical;
}

.support-field__input--readonly {
  color: var(--muted);
  cursor: default;
}

.support-field__hint {
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--muted);
}

.support-serial-autocomplete {
  position: relative;
}

.support-serial-suggestions {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 6px 0;
  list-style: none;
  max-height: min(40vh, 220px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border: 1px solid rgba(211, 47, 47, 0.24);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(33, 33, 33, 0.1);
}

.support-serial-suggestions__item {
  padding: 10px 14px;
  cursor: pointer;
  line-height: 1.35;
}

.support-serial-suggestions__item:hover,
.support-serial-suggestions__item:focus {
  background: rgba(211, 47, 47, 0.08);
}

.support-field__file {
  width: 100%;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
}

.support-field__file::file-selector-button {
  margin-right: 10px;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: #e0e0e0;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.support-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  cursor: pointer;
}

.support-consent__checkbox {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--primary);
}

.support-consent__text {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
}

.support-consent__text a {
  color: var(--text);
  text-decoration: underline;
}

.support-form__error {
  margin: 0;
  color: var(--primary-dark);
  font-size: 0.9rem;
  line-height: 1.4;
}

.support-form__success {
  margin: 0;
  color: #2e7d32;
  font-size: 0.9rem;
  line-height: 1.4;
}

.support-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-top: 4px;
  padding: 14px 16px 14px 20px;
  border: 0;
  border-radius: 14px;
  background: #ececec;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.support-submit:hover:not(:disabled),
.support-submit:focus-visible:not(:disabled) {
  background: #e0e0e0;
}

.support-submit:disabled {
  opacity: 0.65;
  cursor: wait;
}

.support-submit__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  flex-shrink: 0;
}

body.layout-support {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.page--support {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  align-items: stretch;
  justify-content: flex-start;
  padding: 28px 16px 32px;
}

.card--support {
  width: 100%;
  max-width: none;
  padding: 0;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.support-page-header {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
  justify-items: center;
}

.support-back-link {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  background: rgba(211, 47, 47, 0.1);
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.support-back-link:hover,
.support-back-link:focus-visible {
  background: var(--primary);
  color: #fff;
  transform: translateY(-1px);
}

.support-back-link__icon {
  font-size: 1.15rem;
  line-height: 1;
}

.support-page-title {
  margin: 0;
  width: 100%;
  text-align: center;
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  line-height: 1.2;
}

.support-page-header .equipment-badge {
  margin: 0;
}

.support-form--page {
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

@media (max-width: 640px) {
  body.layout-support .footer--support {
    display: none;
  }

  .page--support {
    max-width: none;
    padding:
      calc(8px + env(safe-area-inset-top))
      14px
      calc(24px + env(safe-area-inset-bottom));
  }

  .support-form--page .support-field__input,
  .support-form--page .support-field__textarea {
    font-size: 16px;
  }

  .support-modal__panel {
    width: 100%;
    max-height: calc(100dvh - 32px);
    padding: 18px 14px 16px;
    border-radius: 16px;
  }

  .support-modal__title {
    margin-right: 40px;
    margin-bottom: 14px;
    font-size: 1.2rem;
  }
}

.footer-logout {
  margin-left: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
}
