:root {
  --bg: #0b0d17;
  --bg-2: #11142a;
  --surface: #ffffff;
  --surface-soft: #f6f7fb;
  --ink: #0b0d17;
  --ink-soft: #4a4f6a;
  --muted: #8a90a8;
  --border: #e7e9f2;
  --accent: #1e4fd9;
  --accent-2: #2b7fff;
  --accent-3: #00bfa5;
  --grad: linear-gradient(135deg, #1e4fd9 0%, #2b7fff 55%, #00bfa5 100%);
  --grad-soft: linear-gradient(135deg, #eaf1ff 0%, #e6fbf6 100%);
  --shadow-lg: 0 30px 80px -20px rgba(30, 79, 217, .30);
  --shadow-md: 0 10px 30px -10px rgba(30, 79, 217, .22);
  --radius: 18px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ============ Brand ============ */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
}
.brand__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 12px;
  background: var(--grad);
  font-size: 20px;
  box-shadow: var(--shadow-md);
}
.brand__text span { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
  white-space: nowrap;
}
.btn--sm  { padding: 8px 14px; font-size: 13px; }
.btn--lg  { padding: 16px 28px; font-size: 16px; }
.btn--primary {
  background: var(--grad);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.btn--primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--ink);
}
.btn--ghost:hover { background: var(--surface-soft); }
.landing .btn--ghost { border-color: rgba(255,255,255,.18); color: #fff; }
.landing .btn--ghost:hover { background: rgba(255,255,255,.06); }

/* ============ Landing layout ============ */
.landing {
  background: var(--bg);
  color: #fff;
}
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(16px);
  background: rgba(11, 13, 23, .65);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.nav__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex; align-items: center; gap: 24px;
}
.nav__links {
  display: flex; gap: 28px;
  margin-left: 32px;
  flex: 1;
}
.nav__links a {
  color: rgba(255,255,255,.75);
  font-size: 14px;
  font-weight: 500;
  transition: color .2s;
}
.nav__links a:hover { color: #fff; }

@media (max-width: 720px) {
  .nav__links { display: none; }
}

/* ============ Hero ============ */
.hero {
  position: relative;
  overflow: hidden;
  padding: 90px 24px 120px;
}
.hero__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 50% at 20% 0%, rgba(108, 92, 255, .35), transparent 60%),
    radial-gradient(50% 40% at 90% 20%, rgba(255, 107, 214, .28), transparent 60%),
    radial-gradient(40% 50% at 60% 100%, rgba(160, 107, 255, .25), transparent 60%);
  filter: blur(10px);
  pointer-events: none;
}
.hero__inner {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  font-size: 13px;
  color: rgba(255,255,255,.85);
  margin-bottom: 28px;
}
.badge__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 12px #4ade80;
}
.hero__title {
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 800;
  margin: 0 0 24px;
}
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero__subtitle {
  font-size: 19px;
  color: rgba(255,255,255,.72);
  max-width: 640px;
  margin: 0 auto 40px;
}
.hero__cta {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 64px;
}
.hero__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 600px;
  margin: 0 auto;
  padding: 24px;
  border-radius: var(--radius);
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
}
.hero__stats div { display: flex; flex-direction: column; }
.hero__stats strong {
  font-size: 20px;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero__stats span {
  font-size: 13px;
  color: rgba(255,255,255,.6);
  margin-top: 4px;
}
@media (max-width: 600px) {
  .hero__stats { grid-template-columns: 1fr; }
}

/* ============ Sections (on dark bg) ============ */
.section__head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 56px;
  padding: 0 24px;
}
.section__head h2 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}
.section__head p {
  color: rgba(255,255,255,.65);
  font-size: 17px;
  margin: 0;
}

.features, .how {
  padding: 80px 24px;
  background: var(--bg);
}
.features { background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%); }
.how { background: var(--bg-2); }

.cards {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(108,92,255,.4);
  background: rgba(255,255,255,.06);
}
.card__icon {
  width: 52px; height: 52px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 14px;
  background: var(--grad);
  font-size: 24px;
  margin-bottom: 18px;
}
.card h3 { font-size: 19px; margin: 0 0 8px; font-weight: 700; }
.card p { color: rgba(255,255,255,.68); margin: 0; font-size: 15px; }

