/* ============================================================
   1. TOKENS, RESET, BASE
   ============================================================ */
:root {
  --bg-color: #fafbfa;
  --card-bg: #ffffff;
  --soft-section-bg: #f5f7f6;
  --primary-text: #1d1d1f;
  --secondary-text: #86868b;
  --muted-text: #86868b;
  --accent: #2f8f7a;
  --accent-dark: #1e5a4d;
  --accent-soft: #e8f5f2;
  --border-color: #e5eaea;

  --font-family: -apple-system, BlinkMacSystemFont, "Inter", Roboto, sans-serif;
  --container-max-width: 1240px;
  --btn-height: 56px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 28px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  --header-height-desktop: 68px;
  --header-height-mobile: 62px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --home-shell-width: 1100px;
  --home-hero-height: 430px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { overflow-x: hidden; }
body {
  font-family: var(--font-family);
  background: var(--bg-color);
  color: var(--primary-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
body.home-page, body.sub-page { padding-top: calc(var(--header-height-desktop) + var(--safe-top)); }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; }
.container { max-width: var(--container-max-width); margin: 0 auto; padding: 0 24px; }

/* ============================================================
   2. TYPOGRAPHY
   ============================================================ */
.light-title {
  font-weight: 300;
  font-size: clamp(3.5rem, 8vw, 4.5rem);
  letter-spacing: -0.04em;
  line-height: 1.2;
  color: var(--primary-text);
  margin-bottom: 24px;
}
.light-desc {
  font-weight: 300;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
  color: var(--secondary-text);
  max-width: 600px;
  line-height: 1.6;
  margin: 0 auto 40px;
}

/* ============================================================
   3. BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--btn-height);
  padding: 0 32px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-family: var(--font-family);
  text-align: center;
  box-sizing: border-box;
}
.btn-primary { background-color: var(--accent); color: #fff; letter-spacing: 0.01em; }
.btn-primary:hover {
  background-color: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(47, 143, 122, 0.2);
}
.btn-primary:active { transform: translateY(0); box-shadow: 0 4px 8px rgba(47, 143, 122, 0.2); }
.btn-secondary { background-color: transparent; color: var(--primary-text); border: 1px solid var(--border-color); }
.btn-secondary:hover { border-color: var(--accent); background-color: var(--accent-soft); color: var(--accent-dark); }
.btn-secondary:active { background-color: rgba(47, 143, 122, 0.1); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn-disabled { opacity: 0.5 !important; pointer-events: none !important; cursor: not-allowed !important; }

/* ============================================================
   4. HEADER & FOOTER
   ============================================================ */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  width: 100%;
  z-index: 9999;
  background: rgba(250, 250, 252, 0.82);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid rgba(17, 17, 17, 0.06);
  padding-top: var(--safe-top);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height-desktop);
  gap: 16px;
}
.logo { font-size: 20px; font-weight: 600; color: var(--primary-text); white-space: nowrap; }
.nav { display: flex; gap: 32px; }
.nav a { font-size: 15px; font-weight: 500; color: var(--secondary-text); transition: var(--transition); }
.nav a:hover { color: var(--primary-text); }
.header-btn,
.home-hero-actions .btn.btn-primary {
  min-width: 138px;
  min-height: 40px;
  padding: 0 16px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.18);
  color: #1d1d1f;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.42), 0 10px 24px rgba(15,23,42,.08);
}
.header-btn:hover,
.home-hero-actions .btn.btn-primary:hover {
  background: rgba(255,255,255,.26);
  color: #111;
  border-color: rgba(255,255,255,.52);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 14px 28px rgba(15,23,42,.1);
}
/* Header navigation — shared across all pages */
.site-header-nav { display: flex; gap: 4px; align-items: center; }
.site-header-link { padding: 7px 16px; border-radius: 50px; font-size: 14px; font-weight: 500; color: var(--secondary-text); text-decoration: none; transition: color .15s, background .15s; }
.site-header-link:hover { color: var(--primary-text); background: var(--soft-section-bg); }
.site-header-link--active { color: var(--primary-text); font-weight: 600; }

/* Mobile hamburger */
.site-hamburger { display: none; background: none; border: none; cursor: pointer; padding: 8px; margin: -8px -4px -8px 4px; color: var(--primary-text); }
.site-hamburger svg { display: block; }

/* Mobile menu overlay */
.site-mobile-menu { display: none; position: fixed; inset: 0; z-index: 10000; background: rgba(250,250,252,.97); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.site-mobile-menu.open { display: flex; animation: mMenuIn .2s ease; }
@keyframes mMenuIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.site-mobile-link { font-size: 22px; font-weight: 500; color: var(--secondary-text); text-decoration: none; padding: 12px 32px; border-radius: 16px; transition: color .15s, background .15s; }
.site-mobile-link:hover, .site-mobile-link--active { color: var(--primary-text); background: var(--soft-section-bg); }
.site-mobile-close { position: absolute; top: 20px; right: 20px; background: none; border: none; font-size: 24px; cursor: pointer; padding: 8px; color: var(--secondary-text); line-height: 1; }
.site-mobile-auth { margin-top: 16px; }

@media (max-width: 600px) {
  .site-header-nav { display: none; }
  .site-hamburger { display: block; }
}

.footer { background: #fff; padding: 60px 20px; border-top: 1px solid var(--border-color); padding-bottom: calc(60px + var(--safe-bottom)); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1.5fr; gap: 48px; margin-bottom: 64px; }
.footer-brand { display: flex; flex-direction: column; gap: 16px; }
.footer-logo { font-size: 20px; font-weight: 600; color: var(--primary-text); }
.footer-disclaimer { font-size: 13px; color: var(--muted-text); line-height: 1.6; }
.footer-nav-group { display: flex; flex-direction: column; gap: 16px; }
.footer-nav-title { font-size: 14px; font-weight: 600; color: var(--primary-text); }
.footer-links-col { display: flex; flex-direction: column; gap: 12px; }
.footer-links-col a { font-size: 14px; color: var(--secondary-text); transition: var(--transition); }
.footer-links-col a:hover { color: var(--primary-text); }
.footer-telegram { background-color: var(--soft-section-bg); border-radius: var(--radius-md); padding: 24px; }
.footer-telegram-title { font-size: 16px; font-weight: 600; color: var(--primary-text); margin-bottom: 8px; }
.footer-telegram-text { font-size: 14px; color: var(--secondary-text); line-height: 1.5; margin-bottom: 16px; }
.footer-telegram-link { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--accent-dark); transition: var(--transition); }
.footer-telegram-link:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--border-color); padding-top: 32px; display: flex; justify-content: space-between; align-items: center; }
.footer-copy { font-size: 14px; color: var(--muted-text); }

