:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --border: #2d3a4d;
  --text: #e8eef7;
  --muted: #9aa8bc;
  --accent: #4c8dff;
  --accent-dim: #2d5aa0;
  --radius: 12px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;

  /* Brand (site) */
  --site-bg: #ffffff;
  --site-surface: #ffffff;
  --site-surface-alt: #f3f4f6;
  --site-text: #374151;
  --site-heading: #111827;
  --site-link: #6bb6ff;
  --site-border: rgba(17, 24, 39, 0.12);
  --grad-a: #8b5cf6;
  --grad-b: #c026d3;
  --shadow: 0 14px 30px rgba(17, 24, 39, 0.12);
}

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

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  background: linear-gradient(160deg, #0c1018 0%, #151d2b 50%, #0f1419 100%);
  color: var(--text);
  line-height: 1.5;
}

body.layout-widget {
  background: var(--bg);
}

.layout-site {
  background: var(--site-bg);
  color: var(--site-text);
}

/* Без горизонтального «вылезания» контента (часто из-за шапки на узкой ширине) */
body.layout-site {
  overflow-x: clip;
  max-width: 100%;
}

@supports not (overflow: clip) {
  body.layout-site {
    overflow-x: hidden;
  }
}

.shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
}

.layout-site .shell {
  max-width: min(1200px, 100%);
  padding: 0;
  overflow-x: clip;
}

@supports not (overflow: clip) {
  .layout-site .shell {
    overflow-x: hidden;
  }
}

.layout-widget .shell {
  max-width: 720px;
  padding: 0.5rem 0.75rem 1rem;
}

.topbar {
  margin-bottom: 1.5rem;
}

.brand {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
}

.brand.compact {
  font-size: 1.15rem;
}

.tagline {
  color: var(--muted);
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.h-small {
  font-size: 1rem;
  margin: 0 0 0.5rem;
}

.link-quiet {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}

.link-quiet:hover {
  text-decoration: underline;
}

.grid-main {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 800px) {
  .grid-main {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: start;
  }
}

.widget-grid {
  gap: 0.75rem;
}

@media (min-width: 560px) {
  .widget-grid {
    grid-template-columns: 1fr 200px;
  }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}

.panel h2 {
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
}

.chat-log {
  min-height: 180px;
  max-height: 360px;
  overflow-y: auto;
  padding: 0.5rem 0.25rem;
  margin-bottom: 0.75rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
}

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

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

.chat-panel .chat-form {
  margin-top: auto;
}

.layout-widget .chat-log {
  min-height: 140px;
  max-height: 280px;
}

.msg {
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  font-size: 0.92rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg.user {
  background: rgba(76, 141, 255, 0.15);
  border-left: 3px solid var(--accent);
}

.msg.bot {
  background: rgba(255, 255, 255, 0.04);
  border-left: 3px solid var(--muted);
}

.msg .label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.chat-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 72px;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0d1218;
  color: var(--text);
  font: inherit;
}

.chat-form textarea:focus {
  outline: 2px solid var(--accent-dim);
  outline-offset: 1px;
}

.chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
}

.file-names {
  flex: 1;
  min-width: 140px;
  padding: 0 0.25rem;
  color: var(--muted);
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn {
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 0.45rem 1rem;
  background: #243044;
  color: var(--text);
}

.btn.primary {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}

.btn.primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.file-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  color: var(--muted);
  cursor: pointer;
}

.file-pill input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0.35rem 0 0;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.muted.small {
  font-size: 0.8rem;
}

.template-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.template-list li {
  margin-bottom: 0.5rem;
}

.template-list.compact li {
  margin-bottom: 0.35rem;
}

.template-list a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.92rem;
}

.template-list.compact a {
  font-size: 0.85rem;
}

.template-list a:hover {
  text-decoration: underline;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.widget-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Полноэкранная высота для /consultant и виджета */
.layout-app .shell,
.layout-widget .shell {
  min-height: 100dvh;
}

.layout-app .grid-main,
.layout-widget .widget-wrap {
  min-height: 100dvh;
}

@media (max-width: 520px) {
  .layout-app .shell {
    padding: 0.75rem 0.75rem 1rem;
  }
  .chat-form textarea {
    min-height: 56px;
  }
}

.widget-head {
  padding: 0.25rem 0 0.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

code {
  font-size: 0.85em;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* --------------------------- */
/* Site layout (rusalts.ru MVP) */
/* --------------------------- */

.layout-site code {
  background: rgba(17, 24, 39, 0.06);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--site-border);
  backdrop-filter: blur(10px);
}

.site-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.75rem;
  align-items: center;
  min-height: 72px;
}

.brandmark {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--site-heading);
  min-width: 220px;
  height: 100%;
}