.steps {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.step {
  position: relative;
  padding: 32px 28px;
  border-radius: var(--radius);
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
}
.step__num {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--grad);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800;
  margin-bottom: 18px;
}
.step h3 { margin: 0 0 8px; font-size: 18px; font-weight: 700; }
.step p { margin: 0; color: rgba(255,255,255,.68); font-size: 15px; }

/* ============ CTA ============ */
.cta {
  padding: 90px 24px;
  background: var(--bg-2);
}
.cta__inner {
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
  padding: 64px 32px;
  border-radius: 28px;
  background: var(--grad);
  box-shadow: var(--shadow-lg);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.cta__inner::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(50% 60% at 80% 0%, rgba(255,255,255,.3), transparent 70%);
  pointer-events: none;
}
.cta__inner h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  position: relative;
}
.cta__inner p { margin: 0 0 28px; font-size: 17px; opacity: .9; position: relative; }
.cta__inner .btn--primary {
  background: #fff;
  color: var(--accent);
  position: relative;
}

/* ============ Footer ============ */
.footer {
  padding: 48px 24px;
  background: var(--bg);
  border-top: 1px solid rgba(255,255,255,.06);
}
.footer__inner {
  max-width: 1180px;
  margin: 0 auto;
  text-align: center;
}
.footer p {
  color: rgba(255,255,255,.5);
  font-size: 14px;
  margin: 16px 0 0;
}

/* ============ Chat page (единый тёмный стиль с лендингом) ============ */
.chat-page {
  position: relative;
  min-height: 100vh;
  color: #fff;
  background: var(--bg);
  display: flex; flex-direction: column;
  overflow-x: hidden;
}
.chat-page::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(60% 50% at 20% 0%, rgba(108, 92, 255, .28), transparent 60%),
    radial-gradient(50% 40% at 90% 20%, rgba(255, 107, 214, .20), transparent 60%),
    radial-gradient(40% 50% at 60% 100%, rgba(160, 107, 255, .18), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.chat-page > * { position: relative; z-index: 1; }

.chat-header {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 24px;
  backdrop-filter: blur(16px);
  background: rgba(11, 13, 23, .65);
  border-bottom: 1px solid rgba(255,255,255,.08);
  position: sticky; top: 0; z-index: 10;
}
.chat-header__status {
  display: inline-flex; align-items: center; gap: 8px;
  margin-left: 16px;
  font-size: 13px;
  color: rgba(255,255,255,.65);
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #9ca3af;
}
.status-dot--ok { background: #4ade80; box-shadow: 0 0 12px rgba(74,222,128,.7); }
.status-dot--warn { background: #f59e0b; box-shadow: 0 0 12px rgba(245,158,11,.5); }
.chat-header__actions {
  margin-left: auto;
  display: flex; gap: 8px;
}
.chat-page .btn--ghost {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.14);
  color: #fff;
}
.chat-page .btn--ghost:hover { background: rgba(255,255,255,.08); }

.chat {
  flex: 1;
  display: flex; flex-direction: column;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
  gap: 20px;
}
.chat__messages {
  flex: 1;
  display: flex; flex-direction: column;
  gap: 18px;
  padding-bottom: 20px;
}

.msg {
  display: flex;
  gap: 12px;
  animation: msg-in .25s ease;
}
@keyframes msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.msg--user { flex-direction: row-reverse; }
.msg__avatar {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--grad);
  font-size: 18px;
  box-shadow: var(--shadow-md);
}
.msg--user .msg__avatar {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  color: #fff;
  font-weight: 700;
  box-shadow: none;
}
.msg__bubble {
  max-width: 85%;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
  color: rgba(255,255,255,.92);
  padding: 14px 18px;
  border-radius: 16px;
  border-top-left-radius: 4px;
  backdrop-filter: blur(8px);
  word-wrap: break-word;
  white-space: pre-wrap;
}
.msg--user .msg__bubble {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
  border-top-left-radius: 16px;
  border-top-right-radius: 4px;
  box-shadow: var(--shadow-md);
}
.msg__name {
  font-size: 12px;
  font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.msg--user .msg__name {
  background: none;
  -webkit-text-fill-color: rgba(255,255,255,.85);
  color: rgba(255,255,255,.85);
}
.msg__bubble p { margin: 0; }

.chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 14px;
}
.chip {
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.85);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s ease;
}
.chip:hover {
  border-color: transparent;
  color: #fff;
  background: var(--grad);
  box-shadow: var(--shadow-md);
}