/* ============================================================
   5. HOME PAGE
   ============================================================ */
body.home-page {
  background: radial-gradient(circle at top, rgba(255,255,255,.92), rgba(245,245,247,1) 48%), #f5f5f7;
}
.home-main { width: 100%; }
.home-hero-section { padding: 14px 0 16px; }
.home-hero-card, .home-benefits-grid, .plans-panel, .home-flagship .plan-flagship {
  width: min(var(--home-shell-width), calc(100vw - 64px));
  margin: 0 auto;
}
.home-hero-card {
  position: relative;
  overflow: hidden;
  min-height: var(--home-hero-height);
  border-radius: 24px;
  background: linear-gradient(180deg, #fff 0%, #f8f8fa 100%);
  border: 1px solid #e3e5e8;
  box-shadow: 0 14px 36px rgba(15,23,42,.035);
}
.home-hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.06) 34%, rgba(255,255,255,.42) 52%, rgba(255,255,255,.72) 66%, rgba(255,255,255,.88) 82%, rgba(255,255,255,.94) 100%);
}
.home-hero-media { position: relative; z-index: 1; min-height: var(--home-hero-height); height: var(--home-hero-height); }
.home-hero-image { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center center; }
.home-hero-copy {
  position: absolute;
  top: 57%;
  left: 66%;
  transform: translate(-50%, -50%);
  width: min(620px, calc(100% - 72px));
  z-index: 3;
  text-align: center;
}
.home-hero-title {
  max-width: 720px;
  margin: 0 auto 14px;
  font-size: clamp(2.15rem, 3.1vw, 3.25rem);
  line-height: 1.04;
  letter-spacing: -0.038em;
  font-weight: 300;
  color: #111;
  text-shadow: 0 1px 1px rgba(255,255,255,.22);
}
.home-hero-text { max-width: 520px; margin: 0 auto 18px; color: #4f4f57; font-size: 15px; line-height: 1.5; font-weight: 400; }
.home-hero-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.home-hero-actions .btn.btn-secondary {
  min-width: 138px;
  min-height: 40px;
  padding: 0 16px;
  font-size: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  color: #1d1d1f;
  border: 1px solid rgba(255,255,255,.34);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 8px 24px rgba(15,23,42,.06);
}
.home-hero-actions .btn.btn-secondary:hover { background: rgba(255,255,255,.2); color: #111; border-color: rgba(255,255,255,.46); }
.home-benefits { margin-top: 16px; }
.home-benefits-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.benefit-card {
  min-height: 320px;
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, #fff 0%, #f8f8fa 100%);
  border: 1px solid #e3e5e8;
  box-shadow: 0 14px 36px rgba(15,23,42,.035);
}
.benefit-media { height: 200px; margin-bottom: 16px; border-radius: 16px; overflow: hidden; background: #f3f4f6; }
.benefit-image { width: 100%; height: 100%; display: block; object-fit: cover; }
.benefit-copy { display: flex; flex-direction: column; gap: 10px; }
.benefit-title { font-size: 17px; line-height: 1.14; letter-spacing: -0.015em; font-weight: 500; color: #111; }
.benefit-text { font-size: 12px; line-height: 1.45; color: #7d7d84; }
.home-plans { margin-top: 18px; }
.plans-panel {
  padding: 28px 24px 24px;
  border-radius: 28px;
  background: linear-gradient(180deg, #fff 0%, #f8f8fa 100%);
  border: 1px solid #e3e5e8;
  box-shadow: 0 14px 36px rgba(15,23,42,.035);
}
.plans-heading { width: 100%; max-width: 720px; margin: 0 auto 22px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.plans-title { width: 100%; margin: 0 0 8px; font-size: clamp(2.05rem, 3vw, 3.05rem); line-height: 1.05; letter-spacing: -0.036em; font-weight: 300; color: #111; }
.plans-text { width: 100%; margin: 0; font-size: 14px; line-height: 1.45; color: #7d7d84; }
.plans-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.plan-card { min-height: 320px; padding: 16px; border-radius: 22px; background: linear-gradient(180deg, #fff 0%, #f8f8fa 100%); border: 1px solid #e3e5e8; }
.plan-media { height: 170px; margin-bottom: 14px; border-radius: 16px; overflow: hidden; background: #f3f4f6; }
.plan-image { width: 100%; height: 100%; display: block; object-fit: cover; }
.plan-meta { min-height: 120px; display: flex; flex-direction: column; gap: 6px; }
.plan-level { font-size: 10px; letter-spacing: 0.11em; font-weight: 500; color: #9a9aa1; text-transform: uppercase; }
.plan-duration { font-size: 18px; line-height: 1.08; letter-spacing: -0.015em; font-weight: 600; color: #111; }
.plan-price { font-size: 14px; line-height: 1.35; color: #7d7d84; margin-bottom: auto; }
.plan-button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 16px; font-size: 12px; border-radius: 999px; background: #1d1d1f; color: #fff; transition: var(--transition); }
.plan-button:hover { background: #2b2b2f; transform: translateY(-1px); }
.home-flagship { margin-top: 18px; }
.home-flagship .plan-flagship {
  min-height: 300px;
  padding: 20px 22px;
  border-radius: 28px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 20px;
  align-items: center;
  background: linear-gradient(180deg, #161618 0%, #0f0f10 100%);
  border: 1px solid rgba(255,255,255,.08);
  color: #fff;
  box-shadow: 0 20px 48px rgba(15,23,42,.16);
}
.plan-flagship-media { height: 210px; margin-bottom: 0; border-radius: 18px; overflow: hidden; background: #1d1d1f; }
.plan-flagship-image { width: 100%; height: 100%; display: block; object-fit: cover; }
.plan-flagship-meta { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; justify-content: center; text-align: left; }
.plan-level--light { color: rgba(255,255,255,.62); }
.plan-flagship-duration { font-size: 22px; line-height: 1.06; letter-spacing: -0.02em; font-weight: 600; color: #fff; }
.plan-flagship-price { font-size: 16px; line-height: 1.35; color: rgba(255,255,255,.8); }
.plan-flagship-note { font-size: 13px; line-height: 1.45; color: rgba(255,255,255,.62); margin-bottom: 8px; }
.plan-button--light { min-width: 150px; min-height: 40px; font-size: 12px; border-radius: 999px; background: #fff; color: #111; }
.plan-button--light:hover { background: #f2f2f4; }

/* ============================================================
   6. APP & CONNECT PAGES
   ============================================================ */
.app-content { max-width: 800px; margin: 0 auto; padding: 64px 24px 120px; }
.app-title { font-size: 32px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 12px; color: var(--primary-text); }
.app-subtitle { font-size: 16px; color: var(--secondary-text); line-height: 1.6; margin-bottom: 32px; max-width: 680px; }
.app-card { background-color: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 40px; margin-bottom: 24px; box-shadow: 0 8px 32px rgba(0,0,0,.04); transition: var(--transition); }
.app-card:hover { box-shadow: 0 12px 48px rgba(0,0,0,.06); }
body:not(.home-page) .card-title { font-size: 20px; font-weight: 600; color: var(--primary-text); margin-bottom: 10px; }
body:not(.home-page) .card-subtitle { font-size: 14px; color: var(--secondary-text); line-height: 1.6; margin-bottom: 24px; }
.section-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; padding: 6px 14px; border-radius: 100px; background-color: var(--accent-soft); color: var(--accent-dark); margin-bottom: 20px; }
.section-label { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; color: var(--primary-text); line-height: 1.2; }
.app-muted { font-size: 14px; color: var(--secondary-text); line-height: 1.55; }
.auth-grid { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; width: 100%; }
.app-input, .link-input {
  flex: 1 1 200px;
  min-width: 0;
  background: var(--bg-color);
  color: var(--primary-text);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 20px;
  font-size: 16px;
  min-height: var(--btn-height);
  outline: none;
  transition: var(--transition);
  font-family: var(--font-family);
}
.link-input { text-transform: uppercase; }
.app-input:focus, .link-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(47,143,122,.1); }
.auth-grid .btn { flex: 0 0 auto; min-width: 160px; }
body:not(.home-page) .access-card { background-color: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 24px; margin-bottom: 16px; transition: var(--transition); }
body:not(.home-page) .access-card:hover { border-color: rgba(47,143,122,.3); box-shadow: 0 4px 16px rgba(0,0,0,.03); }
.access-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border-color); }
.access-title { font-size: 18px; font-weight: 600; color: var(--primary-text); margin-bottom: 4px; }
.access-subtitle { font-size: 14px; color: var(--secondary-text); }
.access-status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; padding: 6px 14px; border-radius: 100px; }
.status-active, .status-linked { background-color: var(--accent-soft); color: var(--accent-dark); }
.status-pending, .status-unlinked { background-color: #fff3e0; color: #e65100; }
.access-details { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 24px; }
.detail-row { display: flex; flex-direction: column; gap: 6px; background: var(--bg-color); padding: 16px; border-radius: var(--radius-sm); border: 1px solid var(--border-color); }
.detail-label, .user-info-label { font-size: 13px; color: var(--secondary-text); font-weight: 500; }
.detail-value { font-size: 14px; color: var(--primary-text); font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; word-break: break-all; overflow-wrap: break-word; max-height: 100px; overflow-y: auto; }
.detail-value a, .legal-label a { color: var(--accent); }
.detail-value a:hover, .legal-label a:hover { text-decoration: underline; }
.access-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.user-info { display: flex; gap: 32px; margin-bottom: 32px; padding: 24px; background-color: var(--soft-section-bg); border-radius: var(--radius-md); border: 1px solid var(--border-color); }
.user-info-item { display: flex; flex-direction: column; gap: 6px; }
.user-info-value { font-size: 16px; font-weight: 600; color: var(--primary-text); }
.link-card { background-color: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 32px; margin-bottom: 24px; }
.link-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.link-title { font-size: 18px; font-weight: 600; color: var(--primary-text); margin-bottom: 8px; }
.link-subtitle { font-size: 14px; color: var(--secondary-text); line-height: 1.6; }
.link-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; margin-top: 24px; }
.link-help { margin-top: 16px; font-size: 13px; color: var(--secondary-text); line-height: 1.6; }
.link-help a { color: var(--accent-dark); text-decoration: underline; text-decoration-color: transparent; transition: var(--transition); }
.link-help a:hover { text-decoration-color: var(--accent-dark); }
.link-success { margin-top: 20px; padding: 16px 20px; background: var(--accent-soft); color: var(--accent-dark); border-radius: var(--radius-md); font-size: 14px; line-height: 1.6; border: 1px solid rgba(47,143,122,.2); }
.empty-state { text-align: center; padding: 64px 24px; color: var(--secondary-text); background-color: var(--soft-section-bg); border-radius: var(--radius-lg); border: 1px dashed var(--border-color); font-size: 16px; }
.account-box { margin-top: 24px; padding: 20px; background: var(--soft-section-bg); border-radius: var(--radius-md); display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border: 1px solid var(--border-color); }
.account-text { font-size: 15px; color: var(--primary-text); line-height: 1.6; }
.legal-check-wrapper { margin: 24px 0; text-align: left; }
.legal-label { display: flex; gap: 12px; cursor: pointer; font-size: 14px; color: var(--secondary-text); line-height: 1.5; align-items: flex-start; }
.legal-label input { width: 20px; height: 20px; cursor: pointer; margin-top: 2px; accent-color: var(--accent); }
.hidden { display: none !important; }
.status { white-space: pre-wrap; line-height: 1.6; word-break: break-word; font-size: 14px; color: var(--secondary-text); }

/* ============================================================
   7. FAQ
   ============================================================ */
.faq-container { max-width: 800px; margin: 0 auto; }
.accordion { display: flex; flex-direction: column; gap: 16px; }
.accordion-item { background: var(--card-bg); border-radius: var(--radius-md); box-shadow: 0 4px 12px rgba(0,0,0,.03); overflow: hidden; transition: var(--transition); }
.accordion-item:hover { box-shadow: 0 8px 24px rgba(0,0,0,.06); }
.accordion-header { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 24px; background: none; border: none; cursor: pointer; text-align: left; font-size: 1.1rem; font-weight: 500; color: var(--primary-text); font-family: var(--font-family); }
.accordion-icon { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--soft-section-bg); color: var(--accent); transition: transform .3s ease; flex-shrink: 0; margin-left: 16px; }
.accordion-item.active .accordion-icon { transform: rotate(180deg); background: var(--accent); color: #fff; }
.accordion-content { max-height: 0; overflow: hidden; transition: max-height .3s ease-out; }
.accordion-body { padding: 0 24px 24px; color: var(--secondary-text); line-height: 1.6; }

/* ============================================================
   8. RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .home-hero-card, .home-benefits-grid, .plans-panel, .home-flagship .plan-flagship { width: 100%; }
  .home-hero-card::after { background: linear-gradient(180deg, rgba(255,255,255,.1) 0%, rgba(255,255,255,.28) 48%, rgba(255,255,255,.82) 78%, rgba(255,255,255,.94) 100%); }
  .home-hero-card { min-height: 400px; }
  .home-hero-media { min-height: 400px; height: 400px; }
  .home-hero-copy { left: 50%; top: 66%; width: min(560px, calc(100% - 28px)); }
  .home-hero-title { font-size: 2.45rem; }
  .home-benefits-grid, .plans-grid, .home-flagship .plan-flagship { grid-template-columns: 1fr; }
  .benefit-card, .plan-card { min-height: unset; }
  .benefit-media { height: 180px; }
  .home-flagship .plan-flagship { min-height: unset; }
  .plan-flagship-media { height: 220px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
  .footer-brand { grid-column: span 2; max-width: 600px; }
}

@media (max-width: 768px) {
  body.home-page, body.sub-page { padding-top: calc(var(--header-height-mobile) + var(--safe-top)); }
  .header { background: rgba(250,250,252,.82); backdrop-filter: blur(16px) saturate(135%); -webkit-backdrop-filter: blur(16px) saturate(135%); }
  .header-inner { min-height: var(--header-height-mobile); }
  .nav { display: none; }
  .container { padding-left: 14px; padding-right: 14px; }
  .light-title { font-size: 2.2rem !important; margin-bottom: 16px; }
  .light-desc { font-size: 1rem !important; margin-bottom: 24px; }
  .home-hero-card { width: 100%; min-height: 430px; border-radius: 26px; }
  .home-hero-media, .home-hero-image { min-height: 430px; height: 430px; }
  .home-hero-card::after { background: linear-gradient(180deg, rgba(255,255,255,.04) 0%, rgba(255,255,255,.16) 44%, rgba(255,255,255,.78) 74%, rgba(255,255,255,.92) 100%); }
  .home-hero-copy { left: 50%; top: 70%; width: calc(100% - 28px); }
  .home-hero-title { font-size: clamp(2.2rem, 8vw, 3rem); line-height: 1.02; letter-spacing: -0.04em; font-weight: 300; margin-bottom: 12px; }
  .home-hero-text { max-width: 320px; margin: 0 auto 16px; font-size: 14px; line-height: 1.45; }
  .home-hero-actions { gap: 10px; }
  .home-hero-actions .btn, .header-btn { min-width: 132px; min-height: 42px; padding: 0 16px; border-radius: 999px; font-size: 13px; }
  .home-benefits { display: none; }
  .home-plans { margin-top: 14px; }
  .plans-panel { width: 100%; padding: 22px 14px 14px; border-radius: 26px; }
  .plans-heading { max-width: 320px; margin-bottom: 14px; }
  .plans-title { font-size: clamp(2rem, 8vw, 2.8rem); line-height: 1.02; letter-spacing: -0.04em; font-weight: 300; margin-bottom: 8px; }
  .plans-text { font-size: 14px; }
  .plans-grid { gap: 14px; }
  .plan-card, .home-flagship .plan-flagship { width: 100%; min-height: unset; padding: 14px; border-radius: 26px; }
  .plan-card { background: #fff; border: 1px solid rgba(17,17,17,.08); box-shadow: none; }
  .plan-media, .plan-flagship-media { height: 240px; margin-bottom: 14px; border-radius: 18px; overflow: hidden; }
  .plan-meta, .plan-flagship-meta { min-height: unset; gap: 6px; padding: 0 2px; align-items: flex-start; text-align: left; }
  .plan-level { font-size: 11px; letter-spacing: 0.14em; }
  .plan-duration, .plan-flagship-duration { font-size: 18px; line-height: 1.08; }
  .plan-price, .plan-flagship-price { font-size: 15px; }
  .plan-price { margin-bottom: 10px; }
  .plan-flagship-note { font-size: 14px; margin-bottom: 10px; }
  .plan-button, .plan-button--light { width: 100%; min-height: 44px; font-size: 13px; margin-top: 6px; }
  .home-flagship { margin-top: 14px; }
  .home-flagship .plan-flagship { display: block; }
  .footer { padding: 28px 0 18px; margin-top: 18px; }
  .footer-grid { grid-template-columns: 1fr; gap: 22px; margin-bottom: 24px; }
  .footer-brand, .footer-nav-group, .footer-telegram { gap: 10px; }
  .footer-logo { font-size: 16px; }
  .footer-disclaimer, .footer-links-col a, .footer-telegram-text, .footer-copy { font-size: 13px; line-height: 1.45; }
  .footer-nav-title, .footer-telegram-title { font-size: 14px; margin-bottom: 6px; }
  .footer-links-col { gap: 8px; }
  .footer-telegram { padding: 18px; border-radius: 18px; }
  .footer-bottom { padding-top: 18px; margin-top: 0; }
}

@media (max-width: 640px) {
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 16px; }
  .auth-grid, .link-form { flex-direction: column; }
  .auth-grid .btn, .link-form .btn { width: 100%; }
  .app-input, .link-input { min-height: 48px; font-size: 15px; width: 100%; box-sizing: border-box; flex: none; }
  .access-header, .link-header, .user-info { flex-direction: column; gap: 12px; }
  .user-info { gap: 16px; }
  .app-card { padding: 20px; }
}

/* --- HERO CTA LIKE PLAN BUTTON --- */
.home-hero-actions .btn,
.home-hero-actions .btn.btn-primary {
  min-width: 176px !important;
  height: 46px !important;
  padding: 0 24px !important;
  border-radius: 999px !important;
  background: #1d1d1f !important;
  color: #ffffff !important;
  border: 1px solid #1d1d1f !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  font-size: 14px !important;
  font-weight: 500 !important;
}

.home-hero-actions .btn:hover,
.home-hero-actions .btn.btn-primary:hover {
  background: #2b2b2f !important;
  border-color: #2b2b2f !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
}

@media (max-width: 768px) {
  .home-hero-actions .btn,
  .home-hero-actions .btn.btn-primary {
    min-width: 168px !important;
    height: 44px !important;
    font-size: 13px !important;
  }
}


/* --- SAFE22 APP DESKTOP REWORK --- */
body.app-page .app-content {
  max-width: 1180px;
  padding: 40px 24px 120px;
}

.dashboard-shell {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-top: 56px; /* высота quick-nav чтобы не перекрывал hero */
}

/* --- Quick nav (всегда видна под шапкой) --- */
.app-quick-nav {
  position: fixed;
  top: calc(var(--header-height-desktop) + var(--safe-top));
  left: 0;
  right: 0;
  z-index: 200;
  background: #fafafc;
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  border-bottom: 1px solid rgba(17, 17, 17, 0.09);
  padding: 10px 24px;
}

.app-quick-nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.app-quick-nav-inner::-webkit-scrollbar { display: none; }

.app-nav-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--secondary-text);
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.14);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  transition: var(--transition);
}
.app-nav-pill:hover {
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-color: rgba(47, 143, 122, 0.4);
  box-shadow: none;
}
.app-nav-pill.active {
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-color: rgba(47, 143, 122, 0.5);
  box-shadow: none;
  font-weight: 600;
}
/* Main section switcher tabs (Доступ / Магазин) */
.app-main-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  background: var(--soft-section-bg);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 4px;
}
.app-main-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--secondary-text);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: var(--font-family);
}
.app-main-tab:hover {
  color: var(--primary-text);
}
.app-main-tab.active {
  background: var(--card-bg);
  color: var(--primary-text);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(15,23,42,.08);
}
.app-main-tab-panel {
  display: block;
}

/* Секции учитывают высоту шапки + nav при якорном скролле */
#activeAccessSection,
#pendingOrdersSection,
#buyTariffSection,
#instructionsSection,
#telegramSection,
#helpSection {
  scroll-margin-top: calc(var(--header-height-desktop) + var(--safe-top) + 56px + 8px);
}

.dashboard-summary-card,
.dashboard-hero-card,
.dashboard-instructions-card,
.dashboard-service-card {
  border-radius: 28px;
  border: 1px solid #e3e5e8;
  box-shadow: 0 14px 36px rgba(15,23,42,.035);
}

.dashboard-summary-grid,
.dashboard-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  gap: 24px;
  align-items: start;
}

.dashboard-summary-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.dashboard-main-title {
  font-size: 30px;
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.dashboard-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.dashboard-metrics-grid--compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 20px;
}

.dashboard-metric-card {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 16px 18px;
  min-width: 0;
}

.dashboard-metric-label,
.dashboard-link-label {
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--secondary-text);
  margin-bottom: 8px;
}

.dashboard-metric-value {
  font-size: 16px;
  line-height: 1.4;
  color: var(--primary-text);
  font-weight: 600;
  word-break: break-word;
}

.dashboard-hero-title {
  font-size: 34px;
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin-bottom: 10px;
}

.dashboard-hero-subtitle,
.dashboard-section-subtitle {
  max-width: 620px;
  margin-bottom: 0;
}

.dashboard-link-panel {
  background: linear-gradient(180deg, #fff 0%, #f8f8fa 100%);
  border: 1px solid var(--border-color);
  border-radius: 22px;
  padding: 22px;
}

.dashboard-link-box {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--primary-text);
  word-break: break-word;
}

.dashboard-link-box a,
.dashboard-link-box span {
  color: var(--primary-text);
}

.dashboard-link-box--soft {
  background: #fff;
}

.dashboard-link-actions {
  margin-top: 16px;
}

.dashboard-renew-row {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
}

.dashboard-inline-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.dashboard-inline-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: #f5f7f6;
  border: 1px solid var(--border-color);
  font-size: 13px;
  color: var(--primary-text);
}

.dashboard-section-head {
  margin-bottom: 18px;
}

.dashboard-section-title {
  font-size: 28px;
  line-height: 1.04;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.dashboard-device-tabs {
  gap: 10px;
}

.dashboard-install-grid,
.dashboard-service-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.dashboard-service-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-install-card,
.dashboard-steps-card {
  background: var(--soft-section-bg);
  border: 1px solid var(--border-color);
  border-radius: 22px;
  padding: 22px;
}

.dashboard-install-title {
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--primary-text);
  font-weight: 600;
  margin-bottom: 8px;
}

.dashboard-steps-card {
  margin-top: 18px;
  background: #fff;
}

.dashboard-help-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dashboard-help-item {
  background: var(--soft-section-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--primary-text);
}

body.app-page .section-badge,
body.app-page .status-active,
body.app-page .status-linked {
  background: #f3f4f6;
  color: #1d1d1f;
}

body.app-page .app-input:focus,
body.app-page .link-input:focus {
  border-color: #1d1d1f;
  box-shadow: 0 0 0 4px rgba(29,29,31,.08);
}

@media (max-width: 991px) {
  body.app-page .app-content {
    max-width: 800px;
    padding: 28px 14px 96px;
  }

  .dashboard-summary-grid,
  .dashboard-hero-grid,
  .dashboard-install-grid,
  .dashboard-service-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-metrics-grid,
  .dashboard-metrics-grid--compact {
    grid-template-columns: 1fr;
  }

  .dashboard-main-title,
  .dashboard-hero-title,
  .dashboard-section-title {
    font-size: 24px;
  }
}

/* ============================================================
   9. DASHBOARD LAYOUT REWORK
   ============================================================ */

/* Instructions section: 3 отдельных блока с отступами между ними */
.inst-section-wrap {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Отменяем margin-bottom у app-card внутри inst-section-wrap,
   т.к. spacing управляется через gap */
.inst-section-wrap .app-card,
.inst-section-wrap .dashboard-install-grid {
  margin-bottom: 0;
}

/* Карточка с device-tabs: чуть компактнее по padding */
.inst-device-strip {
  padding: 28px 32px;
}

/* Карточки скачивания и ссылки: flex-колонка чтобы кнопка всегда снизу */
.inst-step-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
}

/* Последний элемент в карточке (кнопка или copy-wrapper) — прижимается к низу */
.inst-step-card > div:last-child {
  margin-top: auto;
  padding-top: 16px;
}

/* Карточка со шагами */
.inst-steps-card {
  padding: 32px;
}

/* No-active layout: помощь + telegram в 2-col */
.dashboard-noactive-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

/* No-active: buyTariffSection занимает полную ширину,
   внутренняя сетка тарифов auto-fit расставит карточки сама */
#buyTariffSection.app-card {
  margin-bottom: 0;
}

@media (max-width: 991px) {
  .dashboard-noactive-grid {
    grid-template-columns: 1fr;
  }
  .inst-device-strip,
  .inst-step-card,
  .inst-steps-card {
    padding: 22px;
  }
}

/* ============================================================
   10. INSTRUCTIONS SECTION STYLES
   ============================================================ */

/* Step badge: "01", "02", "03" */
.inst-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--primary-text);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 14px;
  flex-shrink: 0;
}

/* Card title inside install cards */
.inst-card-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--primary-text);
  margin-bottom: 8px;
  line-height: 1.2;
}

/* Steps header: badge + title side by side */
.inst-steps-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}
.inst-steps-header .inst-step-badge {
  margin-bottom: 0;
  margin-top: 2px;
}