.brandmark__logo {
  height: 64px;
  width: auto;
  object-fit: contain;
}

.brandmark__text {
  font-weight: 800;
  letter-spacing: -0.02em;
}

.site-nav {
  display: none;
  gap: 0.85rem;
  align-items: center;
}

.site-nav__link {
  color: var(--site-heading);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.35rem 0.25rem;
  line-height: 1;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.site-nav__link:hover {
  color: var(--grad-a);
}

.header-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
  max-width: 100%;
}

.header-actions__cta {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
}

.btn-site--compact {
  padding: 0.45rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.btn-site--expert {
  gap: 0.35rem;
  padding: 0.45rem 0.75rem 0.45rem 0.5rem;
  white-space: nowrap;
}

.btn-site-expert__logo {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex-shrink: 0;
}

.btn-site-expert__label {
  font-weight: 700;
  font-size: 0.88rem;
}

.btn-site--expert-wide {
  width: fit-content;
  max-width: 100%;
}

@media (max-width: 420px) {
  .btn-site--expert .btn-site-expert__label {
    font-size: 0.8rem;
  }
}

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  padding: 0.5rem;
  border: 1px solid var(--site-border);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}

.nav-toggle__bar {
  width: 20px;
  height: 2px;
  background: var(--site-heading);
}

@media (min-width: 980px) {
  .site-header__inner {
    grid-template-columns: 320px 1fr auto;
  }
  .nav-toggle {
    display: none;
  }
  .site-nav {
    display: inline-flex;
  }
}

@media (max-width: 979px) {
  .site-header__inner {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .brandmark {
    min-width: 0;
    max-width: 100%;
  }

  .header-actions {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 100%;
    justify-content: stretch;
  }

  .header-actions__cta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    width: 100%;
    min-width: 0;
  }

  .header-actions__cta > .btn-site {
    min-width: 0;
    white-space: normal;
    text-align: center;
    line-height: 1.2;
    font-size: 0.78rem;
    padding: 0.5rem 0.35rem;
  }

  .btn-site--expert {
    white-space: normal;
  }
}

.site-nav.is-open {
  display: grid;
  grid-column: 1 / -1;
  padding: 0.25rem 0 0.5rem;
}

.btn-site {
  font: inherit;
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid var(--site-border);
  padding: 0.5rem 0.9rem;
  background: #ffffff;
  color: var(--site-heading);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-site--lg {
  padding: 0.7rem 1.1rem;
  border-radius: 12px;
}

.btn-site--primary {
  border: none;
  color: #fff;
  background: linear-gradient(45deg, var(--grad-a), var(--grad-b));
  box-shadow: 0 10px 24px rgba(139, 92, 246, 0.32);
  font-weight: 700;
}

.btn-site--outline {
  background: transparent;
  border: 1px solid rgba(139, 92, 246, 0.45);
  color: var(--site-heading);
}

.btn-site--ghost {
  background: rgba(17, 24, 39, 0.02);
}

.btn-site:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.site-main {
  display: block;
}

.hero {
  position: relative;
  overflow: hidden;
  display: block;
  background: url("/static/img/cover.png");
  background-size: cover;
  background-position: center;
  color: #fff;
}

.hero__content {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem 1.65rem;
}

.hero__title {
  margin: 0 0 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.12;
  font-size: clamp(2rem, 3.6vw, 3.6rem);
  text-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.page-grid {
  max-width: 1200px;
  margin: 0 auto;
}

@media (min-width: 1100px) {
  .page-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 1.25rem;
    align-items: start;
  }
  .page-main .section {
    padding-left: 0;
    padding-right: 0;
  }
}

.page-aside {
  padding: 2.25rem 1rem 0;
}

@media (min-width: 1100px) {
  .page-aside {
    padding: 3.25rem 0 0;
    position: sticky;
    top: 92px;
  }
}

.aside-card {
  background: #fff;
  border: 1px solid var(--site-border);
  border-radius: 16px;
  box-shadow: 0 16px 38px rgba(17, 24, 39, 0.12);
  padding: 1rem 1rem 0.9rem;
}

.aside-head {
  margin-bottom: 0.75rem;
}

.aside-title {
  margin: 0;
  font-size: 1.1rem;
  color: var(--site-heading);
  letter-spacing: -0.01em;
}

.aside-subtitle {
  margin: 0.2rem 0 0;
  color: var(--site-text);
  opacity: 0.75;
  font-size: 0.9rem;
}

.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.news-item {
  border-top: 1px solid rgba(17, 24, 39, 0.08);
  padding-top: 0.75rem;
}

.news-item:first-child {
  border-top: none;
  padding-top: 0;
}

.news-item__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--site-text);
  opacity: 0.78;
  font-size: 0.85rem;
}

