:root {
  --bg: #0c0b0a;
  --bg-soft: #131211;
  --accent: #c5a897;
  --accent-strong: #e0c3b0;
  --text: #eae6e1;
  --muted: #8a837c;
  --line: rgba(255, 255, 255, 0.08);
  --radius: 18px;
  --font: 'Manrope', system-ui, sans-serif;
  --serif: 'Playfair Display', Georgia, serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* мягкие световые пятна на фоне */
.glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}
.glow-a {
  width: 560px; height: 560px;
  background: rgba(197, 168, 151, 0.12);
  top: -180px; left: -120px;
}
.glow-b {
  width: 520px; height: 520px;
  background: rgba(197, 168, 151, 0.07);
  bottom: -200px; right: -140px;
}

/* навигация */
.nav {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 40px;
  max-width: 1200px;
  margin: 0 auto;
}
.logo {
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: 0.5px;
  color: var(--text);
}
.logo-dot { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 28px;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s ease;
}
.nav-links a:hover { color: var(--text); }
.nav .btn { height: 38px; padding: 0 22px; font-size: 13px; }

/* кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 30px;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #17140f;
  box-shadow: 0 12px 34px rgba(197, 168, 151, 0.22);
}
.btn-primary:hover { box-shadow: 0 18px 44px rgba(197, 168, 151, 0.3); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  color: var(--text);
}
.btn-ghost:hover { border-color: rgba(197, 168, 151, 0.4); }

/* герой */
.hero {
  position: relative;
  z-index: 5;
  max-width: 1100px;
  margin: 0 auto;
  padding: 110px 40px 90px;
  text-align: center;
}
.hero-badge {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(197, 168, 151, 0.25);
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  margin-bottom: 34px;
}
.hero-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(52px, 9vw, 118px);
  line-height: 1.02;
  letter-spacing: -1px;
}
.hero-title .line { display: block; }
.hero-title em {
  font-style: italic;
  color: var(--accent);
}
.hero-sub {
  max-width: 620px;
  margin: 32px auto 0;
  font-size: 19px;
  color: var(--muted);
}
.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 42px;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 56px;
  margin-top: 80px;
  flex-wrap: wrap;
}
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-num {
  font-family: var(--serif);
  font-size: 42px;
  color: var(--accent);
  line-height: 1;
}
.stat-label {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}

/* секция возможностей */
.features {
  position: relative;
  z-index: 5;
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 40px 110px;
}
.section-title {
  font-family: var(--serif);
  font-size: clamp(32px, 5vw, 52px);
  text-align: center;
  margin-bottom: 56px;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.feature {
  padding: 34px 30px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s ease, background 0.3s ease;
}
.feature:hover {
  transform: translateY(-6px);
  border-color: rgba(197, 168, 151, 0.3);
  background: rgba(197, 168, 151, 0.05);
}
.feature-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(197, 168, 151, 0.12);
  color: var(--accent);
  font-size: 22px;
  margin-bottom: 20px;
}
.feature h3 {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 10px;
}
.feature p {
  color: var(--muted);
  font-size: 15px;
}

/* секция «почему» */
.why {
  position: relative;
  z-index: 5;
  padding: 40px 40px 130px;
}
.why-inner {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}
.why-title {
  font-family: var(--serif);
  font-size: clamp(36px, 6vw, 68px);
  line-height: 1.1;
}
.why-title em { color: var(--accent); font-style: italic; }
.why-text {
  max-width: 560px;
  margin: 26px auto 38px;
  color: var(--muted);
  font-size: 18px;
}

/* футер */
.footer {
  position: relative;
  z-index: 5;
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 40px 48px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-links { display: flex; gap: 22px; }
.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s ease;
}
.footer-links a:hover { color: var(--text); }
.footer-copy { color: var(--muted); font-size: 13px; }

