/* Базовая тема повторяет переменные Telegram и остаётся читаемой вне WebView. */
:root {
  color-scheme: light;
  --tg-bg: var(--tg-theme-bg-color, #f4f5f7);
  --tg-secondary-bg: var(--tg-theme-secondary-bg-color, #ffffff);
  --tg-section-bg: var(--tg-theme-section-bg-color, #ffffff);
  --tg-text: var(--tg-theme-text-color, #111820);
  --tg-hint: var(--tg-theme-hint-color, #7b8794);
  --tg-link: var(--tg-theme-link-color, #168acd);
  --accent: #2aabee;
  --accent-strong: #168acd;
  --accent-soft: #e5f5fd;
  --mint: #dcf7ee;
  --violet: #f0e9fa;
  --coral: #ffe8e3;
  --yellow: #fff1cd;
  --rose: #f8e9ef;
  --separator: rgba(20, 30, 40, 0.1);
  --shadow: 0 8px 28px rgba(23, 43, 58, 0.07);
  --safe-top: max(env(safe-area-inset-top), var(--tg-safe-area-inset-top, 0px));
  --safe-right: max(env(safe-area-inset-right), var(--tg-safe-area-inset-right, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom), var(--tg-safe-area-inset-bottom, 0px));
  --safe-left: max(env(safe-area-inset-left), var(--tg-safe-area-inset-left, 0px));
  --content-bottom: max(env(safe-area-inset-bottom), var(--tg-content-safe-area-inset-bottom, 0px));
  --radius-card: 14px;
  --radius-control: 12px;
  --nav-height: 64px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  min-width: 320px;
  background: var(--tg-bg);
  overscroll-behavior: none;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  background: var(--tg-bg);
  color: var(--tg-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
}

button,
[role="button"] {
  touch-action: manipulation;
}

button {
  color: inherit;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.icon--small {
  width: 18px;
  height: 18px;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--tg-bg);
}

.screen {
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(16px + var(--safe-top)) calc(16px + var(--safe-right)) calc(24px + var(--safe-bottom)) calc(16px + var(--safe-left));
}

.screen.has-nav {
  padding-bottom: calc(var(--nav-height) + 28px + var(--content-bottom));
}

.screen.has-action {
  padding-bottom: calc(92px + var(--content-bottom));
}

.screen.entering > * {
  animation: screen-in 180ms ease-out both;
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* Типографика держит один короткий смысл на экране. */
.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(27px, 7.6vw, 34px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

h2 {
  margin-bottom: 10px;
  font-size: 23px;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

h3 {
  margin-bottom: 5px;
  font-size: 17px;
  line-height: 1.25;
}

.lead {
  margin-bottom: 0;
  color: var(--tg-hint);
  font-size: 16px;
}

.caption {
  color: var(--tg-hint);
  font-size: 14px;
}

.section-heading {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  margin-top: 22px;
}

.section-heading h2 {
  margin: 0;
  font-size: 20px;
}

.section-link,
.text-button {
  min-height: 44px;
  padding: 8px 0 8px 12px;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font-weight: 600;
  cursor: pointer;
}

/* Верхний блок главного экрана — единственное место с фирменной композицией. */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 170px;
  margin: 0 -16px 18px;
  padding: 22px 18px 24px;
  background: linear-gradient(145deg, #e8f7ff 0%, #f4faff 52%, #eefaf6 100%);
  border-bottom: 1px solid rgba(42, 171, 238, 0.16);
}

.hero::after {
  content: "";
  position: absolute;
  top: -46px;
  right: -44px;
  width: 150px;
  height: 150px;
  border: 22px solid rgba(42, 171, 238, 0.1);
  border-radius: 50%;
}

.hero__mark {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 20px;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 700;
}

.hero__mark .brand-mark {
  width: 26px;
  height: 26px;
}

.hero h1,
.hero p {
  position: relative;
  z-index: 1;
  max-width: 330px;
}

.hero p {
  margin: 0;
  color: #53616d;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  grid-template-columns: repeat(3, 6px);
  gap: 3px;
  border-radius: 12px;
  background: var(--accent);
}

.brand-mark span {
  display: block;
  width: 6px;
  border-radius: 3px;
  background: #fff;
}

.brand-mark span:nth-child(1) { height: 11px; }
.brand-mark span:nth-child(2) { height: 21px; }
.brand-mark span:nth-child(3) { height: 15px; }

/* Карточки проблем — визуальный вход вместо длинного каталога услуг. */
.problem-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.problem-card {
  position: relative;
  display: flex;
  min-height: 126px;
  padding: 14px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  overflow: hidden;
  border: 1px solid rgba(20, 30, 40, 0.05);
  border-radius: var(--radius-card);
  background: var(--tg-section-bg);
  box-shadow: 0 2px 10px rgba(24, 42, 54, 0.04);
  cursor: pointer;
  text-align: left;
  transition: transform 120ms ease, filter 120ms ease;
}

.problem-card:active,
.solution-card:active,
.case-card:active,
.option-card:active {
  transform: scale(0.98);
  filter: brightness(0.98);
}

.problem-card__icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 11px;
  color: #197fac;
}

.problem-card__title {
  max-width: 125px;
  margin-top: 12px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.problem-card__arrow {
  position: absolute;
  right: 11px;
  bottom: 11px;
  width: 18px;
  height: 18px;
  color: rgba(17, 24, 32, 0.42);
}

.tint-blue .problem-card__icon { background: var(--accent-soft); }
.tint-mint .problem-card__icon { background: var(--mint); color: #168b6a; }
.tint-violet .problem-card__icon { background: var(--violet); color: #8a59ad; }
.tint-coral .problem-card__icon { background: var(--coral); color: #cc6658; }
.tint-yellow .problem-card__icon { background: var(--yellow); color: #a87516; }
.tint-rose .problem-card__icon { background: var(--rose); color: #ad5778; }

.draft-banner {
  display: grid;
  min-height: 70px;
  margin-bottom: 14px;
  padding: 12px 14px;
  grid-template-columns: 42px 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(42, 171, 238, 0.2);
  border-radius: var(--radius-card);
  background: var(--accent-soft);
  cursor: pointer;
}

.draft-banner__icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 10px;
  background: #fff;
  color: var(--accent-strong);
}

.draft-banner strong,
.draft-banner small {
  display: block;
}

.draft-banner small {
  margin-top: 2px;
  color: var(--tg-hint);
}

/* Универсальные карточки решений и кейсов. */
.card-stack {
  display: grid;
  gap: 12px;
}

.solution-card,
.case-card {
  width: 100%;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--separator);
  border-radius: var(--radius-card);
  background: var(--tg-section-bg);
  box-shadow: var(--shadow);
  cursor: pointer;
  text-align: left;
  transition: transform 120ms ease, filter 120ms ease;
}

.solution-card--compact {
  display: grid;
  grid-template-columns: 92px 1fr;
}

.solution-card--compact .visual {
  min-height: 148px;
  border-radius: 0;
}

.solution-card--compact .card-body {
  padding: 14px;
}

.card-body {
  padding: 15px;
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tag {
  display: inline-flex;
  min-height: 26px;
  padding: 4px 9px;
  align-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 700;
}

.tag--recommended {
  background: #dff7ed;
  color: #177d5f;
}

.card-title {
  margin: 11px 0 5px;
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.card-result {
  margin: 0;
  color: var(--tg-hint);
  line-height: 1.35;
}

.meta-row {
  display: flex;
  margin-top: 13px;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--tg-hint);
  font-size: 14px;
}

.meta-row span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.case-card__cover {
  display: block;
  min-height: 178px;
}

.case-card__result {
  display: flex;
  margin-top: 12px;
  gap: 9px;
  align-items: flex-start;
  color: var(--tg-text);
  font-size: 14px;
}

.case-card__result .icon {
  margin-top: 1px;
  color: #18a774;
}

.featured-case {
  display: grid;
  min-height: 106px;
  grid-template-columns: 108px 1fr;
  overflow: hidden;
  border: 1px solid var(--separator);
  border-radius: var(--radius-card);
  background: var(--tg-section-bg);
  cursor: pointer;
  text-align: left;
}

.featured-case .visual {
  min-height: 106px;
  border-radius: 0;
}

.featured-case__body {
  padding: 12px 13px;
}

.featured-case__body small {
  color: var(--accent-strong);
  font-weight: 700;
}

.featured-case__body strong {
  display: block;
  margin: 4px 0;
}

.featured-case__body span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--tg-hint);
  font-size: 14px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* Иллюстрации собраны CSS-формами, поэтому быстро загружаются и масштабируются. */
.visual {
  position: relative;
  display: block;
  min-height: 190px;
  overflow: hidden;
  background: linear-gradient(140deg, #dff4ff, #f6fbff);
}

.visual::before,
.visual::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.visual::before {
  top: -44px;
  right: -22px;
  width: 130px;
  height: 130px;
  background: rgba(42, 171, 238, 0.12);
}

.visual::after {
  bottom: -40px;
  left: -25px;
  width: 112px;
  height: 112px;
  background: rgba(14, 157, 120, 0.11);
}

.visual__device {
  position: absolute;
  z-index: 2;
  top: 23px;
  left: 50%;
  width: 104px;
  height: 164px;
  padding: 0;
  overflow: hidden;
  transform: translateX(-50%) rotate(-2deg);
  border: 5px solid #1c2c38;
  border-radius: 20px;
  background: #f8fbfc;
  box-shadow: 0 16px 28px rgba(24, 51, 67, 0.19);
}

.visual__device::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 50%;
  width: 27px;
  height: 4px;
  transform: translateX(-50%);
  border-radius: 3px;
  background: #1c2c38;
  z-index: 2;
}

.visual__screen {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  background: #f8fbfc;
}

.visual__line {
  height: 6px;
  margin: 7px 0;
  border-radius: 4px;
  background: #dce7ec;
}

.visual__line.short { width: 62%; }
.visual__line.accent { width: 78%; background: #7bcdf3; }

.visual__tile {
  height: 35px;
  margin: 8px 0;
  border-radius: 7px;
  background: #e0f5ee;
}

.visual__node {
  position: absolute;
  z-index: 3;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(20, 40, 54, 0.08);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(22, 55, 74, 0.13);
  color: var(--accent-strong);
}

.visual__node--left { top: 67px; left: 20%; }
.visual__node--right { right: 17%; bottom: 25px; }

.visual--map { background: linear-gradient(145deg, #e5f6ff, #e6f7f1); }
.visual--flow { background: linear-gradient(145deg, #dcf7ee, #eff9f5); }
.visual--assistant { background: linear-gradient(145deg, #efe7fa, #f9f4ff); }
.visual--app { background: linear-gradient(145deg, #ffe9e2, #fff6f3); }
.visual--site { background: linear-gradient(145deg, #fff1cf, #fff9eb); }
.visual--integration { background: linear-gradient(145deg, #e3f2ff, #edeafd); }
.visual--lesson { background: linear-gradient(145deg, #e7efff, #f3f7ff); }
.visual--macrame { background: linear-gradient(145deg, #eee5dc, #faf4ed); }

.visual--macrame .visual__tile {
  background: repeating-linear-gradient(45deg, #c4a88d 0 4px, #e7d7c7 4px 8px);
}

.visual--lesson .visual__tile { background: #e4edff; }

/* Фильтры остаются прокручиваемой строкой и не перегружают экран. */
.filter-row {
  display: flex;
  overflow-x: auto;
  margin: 14px -16px 18px;
  padding: 0 16px;
  gap: 8px;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar { display: none; }

.chip {
  min-width: max-content;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--separator);
  border-radius: 12px;
  background: var(--tg-section-bg);
  color: var(--tg-text);
  font-weight: 600;
  cursor: pointer;
}

.chip.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

/* Детальные экраны используют группы в стиле настроек Telegram. */
.detail-cover {
  margin: -16px -16px 20px;
}

.detail-cover .visual {
  min-height: 220px;
  border-radius: 0;
}

.detail-title {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.detail-title__icon {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.detail-title h1 { margin-bottom: 5px; }
.detail-title p { margin: 0; color: var(--tg-hint); }

.stat-strip {
  display: grid;
  margin: 18px 0;
  padding: 14px 0;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--separator);
  border-bottom: 1px solid var(--separator);
}

.stat-strip div {
  min-width: 0;
  padding: 0 10px;
  border-right: 1px solid var(--separator);
}

.stat-strip div:first-child { padding-left: 0; }
.stat-strip div:last-child { padding-right: 0; border-right: 0; }
.stat-strip small,
.stat-strip strong { display: block; }
.stat-strip small { color: var(--tg-hint); font-size: 14px; }
.stat-strip strong { margin-top: 3px; font-size: 14px; overflow-wrap: anywhere; }

.group {
  margin: 14px 0;
  padding: 4px 16px;
  border-radius: var(--radius-card);
  background: var(--tg-section-bg);
  box-shadow: 0 2px 12px rgba(21, 43, 57, 0.04);
}

.group__title {
  margin: 13px 0 7px;
  color: var(--tg-hint);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
}

.list-row {
  display: flex;
  min-height: 52px;
  padding: 10px 0;
  gap: 12px;
  align-items: flex-start;
  border-bottom: 1px solid var(--separator);
}

.list-row:last-child { border-bottom: 0; }

.list-row__icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.list-row__icon .icon { width: 18px; height: 18px; }
.list-row strong { display: block; margin: 2px 0; }
.list-row span { display: block; color: var(--tg-hint); font-size: 14px; }

.process-line {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.process-step {
  position: relative;
  min-width: 0;
  padding: 12px 8px;
  border-radius: 10px;
  background: var(--accent-soft);
  text-align: center;
}

.process-step b {
  display: grid;
  width: 26px;
  height: 26px;
  margin: 0 auto 8px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
}

.process-step span {
  display: block;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.25;
}

.accordion {
  width: 100%;
  min-height: 52px;
  padding: 12px 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.accordion__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 650;
}

.accordion__body {
  display: none;
  margin: 8px 0 2px;
  color: var(--tg-hint);
  font-size: 14px;
}

.accordion.is-open .accordion__body { display: block; }
.accordion.is-open .icon { transform: rotate(90deg); }

/* История кейса читается как компактная вертикальная шкала. */
.story {
  position: relative;
  margin: 20px 0;
  padding-left: 31px;
}

.story::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 17px;
  left: 11px;
  width: 2px;
  background: #cfe5ef;
}

.story-step {
  position: relative;
  min-height: 64px;
  padding-bottom: 18px;
}

.story-step::before {
  content: "";
  position: absolute;
  top: 4px;
  left: -25px;
  width: 12px;
  height: 12px;
  border: 3px solid var(--tg-bg);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px #b9dcea;
}

.story-step small {
  display: block;
  margin-bottom: 3px;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 750;
  text-transform: uppercase;
}

.story-step p { margin: 0; color: var(--tg-hint); font-size: 14px; }

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.gallery-shot {
  position: relative;
  min-height: 144px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--separator);
  border-radius: 11px;
  background: var(--tg-section-bg);
  cursor: pointer;
}

.gallery-shot .visual {
  min-height: 144px;
}

.gallery-shot .visual__device {
  top: 16px;
  width: 60px;
  height: 119px;
  padding: 10px 5px;
  border-width: 3px;
  border-radius: 12px;
}

.gallery-shot .visual__node { display: none; }

.gallery-shot__image {
  display: block;
  width: 100%;
  height: 144px;
  object-fit: cover;
  object-position: top center;
}

.info-note {
  display: flex;
  margin: 14px 0;
  padding: 13px;
  gap: 10px;
  align-items: flex-start;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 4px 10px 10px 4px;
  color: var(--tg-text);
  font-size: 14px;
}

/* Пошаговый бриф: один вопрос, крупные варианты, явный прогресс. */
.brief-head {
  position: sticky;
  z-index: 5;
  top: 0;
  margin: calc(-16px - var(--safe-top)) -16px 0;
  padding: calc(13px + var(--safe-top)) 16px 12px;
  background: var(--tg-bg);
  background: color-mix(in srgb, var(--tg-bg) 92%, transparent);
  backdrop-filter: blur(16px);
}

.brief-head__row {
  display: flex;
  margin-bottom: 9px;
  align-items: center;
  justify-content: space-between;
  color: var(--tg-hint);
  font-size: 14px;
  font-weight: 650;
}

.progress {
  height: 5px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(127, 141, 152, 0.18);
}

.progress__bar {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 180ms ease;
}

.brief-question {
  padding-top: 28px;
}

.brief-question h1 {
  max-width: 360px;
  margin-bottom: 8px;
}

.option-list {
  display: grid;
  margin-top: 22px;
  gap: 9px;
}

.option-card {
  display: grid;
  width: 100%;
  min-height: 54px;
  padding: 12px 14px;
  grid-template-columns: 26px 1fr;
  gap: 11px;
  align-items: center;
  border: 1px solid var(--separator);
  border-radius: var(--radius-control);
  background: var(--tg-section-bg);
  cursor: pointer;
  text-align: left;
}

.option-card__check {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border: 1.5px solid #b8c1c8;
  border-radius: 50%;
  color: transparent;
}

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

.option-card.is-selected .option-card__check {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.option-card.is-selected .option-card__check .icon {
  width: 15px;
  height: 15px;
  stroke-width: 2.4;
}

.field-label {
  display: block;
  margin: 18px 0 7px;
  color: var(--tg-hint);
  font-size: 14px;
  font-weight: 650;
}

.text-field,
.textarea-field {
  width: 100%;
  min-height: 50px;
  padding: 13px 14px;
  border: 1px solid var(--separator);
  border-radius: var(--radius-control);
  outline: none;
  background: var(--tg-section-bg);
  color: var(--tg-text);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.textarea-field {
  min-height: 150px;
  resize: vertical;
  line-height: 1.45;
}

.text-field:focus,
.textarea-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(42, 171, 238, 0.14);
}

.field-meta {
  display: flex;
  min-height: 32px;
  padding-top: 6px;
  justify-content: space-between;
  color: var(--tg-hint);
  font-size: 14px;
}

.validation-message {
  min-height: 22px;
  margin-top: 8px;
  color: #c44c4c;
  font-size: 14px;
}

/* Результат подбора показывает первый шаг до продажи. */
.route-hero {
  position: relative;
  margin: -16px -16px 18px;
  padding: 30px 18px 24px;
  overflow: hidden;
  background: linear-gradient(145deg, #dff4ff 0%, #effaff 55%, #e6f7f1 100%);
  border-bottom: 1px solid rgba(42, 171, 238, 0.16);
}

.route-hero__check {
  display: grid;
  width: 50px;
  height: 50px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 22px rgba(42, 171, 238, 0.25);
}

.route-card {
  position: relative;
  padding: 18px;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: #172a35;
  color: #fff;
  box-shadow: 0 12px 30px rgba(15, 38, 52, 0.18);
}

.route-card .tag { background: rgba(255,255,255,.14); color: #cfefff; }
.route-card h2 { margin: 13px 0 6px; }
.route-card p { margin: 0; color: rgba(255,255,255,.7); }
.route-card .meta-row { color: rgba(255,255,255,.68); }

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

.summary-list li {
  display: grid;
  min-height: 50px;
  padding: 10px 0;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  border-bottom: 1px solid var(--separator);
  font-size: 14px;
}

.summary-list li:last-child { border-bottom: 0; }
.summary-list span { color: var(--tg-hint); }
.summary-list strong { text-align: right; overflow-wrap: anywhere; }

/* Заявки используют статус и следующий шаг вместо тяжёлого кабинета. */
.request-card {
  width: 100%;
  min-height: 112px;
  padding: 15px;
  border: 1px solid var(--separator);
  border-radius: var(--radius-card);
  background: var(--tg-section-bg);
  cursor: pointer;
  text-align: left;
}

.request-card__top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.request-card__id { color: var(--tg-hint); font-size: 14px; }
.request-card h3 { margin: 4px 0; }
.request-card p { margin: 12px 0 0; color: var(--tg-hint); font-size: 14px; }

.status {
  display: inline-flex;
  min-height: 28px;
  padding: 5px 9px;
  align-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 750;
  white-space: nowrap;
}

.timeline {
  margin: 18px 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  position: relative;
  min-height: 55px;
  padding: 2px 0 18px 34px;
  color: var(--tg-hint);
}

.timeline li::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: 2px;
  left: 4px;
  width: 14px;
  height: 14px;
  border: 3px solid var(--tg-bg);
  border-radius: 50%;
  background: #c8d0d5;
}

.timeline li::after {
  content: "";
  position: absolute;
  top: 16px;
  bottom: -2px;
  left: 10px;
  width: 2px;
  background: #dce3e7;
}

.timeline li:last-child::after { display: none; }
.timeline li.is-done { color: var(--tg-text); }
.timeline li.is-done::before { background: #21b57d; }
.timeline li.is-current { color: var(--tg-text); font-weight: 700; }
.timeline li.is-current::before { background: var(--accent); box-shadow: 0 0 0 5px rgba(42,171,238,.14); }

.empty-state,
.success-state,
.error-state {
  display: flex;
  min-height: calc(100svh - 120px);
  padding: 30px 10px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.empty-state__visual,
.success-state__visual,
.error-state__visual {
  display: grid;
  width: 88px;
  height: 88px;
  margin-bottom: 22px;
  place-items: center;
  border-radius: 22px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.success-state__visual { background: #dcf7ee; color: #15936b; }
.error-state__visual { background: #ffe7e4; color: #c45149; }
.empty-state__visual .icon,
.success-state__visual .icon,
.error-state__visual .icon { width: 42px; height: 42px; }
.empty-state p,
.success-state p,
.error-state p { max-width: 290px; color: var(--tg-hint); }

/* Кнопки не меньше 44 px; главные действия — 54 px. */
.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  display: inline-flex;
  width: 100%;
  min-height: 52px;
  padding: 13px 18px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: var(--radius-control);
  font-weight: 750;
  cursor: pointer;
}

.primary-button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
}

.secondary-button {
  border: 1px solid rgba(42, 171, 238, 0.17);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.ghost-button {
  border: 1px solid var(--separator);
  background: transparent;
}

.danger-button {
  border: 1px solid rgba(204, 70, 70, 0.16);
  background: rgba(204, 70, 70, 0.08);
  color: #c34a4a;
}

button:disabled,
.is-disabled {
  opacity: 0.45;
  cursor: default;
}

.button-row {
  display: grid;
  margin-top: 14px;
  gap: 10px;
}

/* Нижняя навигация фиксирована как в мобильном приложении. */
.bottom-nav {
  position: fixed;
  z-index: 50;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  height: calc(var(--nav-height) + var(--content-bottom));
  padding: 5px max(7px, var(--safe-right)) var(--content-bottom) max(7px, var(--safe-left));
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--separator);
  background: var(--tg-section-bg);
  background: color-mix(in srgb, var(--tg-section-bg) 92%, transparent);
  backdrop-filter: blur(18px);
}

.bottom-nav[hidden] { display: none; }

.nav-item {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 54px;
  padding: 5px 2px 4px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 0;
  background: transparent;
  color: var(--tg-hint);
  cursor: pointer;
  font-size: 14px;
  line-height: 1.1;
}

.nav-item .icon { width: 23px; height: 23px; }
.nav-item.is-active { color: var(--accent-strong); }

.nav-badge {
  position: absolute;
  top: 2px;
  left: calc(50% + 7px);
  min-width: 22px;
  height: 22px;
  padding: 0 4px;
  border: 2px solid var(--tg-section-bg);
  border-radius: 11px;
  background: #e95151;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 18px;
}

.fallback-action {
  position: fixed;
  z-index: 60;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 10px max(16px, var(--safe-right)) calc(10px + var(--content-bottom)) max(16px, var(--safe-left));
  border-top: 1px solid var(--separator);
  background: var(--tg-section-bg);
  background: color-mix(in srgb, var(--tg-section-bg) 94%, transparent);
  backdrop-filter: blur(18px);
}

.fallback-action[hidden] { display: none; }

.telegram-runtime .fallback-action {
  display: none !important;
}

/* Нижний лист и полноэкранная галерея. */
.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  padding-top: max(40px, var(--safe-top));
  align-items: flex-end;
  justify-content: center;
  background: rgba(8, 17, 23, 0.42);
  animation: fade-in 140ms ease-out both;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  width: 100%;
  max-height: calc(100svh - 32px - var(--safe-top));
  padding: 8px 16px calc(18px + var(--content-bottom));
  overflow-y: auto;
  border-radius: 18px 18px 0 0;
  background: var(--tg-bg);
  box-shadow: 0 -12px 40px rgba(0,0,0,.18);
  animation: sheet-in 180ms ease-out both;
}

@keyframes sheet-in { from { transform: translateY(22px); } to { transform: translateY(0); } }

.sheet__handle {
  width: 36px;
  height: 4px;
  margin: 2px auto 15px;
  border-radius: 3px;
  background: rgba(117, 130, 140, 0.35);
}

.sheet__head {
  display: flex;
  min-height: 48px;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.sheet__head h2 { margin: 0; }

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 11px;
  background: rgba(127, 141, 152, 0.12);
  cursor: pointer;
}

.consent {
  display: grid;
  min-height: 54px;
  margin: 14px 0;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
  font-size: 14px;
}

.consent input {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--accent);
}

.consent a { color: var(--accent-strong); }

.gallery-modal {
  position: fixed;
  z-index: 110;
  inset: 0;
  display: flex;
  padding: calc(16px + var(--safe-top)) 16px calc(16px + var(--safe-bottom));
  flex-direction: column;
  background: #0e161c;
  color: #fff;
}

.gallery-modal__top {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
}

.gallery-modal__content {
  display: grid;
  min-height: 0;
  flex: 1;
  place-items: center;
}

.gallery-modal .visual {
  width: min(100%, 360px);
  height: min(70svh, 620px);
  border-radius: 18px;
}

.gallery-modal .gallery-shot__image {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(78svh, 720px);
  border-radius: 16px;
  object-fit: contain;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.36);
}

.toast-root {
  position: fixed;
  z-index: 130;
  top: calc(12px + var(--safe-top));
  right: 14px;
  left: 14px;
  pointer-events: none;
}

.toast {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 11px 14px;
  border-radius: 10px;
  background: rgba(22, 37, 46, 0.92);
  color: #fff;
  box-shadow: 0 8px 28px rgba(0,0,0,.2);
  font-size: 14px;
  animation: toast-in 180ms ease-out both;
}

@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* Состояние загрузки без блокирующей заставки. */
.loading-screen {
  max-width: 430px;
  margin: 0 auto;
  padding-top: 44px;
}

.loading-screen .brand-mark { margin-bottom: 26px; }

.skeleton {
  min-height: 126px;
  border-radius: var(--radius-card);
  background: linear-gradient(90deg, rgba(130,145,155,.12) 25%, rgba(130,145,155,.2) 50%, rgba(130,145,155,.12) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
}

.skeleton-title {
  width: 72%;
  min-height: 32px;
  margin-bottom: 22px;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@keyframes shimmer { to { background-position: -200% 0; } }

/* Тёмная тема адаптирует фирменные оттенки, сохраняя акцент Telegram. */
html[data-theme="dark"] {
  color-scheme: dark;
  --tg-bg: var(--tg-theme-bg-color, #18222d);
  --tg-secondary-bg: var(--tg-theme-secondary-bg-color, #111a22);
  --tg-section-bg: var(--tg-theme-section-bg-color, #202c38);
  --tg-text: var(--tg-theme-text-color, #f4f7f9);
  --tg-hint: var(--tg-theme-hint-color, #91a2ae);
  --accent: #2aabee;
  --accent-strong: #65c3f2;
  --accent-soft: rgba(42, 171, 238, 0.15);
  --separator: rgba(255,255,255,.09);
  --shadow: 0 8px 28px rgba(0,0,0,.12);
}

html[data-theme="dark"] .hero,
html[data-theme="dark"] .route-hero {
  background: linear-gradient(145deg, #183847 0%, #1c2f39 55%, #193a34 100%);
}

html[data-theme="dark"] .hero p { color: #9fb1bd; }
html[data-theme="dark"] .problem-card__arrow { color: rgba(255,255,255,.38); }
html[data-theme="dark"] .visual { filter: saturate(.82) brightness(.78); }
html[data-theme="dark"] .route-card { background: #0d171d; }
html[data-theme="dark"] .tag--recommended { background: rgba(32,178,126,.16); color: #70d8b3; }
html[data-theme="dark"] .draft-banner { background: rgba(42,171,238,.12); }
html[data-theme="dark"] .draft-banner__icon { background: rgba(255,255,255,.08); }

@media (min-width: 431px) {
  .screen {
    max-width: 430px;
    margin: 0 auto;
  }

  .bottom-nav,
  .fallback-action {
    right: 50%;
    left: auto;
    width: 430px;
    transform: translateX(50%);
  }

  .sheet {
    max-width: 430px;
  }
}

@media (max-width: 350px) {
  .screen { padding-right: 12px; padding-left: 12px; }
  .hero,
  .route-hero,
  .detail-cover { margin-right: -12px; margin-left: -12px; }
  .problem-grid { gap: 8px; }
  .problem-card { min-height: 120px; padding: 12px; }
  .stat-strip strong { font-size: 14px; }
  .summary-list li { grid-template-columns: 90px 1fr; }
}
