:root {
  --bg-0: #06080d;
  --bg-1: #0a0d14;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-border: rgba(255, 255, 255, 0.08);
  --panel-strong: rgba(255, 255, 255, 0.07);
  --text-0: #eef1f6;
  --text-1: #a7afc0;
  --text-2: #6b7280;
  --accent: #22d3ee;
  --accent-strong: #0ea5e9;
  --accent-glow: rgba(34, 211, 238, 0.35);
  --purple: #a78bfa;
  --purple-glow: rgba(167, 139, 250, 0.3);
  --green: #34d399;
  --red: #f87171;
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-0);
  color: var(--text-0);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  overflow-x: hidden;
}


.mono { font-family: var(--font-mono); letter-spacing: -0.02em; }

.app {
  position: relative;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: visible;
  background: radial-gradient(120% 60% at 50% -10%, #0d1420 0%, var(--bg-0) 55%);
}

/* ─── Ambient background ─── */
.bg-grid {
  position: fixed;
  inset: 0;
  max-width: 480px;
  margin: 0 auto;
  background-image: radial-gradient(rgba(255,255,255,0.07) 1px, transparent 1.2px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 90% 55% at 50% 0%, black 25%, transparent 85%);
  pointer-events: none;
  z-index: 0;
  transform: translateZ(0);
  will-change: transform;
}
.bg-noise {
  position: fixed;
  inset: 0;
  max-width: 480px;
  margin: 0 auto;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.04;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 0;
  transform: translateZ(0);
  will-change: transform;
}
.bg-glow {
  position: fixed;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
  transition: opacity 1.5s ease;
  transform: translateZ(0);
  will-change: transform;
}
.bg-glow--1 { background: radial-gradient(ellipse at center, var(--accent) 0%, transparent 70%); width: 100%; left: 0; right: 0; top: -160px; opacity: 0.22; }
.bg-glow--2 { display: none; }

/* ─── Topbar ─── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 18px) + 6px) 20px 14px;
}
.topbar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 100%;
  background: rgba(6, 8, 13, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  z-index: -1;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand__logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  filter: drop-shadow(0 0 8px var(--accent-glow));
  border: 1.5px solid rgba(34, 211, 238, 0.3);
}
.brand__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.brand__name {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, #ffffff 10%, var(--accent) 130%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand__tagline {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--accent);
  opacity: 0.55;
}
.topbar__actions { display: flex; align-items: center; gap: 8px; }

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  color: var(--text-1);
}
.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.dot--live {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2a3140, #12161f);
  border: 1px solid var(--panel-border);
  transition: border-color 0.2s;
}
.avatar:active { border-color: var(--accent); }

/* ─── Screens ─── */
.screens {
  position: relative;
  z-index: 1;
  flex: 1;
  padding: 4px 20px 120px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateZ(0);
}

.screen {
  display: none;
  animation: screenIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.screen--active { display: block; }
@keyframes screenIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.screen__head { padding: 10px 2px 18px; }
.screen__head h1 {
  margin: 0 0 4px;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.03em;
}
.screen__sub { margin: 0; color: var(--text-1); font-size: 14px; line-height: 1.5; }

.feed-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  margin-left: -20px;
  margin-right: -20px;
  padding-left: 20px;
  padding-right: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 6px;
}
.feed-title {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-0);
}
.feed-badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: rgba(0, 194, 255, 0.08);
  border: 1px solid rgba(0, 194, 255, 0.2);
  padding: 3px 10px;
  border-radius: 20px;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-2);
  margin: 24px 2px 12px;
}

/* ─── Animate items on appear ─── */
.anim-item {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.anim-item:nth-child(1) { animation-delay: 0.05s; }
.anim-item:nth-child(2) { animation-delay: 0.1s; }
.anim-item:nth-child(3) { animation-delay: 0.15s; }
.anim-item:nth-child(4) { animation-delay: 0.2s; }
.anim-item:nth-child(5) { animation-delay: 0.25s; }
.anim-item:nth-child(6) { animation-delay: 0.3s; }
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Feed posts ─── */
.post {
  padding: 0 2px;
  margin-bottom: 22px;
}
.post:last-child { margin-bottom: 0; }
.post__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.post__avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex: none;
  background: #000 url('VULT.png') center / 135% no-repeat;
  box-shadow: 0 0 0 1.5px rgba(34, 211, 238, 0.25);
}
.post__who {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.post__name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-0);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.post__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #03212b;
  font-size: 8px;
  line-height: 1;
}
.post__time {
  font-size: 12px;
  color: var(--text-2);
}
.post__bubble {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  border-top-left-radius: 4px;
  padding: 14px 16px;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 16px 32px -20px rgba(0,0,0,0.55);
  transition: border-color 0.3s ease;
  overflow-wrap: break-word;
  word-break: break-word;
}
.post__bubble:active { border-color: rgba(34, 211, 238, 0.2); }
.post__text {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-0);
}
.post__text:last-of-type { margin-bottom: 0; }

/* Post heading (above bubble, always visible) */
.post__heading {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-0);
  padding: 0 2px 6px;
  line-height: 1.4;
}