/* ===== анимации появления ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1.15s cubic-bezier(0.22, 0.7, 0.2, 1), transform 1.15s cubic-bezier(0.22, 0.7, 0.2, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.d-1 { transition-delay: 0.12s; }
.d-2 { transition-delay: 0.26s; }
.d-3 { transition-delay: 0.42s; }
.d-4 { transition-delay: 0.60s; }
.d-5 { transition-delay: 0.80s; }
.d-6 { transition-delay: 1.02s; }
.d-7 { transition-delay: 1.26s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ===== страница входа ===== */
.auth-wrap {
  position: relative;
  z-index: 5;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 42px 38px;
  border-radius: 26px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(12px);
}
.auth-logo {
  font-family: var(--serif);
  font-size: 34px;
  text-align: center;
  margin-bottom: 8px;
}
.auth-sub {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 32px;
}
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: #b0a79e;
  margin-bottom: 8px;
}
.field input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  outline: none;
  transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}
.field input::placeholder { color: rgba(255, 255, 255, 0.2); }
.field input:focus {
  border-color: rgba(197, 168, 151, 0.5);
  background: rgba(197, 168, 151, 0.06);
  box-shadow: 0 0 0 4px rgba(197, 168, 151, 0.08);
}
.auth-btn {
  width: 100%;
  margin-top: 12px;
  height: 52px;
}
.auth-alt {
  text-align: center;
  margin-top: 22px;
  color: var(--muted);
  font-size: 14px;
}
.auth-alt a {
  color: var(--accent);
  text-decoration: none;
}
.auth-alt a:hover { text-decoration: underline; }

/* адаптив */
@media (max-width: 760px) {
  .nav { padding: 16px 18px; }
  .nav-links { display: none; }
  .logo { font-size: 20px; }

  .hero { padding: 54px 16px 46px; overflow: hidden; }
  .hero-title { font-size: clamp(34px, 11vw, 52px); line-height: 1.08; letter-spacing: -0.5px; overflow-wrap: break-word; word-break: normal; }
  .hero-sub { font-size: 15px; margin-top: 20px; overflow-wrap: break-word; }
  .hero-actions { flex-direction: column; align-items: stretch; gap: 12px; margin-top: 32px; }
  .hero-actions .btn { width: 100%; height: 46px; font-size: 15px; padding: 0 22px; }
  .hero-stats { gap: 20px; margin-top: 44px; max-width: 100%; }
  .stat-num { font-size: 32px; }
  .stat-label { font-size: 10px; letter-spacing: 1.5px; }

  /* на телефоне — отдельная компоновка: без лишних блоков */
  .hero-stats { display: none; }
  .why { display: none; }
  .features { padding: 30px 18px 56px; }
  .section-title { font-size: 30px; margin-bottom: 34px; }
  .feature-grid { grid-template-columns: 1fr; gap: 14px; }
  .feature { padding: 26px 22px; }

  .why { padding: 12px 18px 72px; }
  .why-title { font-size: clamp(30px, 9vw, 44px); }
  .why-text { font-size: 16px; margin: 20px auto 30px; }
  .why .btn { width: 100%; height: 46px; }

  .footer { padding: 24px 18px calc(28px + env(safe-area-inset-bottom)); flex-direction: column; align-items: flex-start; gap: 14px; }

  .auth-wrap { padding: 18px 14px calc(18px + env(safe-area-inset-bottom)); align-items: flex-start; padding-top: 8vh; }
  .auth-card { padding: 32px 22px; border-radius: 22px; }
  .auth-logo { font-size: 30px; }
  .field input { height: 52px; font-size: 16px; }
  .auth-btn { height: 48px; font-size: 15px; }

  /* удобнее пальцем */
  .btn { min-height: 44px; }
  .nav-links a, .footer-links a { padding: 8px 0; }
}

/* очень узкие телефоны */
@media (max-width: 380px) {
  .hero-title { font-size: 32px; }
  .hero-stats { gap: 18px; }
  .stat-num { font-size: 30px; }
}

/* плавность: меньше движения на слабых устройствах */
@media (prefers-reduced-motion: reduce) {
  .btn:hover, .feature:hover { transform: none; }
}

/* ===== авторизация: вкладки, галочки, код, bottom sheet ===== */
.auth-tabs {
  position: relative;
  display: flex;
  gap: 4px;
  padding: 4px;
  margin: -6px 0 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}