.typing {
  display: inline-flex; gap: 4px; align-items: center;
}
.typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-2);
  opacity: .4;
  animation: typing 1.2s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing {
  0%, 80%, 100% { transform: scale(.6); opacity: .3; }
  40% { transform: scale(1); opacity: 1; }
}

.msg--error .msg__bubble {
  background: rgba(248, 113, 113, .12);
  border-color: rgba(248, 113, 113, .35);
  color: #fca5a5;
}

/* ============ Composer ============ */
.composer {
  position: sticky;
  bottom: 16px;
  background: transparent;
}
.composer__box {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: rgba(17, 20, 42, .85);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 18px;
  padding: 10px 10px 10px 18px;
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5);
  transition: border-color .2s, box-shadow .2s;
}
.composer__box:focus-within {
  border-color: rgba(160, 107, 255, .6);
  box-shadow: 0 0 0 4px rgba(108, 92, 255, .18), 0 10px 30px -10px rgba(0, 0, 0, .5);
}
.composer textarea {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  font-size: 15.5px;
  font-family: inherit;
  line-height: 1.5;
  max-height: 220px;
  padding: 8px 0;
  background: transparent;
  color: #fff;
}
.composer textarea::placeholder { color: rgba(255,255,255,.4); }

.composer__send {
  width: 42px; height: 42px;
  border-radius: 12px;
  border: none;
  background: var(--grad);
  color: #fff;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .15s ease, box-shadow .2s ease, opacity .2s;
  box-shadow: var(--shadow-md);
}
.composer__send:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.composer__send:disabled { opacity: .5; cursor: not-allowed; }

.composer__hint {
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,.4);
  margin-top: 8px;
}

@media (max-width: 600px) {
  .chat-header { padding: 12px 14px; gap: 10px; }
  .chat-header__status { display: none; }
  .chat { padding: 14px; }
  .msg__bubble { max-width: 90%; }
}

/* ============ Theme toggle ============ */
.theme-toggle {
  width: 38px; height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.04);
  color: #fff;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .2s, border-color .2s, transform .15s;
  flex-shrink: 0;
}
.theme-toggle:hover { background: rgba(255,255,255,.10); transform: translateY(-1px); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }

/* ============ LIGHT THEME ============ */
[data-theme="light"] body { background: #ffffff; color: var(--ink); }

/* Landing — light */
[data-theme="light"] .landing { background: #ffffff; color: var(--ink); }
[data-theme="light"] .nav {
  background: rgba(255,255,255,.85);
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] .nav__links a { color: var(--ink-soft); }
[data-theme="light"] .nav__links a:hover { color: var(--ink); }
[data-theme="light"] .landing .btn--ghost {
  border-color: var(--border);
  color: var(--ink);
  background: transparent;
}
[data-theme="light"] .landing .btn--ghost:hover { background: var(--surface-soft); }
[data-theme="light"] .hero__bg {
  background:
    radial-gradient(60% 50% at 20% 0%, rgba(108, 92, 255, .14), transparent 60%),
    radial-gradient(50% 40% at 90% 20%, rgba(255, 107, 214, .12), transparent 60%),
    radial-gradient(40% 50% at 60% 100%, rgba(160, 107, 255, .10), transparent 60%);
}
[data-theme="light"] .badge {
  background: var(--surface-soft);
  border-color: var(--border);
  color: var(--ink-soft);
}
[data-theme="light"] .hero__subtitle { color: var(--ink-soft); }
[data-theme="light"] .hero__stats {
  background: var(--surface-soft);
  border-color: var(--border);
}
[data-theme="light"] .hero__stats span { color: var(--muted); }

[data-theme="light"] .features { background: linear-gradient(180deg, #ffffff 0%, var(--surface-soft) 100%); }
[data-theme="light"] .how { background: var(--surface-soft); }
[data-theme="light"] .cta { background: var(--surface-soft); }
[data-theme="light"] .section__head p { color: var(--ink-soft); }

[data-theme="light"] .card {
  background: #ffffff;
  border-color: var(--border);
  box-shadow: 0 4px 20px -8px rgba(30, 79, 217, .15);
}
[data-theme="light"] .card:hover {
  background: #ffffff;
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}
[data-theme="light"] .card p { color: var(--ink-soft); }

[data-theme="light"] .step {
  background: #ffffff;
  border-color: var(--border);
  box-shadow: 0 4px 20px -8px rgba(30, 79, 217, .12);
}
[data-theme="light"] .step p { color: var(--ink-soft); }

[data-theme="light"] .footer { background: #ffffff; border-top-color: var(--border); }
[data-theme="light"] .footer p { color: var(--muted); }

/* Chat — light (исходный стиль) */
[data-theme="light"] .chat-page { background: var(--surface-soft); color: var(--ink); }
[data-theme="light"] .chat-page::before { display: none; }
[data-theme="light"] .chat-header {
  background: #fff;
  border-bottom-color: var(--border);
  backdrop-filter: none;
}
[data-theme="light"] .chat-header__status { color: var(--muted); }
[data-theme="light"] .status-dot--ok { background: #22c55e; box-shadow: 0 0 10px rgba(34,197,94,.6); }
[data-theme="light"] .chat-page .btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--ink);
}
[data-theme="light"] .chat-page .btn--ghost:hover { background: var(--surface-soft); }

[data-theme="light"] .msg--user .msg__avatar {
  background: #1f2337;
  border: none;
  color: #fff;
}
[data-theme="light"] .msg__bubble {
  background: #fff;
  border-color: var(--border);
  color: var(--ink);
  backdrop-filter: none;
  box-shadow: 0 2px 10px rgba(15, 20, 50, .03);
}
[data-theme="light"] .msg--user .msg__bubble {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
}
[data-theme="light"] .msg__name {
  background: none;
  -webkit-text-fill-color: var(--accent);
  color: var(--accent);
}
[data-theme="light"] .msg--user .msg__name {
  -webkit-text-fill-color: rgba(255,255,255,.8);
  color: rgba(255,255,255,.8);
}

[data-theme="light"] .chip {
  background: var(--surface-soft);
  border-color: var(--border);
  color: var(--ink);
}
[data-theme="light"] .chip:hover {
  background: #fff;
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: none;
}
[data-theme="light"] .typing span { background: var(--accent); }

[data-theme="light"] .msg--error .msg__bubble {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

[data-theme="light"] .composer__box {
  background: #fff;
  border-color: var(--border);
  backdrop-filter: none;
  box-shadow: 0 10px 30px -10px rgba(15, 20, 50, .08);
}
[data-theme="light"] .composer__box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(108, 92, 255, .12), 0 10px 30px -10px rgba(15, 20, 50, .08);
}
[data-theme="light"] .composer textarea { color: var(--ink); }
[data-theme="light"] .composer textarea::placeholder { color: var(--muted); }
[data-theme="light"] .composer__hint { color: var(--muted); }

/* Theme toggle — light */
[data-theme="light"] .theme-toggle {
  background: var(--surface-soft);
  border-color: var(--border);
  color: var(--ink);
}
[data-theme="light"] .theme-toggle:hover { background: #fff; border-color: var(--accent); }
[data-theme="light"] .theme-toggle .icon-sun  { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* ============ Auth / Cabinet / Admin / Subscribe / Docs ============ */
.page { max-width: 1100px; margin: 0 auto; padding: 40px 24px 60px; }
.nav__auth { display: flex; align-items: center; gap: 10px; }

.auth-page .page, .info-page .page { display: flex; justify-content: center; }
.auth-card {
  max-width: 480px; width: 100%;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-md);
}
.auth-card h1 { margin: 0 0 8px; font-size: 28px; }
.auth-sub { color: var(--muted); margin-bottom: 20px; }
.auth-error {
  background: #fee; color: #b02a37; padding: 10px 14px;
  border-radius: 10px; margin-bottom: 16px; font-size: 14px;
}
.auth-notice {
  background: #e6fbf6; color: #046652; padding: 10px 14px;
  border-radius: 10px; margin-bottom: 16px; font-size: 14px;
}
.logout-form { display: inline; margin: 0; padding: 0; }

.admin__notice {
  padding: 12px 16px; border-radius: 10px; margin-bottom: 20px; font-size: 14px;
}
.admin__notice--ok   { background: #e7f8ec; color: #1a7f37; border: 1px solid #b7e4c0; }
.admin__notice--err  { background: #fee; color: #b02a37; border: 1px solid #f5c2c7; }
.admin__notice--warn { background: #fff4e5; color: #8a4b00; border: 1px solid #f5d9a8; }

.grace-banner {
  max-width: 1100px;
  margin: 16px auto 0;
  padding: 12px 20px;
  background: #fff4e5;
  border: 1px solid #f5d9a8;
  color: #8a4b00;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
}
.grace-banner a { color: #8a4b00; text-decoration: underline; }

.cab-card--wide { grid-column: 1 / -1; margin-top: 20px; }
.pay-history { font-size: 14px; }
.pay-status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.pay-status--ok   { background: #e7f8ec; color: #1a7f37; }
.pay-status--warn { background: #fff4e5; color: #8a4b00; }
.pay-status--err  { background: #fee; color: #b02a37; }

.admin__user-profile {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  margin-bottom: 20px;
}
.admin__user-profile p { margin: 4px 0; }

.billing-terms {
  margin-top: 36px;
  padding: 24px 28px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.billing-terms h2 { margin: 0 0 14px; font-size: 20px; }
.billing-terms ul { list-style: none; padding: 0; margin: 0; }
.billing-terms li { padding: 8px 0; line-height: 1.55; border-bottom: 1px solid var(--border); }
.billing-terms li:last-child { border-bottom: none; }

.s-spinner { margin: 20px 0; text-align: center; }
.s-spinner__dot {
  width: 38px; height: 38px; margin: 0 auto;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: s-spin 0.9s linear infinite;
}
@keyframes s-spin { to { transform: rotate(360deg); } }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
.auth-form input {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}
.auth-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.auth-alt { margin-top: 20px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.auth-alt a { color: var(--accent); }

/* Cabinet */
.cabinet h1 { margin: 0 0 24px; font-size: 32px; }
.cabinet__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.cab-card {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.cab-card h2 { margin: 0 0 12px; font-size: 18px; }
.cab-card p { margin: 6px 0; }
.cab-card .ok { color: #1a7f37; }
.muted { color: var(--muted); font-size: 14px; }

/* Subscribe / plans */
.subscribe, .pricing { padding: 20px 0; }
.subscribe h1 { font-size: 32px; margin-bottom: 8px; }
.subscribe__lead { color: var(--ink-soft); margin-bottom: 28px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.plan {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
}
.plan h2, .plan h3 { margin: 0 0 12px; font-size: 22px; }
.plan__price { font-size: 36px; font-weight: 800; margin-bottom: 18px; }
.plan__price span { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 6px; }
.plan__features { list-style: none; padding: 0; margin: 0 0 22px; }
.plan__features li { padding: 6px 0 6px 24px; position: relative; }
.plan__features li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.plan--featured { border-color: var(--accent); box-shadow: var(--shadow-md); }
.plan__badge {
  position: absolute; top: -12px; right: 20px;
  background: var(--grad); color: #fff;
  padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
}
.plan__active { padding: 10px; background: #e7f8ec; color: #1a7f37; border-radius: 10px; margin-bottom: 12px; }
.docs-promo {
  margin-top: 40px; padding: 28px;
  background: var(--grad-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.docs-promo h2 { margin: 0 0 12px; font-size: 22px; }
.docs-promo ul { line-height: 1.9; }
.pricing__note { text-align: center; margin-top: 18px; }

/* Documents */
.documents h1 { margin: 0 0 8px; font-size: 32px; }
.docs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin-top: 20px; }
.doc-card {
  background: var(--surface-soft); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
}
.doc-card__icon { font-size: 32px; margin-bottom: 8px; }
.doc-card h3 { margin: 0 0 8px; font-size: 16px; }
.doc-card p { color: var(--ink-soft); font-size: 14px; margin-bottom: 12px; }

/* Admin */
.admin h1 { margin: 0 0 20px; font-size: 30px; }
.admin__metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 30px; }
.metric {
  background: var(--surface-soft); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px;
}
.metric__num { font-size: 26px; font-weight: 800; }
.metric__lbl { color: var(--muted); font-size: 13px; }
.admin h2 { font-size: 20px; margin: 24px 0 12px; }
.admin__table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.admin__table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin__table th, .admin__table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.admin__table thead { background: var(--surface-soft); }
.admin__table tbody tr:hover { background: var(--surface-soft); }

/* Chat limits */
.chat-header__limits {
  margin-left: auto; margin-right: 12px;
  font-size: 13px; color: var(--ink-soft);
}
.chat-header__limits a { color: var(--accent); }