/* Tier lock */
.post--locked .post__bubble {
  position: relative;
  min-height: 160px;
}
.post--locked .post__bubble > *:not(.post__lock-overlay) {
  filter: blur(6px);
  -webkit-filter: blur(6px);
  user-select: none;
  pointer-events: none;
}
.post__lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(to bottom, rgba(6,8,13,0.3), rgba(6,8,13,0.8));
  z-index: 2;
  border-radius: inherit;
}
.post__lock-icon {
  width: 28px;
  height: 28px;
  color: var(--text-2);
}
.post__lock-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-0);
  text-align: center;
}
.post__lock-tier {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
}
.post__lock-btn {
  margin-top: 6px;
  padding: 8px 20px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: rgba(34, 211, 238, 0.08);
  color: var(--accent);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.post__lock-btn:active {
  transform: scale(0.96);
  background: rgba(34, 211, 238, 0.15);
}

.post__image {
  margin-top: 12px;
  border-radius: 14px;
  overflow: hidden;
}
.post__image img {
  width: 100%;
  display: block;
  border-radius: 14px;
  border: 1px solid var(--panel-border);
}

.post__link-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 14px;
  background: rgba(34, 211, 238, 0.06);
  border: 1px solid rgba(34, 211, 238, 0.15);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}
.post__link-card:active { transform: scale(0.98); border-color: var(--accent); }
.post__link-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(34, 211, 238, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex: none;
}
.post__link-title { font-size: 14px; font-weight: 600; display: block; }
.post__link-sub { font-size: 11px; color: var(--text-2); display: block; margin-top: 2px; }
.post__link-arrow { color: var(--accent); font-size: 16px; margin-left: auto; }

/* ─── Tool cards ─── */
.tool-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 10px;
  backdrop-filter: blur(20px);
  transition: border-color 0.2s, transform 0.15s;
}
.tool-card:active { transform: scale(0.98); }
.tool-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex: none;
}
.tool-card__icon--purple {
  background: rgba(167, 139, 250, 0.08);
  border-color: rgba(167, 139, 250, 0.15);
  color: var(--purple);
}
.tool-card__icon--blue {
  background: rgba(96, 165, 250, 0.08);
  border-color: rgba(96, 165, 250, 0.15);
  color: #60a5fa;
}
.tool-card__body { flex: 1; min-width: 0; }
.tool-card__body h3 { margin: 0 0 6px; font-size: 15px; font-weight: 700; }
.tool-card__body p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-1); }
.tool-card__meta { font-size: 11px; color: var(--text-2); margin-top: 4px; }
.tool-card__arrow {
  align-self: center;
  color: var(--text-2);
  flex: none;
  transition: color 0.15s;
}
.tool-card:hover .tool-card__arrow { color: var(--accent); }
.tool-card[data-tool-open] { cursor: pointer; }

/* ─── Product cards ─── */
.product-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 14px;
  backdrop-filter: blur(24px);
  overflow: hidden;
  transition: border-color 0.3s, transform 0.15s;
}
.product-card:active { transform: scale(0.98); }
.product-card--featured {
  border-color: rgba(34, 211, 238, 0.3);
}
.product-card__badge {
  display: block;
  width: fit-content;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #001014;
  background: var(--accent);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
  position: relative;
  z-index: 2;
}
@keyframes glowPulse {
  0%, 100% { opacity: 0.15; }
  50% { opacity: 0.25; }
}
.product-card__price { font-size: 15px; font-weight: 600; color: var(--accent); }
.product-card h3 { position: relative; margin: 0 0 8px; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }
.product-card h4 { margin: 10px 0 6px; font-size: 15px; font-weight: 700; }
.product-grid .product-card { margin-bottom: 0; padding: 16px; }

.card__excerpt { margin: 0; font-size: 14px; line-height: 1.55; color: var(--text-1); }
.card__excerpt--sm { font-size: 13px; }

.btn {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  cursor: pointer;
  width: 100%;
  margin-top: 14px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.btn:active { transform: scale(0.97); }
.btn--primary {
  color: #03212b;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 8px 24px -8px var(--accent-glow);
}
.btn--primary:active { box-shadow: 0 4px 12px -4px var(--accent-glow); }
.btn--ghost {
  color: var(--text-0);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--panel-border);
}
.btn--sm {
  width: auto;
  margin-top: 0;
  padding: 9px 18px;
  font-size: 13px;
}
.btn--lg {
  padding: 16px 28px;
  font-size: 16px;
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.sub-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 14px;
  backdrop-filter: blur(20px);
}
.sub-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sub-card__row .btn--sm {
  flex-shrink: 0;
  white-space: nowrap;
}
.sub-card__plan { font-size: 15px; font-weight: 700; }
.sub-card__price { font-size: 12px; color: var(--accent); }
.sub-card__desc { font-size: 12px; color: var(--text-2); margin-top: 3px; line-height: 1.4; }
.sub-card__divider {
  height: 1px;
  background: var(--panel-border);
  margin: 14px 0;
}