.auth-tab {
  flex: 1;
  height: 38px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.3s ease, background 0.3s ease;
}
.auth-tab.active {
  color: #17140f;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}
.auth-tab:not(.active):hover { color: var(--text); }

.tab-pane { display: none; }
.tab-pane.active { display: block; animation: paneIn 0.45s cubic-bezier(0.2, 0.7, 0.2, 1); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 48px; }
.pw-eye {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.25s ease, background 0.25s ease;
}
.pw-eye:hover, .pw-eye.visible { color: var(--accent); background: rgba(197, 168, 151, 0.1); }
.pw-eye svg { width: 19px; height: 19px; }

.auth-note {
  margin-top: 14px;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
}
.auth-note.ok {
  background: rgba(197, 168, 151, 0.12);
  color: var(--accent-strong);
  border: 1px solid rgba(197, 168, 151, 0.25);
}
.auth-note.err {
  background: rgba(220, 90, 80, 0.1);
  color: #e79a92;
  border: 1px solid rgba(220, 90, 80, 0.22);
}

@keyframes paneIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* галочки */
.consents { margin: 18px 0 6px; display: flex; flex-direction: column; gap: 12px; }
.consent { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.consent input { display: none; }
.consent-box {
  flex: 0 0 20px;
  width: 20px; height: 20px;
  margin-top: 1px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.03);
  transition: all 0.25s ease;
  position: relative;
}
.consent-box::after {
  content: '';
  position: absolute;
  left: 6px; top: 2px;
  width: 5px; height: 10px;
  border: solid #17140f;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.consent input:checked + .consent-box {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: transparent;
}
.consent input:checked + .consent-box::after { transform: rotate(45deg) scale(1); }
.consent-text { font-size: 13px; color: var(--muted); line-height: 1.5; }
.consent-text a { color: var(--accent); text-decoration: none; }
.consent-text a:hover { text-decoration: underline; }

/* поля кода */
.code-inputs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 26px 0 8px;
}
.code-inputs input {
  width: 46px; height: 56px;
  text-align: center;
  font-family: var(--font);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.code-inputs input:focus {
  border-color: rgba(197, 168, 151, 0.55);
  box-shadow: 0 0 0 4px rgba(197, 168, 151, 0.08);
}

/* полоска-«ручка» листа — видна только на телефоне */
.sheet-grip {
  display: none;
  width: 42px; height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  margin: -12px auto 18px;
}
.sheet-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 40;
}