/* Steps 2-col grid */
.inst-steps-grid {
  column-count: 2;
  column-gap: 32px;
}

/* Single step row */
.inst-step-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
  break-inside: avoid;
}
.inst-step-row:last-child {
  border-bottom: none;
}

/* Step circle number */
.inst-step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--soft-section-bg);
  border: 1px solid var(--border-color);
  font-size: 11px;
  font-weight: 700;
  color: var(--secondary-text);
  flex-shrink: 0;
  margin-top: 2px;
}

/* Step text */
.inst-step-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--primary-text);
}

/* Footer success bar */
.inst-steps-footer {
  margin-top: 20px;
  padding: 13px 18px;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-dark);
}

@media (max-width: 768px) {
  .inst-steps-grid {
    column-count: 1;
  }
  .inst-steps-header {
    gap: 12px;
  }
  .app-quick-nav {
    top: calc(var(--header-height-mobile) + var(--safe-top));
    padding: 8px 14px;
  }
  .app-quick-nav-inner {
    gap: 5px;
  }
  .app-nav-pill {
    padding: 5px 10px;
    font-size: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  }
  .dashboard-shell {
    padding-top: 50px;
  }
  #activeAccessSection,
  #pendingOrdersSection,
  #buyTariffSection,
  #instructionsSection,
  #telegramSection,
  #helpSection {
    scroll-margin-top: calc(var(--header-height-mobile) + var(--safe-top) + 52px + 8px);
  }
}