/* Кнопка «Моя подписка» в настройках */
.sub-nav {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 14px;
  backdrop-filter: blur(20px);
  cursor: pointer;
  font: inherit;
  color: var(--text-0);
  text-align: left;
  transition: border-color 0.15s;
}
.sub-nav[hidden] { display: none; }
.sub-nav:active { border-color: var(--accent); }
.sub-nav__label { font-size: 15px; font-weight: 700; }
.sub-nav__right { display: inline-flex; align-items: center; gap: 8px; }
.sub-nav__plan { font-size: 13px; color: var(--text-2); }
.sub-nav__chevron { color: var(--text-2); flex: none; }

/* Экран «Моя подписка» */
.screen__head--nav { display: flex; align-items: center; gap: 8px; }
.screen__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-left: -8px;
  border: none;
  background: none;
  color: var(--text-0);
  cursor: pointer;
  flex: none;
}
.screen__back:active { color: var(--accent); }

.sub-page-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 8px;
  backdrop-filter: blur(20px);
}
.sub-page-card__label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
.sub-page-card__plan { font-size: 22px; font-weight: 800; margin-top: 4px; }
.sub-page-card__until { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.sub-page-card__note { font-size: 12px; color: var(--text-2); margin-top: 8px; line-height: 1.45; }

.sub-page-tiers { display: flex; flex-direction: column; gap: 10px; }
.sub-page-tier {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.sub-page-tier--current { border-color: var(--accent); }
.sub-page-tier--pending { border-color: var(--text-1); border-style: dashed; }
.sub-page-tier__name { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.sub-page-tier__badge {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 2px 7px;
}
.sub-page-tier__price { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.sub-page-tier__current { font-size: 12px; font-weight: 600; color: var(--accent); flex: none; }
.sub-page-tier__btn { flex: none; }

.sub-page-resume { width: 100%; margin-top: 16px; }

.sub-page-cancel { margin-top: 28px; text-align: center; }
.sub-page-cancel__link {
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 6px;
}
.sub-page-cancel__link:active { color: var(--text-1); }

/* Яркая кнопка «Подробнее про каждый тариф» */
.plans-cta {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  padding: 15px 18px;
  border: none;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #03212b;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 10px 28px -8px var(--accent-glow);
  transition: transform 0.12s;
}
.plans-cta[hidden] { display: none; }
.plans-cta:active { transform: scale(0.99); }
.plans-cta__spark { display: inline-flex; flex: none; }
.plans-cta__text { flex: 1; text-align: left; }
.plans-cta__arrow { flex: none; opacity: 0.65; }

/* Страница «Что входит в подписку» */
.plans-intro { color: var(--text-2); font-size: 14px; line-height: 1.5; margin: 0 0 20px; }
.plan-block {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 14px;
  backdrop-filter: blur(20px);
}
.plan-block--accent { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-glow); }
.plan-block__head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.plan-block__icon {
  width: 42px; height: 42px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: rgba(34, 211, 238, 0.1);
  color: var(--accent);
}
.plan-block__title { font-size: 16px; font-weight: 700; }
.plan-block__tier { font-size: 12px; color: var(--accent); margin-top: 2px; }
.plan-block__list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 11px; }
.plan-block__list li {
  position: relative;
  padding-left: 24px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text-1);
}
.plan-block__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M20 6L9 17l-5-5' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/11px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M20 6L9 17l-5-5' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/11px no-repeat;
}
.plan-limits {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--panel-border);
}
.plan-limits__label {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 8px;
}
.plan-limits__row {
  padding: 9px 0;
}
.plan-limits__row + .plan-limits__row { border-top: 1px solid rgba(255,255,255,0.04); }
.plan-limits__tier { font-size: 14px; color: var(--text-0); }
.plan-limits__note { font-size: 12.5px; color: var(--text-1); margin-top: 3px; }
.plan-limits__val { color: var(--accent); font-weight: 700; }

.plans-choose { width: 100%; margin-top: 6px; }
.plans-note { font-size: 11px; color: var(--text-2); text-align: center; line-height: 1.4; margin-top: 14px; }
.plan-block__fineprint { font-size: 11px; color: var(--text-2); line-height: 1.4; margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--border); }