/* ===== телефон: bottom sheet ===== */
@media (max-width: 760px) {
  .auth-wrap {
    align-items: flex-end;
    padding: 0;
    padding-top: 0;
    min-height: 100vh;
    min-height: 100dvh;
    z-index: 50;
    position: relative;
  }
  .auth-card {
    width: 100%;
    max-width: none;
    border-radius: 26px 26px 0 0;
    border-bottom: none;
    padding: 20px 20px calc(26px + env(safe-area-inset-bottom));
    background: #1a1918;
    border-top: 1px solid rgba(197, 168, 151, 0.18);
    transform: translateY(0);
    animation: sheetUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 50;
    box-shadow: 0 -18px 48px rgba(0, 0, 0, 0.5);
  }
  .sheet-grip { display: block; }
  .sheet-backdrop { display: block; }
  .auth-logo { font-size: 23px; margin-bottom: 4px; }
  .auth-sub { margin-bottom: 18px; font-size: 13px; }
  .field { margin-bottom: 12px; }
  .field label { font-size: 9.5px; letter-spacing: 1.2px; margin-bottom: 6px; }
  .field input { height: 46px; font-size: 15px; padding: 0 14px; border-radius: 12px; }
  .pw-eye { width: 30px; height: 30px; right: 8px; }
  .pw-eye svg { width: 17px; height: 17px; }
  .auth-btn { height: 44px; font-size: 14px; }
  .auth-alt { margin-top: 16px; font-size: 12.5px; }
  .auth-card { padding: 16px 18px calc(22px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; }
  .consents { margin: 14px 0 4px; gap: 10px; }
  .consent-text { font-size: 12px; }
  .consent-box { width: 18px; height: 18px; border-radius: 6px; }
  .consent-box::after { left: 5px; top: 1.5px; width: 4.5px; height: 9px; }
  .code-inputs { gap: 6px; margin: 20px 0 6px; }
  .code-inputs input { width: 40px; height: 48px; font-size: 19px; border-radius: 12px; }
}

@keyframes dockIn {
  from { opacity: 0; transform: translateY(-50%) translateX(-24px); }
  to   { opacity: 1; transform: translateY(-50%) translateX(0); }
}
@keyframes navIn {
  from { opacity: 0; transform: translateX(-50%) translateY(18px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes sheetUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .auth-card, .tab-pane { animation: none; }
}

/* ===== главная после входа ===== */
.app-main {
  position: relative;
  z-index: 5;
  max-width: 100%;
  margin: 0 auto;
  padding: 56px 30px 80px 100px;
}
.app-head { text-align: center; margin-bottom: 56px; }
.app-hello {
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.app-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1.06;
}
.app-title em { color: var(--accent); font-style: italic; }
.app-sub {
  max-width: 520px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 17px;
}

.app-section { margin-bottom: 46px; }
.app-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.app-section-head h2 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
}
.app-section-hint {
  font-size: 12px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--muted);
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.app-card {
  padding: 30px 28px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s ease, background 0.3s ease;
}
.app-card:hover {
  transform: translateY(-5px);
  border-color: rgba(197, 168, 151, 0.32);
  background: rgba(197, 168, 151, 0.05);
}
.app-card-icon {
  width: 48px; height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(197, 168, 151, 0.12);
  color: var(--accent);
  margin-bottom: 18px;
}
.app-card-icon svg { width: 22px; height: 22px; }
.app-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.app-card p { color: var(--muted); font-size: 14px; }

.app-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 44px 24px;
  border-radius: 22px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.015);
  text-align: center;
}
.app-empty-icon {
  width: 52px; height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: rgba(197, 168, 151, 0.1);
  color: var(--accent);
}
.app-empty-icon svg { width: 24px; height: 24px; }
.app-empty p { color: var(--muted); font-size: 14px; max-width: 340px; }

/* ===== ПК: боковая pill-панель (dock) ===== */
.side-dock {
  position: fixed;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  animation: dockIn 1s cubic-bezier(0.22, 0.7, 0.2, 1) 0.25s backwards;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 10px;
  border-radius: 26px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(14px);
}
.dock-logo {
  font-family: var(--serif);
  font-size: 20px;
  color: var(--text);
  padding: 6px 0 10px;
}
.dock-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dock-btn {
  position: relative;
  width: 46px; height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 15px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.3s ease, background 0.3s ease, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.dock-btn svg { width: 21px; height: 21px; }
.dock-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}
.dock-btn.active {
  color: #17140f;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 10px 26px rgba(197, 168, 151, 0.22);
}
.dock-btn-small { width: 40px; height: 40px; }
.dock-btn-small svg { width: 18px; height: 18px; }
.dock-foot { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); }

/* тултипы при наведении */
.dock-btn::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(-6px);
  padding: 7px 12px;
  border-radius: 10px;
  background: #201e1c;
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font);
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.dock-btn:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* ===== телефон: нижняя навигация ===== */
.bottom-nav {
  display: none;
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  animation: navIn 0.9s cubic-bezier(0.22, 0.7, 0.2, 1) 0.35s backwards;
  z-index: 30;
  gap: 6px;
  padding: 8px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(24, 23, 22, 0.92);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}
.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 96px;
  padding: 9px 16px;
  border: none;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.3s ease, background 0.3s ease;
}
.nav-btn svg { width: 21px; height: 21px; }
.nav-btn.active {
  color: var(--accent-strong);
  background: rgba(197, 168, 151, 0.12);
}

/* анимация закрытия формы/листа перед входом */
.closing .auth-card {
  animation: sheetDown 0.42s cubic-bezier(0.5, 0, 0.75, 0) forwards;
}
.closing .sheet-backdrop {
  animation: fadeOut 0.42s ease forwards;
}
@keyframes sheetDown {
  to { transform: translateY(110%); opacity: 0.4; }
}
@keyframes fadeOut {
  to { opacity: 0; }
}