/* ============================================================
   11. PENDING ORDERS SECTION
   ============================================================ */

/* Заголовок блока заявок */
.pending-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

/* Карточка одной заявки */
.pending-item-card {
  padding: 20px;
  border-radius: 16px;
  background: var(--soft-section-bg);
  border: 1px solid var(--border-color);
  margin-bottom: 12px;
}
.pending-item-card:last-of-type {
  margin-bottom: 0;
}

/* Верхняя строка карточки: название + цена */
.pending-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

/* Текст объяснения внутри заявки */
.pending-item-explanation {
  font-size: 14px;
  line-height: 1.6;
  color: var(--secondary-text);
  margin-bottom: 14px;
}

@media (max-width: 640px) {
  .pending-section-head,
  .pending-item-top {
    flex-direction: column;
    gap: 12px;
  }
}

/* ============================================================
   12. DASHBOARD DESIGN IMPROVEMENTS (visual polish)
   ============================================================ */

/* Metric value states */
.dashboard-metric-value--ok   { color: var(--accent-dark); }
.dashboard-metric-value--muted { color: var(--secondary-text); }

/* Expiry progress bar */
.expiry-bar-wrap {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.expiry-bar-track {
  height: 5px;
  background: var(--border-color);
  border-radius: 999px;
  overflow: hidden;
}
.expiry-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s ease;
}
.expiry-bar-fill.expiry-bar--ok     { background: var(--accent); }
.expiry-bar-fill.expiry-bar--warn   { background: #f59e0b; }
.expiry-bar-fill.expiry-bar--urgent { background: #ef4444; }
.expiry-bar-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.expiry-bar-label.expiry-bar--ok     { color: var(--accent-dark); }
.expiry-bar-label.expiry-bar--warn   { color: #92400e; }
.expiry-bar-label.expiry-bar--urgent { color: #b91c1c; }

/* Pulsing dot for pending status */
@keyframes pulse-dot {
  0%, 100% { opacity: 1;   transform: scale(1);    }
  50%       { opacity: 0.4; transform: scale(0.75); }
}
.pulse-dot {
  display: inline-block;
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse-dot 1.4s ease-in-out infinite;
}

/* ============================================================
   13. DARK BLOCK ACCENTS (flagship language from main page)
   ============================================================ */

/* --- Summary card: dark flagship (mirrors Level 04 on main page) --- */
.dashboard-summary-card {
  background: linear-gradient(180deg, #161618 0%, #0f0f10 100%);
  border-color: rgba(255,255,255,.08);
  box-shadow: 0 20px 48px rgba(15,23,42,.18);
}

.dashboard-summary-card .dashboard-metric-label {
  color: rgba(255,255,255,.48);
}

.dashboard-summary-card .dashboard-main-title {
  color: #fff;
}

.dashboard-summary-card .dashboard-metric-card {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.1);
}

.dashboard-summary-card .dashboard-metric-value {
  color: rgba(255,255,255,.88);
}

.dashboard-summary-card .dashboard-metric-value--ok {
  color: #5cc8b2;
}

.dashboard-summary-card .dashboard-metric-value--muted {
  color: rgba(255,255,255,.42);
}

/* Buttons inside summary card: white pill (like plan-button--light) */
.dashboard-summary-card .btn-primary {
  background: #fff;
  color: #111;
  border-color: #fff;
  box-shadow: none;
}
.dashboard-summary-card .btn-primary:hover {
  background: #f0f0f2;
  border-color: #f0f0f2;
  color: #111;
  box-shadow: 0 4px 12px rgba(255,255,255,.1);
}
.dashboard-summary-card .btn-secondary {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.18);
  color: rgba(255,255,255,.82);
}
.dashboard-summary-card .btn-secondary:hover {
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.28);
  color: #fff;
}

/* --- Instructions device strip: dark section anchor --- */
.inst-device-strip {
  background: linear-gradient(180deg, #1d1d1f 0%, #161618 100%);
  border-color: rgba(255,255,255,.08);
  box-shadow: 0 20px 48px rgba(15,23,42,.18);
}

.inst-device-strip .section-label {
  color: rgba(255,255,255,.48);
}

.inst-device-strip .dashboard-section-title,
.inst-device-strip .access-title {
  color: #fff;
}

.inst-device-strip .dashboard-section-subtitle,
.inst-device-strip .access-subtitle {
  color: rgba(255,255,255,.62);
}

/* Active device tab: white solid */
.inst-device-strip .btn-primary {
  background: #fff;
  color: #111;
  border-color: #fff;
  box-shadow: none;
}
.inst-device-strip .btn-primary:hover {
  background: #f0f0f2;
  border-color: #f0f0f2;
  color: #111;
  box-shadow: none;
}

/* Inactive device tabs: translucent frosted */
.inst-device-strip .btn-secondary {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.15);
  color: rgba(255,255,255,.72);
}
.inst-device-strip .btn-secondary:hover {
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.26);
  color: #fff;
}

/* ============================================================
   14. MOBILE OPTIMISATION
   ============================================================ */

/* ── Tap-targets: минимум 48px на телефонах ── */
@media (max-width: 640px) {
  .btn-sm {
    min-height: 48px;
    padding: 0 18px;
    font-size: 14px;
  }
  /* Кнопка «Скопировать» в карточке доступа — на всю ширину */
  [data-action="copy-link"] {
    width: 100%;
    justify-content: center;
  }
}

/* ── 480px: компактные телефоны (iPhone SE, Redmi, Galaxy A-series) ── */
@media (max-width: 480px) {

  /* App page wrapper */
  body.app-page .app-content {
    padding: 14px 12px 72px;
  }

  /* Cards */
  .app-card {
    padding: 16px;
    border-radius: 20px;
  }
  .inst-device-strip,
  .inst-step-card,
  .inst-steps-card {
    padding: 16px;
  }

  /* Все гриды → 1 колонка */
  .dashboard-summary-grid,
  .dashboard-hero-grid,
  .dashboard-install-grid,
  .dashboard-service-grid,
  .dashboard-metrics-grid,
  .dashboard-metrics-grid--compact,
  .dashboard-noactive-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Типографика */
  .dashboard-main-title,
  .dashboard-hero-title,
  .dashboard-section-title {
    font-size: 19px;
    line-height: 1.2;
  }

  /* Заголовок карточки доступа (статус + кнопка продления) */
  .access-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .access-header .btn {
    width: 100%;
    justify-content: center;
  }

  /* Device-tabs (iOS/Android/...) — перенос кнопок */
  .inst-device-strip .access-header,
  .inst-device-strip .user-info {
    flex-wrap: wrap;
    gap: 8px;
  }
  .inst-device-strip .btn {
    flex: 1 1 auto;
    min-width: 80px;
    text-align: center;
    justify-content: center;
  }

  /* Ссылка доступа */
  .access-link-wrap,
  [style*="display:flex"][style*="align-items:center"][style*="gap:10px"] {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  /* Hero главного экрана */
  .home-hero-card { min-height: 420px; }
  .home-hero-media, .home-hero-image { min-height: 420px; height: 420px; }
  .home-hero-copy { top: 65%; }
  .home-hero-title { font-size: clamp(1.9rem, 9vw, 2.4rem); }
  .light-title { font-size: 1.85rem !important; }

  /* Тарифные карточки на главной */
  .plan-card, .home-flagship .plan-flagship {
    padding: 12px;
    border-radius: 22px;
  }
  .plan-media, .plan-flagship-media { height: 200px; }

  /* Футер */
  .footer { padding: 22px 0 14px; }
  .footer-telegram { padding: 14px; }
}

/* ── Модальные окна: адаптивные ── */
.safe22-modal {
  width: 100%;
  max-width: 480px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(15,23,42,.18);
  padding: 24px;
  box-sizing: border-box;
}
.safe22-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
@media (max-width: 480px) {
  .safe22-modal {
    padding: 18px;
    border-radius: 20px;
  }
  .safe22-modal-actions {
    flex-direction: column-reverse;
  }
  .safe22-modal-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Payment method picker */
.pm-method-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  background: var(--soft-section-bg);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.pm-method-btn:hover {
  border-color: var(--accent);
  background: rgba(31,143,120,0.05);
}
.pm-method-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pm-sbp-icon  { background: rgba(31,143,120,0.12); }
.pm-card-icon { background: rgba(59,95,226,0.10); }
.pm-method-info {
  flex: 1;
}
.pm-method-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary-text);
  margin-bottom: 2px;
}
.pm-method-hint {
  font-size: 12px;
  color: var(--secondary-text);
}
.pm-method-arrow {
  font-size: 18px;
  color: var(--secondary-text);
  flex-shrink: 0;
}

/* Notification toggles */
.notif-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.notif-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.notif-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #d1d5db;
  border-radius: 24px;
  transition: background 0.2s;
}
.notif-toggle-slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.notif-toggle input:checked + .notif-toggle-slider {
  background: #1f8f78;
}
.notif-toggle input:checked + .notif-toggle-slider::before {
  transform: translateX(20px);
}
.notif-toggle--disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ============================================================
   Settings page
   ============================================================ */