/* Модалка согласия на автопродление */
#subscribe-modal .modal__title { text-align: center; }
.sub-modal__price {
  text-align: center;
  font-size: 26px;
  font-weight: 800;
  margin: 2px 0 18px;
}
.sub-modal__per { font-size: 14px; font-weight: 500; color: var(--text-2); }
.sub-modal__points {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sub-modal__points li {
  position: relative;
  padding-left: 26px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-2);
}
.sub-modal__points li b { color: var(--text-0); font-weight: 600; }
.sub-modal__points li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M20 6L9 17l-5-5' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M20 6L9 17l-5-5' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat;
}
.sub-modal__warn {
  margin: 0 0 12px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-1);
  background: rgba(107, 114, 128, 0.1);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  text-align: center;
}
.sub-modal__warn[hidden] { display: none; }
.sub-modal__pay { width: 100%; }
.sub-modal__consent {
  margin: 12px 0 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-2);
  text-align: center;
}
.sub-modal__promo { margin: 0 0 12px; }
.sub-modal__promo-row { display: flex; gap: 8px; }
.sub-modal__promo-input {
  flex: 1 1 auto; min-width: 0;
  padding: 12px 14px;
  font-family: var(--mono, monospace); font-size: 13px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-1);
  background: var(--panel, rgba(255,255,255,0.03));
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  outline: none;
}
.sub-modal__promo-input:focus { border-color: var(--accent); }
.sub-modal__promo-input::placeholder { color: var(--text-2); letter-spacing: 0; text-transform: none; }
.sub-modal__promo-btn {
  flex: 0 0 auto;
  padding: 0 16px;
  font-size: 13px; font-weight: 600;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.sub-modal__promo-btn:disabled { opacity: .5; cursor: default; }
.sub-modal__promo-msg { margin: 8px 0 0; font-size: 12px; line-height: 1.4; text-align: center; }
.sub-modal__promo-msg[hidden] { display: none; }
.sub-modal__promo-msg--ok { color: var(--green, #34d399); }
.sub-modal__promo-msg--err { color: var(--red, #f87171); }

.purchases-empty {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 28px 18px;
  text-align: center;
  margin-bottom: 14px;
}
/* ─── Tools lock ─── */
.tools-lock {
  text-align: center;
  padding: 48px 20px 36px;
  margin-bottom: 16px;
}
.tools-lock__icon {
  color: var(--text-2);
  margin-bottom: 16px;
}
.tools-lock__title {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-0);
}
.tools-lock__desc {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-1);
}
.tools-lock__btn {
  width: 100%;
  max-width: 280px;
}
.tools-lock:not([hidden]) ~ #tools-feed {
  opacity: 0.25;
  pointer-events: none;
  filter: blur(2px);
}

.empty-hint {
  margin: 0;
  font-size: 13px;
  color: var(--text-2);
}

.settings-list {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: blur(20px);
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px;
  font-size: 14px;
  border-bottom: 1px solid var(--panel-border);
}
.settings-row:last-child { border-bottom: none; }
.settings-row__value { color: var(--text-2); font-size: 13px; }
.settings-row__hint { color: var(--text-2); font-size: 12px; margin-top: 3px; max-width: 240px; line-height: 1.35; }

/* Кнопка «Установить на телефон» (видна всем, в т.ч. гостю) */
.install-cta {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  color: inherit;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(20px);
}
.install-cta:active { border-color: var(--accent); }
.install-cta__icon {
  width: 38px; height: 38px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 11px;
  background: rgba(34, 211, 238, 0.1);
  color: var(--accent);
}
.install-cta__label { flex: 1; text-align: left; }
.install-cta__chevron { color: var(--text-2); flex: none; }

/* Модалка «Установить на телефон» */
.install-lead { font-size: 14px; color: var(--text-2); line-height: 1.5; margin: 0 0 16px; text-align: center; }

/* Выбор браузера */
.install-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.install-tab {
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: rgba(255,255,255,0.03);
  color: var(--text-1); font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.install-tab--active { background: var(--accent); color: #03212b; border-color: var(--accent); }

/* Режим Telegram */
.install-tg { text-align: center; }
.install-tg__text { font-size: 14px; line-height: 1.55; color: var(--text-1); margin: 0 0 18px; }
.install-note[hidden], .install-tg[hidden], .install-body[hidden] { display: none; }
.install-steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.install-steps li {
  position: relative; padding-left: 40px; min-height: 28px;
  font-size: 14px; line-height: 1.45; color: var(--text-0);
  counter-increment: step;
}
.install-steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: -2px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--accent); color: #03212b;
  font-weight: 700; font-size: 13px;
}
.install-steps li.install-steps__note { padding-left: 0; counter-increment: none; }
.install-steps li.install-steps__note::before { display: none; }
.ist-ico { width: 17px; height: 17px; vertical-align: -3px; color: var(--accent); margin: 0 1px; display: inline-block; }

.switch { position: relative; width: 42px; height: 25px; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch__track {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
  transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.switch__track::before {
  content: '';
  position: absolute;
  width: 19px; height: 19px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.switch input:checked + .switch__track { background: var(--accent); }
.switch input:checked + .switch__track::before { transform: translateX(17px); }

/* ─── Breathing overlay ─── */
.breathing-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.breathing-overlay[hidden] { display: none; }
.breathing-overlay__bg {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 13, 0.95);
  backdrop-filter: blur(30px);
}
.breathing-overlay__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 40px;
  animation: fadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.breathing-overlay__close {
  position: absolute;
  top: -20px;
  right: -10px;
  background: none;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  padding: 8px;
}
.breathing-overlay__title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.breathing-circle {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  position: relative;
}
.breathing-circle__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(34, 211, 238, 0.2);
  transition: all 0.8s ease;
}
.breathing-circle--inhale .breathing-circle__ring {
  border-color: var(--accent);
  box-shadow: 0 0 40px var(--accent-glow), inset 0 0 40px rgba(34, 211, 238, 0.1);
  transform: scale(1.15);
}
.breathing-circle--hold .breathing-circle__ring {
  border-color: var(--purple);
  box-shadow: 0 0 40px var(--purple-glow), inset 0 0 40px rgba(167, 139, 250, 0.1);
  transform: scale(1.15);
}
.breathing-circle--exhale .breathing-circle__ring {
  border-color: rgba(34, 211, 238, 0.3);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.1);
  transform: scale(0.9);
}
.breathing-circle__text {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
}
.breathing-circle__timer {
  font-size: 46px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-0);
}
.breathing-circle__timer:empty { display: none; }
.breathing-overlay__instruction {
  font-size: 14px;
  color: var(--text-1);
  text-align: center;
}
.breathing-overlay__round {
  font-size: 12px;
  color: var(--text-2);
}

/* ─── Tool detail overlay ─── */
.tool-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tool-detail-overlay[hidden] { display: none; }
.tool-detail-scroll {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px;
}
.tool-detail-scroll::-webkit-scrollbar { width: 0; }
.tool-detail {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: fadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.tool-detail__icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: rgba(34,211,238,0.08);
  border: 1px solid rgba(34,211,238,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.tool-detail__icon svg { width: 32px; height: 32px; }
.tool-detail__title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  text-align: center;
}
.tool-detail__meta {
  font-size: 12px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tool-detail__sections {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 8px 0;
}
.tool-detail__section {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 16px;
}
.tool-detail__section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 8px;
}
.tool-detail__section-text {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-1);
  margin: 0;
}

/* ─── Trainer overlay (CognitexLab style) ─── */
.trainer-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.trainer-overlay[hidden] { display: none; }
.trainer-overlay__bg {
  position: absolute;
  inset: 0;
  background: var(--bg-0);
  pointer-events: none;
}
.trainer-overlay__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 480px;
  height: 100%;
  height: 100dvh;
}
.tr-topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 52px;
  padding: 0 16px;
  padding-top: env(safe-area-inset-top, 0px);
  box-sizing: content-box;
  border-bottom: 1px solid var(--panel-border);
}
.tr-topbar__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-0);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tr-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
#trainer-action { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px); }
#trainer-action:empty { display: none; }
.tr-footer__btn {
  width: 100%;
  padding: 16px;
  border-radius: 16px;
  border: none;
  background: var(--accent);
  color: #001014;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.3px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.tr-footer__btn--ghost {
  background: var(--panel);
  color: var(--text-0);
  border: 1px solid var(--panel-border);
}