@media (max-width: 760px) {
  .side-dock { display: none; }
  .bottom-nav { display: flex; }

  /* компактная шапка */
  .app-main { padding: 26px 14px calc(120px + env(safe-area-inset-bottom)); overflow-x: hidden; }
  .app-head { text-align: center; margin-bottom: 22px; }
  .app-hello { font-size: 10px; letter-spacing: 2.4px; margin-bottom: 10px; }
  .app-title { font-size: clamp(26px, 7.5vw, 34px); line-height: 1.12; overflow-wrap: break-word; }
  .app-sub { font-size: 13px; margin-top: 10px; line-height: 1.55; overflow-wrap: break-word; }

  /* поиск — во всю ширину, крупная цель */
  .char-search-wrap { margin-bottom: 12px; }
  .char-search.big { max-width: none; height: 46px; padding: 0 15px; border-radius: 14px; }
  .char-search.big svg { width: 18px; height: 18px; }
  .char-search.big input { font-size: 15px; }

  /* категории — горизонтальный скролл одной строкой */
  .char-cats-row {
    justify-content: flex-start;
    margin-bottom: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .char-cats-row::-webkit-scrollbar { display: none; }
  .char-cats { flex-wrap: nowrap; padding: 3px; }
  .char-cat { height: 33px; padding: 0 13px; font-size: 11.5px; white-space: nowrap; }

  /* строка: Все/Мои + сортировка */
  .char-tools { gap: 10px; margin-bottom: 16px; }
  .char-scope { padding: 3px; }
  .scope-btn { height: 34px; padding: 0 13px; font-size: 11.5px; white-space: nowrap; }
  .sort-btn { height: 40px; padding: 0 13px; font-size: 11.5px; }
  .sort-btn span { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sort-menu { right: 0; min-width: 180px; }

  /* карточки персонажей: 2 в ряд, без обрезки текста */
  .char-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 11px;
    margin-bottom: 30px;
  }
  .char-card { border-radius: 18px; }
  .char-info { padding: 11px 12px 14px; }
  .char-info h3 {
    font-size: 14px;
    line-height: 1.25;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .char-info p {
    font-size: 11.5px;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
  }
  .char-tag { left: 9px; bottom: 9px; padding: 4px 10px; font-size: 9px; letter-spacing: 1.2px; }

  /* карточки действий и секции */
  .app-grid { grid-template-columns: 1fr; gap: 11px; }
  .app-card { padding: 20px 18px; border-radius: 18px; }
  .app-section { margin-bottom: 32px; }
  .app-section-head { margin-bottom: 13px; }
  .app-section-head h2 { font-size: 20px; }
  .app-section-hint { font-size: 10px; letter-spacing: 1.3px; }
  .app-empty { padding: 32px 18px; }
}

/* ===== карточки персонажей (новый вид) ===== */
.char-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 52px;
}
.char-card {
  display: block;
  text-decoration: none;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.35s ease, box-shadow 0.35s ease;
}
.char-card:hover {
  transform: translateY(-7px);
  border-color: rgba(197, 168, 151, 0.35);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.38);
}
.char-photo {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
}
.char-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.char-card:hover .char-photo img { transform: scale(1.06); }
.char-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(12,11,10,0) 55%, rgba(12,11,10,0.72) 100%);
}
.char-tag {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 2;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(12, 11, 10, 0.55);
  border: 1px solid rgba(197, 168, 151, 0.35);
  color: var(--accent-strong);
  font-size: 10px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}
.char-info { padding: 16px 18px 20px; }
.char-info h3 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}
.char-info p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

@media (max-width: 760px) {
  .char-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 38px;
  }
  .char-info { padding: 12px 14px 16px; }
  .char-info h3 { font-size: 16px; }
  .char-info p { font-size: 12px; }
  .char-tag { left: 10px; bottom: 10px; }
}