.s-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.s-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 20px 24px;
}
.s-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary-text);
  margin-bottom: 18px;
}
.s-account-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.s-account-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--secondary-text);
  white-space: nowrap;
}
.s-account-email {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary-text);
  word-break: break-all;
}

/* Notification table: 3 columns */
.s-notif-table {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  overflow: hidden;
}
.s-notif-head {
  padding: 10px 16px;
  background: #eef3f1;
  font-size: 12px;
  font-weight: 600;
  color: var(--secondary-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border-color);
}
.s-col-head {
  border-left: 1px solid var(--border-color);
}
.s-col-hint {
  font-size: 10px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: #e07b3c;
  opacity: 0.9;
}
.s-notif-label {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.s-notif-label:last-of-type,
.s-notif-table > :nth-last-child(-n+3) {
  border-bottom: none;
}
.s-notif-cell {
  padding: 14px 16px;
  border-left: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: flex-start;
}
.s-notif-table > :nth-last-child(-n+3).s-notif-cell,
.s-notif-table > :nth-last-child(-n+3).s-notif-label {
  border-bottom: none;
}
.s-cell-disabled {
  opacity: 0.4;
  pointer-events: none;
}
.s-row-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--primary-text);
}
.s-row-hint {
  font-size: 12px;
  color: var(--secondary-text);
  line-height: 1.4;
}