/* Trainer close button */
.tr-close {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  color: var(--text-1);
  cursor: pointer;
  padding: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.tr-close svg, .tr-close path {
  pointer-events: none;
}
.tr-close:hover {
  color: var(--accent);
}

/* Trainer stimulus area */
.trainer-area {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
}

/* Trainer feedback line */
.tr-fb {
  font-family: var(--font-mono);
  font-size: 12px;
  min-height: 20px;
  letter-spacing: 2px;
  text-align: center;
  text-shadow: 0 0 16px currentColor;
  margin: 8px 0;
}

/* Span digit pop animation */
@keyframes spanPop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ─── Modals ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease;
}
.modal-overlay[hidden] { display: none; }
@keyframes fadeIn {
  from { opacity: 0; }
}
.modal {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: #0e1118;
  border: 1px solid var(--panel-border);
  border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 28px 24px 36px;
  animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUp {
  from { transform: translateY(100%); }
}

/* Полноэкранная модалка (установка на телефон) */
.modal-overlay--full { align-items: stretch; }
.modal--full {
  max-width: 480px;
  border: none;
  border-radius: 0;
  padding: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal--full .modal__close {
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  right: 16px;
  z-index: 2;
}
.install-fs {
  padding: calc(env(safe-area-inset-top, 0px) + 52px) 24px calc(env(safe-area-inset-bottom, 0px) + 48px);
}
.install-fs .modal__icon { margin: 0 auto 16px; }
.install-os { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.install-group__label {
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-2); margin: 0 0 10px;
}
.install-steps { margin-top: 4px; }
.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
}
.modal__close:active { background: rgba(255,255,255,0.05); }
.modal__icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 16px;
}
.modal__title {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 800;
}

/* ─── Toast ─── */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1a2332;
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 12px 32px -8px rgba(0,0,0,0.7);
  animation: toastIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: calc(100% - 40px);
}
.toast[hidden] { display: none; }
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
}
.toast__text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ─── Protocol Detail ─── */
.protocol-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #06080d;
  overflow-y: auto;
  animation: fadeIn 0.25s ease;
}
.protocol-detail-overlay[hidden] { display: none !important; }
.protocol-detail {
  max-width: 480px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 16px) + 12px) 20px 40px;
}
.protocol-detail__close {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-1);
  cursor: pointer;
  margin-bottom: 20px;
}
.protocol-detail__badge {
  margin-bottom: 12px;
}
.protocol-detail__title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px;
}
.protocol-detail__meta {
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 16px;
}
.protocol-detail__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}
.protocol-detail__desc {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-1);
  margin-bottom: 28px;
  white-space: pre-line;
}
.protocol-detail__note {
  text-align: center;
  font-size: 12px;
  color: var(--text-2, rgba(255,255,255,0.35));
  margin-top: 12px;
}
.protocol-detail__content {
  position: relative;
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.protocol-detail__content[hidden] { display: none; }
.proto-body {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-0);
  white-space: pre-wrap;
  word-break: break-word;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}