.news-item__pin {
  font-weight: 700;
  color: rgba(17, 24, 39, 0.72);
}

.news-item__announce {
  margin: 0.35rem 0 0.35rem;
  color: var(--site-heading);
  font-size: 0.95rem;
  line-height: 1.35;
}

.news-item__more {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--grad-a);
  text-decoration: none;
}

.news-item__more:hover {
  text-decoration: underline;
}

.hero__subtitle {
  margin: 0 0 1.4rem;
  max-width: 58rem;
  font-size: clamp(1rem, 1.35vw, 1.2rem);
  opacity: 0.95;
}

/* hero buttons removed in current layout */

.hero__subtitle--nowrap {
  margin-bottom: 0;
}

@media (min-width: 980px) {
  .hero__subtitle--nowrap {
    max-width: none;
    white-space: nowrap;
  }
}

@media (max-width: 520px) {
  .hero__content {
    padding: 1.5rem 1rem 1.25rem;
  }
}

.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3.25rem 1rem;
}

.page-standalone {
  padding-top: 2.25rem;
}

.page-title {
  margin: 0 0 0.85rem;
  color: var(--site-heading);
  font-size: clamp(1.8rem, 2.6vw, 2.6rem);
  letter-spacing: -0.015em;
}

.page-body {
  margin-top: 0.75rem;
}

.approv-processing-banner {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(139, 92, 246, 0.4);
  background: rgba(139, 92, 246, 0.1);
  color: var(--site-heading);
  font-size: 0.95rem;
  line-height: 1.45;
}

.approv-processing-banner[hidden] {
  display: none !important;
}

.approv__toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.approv__list {
  display: grid;
  gap: 1rem;
}

.approv-item {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 16px;
  box-shadow: 0 16px 38px rgba(17, 24, 39, 0.08);
  padding: 1rem;
}

.approv-item__preview {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--site-text);
  opacity: 0.88;
}

.approv-item__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.approv-item__meta {
  display: grid;
  gap: 0.2rem;
}

.approv-item__id {
  font-weight: 700;
  color: var(--site-heading);
}

.approv-item__time {
  color: var(--site-text);
  opacity: 0.75;
  font-size: 0.9rem;
}

.approv-item__flags {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.approv-flag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.92rem;
  color: var(--site-heading);
}

.approv-label {
  display: block;
  margin: 0.5rem 0 0.35rem;
  color: var(--site-text);
  opacity: 0.8;
  font-size: 0.9rem;
}

.approv-input {
  width: 100%;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  font: inherit;
}

.approv-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

@media (min-width: 920px) {
  .approv-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.approv-col {
  display: grid;
  gap: 0.35rem;
}

.approv-col__title {
  font-weight: 700;
  color: var(--site-heading);
}

.approv-textarea {
  width: 100%;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  min-height: 14rem;
  resize: vertical;
}

.approv-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.approv-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--site-heading);
  margin: 0 0 0.75rem;
}

.approv--corporate {
  margin-bottom: 1.5rem;
}

.approv__published-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.75rem 0 1rem;
}

.approv__published {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  max-height: 22rem;
  overflow: auto;
  padding: 0.35rem 0;
}

.approv-published-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  background: rgba(255, 255, 255, 0.65);
  font-size: 0.95rem;
  cursor: pointer;
}

.approv-published-row input {
  flex-shrink: 0;
}

.alt-surface {
  background: var(--site-surface-alt);
}