/* Radio */
.s-radio-group {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4px 12px;
}
.s-radio {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--primary-text);
  cursor: pointer;
  white-space: nowrap;
}
.s-radio input[type="radio"] {
  accent-color: #1f8f78;
  width: 14px;
  height: 14px;
  cursor: pointer;
  flex-shrink: 0;
}
.s-radio-off span { color: var(--secondary-text); }

/* Checkbox */
.s-check-group {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4px 12px;
}
.s-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--primary-text);
  cursor: pointer;
  white-space: nowrap;
}
.s-check input[type="checkbox"] {
  accent-color: #1f8f78;
  width: 14px;
  height: 14px;
  cursor: pointer;
  flex-shrink: 0;
}

/* Toggle inline */
.s-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--secondary-text);
  cursor: pointer;
}

/* Telegram row */
.s-tg-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.s-tg-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.s-tg-ok {
  color: #1f8f78;
  font-weight: 700;
}
.s-save-status {
  font-size: 13px;
  color: var(--secondary-text);
  margin-top: 14px;
  min-height: 18px;
}

/* Mobile: stack table vertically */
@media (max-width: 600px) {
  .s-notif-table {
    grid-template-columns: 1fr;
  }
  .s-notif-head { display: none; }
  .s-notif-head:first-child { display: flex; }
  .s-col-head { border-left: none; border-top: 1px solid var(--border-color); display: flex; }
  .s-notif-cell { border-left: none; }
  .s-notif-label { border-bottom: none; padding-bottom: 4px; }
  .s-notif-cell { padding-top: 8px; }
  .s-notif-table > :nth-last-child(-n+3).s-notif-cell { border-bottom: 1px solid var(--border-color); }
  .s-notif-table > :last-child { border-bottom: none; }
}