/* Водяной знак с email — вертикальный, на всю высоту контента, поверх текста, скроллится вместе с ним */
.proto-wm {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  display: flex;
  justify-content: center;
  overflow: hidden;
}
.proto-wm__t {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 10px;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.12);
  user-select: none;
}
@keyframes fadeIn {
  from { opacity: 0; }
}

/* ─── Auth Prompt ─── */
.auth-prompt-modal { text-align: center; }
.auth-prompt__icon {
  color: var(--accent);
  margin-bottom: 16px;
}
.auth-prompt__title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 8px;
}
.auth-prompt__text {
  font-size: 14px;
  color: var(--text-1);
  line-height: 1.6;
  margin: 0 0 24px;
}

/* ─── Auth ─── */
.auth-card {
  text-align: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 20px;
  margin-bottom: 20px;
}
.auth-card__icon { color: var(--text-1); margin-bottom: 12px; }
.auth-card__text {
  font-size: 14px;
  color: var(--text-1);
  margin-bottom: 18px;
}
.auth-card__btn {
  display: block;
  width: 100%;
  margin-bottom: 8px;
}
.auth-card__btn:last-child { margin-bottom: 0; }

.auth-user[hidden] { display: none; }
.auth-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 20px;
}
.auth-user__info { display: flex; align-items: center; gap: 12px; }
.auth-user__avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(0,194,255,0.1);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
}
.auth-user__name { font-size: 14px; font-weight: 600; }
.auth-user__email { font-size: 12px; color: var(--text-1); }

.auth-form { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.auth-input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-0);
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.auth-input:focus { border-color: var(--accent); }
.auth-input::placeholder { color: var(--text-2, rgba(255,255,255,0.3)); }

/* ─── Профиль-анкета для Крукса ─── */
/* Мелкий чип «Профиль» над полем ввода */
.agent-toprow { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.agent-profile-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 100px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  color: var(--text-1); font-size: 12px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: color 0.15s, border-color 0.15s;
}
.agent-profile-chip:active { color: var(--accent); border-color: rgba(34,211,238,0.4); }
.agent-profile-chip[hidden] { display: none; }
.agent-profile-chip svg { flex: 0 0 auto; }
.profile-modal {
  text-align: center; max-width: 460px;
  padding: calc(env(safe-area-inset-top, 0px) + 60px) 22px calc(env(safe-area-inset-bottom, 0px) + 32px);
}
.profile-modal__sub { color: var(--text-1); font-size: 14px; line-height: 1.5; margin: 6px 0 20px; }
.profile-form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.profile-field { display: flex; flex-direction: column; gap: 6px; }
.profile-field > span { font-size: 13px; font-weight: 600; color: var(--text-1); padding-left: 2px; }
.profile-field > span i { font-weight: 400; color: var(--text-2, rgba(255,255,255,0.3)); font-style: normal; }
.profile-row { display: flex; gap: 12px; }
.profile-row .profile-field { flex: 1; min-width: 0; }
.profile-select { appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2322d3ee' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px; }
.profile-select option { background: var(--bg-1, #0d1420); color: var(--text-0); }
.profile-modal__note { font-size: 12px; color: var(--text-2, rgba(255,255,255,0.35)); text-align: center; margin: 4px 0 0; line-height: 1.4; }
.profile-form #pf-submit { margin-top: 4px; }

.auth-consent {
  margin: 12px 0 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-2);
  text-align: center;
}
.auth-consent a {
  color: var(--accent);
  text-decoration: none;
}
.auth-consent a:hover {
  text-decoration: underline;
}

.auth-switch {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-1);
  text-align: center;
}
.auth-switch__btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* ─── Tabbar ─── */
.tabbar {
  position: fixed;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 448px;
  display: flex;
  justify-content: space-around;
  padding: 8px 4px;
  border-radius: 26px;
  z-index: 30;
  background: rgba(14, 17, 24, 0.75);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  box-shadow: 0 20px 50px -20px rgba(0,0,0,0.7), 0 1px 0 rgba(255,255,255,0.05) inset;
}
.tab {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 10px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 16px;
  cursor: pointer;
  transition: color 0.25s ease, background 0.25s ease;
}
.tab svg { width: 21px; height: 21px; }
.tab--active {
  color: var(--accent);
  background: rgba(34, 211, 238, 0.1);
}

/* ─── Purchase items ─── */
.purchases-filled {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 4px 0;
  margin-bottom: 14px;
  text-align: left;
}
.purchase-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-0);
  border-bottom: 1px solid var(--panel-border);
}
.purchase-item:last-child { border-bottom: none; }
.purchase-item svg { color: var(--accent); flex: none; }