/* ===== поиск и категории персонажей ===== */
.char-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}
.char-tools > .char-scope,
.char-tools > .char-search,
.char-tools > .char-right > * { flex: 0 0 auto; }
.char-search {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 180px;
  max-width: 420px;
  height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.035);
  transition: border-color 0.35s ease, background 0.35s ease, box-shadow 0.35s ease;
}
.char-search:focus-within {
  border-color: rgba(197, 168, 151, 0.4);
  background: rgba(197, 168, 151, 0.06);
  box-shadow: 0 8px 28px rgba(197, 168, 151, 0.1);
}
.char-search svg {
  width: 19px;
  height: 19px;
  color: var(--muted);
  flex: 0 0 auto;
}
.char-search input {
  flex: 1;
  font-size: 14px;
  height: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  outline: none;
}
.char-search input::placeholder { color: rgba(255, 255, 255, 0.22); }

.char-cats {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}
.char-cat {
  height: 34px;
  padding: 0 15px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.3s ease, background 0.3s ease;
}
.char-cat:hover { color: var(--text); }
.char-cat.active {
  color: #17140f;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

/* скрытие при фильтрации */
.char-card.hidden { display: none; }
.char-empty-note {
  display: none;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 30px 0;
}
.char-empty-note.show { display: block; }

@media (max-width: 760px) {
  .char-tools { flex-direction: column; align-items: stretch; gap: 11px; margin-bottom: 18px; }
  .char-search { width: 100%; height: 44px; padding: 0 14px; border-radius: 13px; }
  .char-cat { height: 32px; padding: 0 13px; font-size: 11.5px; }
}

/* переключатель «Все / Мои» */
.char-scope {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}
.scope-btn {
  height: 34px;
  padding: 0 17px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.3s ease, background 0.3s ease;
}
.scope-btn:hover { color: var(--text); }
.scope-btn.active {
  color: #17140f;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.char-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* сортировка */
.char-sort {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  transition: border-color 0.35s ease, background 0.35s ease;
}
.char-sort:hover { border-color: rgba(197, 168, 151, 0.3); background: rgba(255, 255, 255, 0.04); }
.char-sort:focus-within { border-color: rgba(197, 168, 151, 0.45); }
.char-sort svg { width: 16px; height: 16px; color: var(--muted); }
.char-sort select {
  border: none;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}
.char-sort select option { background: #1a1918; color: var(--text); }

@media (max-width: 760px) {
  .char-scope { align-self: flex-start; }
  .scope-btn { height: 32px; padding: 0 14px; font-size: 11.5px; }
  .char-right { justify-content: space-between; }
  .char-sort { height: 32px; }
}

/* категории — отдельная строка по центру под поиском */
.char-cats-row {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

/* большой поиск — отдельная строка */
.char-search-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}
.char-search.big {
  flex: none;
  width: 100%;
  max-width: 620px;
  height: 52px;
  padding: 0 22px;
  gap: 12px;
}
.char-search.big svg { width: 21px; height: 21px; }
.char-search.big input { font-size: 15.5px; }
.char-search.big input::placeholder { color: rgba(255, 255, 255, 0.28); }

/* кастомное меню сортировки */
.char-sort { position: relative; }
.sort-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.sort-btn:hover { border-color: rgba(197, 168, 151, 0.3); background: rgba(255, 255, 255, 0.045); }
.sort-btn svg { width: 16px; height: 16px; color: var(--muted); }
.sort-btn .chev { width: 14px; height: 14px; transition: transform 0.3s ease; }
.char-sort.open .sort-btn .chev { transform: rotate(180deg); }
.char-sort.open .sort-btn { border-color: rgba(197, 168, 151, 0.45); }

.sort-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 190px;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #1a1918;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(-8px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 40;
}
.char-sort.open .sort-menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.sort-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 11px 15px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.25s ease, background 0.25s ease;
}
.sort-item:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.sort-item.active {
  color: var(--accent-strong);
  background: rgba(197, 168, 151, 0.12);
}

@media (max-width: 760px) {
  .char-search.big { height: 48px; padding: 0 16px; }
  .char-search.big input { font-size: 15px; }
}