/* ──────────────────────────────────────────────────────────
   Store page
   ────────────────────────────────────────────────────────── */
.store-hero {
  text-align: center;
  padding: 48px 0 36px;
}
.store-hero-title {
  font-size: 36px;
  font-weight: 600;
  color: var(--primary-text);
  letter-spacing: -0.03em;
  margin: 0 0 12px;
}
.store-hero-sub {
  font-size: 16px;
  color: var(--secondary-text);
  line-height: 1.6;
  max-width: 580px;
  margin: 0 auto;
}

/* Tabs */
.store-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
  margin-bottom: 20px;
}
.store-tabs::-webkit-scrollbar { display: none; }

.store-tab {
  flex-shrink: 0;
  padding: 9px 18px;
  border-radius: 50px;
  border: 1.5px solid var(--border-color);
  background: var(--card-bg);
  font-size: 13px;
  font-weight: 600;
  color: var(--secondary-text);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s, box-shadow 0.15s;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(15,23,42,.06);
  font-family: var(--font-family);
}
.store-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 2px 8px rgba(31,143,120,.15);
}
.store-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 10px rgba(31,143,120,.3);
}

/* Scroll offset for fixed quick-nav (header ~68px + nav ~50px) */
#shopSection {
  scroll-margin-top: 124px;
}