/* ─── Responsive ─── */
@media (max-width: 400px) {
  .screens { padding-left: 16px; padding-right: 16px; }
  .topbar { padding: 14px 14px 10px; gap: 6px; }
  .brand { gap: 10px; }
  .brand__logo { width: 32px; height: 32px; }
  .brand__name { font-size: 14px; }
  .brand__tagline { font-size: 8px; }
  .topbar__actions { gap: 5px; }
  .balance-btn { font-size: 11px; padding: 5px 9px; }
  .badge-pill { font-size: 9px; padding: 5px 8px; }
  .tab { font-size: 9px; padding: 7px 10px; }
  .tab svg { width: 19px; height: 19px; }
}

/* ─── Splash screen ─── */
.splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: radial-gradient(120% 80% at 50% 35%, #0d1420 0%, var(--bg-0) 60%);
  opacity: 1;
  transition: opacity 0.55s ease;
}
.splash--hide { opacity: 0; pointer-events: none; }

.splash__glow {
  position: absolute;
  top: 38%;
  left: 50%;
  width: 320px;
  height: 320px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 62%);
  filter: blur(14px);
  opacity: 0.55;
  animation: splashGlow 2.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes splashGlow {
  0%, 100% { opacity: 0.4; transform: translate(-50%, -50%) scale(0.92); }
  50% { opacity: 0.7; transform: translate(-50%, -50%) scale(1.06); }
}

.splash__node {
  position: relative;
  width: 148px;
  height: 148px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: splashIn 0.7s ease both;
}
@keyframes splashIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

.splash__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(34, 211, 238, 0.12);
  border-top-color: var(--accent);
  border-right-color: rgba(34, 211, 238, 0.5);
  animation: splashSpin 1.1s linear infinite;
}
@keyframes splashSpin { to { transform: rotate(360deg); } }

.splash__vult {
  width: 96px;
  height: 96px;
  animation: splashRotate 9s linear infinite;
}
@keyframes splashRotate { to { transform: rotate(360deg); } }

.splash__net line {
  stroke: rgba(34, 211, 238, 0.4);
  stroke-width: 1.5;
  animation: splashPulse 2s ease-in-out infinite;
}
.splash__net line:nth-child(2) { animation-delay: 0.15s; }
.splash__net line:nth-child(3) { animation-delay: 0.3s; }
.splash__net line:nth-child(4) { animation-delay: 0.45s; }
.splash__net line:nth-child(5) { animation-delay: 0.6s; }
.splash__net line:nth-child(6) { animation-delay: 0.75s; }
@keyframes splashPulse {
  0%, 100% { stroke: rgba(34, 211, 238, 0.2); }
  50% { stroke: rgba(34, 211, 238, 0.75); }
}

.splash__dot {
  fill: var(--accent);
  animation: splashDot 2s ease-in-out infinite;
}
.splash__dot:nth-child(8) { animation-delay: 0.15s; }
.splash__dot:nth-child(9) { animation-delay: 0.3s; }
.splash__dot:nth-child(10) { animation-delay: 0.45s; }
.splash__dot:nth-child(11) { animation-delay: 0.6s; }
.splash__dot:nth-child(12) { animation-delay: 0.75s; }
@keyframes splashDot {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.splash__core {
  fill: var(--accent);
  filter: drop-shadow(0 0 6px var(--accent-glow));
  animation: splashCore 2s ease-in-out infinite;
}
@keyframes splashCore {
  0%, 100% { transform: scale(1); transform-origin: 60px 60px; }
  50% { transform: scale(1.18); transform-origin: 60px 60px; }
}

.splash__brand {
  margin-top: 30px;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: var(--text-0);
  animation: splashText 0.8s ease 0.25s both;
}
.splash__tagline {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-1);
  animation: splashText 0.8s ease 0.45s both;
}
@keyframes splashText {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Feed loading skeleton ─── */
.post-skel { padding: 0 2px; margin-bottom: 22px; }
.post-skel__head { display: flex; align-items: center; gap: 12px; }
.post-skel__avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--panel); flex: 0 0 auto; }
.post-skel__lines { display: flex; flex-direction: column; gap: 7px; }
.post-skel__bubble {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 16px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
}
.skel-bar {
  height: 11px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.09) 37%, rgba(255,255,255,0.04) 63%);
  background-size: 400% 100%;
  animation: skelShimmer 1.4s ease infinite;
}
@keyframes skelShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

/* ─── Крукс агент (чат) ─── */
.agent-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 176px;
}
.agent-empty {
  text-align: center;
  color: var(--text-2);
  padding: 40px 20px;
}
.agent-empty__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(34,211,238,0.08);
  border: 1px solid rgba(34,211,238,0.2);
  color: var(--accent);
}
.agent-empty__sub { font-size: 13px; line-height: 1.5; }
.agent-msg {
  max-width: 85%;
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: break-word;
}
.agent-msg--user {
  align-self: flex-end;
  background: var(--accent);
  color: #001014;
  border-bottom-right-radius: 5px;
}
.agent-msg--assistant {
  align-self: flex-start;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  color: var(--text-0);
  border-bottom-left-radius: 5px;
}

