:root {
  --bg: #FFFBF5;
  --bg-elevated: #FFFFFF;
  --surface: #F7F4EE;
  --border: rgba(0, 0, 0, 0.08);
  --text-primary: #1A1A1A;
  --text-secondary: #525252;
  --text-muted: #8E8E93;
  --brand: #FF6B47;
  --brand-dark: #E5482A;
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.06);
  --max-width: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0D1117;
    --bg-elevated: #161B22;
    --surface: #1F2530;
    --border: rgba(255, 255, 255, 0.08);
    --text-primary: #F0F6FC;
    --text-secondary: #9DA7B3;
    --text-muted: #6E7681;
    --shadow-card: none;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.topbar {
  background: transparent;
  border-bottom: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
}
.topbar .container {
  padding-top: 16px;
  padding-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand {
  font-weight: 700;
  font-size: 18px;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-icon { font-size: 20px; }

/* Юридические страницы: обычная шапка без hero */
.doc-page .topbar {
  position: static;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}
.doc-page .brand {
  color: var(--text-primary);
  text-shadow: none;
}
.doc-page nav a {
  color: var(--text-secondary);
  text-shadow: none;
}
.doc-page nav a:hover { color: var(--brand); }
.doc-page main.container { padding-top: 24px; }

nav {
  margin-left: auto;
  display: flex;
  gap: 16px;
  align-items: center;
}
nav a {
  color: rgba(255,255,255,0.92);
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
nav a:hover { color: var(--brand); }

h1 {
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.5px;
}
.subtitle {
  color: var(--text-secondary);
  font-size: 16px;
  margin: 0 0 8px;
}
.updated {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 32px;
}

h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 36px 0 12px;
  color: var(--text-primary);
}
h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 24px 0 8px;
}
p { margin: 0 0 12px; color: var(--text-secondary); }
strong { color: var(--text-primary); }
ul, ol { padding-left: 24px; margin: 0 0 16px; color: var(--text-secondary); }
li { margin-bottom: 6px; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  padding: 150px 24px 40px;
  background: url('../img/hero.jpg') center center / cover no-repeat;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.30) 45%, rgba(0,0,0,0.70) 100%);
}
.hero-content { position: relative; z-index: 1; max-width: 1140px; width: 100%; }
.hero h1 {
  color: #fff;
  font-size: clamp(26px, 4.6vw, 52px);
  white-space: nowrap;
  margin: 0 0 16px;
  text-shadow: 0 2px 18px rgba(0,0,0,0.45);
}
.hero-sub {
  color: rgba(255,255,255,0.92);
  font-size: clamp(15px, 2.2vw, 19px);
  max-width: 600px;
  margin: 0 auto 28px;
  text-shadow: 0 1px 10px rgba(0,0,0,0.5);
}
.chips {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
  margin: 90px auto 0;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  white-space: nowrap;
  flex: 0 0 auto;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.chip:hover,
.chip.is-active {
  background: rgba(255,107,71,0.9);
  border-color: rgba(255,255,255,0.75);
}
.chip:active { transform: scale(0.97); }

.topic-panel {
  max-width: 560px;
  margin: 16px auto 0;
  padding: 18px 20px;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 16px;
  text-align: left;
  color: #fff;
  animation: topicFade 0.2s ease;
}
.topic-panel[hidden] { display: none !important; }
.topic-panel-title {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
}
.topic-panel-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255,255,255,0.9);
}
@keyframes topicFade {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.store-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 28px;
}
.store-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  padding: 13px 32px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 700;
  min-width: 160px;
}
.store-badge:hover { background: var(--brand); border-color: var(--brand); text-decoration: none; }
@media (max-width: 768px) {
  .topbar .container {
    flex-direction: column;
    gap: 16px;
    padding-top: 20px;
  }
  nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 16px;
  }
  .hero {
    padding-top: 180px;
    min-height: auto;
    padding-bottom: 60px;
  }
  .hero h1 { white-space: normal; }
  .chips {
    justify-content: flex-start;
    margin-top: 40px;
    padding-left: 24px;
    padding-right: 24px;
    width: 100vw;
    margin-left: -24px;
    -webkit-overflow-scrolling: touch;
  }
  .topic-panel {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
  }
  .app-access {
    margin-top: 40px;
  }
}
.cta-btn {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 6px 20px rgba(255, 107, 71, 0.3);
}
.cta-btn:hover { background: var(--brand-dark); text-decoration: none; }

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 0;
}
@media (min-width: 700px) {
  .cards { grid-template-columns: 1fr 1fr 1fr; }
}
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-card);
}
.card h3 { margin-top: 0; }

footer {
  border-top: 1px solid var(--border);
  margin-top: 64px;
  padding: 32px 0;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

.app-access {
  margin-top: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.qr-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.qr-block img {
  width: 150px;
  height: 150px;
  border-radius: 16px;
  border: 4px solid #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  background: #fff;
}
.btn-mobile-app {
  display: none;
  background: var(--brand);
  color: #fff;
  padding: 16px 32px;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(255, 107, 71, 0.3);
}
.btn-mobile-app:hover {
  background: #ff5233;
  text-decoration: none;
}

/* SEO посадочные категорий */
.service-page .breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 16px;
}
.service-page .breadcrumb a { color: var(--text-secondary); }
.service-cta {
  margin: 24px 0 8px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: center;
}
.service-cta-bottom { margin-top: 40px; }
.service-cta-hint {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}
.service-list, .service-steps, .related-services {
  color: var(--text-secondary);
}
.faq-item {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.faq-item h3 {
  margin: 0 0 6px;
  font-size: 16px;
}
.faq-item p { margin: 0; }
.service-note { margin-top: 24px; }
.catalog-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 600px) {
  .catalog-grid { grid-template-columns: 1fr 1fr 1fr; }
}
.catalog-grid a {
  display: block;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}
.catalog-grid a:hover {
  border-color: var(--brand);
  color: var(--brand);
}
a.chip {
  text-decoration: none;
}
a.chip:hover { text-decoration: none; }

@media (max-width: 768px) {
  .qr-block { display: none; }
  .btn-mobile-app { display: inline-flex; }
}