/* Category description */
.store-cat-desc {
  font-size: 14px;
  color: var(--secondary-text);
  line-height: 1.6;
  margin: 0 0 24px;
}

/* Grid */
.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}

/* Card */
.store-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 24px 20px 20px;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}
.store-card:hover {
  box-shadow: 0 12px 36px rgba(15,23,42,.10);
  border-color: #c8d0ce;
  transform: translateY(-2px);
}
.store-card-brand {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.store-card-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.store-card-amount {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-text);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 4px;
}
.store-card-note {
  font-size: 12px;
  color: var(--secondary-text);
  margin-bottom: 4px;
}
.store-card-price {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-text);
  letter-spacing: -0.03em;
  margin: 8px 0 20px;
}
.store-card-btn {
  width: 100%;
  margin-top: auto;
}

/* Store modal text */
.smodal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-text);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.smodal-sub {
  font-size: 14px;
  color: var(--secondary-text);
  line-height: 1.5;
  margin: 0 0 20px;
}
/* Shop delivery steps */
.shop-delivery-wrap {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}
.shop-delivery-note {
  font-size: 13px;
  color: var(--secondary-text);
  margin-bottom: 16px;
  line-height: 1.5;
}
.shop-delivery-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.shop-delivery-step {
  background: var(--soft-section-bg);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.shop-delivery-num {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.shop-delivery-text {
  font-size: 13px;
  color: var(--primary-text);
  line-height: 1.45;
}
.store-card-delay {
  font-size: 11px;
  font-weight: 500;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 6px 10px;
  line-height: 1.4;
  margin-bottom: 4px;
}
.shop-instr-anchor {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 11px 20px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border: 1.5px solid rgba(31,143,120,.3);
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-family);
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.shop-instr-anchor:hover {
  background: rgba(31,143,120,.15);
  border-color: rgba(31,143,120,.5);
  transform: translateY(-1px);
}
@media (max-width: 640px) {
  .shop-delivery-steps {
    grid-template-columns: 1fr;
  }
  #categoryInstructionsSection > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}

.store-input-error {
  font-size: 12px;
  color: #e53e3e;
  min-height: 18px;
  margin-top: 6px;
}

/* Username input */
.store-input {
  width: 100%;
  height: 48px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 16px;
  font-family: var(--font-family);
  color: var(--primary-text);
  background: var(--card-bg);
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s;
}
.store-input:focus {
  border-color: var(--accent);
}

@media (max-width: 640px) {
  .store-hero { padding: 32px 0 24px; }
  .store-hero-title { font-size: 26px; }
  .store-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .store-card { padding: 18px 14px 16px; border-radius: 20px; }
  .store-card-price { font-size: 22px; }
}