.agent-inputbar[hidden] { display: none; }
.agent-inputbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 112px);
  width: calc(100% - 32px);
  max-width: 448px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 8px;
  border-radius: 22px;
  background: rgba(14, 17, 24, 0.9);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  z-index: 25;
}
.agent-inputrow {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
}
.agent-attach {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.06);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: background .15s, color .15s;
}
.agent-attach:hover { background: rgba(255,255,255,0.1); color: var(--text-0); }
.agent-attach:active { transform: scale(0.94); }
.agent-preview {
  position: relative;
  width: 64px;
  height: 64px;
  margin-left: 4px;
}
.agent-preview[hidden] { display: none; }
.agent-preview__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
}
.agent-preview__remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--bg-0, #0e1118);
  background: #e5484d;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.agent-msg__img {
  display: block;
  max-width: min(220px, 70%);
  max-height: 240px;
  border-radius: 12px;
  margin-bottom: 6px;
}
.agent-msg--user .agent-msg__img { margin-left: auto; }
/* Лёгкий дисклеймер под ответом агента */
.agent-disclaimer {
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-2);
  opacity: 0.7;
  margin: -2px 4px 14px;
  max-width: 90%;
}
.agent-disclaimer--fade {
  opacity: 0;
  transition: opacity 0.5s ease;
}
.agent-disclaimer--fade.on { opacity: 0.7; }
.agent-input {
  flex: 1;
  border: none;
  background: none;
  color: var(--text-0);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.4;
  padding: 8px 6px 8px 10px;
  max-height: 120px;
  resize: none;
  outline: none;
}
.agent-input::placeholder { color: var(--text-2); }
.agent-send {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #001014;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
}
.agent-send:disabled { opacity: 0.4; }

/* 1) Пузырь появляется (уже размером под ответ) */
@keyframes agentBubbleIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.agent-bubble-in {
  animation: agentBubbleIn 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
  will-change: opacity, transform;
}

/* 2) Текст "печатается": символы проступают по очереди — слева направо и вниз */
.agent-ch {
  opacity: 0;
  transition: opacity 0.3s ease;
}
.agent-ch.on { opacity: 1; }

/* 3) Анимация "агент думает" */
/* Индикатор «Агент думает» — анимированный узел + подпись */
.agent-msg--thinking { background: none; padding: 4px 2px; }
.agent-thinking { display: inline-flex; align-items: center; gap: 11px; color: var(--accent); }
.agent-thinking__node { flex: 0 0 auto; overflow: visible; }
.agent-thinking__links line {
  opacity: 0.2;
  animation: nodeLink 1.9s ease-in-out infinite;
}
.agent-thinking__node .d {
  transform-box: fill-box;
  transform-origin: center;
  animation: nodePulse 1.7s ease-in-out infinite;
}
.agent-thinking__node .d:nth-of-type(1) { animation-delay: 0s; }
.agent-thinking__node .d:nth-of-type(2) { animation-delay: 0.22s; }
.agent-thinking__node .d:nth-of-type(3) { animation-delay: 0.44s; }
.agent-thinking__node .d:nth-of-type(4) { animation-delay: 0.66s; }
.agent-thinking__node .d:nth-of-type(5) { animation-delay: 0.88s; }
.agent-thinking__node .d:nth-of-type(6) { animation-delay: 1.1s; }
.agent-thinking__node .core {
  transform-box: fill-box;
  transform-origin: center;
  animation: nodeCore 1.7s ease-in-out infinite;
}
.agent-thinking__text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-1);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.agent-thinking__ell i {
  opacity: 0;
  animation: nodeEll 1.4s steps(1) infinite;
}
.agent-thinking__ell i:nth-child(2) { animation-delay: 0.25s; }
.agent-thinking__ell i:nth-child(3) { animation-delay: 0.5s; }
@keyframes nodePulse {
  0%, 68%, 100% { opacity: 0.3; transform: scale(0.65); }
  34% { opacity: 1; transform: scale(1.3); }
}
@keyframes nodeCore {
  0%, 100% { opacity: 0.7; transform: scale(0.88); }
  50% { opacity: 1; transform: scale(1.14); }
}
@keyframes nodeLink {
  0%, 100% { opacity: 0.12; }
  50% { opacity: 0.5; }
}
@keyframes nodeEll {
  0%, 100% { opacity: 0; }
  40% { opacity: 1; }
}

/* ─── Гейт для незарегистрированных ─── */
.auth-gate {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 44px 24px;
  margin-top: 8px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
}
body.guest .auth-gate { display: flex; }
body.guest #dynamic-posts-feed,
body.guest #tools-feed,
body.guest #tools-feed-empty,
body.guest #tools-lock,
body.guest #protocols-feed,
body.guest #protocols-feed-empty,
body.guest #agent-messages,
body.guest #agent-lock,
body.guest #agent-inputbar { display: none !important; }

.auth-gate__actions {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 320px;
  margin-top: 4px;
}
.auth-gate__actions .btn { flex: 1; }

/* Гость на вкладке «Тарифы»: показываем только карточку входа */
body.guest #screen-settings .section-label,
body.guest #screen-settings .sub-card,
body.guest #screen-settings #purchases-list,
body.guest #screen-settings .settings-list { display: none !important; }

body.guest #screen-settings .screen__head,
body.guest #screen-settings .auth-card__text { display: none; }