.alt-surface .section {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.section__head {
  margin-bottom: 1.5rem;
}

.section__head--row {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  align-items: flex-start;
  justify-content: space-between;
}

@media (min-width: 980px) {
  .section__head--row {
    flex-direction: row;
    align-items: center;
  }
}

.section__title {
  color: var(--site-heading);
  margin: 0 0 0.35rem;
  font-size: clamp(1.6rem, 2.2vw, 2.25rem);
  letter-spacing: -0.01em;
}

.section__lead {
  margin: 0;
  color: var(--site-text);
  opacity: 0.9;
  max-width: 60rem;
}

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}

@media (min-width: 760px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1080px) {
  .cards {
    grid-template-columns: repeat(4, 1fr);
  }
  .cards--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: var(--site-surface);
  border: 1px solid var(--site-border);
  border-radius: 14px;
  padding: 1.1rem 1.1rem 1rem;
  box-shadow: 0 10px 20px rgba(17, 24, 39, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(17, 24, 39, 0.12);
  border-color: rgba(139, 92, 246, 0.35);
}

.card__title {
  margin: 0 0 0.45rem;
  color: var(--site-heading);
  font-size: 1.05rem;
}

.card__text {
  margin: 0;
  color: var(--site-text);
}

.accordion {
  display: grid;
  gap: 0.75rem;
}

.acc-item {
  background: #fff;
  border: 1px solid var(--site-border);
  border-radius: 14px;
  padding: 0.25rem 0.9rem;
  box-shadow: 0 10px 20px rgba(17, 24, 39, 0.06);
}

.acc-title {
  cursor: pointer;
  padding: 0.75rem 0;
  color: var(--site-heading);
  font-weight: 700;
}

.acc-body {
  padding: 0 0 0.9rem;
  color: var(--site-text);
}

.acc-p {
  margin: 0 0 0.5rem;
}

.bullets {
  margin: 0.2rem 0 0.2rem 1.1rem;
}

.link {
  color: var(--site-link);
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

.linklike {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--grad-a);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.news-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tab {
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
  border: 1px solid var(--site-border);
  padding: 0.35rem 0.7rem;
  background: #fff;
  color: var(--site-heading);
}

.tab.is-active {
  border-color: rgba(139, 92, 246, 0.5);
  background: rgba(139, 92, 246, 0.08);
}

.news-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}

@media (min-width: 900px) {
  .news-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.news-card {
  background: #fff;
  border: 1px solid var(--site-border);
  border-radius: 14px;
  padding: 1rem 1rem 0.95rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  min-height: 420px;
  max-height: 640px;
}

.news-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(17, 24, 39, 0.12);
}

.news-meta {
  margin: 0 0 0.5rem;
  color: var(--site-text);
  opacity: 0.8;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.news-meta__left {
  min-height: 1em;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.08rem 0.5rem;
  border-radius: 999px;
  background: rgba(107, 182, 255, 0.2);
  color: #1f4e7a;
  border: 1px solid rgba(107, 182, 255, 0.35);
}

.news-text {
  margin: 0;
  color: var(--site-text);
  white-space: pre-wrap;
  word-break: break-word;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  max-height: 320px;
  padding-right: 0.35rem;
}

@media (max-width: 900px) {
  .news-card {
    min-height: 380px;
  }
  .news-text {
    max-height: 260px;
  }
}

.contacts {
  display: grid;
  gap: 1rem;
}

@media (min-width: 980px) {
  .contacts {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.contacts__card {
  background: #fff;
  border: 1px solid var(--site-border);
  border-radius: 14px;
  padding: 1.1rem 1.1rem 1rem;
  box-shadow: 0 10px 20px rgba(17, 24, 39, 0.06);
}

.contacts__line {
  margin: 0 0 0.55rem;
  color: var(--site-text);
}

.contacts__note {
  padding: 0.25rem 0.25rem 0;
}

.muted-site {
  margin: 0 0 0.55rem;
  color: var(--site-text);
  opacity: 0.85;
}

.site-footer {
  background: #111827;
  color: #f3f4f6;
}

.site-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.2rem 1rem;
  display: grid;
  gap: 1rem;
}

@media (min-width: 980px) {
  .site-footer__inner {
    grid-template-columns: 1.3fr 1fr 1fr;
    align-items: start;
  }
}

.footer-brand {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 0.75rem;
  align-items: start;
}

.footer-brand__col {
  min-width: 0;
  display: grid;
  gap: 0.65rem;
}

.footer-brand__logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: grayscale(1) brightness(1.2);
  opacity: 0.9;
}

.footer-brand__text {
  margin: 0;
  opacity: 0.92;
}

.footer-social {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.footer-social__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6bb6ff;
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

.footer-social__link:hover {
  color: #8b5cf6;
  transform: translateY(-1px);
}

.footer-social__icon {
  display: block;
  width: 28px;
  height: 28px;
}

.footer-social__icon--vk {
  width: 30px;
  height: 30px;
}

.footer-social__icon--max {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.25);
}

.footer-links,
.footer-legal {
  display: grid;
  gap: 0.35rem;
}

.footer-link {
  color: #6bb6ff;
  text-decoration: none;
}

.footer-link:hover {
  color: #8b5cf6;
  text-decoration: underline;
}

/* Плавающий чат: полноэкранная обёртка + flex-end — стабильнее position:fixed у кнопки на iOS/Android */
.altbot-root {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
  padding: 0 max(1rem, env(safe-area-inset-right, 0px)) calc(1rem + env(safe-area-inset-bottom, 0px))
    max(1rem, env(safe-area-inset-left, 0px));
  box-sizing: border-box;
}

.altbot-root .altbot {
  position: static;
  display: grid;
  gap: 0.75rem;
  justify-items: end;
  width: max-content;
  max-width: 100%;
  pointer-events: auto;
}

.altbot__fab {
  justify-self: end;
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: linear-gradient(45deg, var(--grad-a), var(--grad-b));
  box-shadow: 0 14px 32px rgba(139, 92, 246, 0.4);
  cursor: pointer;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font: inherit;
  font-weight: 800;
  font-size: 0.92rem;
  line-height: 1.05;
  text-align: center;
  letter-spacing: 0.02em;
}

.altbot__fab:hover {
  filter: brightness(1.05);
}

@media (max-width: 520px) {
  .altbot__fab {
    width: 48px;
    height: 48px;
    font-size: 0.8rem;
  }
}

/* Авторский display:grid иначе перебивает [hidden] в ряде браузеров — явно скрываем */
.altbot__panel[hidden] {
  display: none !important;
}

.altbot__panel:not([hidden]) {
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.altbot__panel {
  width: min(360px, calc(100vw - 2rem));
  height: 480px;
  background: #fff;
  border: 1px solid var(--site-border);
  border-radius: 16px;
  box-shadow: 0 22px 60px rgba(17, 24, 39, 0.22);
  overflow: hidden;
}

.altbot__head {
  padding: 0.7rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--site-border);
}

.altbot__title {
  font-weight: 800;
  color: var(--site-heading);
}

.altbot__close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--site-border);
  background: transparent;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.altbot__log {
  padding: 0.75rem 0.85rem;
  overflow: auto;
  background: #fff;
}

.altbot__form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  padding: 0.75rem 0.85rem;
  border-top: 1px solid var(--site-border);
}

.altbot__form input {
  width: 100%;
  border: 1px solid var(--site-border);
  border-radius: 12px;
  padding: 0.6rem 0.75rem;
  font: inherit;
}

.layout-site .msg.user {
  background: rgba(107, 182, 255, 0.18);
  border-left-color: #6bb6ff;
  color: var(--site-text);
}

.layout-site .msg.bot {
  background: rgba(17, 24, 39, 0.04);
  border-left-color: rgba(17, 24, 39, 0.35);
  color: var(--site-text);
}

.layout-site .msg .label {
  color: rgba(55, 65, 81, 0.7);
}

/* A11y mode (ГОСТ: high contrast + 200% font + no animations + no background images) */
html.a11y {
  font-size: 200%;
}

html.a11y body.layout-site {
  background: #fff !important;
  color: #000 !important;
}

html.a11y .site-header {
  background: #fff !important;
  backdrop-filter: none;
}

html.a11y .hero__bg {
  background: none !important;
}

html.a11y .btn-site,
html.a11y .tab,
html.a11y .card,
html.a11y .news-card,
html.a11y .acc-item,
html.a11y .contacts__card {
  box-shadow: none !important;
}

html.a11y * {
  transition: none !important;
  animation: none !important;
}
