/* ============ ПравоФин — юридический дизайн v2 ============ */
/* Палитра: изумруд + navy + золото. Градиенты, стекло, анимации */

/* Шрифты подключены ссылкой в разметке каждой страницы — так браузер
   начинает их грузить сразу, а не после разбора этого файла. Manrope
   и Playfair Display больше не используются: их заменили Onest и Golos
   Text с настоящей кириллицей. */

:root {
  /* светлая тема — тёплая бумага + морская волна + зелёный + золото */
  --bg: #f2f6f3;
  --bg-2: #e8efea;
  --surface: #ffffff;
  --surface-2: #eef4f0;
  --text: #0d1c19;
  --muted: #546b65;
  --primary: #0e8f86;
  --primary-2: #17a673;
  --primary-dark: #0a6f68;
  --navy: #14342f;
  --gold: #a8791b;
  --gold-2: #c99a2e;
  --violet: #0e8f86;
  --danger: #b3392c;
  --accent: #0e8f86;
  --border: #d3ded8;
  --shadow: 0 1px 2px rgba(13, 40, 36, .05);
  --shadow-lg: 0 12px 32px -18px rgba(13, 40, 36, .45);
  --radius: 12px;
  --grad-primary: linear-gradient(135deg, #0e8f86 0%, #14a88c 50%, #17a673 100%);
  --grad-navy: linear-gradient(135deg, #0d3a35 0%, #14564d 100%);
  --grad-gold: linear-gradient(135deg, #0a6f68 0%, #0e8f86 50%, #17a673 100%);
  --grad-violet: linear-gradient(135deg, #0e8f86 0%, #17a673 100%);
  --grad-hero: linear-gradient(155deg, #061f1c 0%, #0a4a44 48%, #0f5c46 100%);
  --glass: rgba(255, 255, 255, .72);
  --header-bg: rgba(255, 255, 255, .82);
}

[data-theme="dark"] {
  --bg: #071a17;
  --bg-2: #0a201c;
  --surface: #0c2521;
  --surface-2: #10302a;
  --text: #e4f1ed;
  --muted: #8aa9a3;
  --primary: #2dd4bf;
  --primary-2: #34d399;
  --primary-dark: #14a89a;
  --navy: #a7c8c1;
  --gold: #d9b437;
  --gold-2: #efd88a;
  --violet: #2dd4bf;
  --danger: #e57a6d;
  --border: #1a3a34;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-lg: 0 12px 32px -18px rgba(0, 0, 0, .9);
  --grad-primary: linear-gradient(135deg, #0f9d8f 0%, #17b894 50%, #22c55e 100%);
  --grad-navy: linear-gradient(135deg, #0b2f2b 0%, #124c44 100%);
  --grad-gold: linear-gradient(135deg, #0f9d8f 0%, #2dd4bf 50%, #34d399 100%);
  --grad-violet: linear-gradient(135deg, #2dd4bf 0%, #34d399 100%);
  --glass: rgba(13, 36, 32, .72);
  --header-bg: rgba(7, 24, 22, .82);
  /* Этих трёх не было: тёмная тема тянула их из светлой. --accent в итоге
     оставался тёмно-бирюзовым и почти сливался с тёмным фоном. */
  --accent: #2dd4bf;
  --grad-hero: linear-gradient(155deg, #04120f 0%, #073630 48%, #0a4436 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: "Manrope", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  transition: background .35s, color .35s;
  overflow-x: hidden;
}

/* Цветные светящиеся сферы на фоне каждой страницы */
body::before, body::after {
  content: "";
  position: fixed; z-index: -1; border-radius: 50%;
  filter: blur(90px); opacity: .5; pointer-events: none;
  animation: orbFloat 18s ease-in-out infinite alternate;
}
body::before {
  width: 520px; height: 520px; top: -160px; right: -140px;
  background: radial-gradient(circle, rgba(20, 184, 166, .38), transparent 70%);
}
body::after {
  width: 460px; height: 460px; bottom: -180px; left: -140px;
  background: radial-gradient(circle, rgba(201, 162, 39, .22), transparent 70%);
  animation-delay: -9s;
}
@keyframes orbFloat {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-60px, 50px) scale(1.15); }
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: none; }
img { max-width: 100%; }
::selection { background: var(--primary); color: #fff; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 22px; }

/* ============ Шапка ============ */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 14px; height: 68px; }
.logo {
  font-family: "Onest", Georgia, serif;
  font-weight: 800; font-size: 1.35rem; color: var(--text);
  display: flex; align-items: center; gap: 9px; letter-spacing: .3px;
}
.logo:hover { text-decoration: none; }
/* Знак весов — вектор, не эмодзи: наследует цвет темы, одинаков
   во всех системах и не зависит от того, как ОС рисует ⚖. */
.logo .logo-mark {
  width: 1.15em; height: 1.15em;
  flex: 0 0 auto;
  color: var(--primary);
  vertical-align: -0.18em;
}
.logo b {
  background: var(--grad-primary);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nav-links {
  display: flex; gap: 0; margin-left: auto;
  flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
  -ms-overflow-style: none;
  /* min-width: 0 обязателен: без него блок с прокруткой отказывается
     сжиматься и вылезает под соседние кнопки. Из-за этого «Кабинет»
     заезжал под плашку уведомлений. */
  flex: 0 1 auto; min-width: 0;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  position: relative; color: var(--muted); padding: 9px 11px;
  border-radius: 10px; font-weight: 600; font-size: .88rem;
  white-space: nowrap; transition: color .2s;
}
.nav-links a::after {
  content: ""; position: absolute; left: 11px; right: 11px; bottom: 4px; height: 2px;
  background: var(--grad-gold); border-radius: 2px;
  transform: scaleX(0); transform-origin: left; transition: transform .25s;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.nav-links a.active { color: var(--primary); }

/* ============ Кнопки ============ */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 26px; border-radius: 999px; border: none; cursor: pointer;
  font-weight: 700; font-size: .95rem; font-family: inherit;
  background: var(--grad-primary); color: #fff;
  box-shadow: 0 8px 22px rgba(14, 143, 134, .35);
  transition: transform .2s, box-shadow .2s, filter .2s;
  overflow: hidden;
}
.btn::before {
  content: ""; position: absolute; top: 0; left: -80%; width: 50%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .45), transparent);
  transform: skewX(-20deg); transition: left .5s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(14, 143, 134, .45); }
.btn:hover::before { left: 130%; }
.btn.secondary {
  background: var(--surface); color: var(--text);
  border: 1.5px solid var(--border); box-shadow: var(--shadow);
}
.btn.secondary:hover { border-color: var(--primary); color: var(--primary); box-shadow: var(--shadow-lg); }
.btn.gold { background: var(--grad-gold); color: #2a2205; box-shadow: 0 8px 22px rgba(201, 162, 39, .35); }
.btn.ghost { background: transparent; color: #fff; border: 2px solid rgba(255, 255, 255, .7); box-shadow: none; }
.btn.ghost:hover { background: rgba(255, 255, 255, .12); }
.btn.danger { background: linear-gradient(135deg, #c0392b, #e86a6a); box-shadow: 0 8px 22px rgba(198, 60, 48, .3); }
.btn.small { padding: 8px 18px; font-size: .86rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* Общий вид кнопок-таблеток в шапке. Оформление вынесено в отдельный
   класс: раньше кнопка уведомлений носила класс переключателя темы
   ради стилей, и смена темы переписывала ей текст. */
.header-pill, .theme-toggle {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 999px;
  padding: 9px 16px; cursor: pointer; font-size: .8rem; font-weight: 700; color: var(--text);
  font-family: inherit; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .25s, border-color .2s;
}
.header-pill:hover, .theme-toggle:hover {
  transform: translateY(-1px); border-color: var(--primary); color: var(--primary);
}

/* Аватар в шапке и настройках */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255, 255, 255, .25); font-weight: 800; font-size: .8rem;
}
.avatar-row { display: flex; gap: 8px; flex-wrap: wrap; }
.avatar-option {
  width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
  border: 2px solid var(--border); background: var(--surface-2);
  font-size: 1.15rem; font-family: inherit; transition: all .2s;
  display: inline-flex; align-items: center; justify-content: center;
}
.avatar-option:hover { border-color: var(--violet); transform: scale(1.08); }
.avatar-option.selected {
  border-color: transparent; background: var(--grad-violet); color: #fff;
  box-shadow: 0 4px 12px rgba(91, 91, 214, .35);
}

/* ============ Оплата ============ */
.pay-plans { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pay-plan {
  border: 2px solid var(--border); border-radius: 14px; padding: 16px;
  cursor: pointer; text-align: center; transition: all .2s; background: var(--surface);
}
.pay-plan:hover { border-color: var(--gold); }
.pay-plan.selected { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 8%, var(--surface)); }
.pay-plan b { display: block; font-size: .92rem; }
.pay-price { font-size: 1.5rem; font-weight: 800; margin: 6px 0; }
.pay-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pay-method {
  padding: 12px; border-radius: 12px; border: 2px solid var(--border);
  background: var(--surface); color: var(--text); font-weight: 700;
  font-size: .9rem; font-family: inherit; cursor: pointer; transition: all .2s;
}
.pay-method:hover { border-color: var(--primary); }
.pay-method.selected { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--surface)); color: var(--primary); }
.pay-note { color: var(--muted); font-size: .76rem; margin-top: 10px; text-align: center; }
.pay-qr {
  width: 130px; height: 130px; margin: 12px auto; border-radius: 14px;
  background: repeating-conic-gradient(var(--text) 0 25%, var(--surface) 0 50%) 0 0/16px 16px;
  border: 3px solid var(--gold); display: flex; align-items: center; justify-content: center;
  color: var(--surface); font-weight: 800; text-shadow: 0 0 4px var(--text);
}
@media (max-width: 480px) { .pay-plans, .pay-methods { grid-template-columns: 1fr; } }

/* ============ Герой с весами правосудия ============ */
.hero {
  position: relative; overflow: hidden;
  min-height: 92vh; display: flex; align-items: center;
  background: var(--grad-hero);
  color: #f2f7f4;
  padding: 90px 0 70px;
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 70% 30%, rgba(45, 212, 191, .25), transparent 55%),
              radial-gradient(ellipse at 20% 80%, rgba(201, 162, 39, .14), transparent 50%);
}
.hero-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: .35; z-index: 0;
}
.hero-scales {
  position: absolute; right: -30px; bottom: -20px; width: min(620px, 55vw);
  opacity: .78; z-index: 0; pointer-events: none;
  filter: drop-shadow(0 0 46px rgba(211, 178, 60, .4));
}
.hero-inner { position: relative; z-index: 2; }
.hero h1 {
  font-family: "Onest", Georgia, serif;
  font-size: clamp(2.1rem, 5vw, 3.6rem); line-height: 1.12; margin-bottom: 18px;
  color: #fff;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, #5eead4, #eed688, #5eead4);
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 5s linear infinite;
}
@keyframes shimmer { to { background-position: 200% center; } }
.hero p { max-width: 560px; margin: 0 0 30px; color: rgba(240, 247, 243, .85); font-size: 1.12rem; }
.hero .badge {
  background: rgba(255, 255, 255, .12); color: #eed688;
  border: 1px solid rgba(238, 214, 136, .35); backdrop-filter: blur(6px);
  animation: pulse 3s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(238, 214, 136, .25); } 50% { box-shadow: 0 0 0 10px rgba(238, 214, 136, 0); } }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 34px; margin-top: 44px; flex-wrap: wrap; }
.hero-stats .hs b {
  display: block; font-size: 1.7rem; font-weight: 800;
  background: var(--grad-gold);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-stats .hs span { color: rgba(240, 247, 243, .7); font-size: .86rem; }

/* Анимация весов */
.scales-sway { transform-box: fill-box; transform-origin: 50% 0%; animation: sway 7s ease-in-out infinite; }
@keyframes sway {
  0%, 100% { transform: rotate(-4.5deg); }
  50% { transform: rotate(4.5deg); }
}
.scales-glow { animation: glowPulse 7s ease-in-out infinite; }
@keyframes glowPulse { 0%, 100% { opacity: .55; } 50% { opacity: .8; } }
.hero-particle {
  position: absolute; border-radius: 50%; background: rgba(238, 214, 136, .55);
  pointer-events: none; z-index: 1;
  animation: rise linear infinite;
}
@keyframes rise {
  from { transform: translateY(0); opacity: 0; }
  12% { opacity: .8; }
  to { transform: translateY(-110vh); opacity: 0; }
}

/* ============ Секции ============ */
.section { padding: 64px 0; position: relative; }
.section.tint-green { background: linear-gradient(180deg, transparent, rgba(20, 184, 166, .08), transparent); }
.section.tint-gold { background: linear-gradient(180deg, transparent, rgba(201, 162, 39, .08), transparent); }
.section.tint-navy { background: linear-gradient(180deg, transparent, rgba(22, 50, 79, .06), transparent); }

.section-title { text-align: center; margin-bottom: 40px; }
.section-title h2 {
  font-family: "Onest", Georgia, serif;
  font-size: clamp(1.5rem, 3.2vw, 2.2rem); margin-bottom: 10px;
}
.section-title h2 span {
  background: var(--grad-primary);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.section-title .subtitle { color: var(--muted); max-width: 560px; margin: 0 auto; }
.section-title .line {
  width: 72px; height: 3px; margin: 14px auto 0; border-radius: 3px;
  background: var(--grad-gold);
}

/* ============ Карточки ============ */
.grid { display: grid; gap: 22px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow);
  transition: transform .25s, box-shadow .25s, border-color .25s;
  color: var(--text);
}
.card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--grad-primary); opacity: 0; transition: opacity .25s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: transparent; }
.card:hover::before { opacity: 1; }
.card h3 { margin-bottom: 8px; font-size: 1.12rem; }
.card p { color: var(--muted); font-size: .93rem; }
.card .icon {
  font-size: 1.7rem; margin-bottom: 14px; display: inline-flex;
  width: 54px; height: 54px; align-items: center; justify-content: center;
  border-radius: 14px; background: var(--surface-2);
  transition: transform .3s;
}
.card:hover .icon { transform: scale(1.12) rotate(-6deg); }
a.card:hover h3 { color: var(--primary); }

/* Появление при скролле */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ============ Формы ============ */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 700; margin-bottom: 6px; font-size: .88rem; }
/* Типы полей перечислялись поимённо, и «search» в список не попал:
   браузер рисовал его по-своему — белый прямоугольник посреди тёмной
   темы. Так выглядели поиск по базе знаний, по ленте вопросов и по
   кабинету. Перечисляем через :is и добавляем остальные текстовые типы
   разом, чтобы это не повторилось со следующим полем. */
input:is([type="text"], [type="email"], [type="password"], [type="number"],
         [type="search"], [type="tel"], [type="url"], [type="date"], [type="time"]),
select, textarea {
  width: 100%; padding: 12px 15px; border-radius: 12px;
  border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text); font-family: inherit; font-size: .95rem;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(20, 184, 166, .15);
}
textarea { min-height: 120px; resize: vertical; }

/* ============ Табы ============ */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; }
.tab {
  padding: 10px 20px; border-radius: 999px; border: 1.5px solid var(--border);
  background: var(--surface); color: var(--muted); cursor: pointer;
  font-weight: 700; font-size: .9rem; font-family: inherit;
  transition: all .25s;
}
.tab:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.tab.active { background: var(--grad-primary); color: #fff; border-color: transparent; box-shadow: 0 6px 18px rgba(14, 143, 134, .35); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn .3s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }

/* ============ Результат AI ============ */
.ai-result {
  background: var(--surface-2); border-left: 4px solid;
  border-image: var(--grad-gold) 1; border-radius: 12px;
  padding: 18px; margin-top: 16px; white-space: pre-wrap; font-size: .95rem; display: none;
}
.ai-result.show { display: block; animation: fadeIn .4s; }

.badge {
  display: inline-block; padding: 5px 14px; border-radius: 999px;
  font-size: .78rem; font-weight: 800; background: var(--surface-2); color: var(--muted);
  letter-spacing: .3px;
}
.badge.ok { background: rgba(20, 184, 166, .14); color: var(--primary); }
.badge.pro {
  background: var(--grad-gold); color: #2a2205;
  box-shadow: 0 4px 12px rgba(201, 162, 39, .3);
}

/* ============ Кабинет ============ */
.stat-value {
  font-size: 1.9rem; font-weight: 800;
  background: var(--grad-primary);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-label { color: var(--muted); font-size: .86rem; }

/* ============ Чат-виджет ============ */
.chat-widget {
  position: fixed; right: 22px; bottom: 22px; z-index: 100;
  display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
}
.chat-toggle {
  width: 60px; height: 60px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--grad-primary); color: #fff; font-size: 1.55rem;
  box-shadow: 0 10px 26px rgba(14, 143, 134, .45);
  transition: transform .25s;
  animation: chatPing 3.5s ease-in-out infinite;
}
@keyframes chatPing { 0%, 100% { box-shadow: 0 10px 26px rgba(14, 143, 134, .45), 0 0 0 0 rgba(20, 184, 166, .4); } 50% { box-shadow: 0 10px 26px rgba(14, 143, 134, .45), 0 0 0 14px rgba(20, 160, 122, 0); } }
.chat-toggle:hover { transform: scale(1.1) rotate(8deg); }
.chat-box {
  width: min(370px, calc(100vw - 44px)); height: 470px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); display: none; flex-direction: column; overflow: hidden;
  animation: chatUp .3s ease;
}
@keyframes chatUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; } }
.chat-box.open { display: flex; }
.chat-header {
  padding: 15px 18px; background: var(--grad-primary); color: #fff; font-weight: 700;
  display: flex; justify-content: space-between; align-items: center;
}
.chat-header button { background: none; border: none; color: #fff; font-size: 1.2rem; cursor: pointer; }
.chat-messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { max-width: 85%; padding: 10px 14px; border-radius: 14px; font-size: .9rem; white-space: pre-wrap; animation: fadeIn .25s; }
.chat-msg.user { align-self: flex-end; background: var(--grad-primary); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.bot { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px; }
.chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.chat-input input { flex: 1; }

/* ============ Игры ============ */
.game-stage {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow);
}
canvas { display: block; margin: 0 auto; background: var(--surface-2); border-radius: 12px; touch-action: none; }
.game-hud { display: flex; gap: 14px; justify-content: center; margin-bottom: 16px; flex-wrap: wrap; }
.game-hud .stat { background: var(--surface-2); border-radius: 12px; padding: 8px 18px; text-align: center; font-size: .82rem; color: var(--muted); }
.game-hud .stat b { display: block; font-size: 1.25rem; color: var(--primary); }
.quiz-option {
  display: block; width: 100%; text-align: left; margin-bottom: 10px;
  padding: 14px 18px; border-radius: 12px; border: 2px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer;
  font-weight: 600; font-size: .95rem; font-family: inherit; transition: all .2s;
}
.quiz-option:hover { border-color: var(--primary); transform: translateX(4px); }
.quiz-option.correct { border-color: var(--primary); background: rgba(20, 184, 166, .14); }
.quiz-option.wrong { border-color: var(--danger); background: rgba(214, 69, 69, .1); }

.progress-bar { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress-bar > div { height: 100%; background: var(--grad-primary); border-radius: 999px; transition: width .4s; }

/* Календарь «Копилка» в кабинете — стиль Google Calendar */
.cal-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-title {
  font-family: "Onest", Georgia, serif;
  font-size: 1.3rem; font-weight: 700; min-width: 190px;
}
.cal-nav { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.cal-nav-btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 1.05rem; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: inherit; transition: all .2s;
}
.cal-nav-btn:hover { border-color: var(--violet); color: var(--violet); transform: scale(1.08); }
.cal-today-btn {
  padding: 9px 18px; border-radius: 999px; border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text); font-weight: 700;
  font-size: .84rem; cursor: pointer; font-family: inherit; transition: all .2s;
}
.cal-today-btn:hover { border-color: var(--violet); color: var(--violet); }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-weekdays span {
  text-align: center; font-size: .7rem; font-weight: 800; letter-spacing: 1px;
  color: var(--muted); padding: 6px 0; text-transform: uppercase;
}
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  border-left: 1px solid var(--border); border-top: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
}
.cal-cell {
  min-height: 74px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 6px; position: relative; background: var(--surface);
}
.cal-cell .d {
  width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; color: var(--text); border-radius: 50%;
}
.cal-cell.other .d { color: var(--muted); opacity: .45; }
.cal-cell.other.done { opacity: .55; }
.cal-cell.future { background: var(--surface-2); cursor: default; }
.cal-cell.future .d { color: var(--muted); opacity: .5; }
.cal-cell.clickable { cursor: pointer; transition: background .15s; }
.cal-cell.clickable:hover { background: color-mix(in srgb, var(--violet) 10%, var(--surface)); }
.cal-cell.today .d { outline: 2px solid var(--violet); outline-offset: 1px; }
.cal-cell.done { background: var(--grad-violet); }
.cal-cell.done .d { color: #fff; }
.cal-cell.done.clickable:hover { filter: brightness(1.08); }
.cal-cell .mark {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; font-size: 1.2rem; pointer-events: none; opacity: .9;
}
/* Бургер/Меню: скрыто на десктопе */
.nav-burger { display: none; }
.mobile-menu { display: none; }

/* Бургер включается раньше: шесть пунктов меню перестают помещаться
   уже около 960 пикселей, и между 860 и 1024 последние из них
   уходили за край в горизонтальную прокрутку. */
@media (max-width: 1010px) {
  /* двухслойная шапка: название+кнопки сверху, пункты — ниже в два ряда */
  .nav { height: auto; flex-wrap: wrap; padding: 10px 0; row-gap: 4px; }
  .logo { order: 0; font-size: 1.02rem; gap: 6px; }
  .header-pill, .theme-toggle { order: 1; padding: 7px 9px; font-size: .7rem; }
  .theme-toggle { margin-left: auto; }
  .nav > .btn { order: 2; padding: 7px 11px; font-size: .76rem; }
  .nav-burger {
    order: 3; display: inline-flex; align-items: center; justify-content: center;
    padding: 7px 11px; border-radius: 999px; font-size: .76rem; font-weight: 700;
  }
  .nav-links {
    display: flex; order: 4; width: 100%;
    flex-wrap: wrap; overflow: visible; margin-left: 0;
  }
  .nav-links a { padding: 7px 9px; font-size: .78rem; }
  .site-header.menu-open .nav-burger { border-color: var(--primary); color: var(--primary); }
  .mobile-menu { display: none; }
  .site-header.menu-open .mobile-menu {
    display: flex; flex-direction: column; gap: 2px;
    padding: 10px 22px 16px; border-top: 1px solid var(--border);
    background: var(--header-bg); backdrop-filter: blur(14px);
  }
  .mobile-menu a { padding: 13px 6px; font-size: 1rem; border-bottom: 1px solid var(--border); }
  .mobile-menu a::after { display: none; }
  .mobile-menu a.active { color: var(--primary); font-weight: 800; }
}

@media (max-width: 640px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding: 64px 0 56px; }
  .hero-scales {
    width: min(430px, 98vw); right: auto; left: 50%;
    transform: translateX(-50%); bottom: -24px; opacity: .28;
  }
  .hero-stats { gap: 20px; }
  /* чат-кнопка не перекрывает контент внизу */
  body { padding-bottom: 88px; }
  /* iOS не зумит поле при фокусе */
  input, select, textarea { font-size: 16px; }
  /* бейдж квоты ИИ — отдельной строкой над табами */
  #quotaBadge { flex-basis: 100%; text-align: center; margin-bottom: 4px; }
  /* позиции счёта: без колонки суммы, компактно */
  .inv-pos-row { grid-template-columns: 1fr 52px 84px 36px; gap: 6px; }
  .inv-pos-row input { padding: 9px 8px; }
  .inv-pos-row > div:nth-child(4) { display: none; }
  .cal-cell { min-height: 46px; padding: 3px; }
  .cal-cell .d { width: 22px; height: 22px; font-size: .7rem; }
  .cal-cell .mark { font-size: .85rem; }
  .pay-plans, .pay-methods { grid-template-columns: 1fr; }
  .chat-toggle { width: 54px; height: 54px; font-size: 1.35rem; }
}

/* ============ Уведомления (toast) ============ */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px);
  background: var(--grad-navy); color: #fff; padding: 13px 26px; border-radius: 999px;
  font-weight: 700; font-size: .92rem; z-index: 300; opacity: 0;
  transition: opacity .35s, transform .35s; pointer-events: none;
  box-shadow: var(--shadow-lg); max-width: min(560px, calc(100vw - 40px));
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.error {
  background: linear-gradient(135deg, #b0362a, #d95b4e);
  border-radius: 14px; font-size: .95rem; line-height: 1.45; white-space: pre-line;
  border: 1px solid rgba(255, 255, 255, .25);
  animation: toastShake .4s ease;
}
@keyframes toastShake {
  0%, 100% { transform: translateX(-50%); }
  25% { transform: translateX(calc(-50% - 7px)); }
  75% { transform: translateX(calc(-50% + 7px)); }
}
@media (max-width: 640px) {
  .toast { bottom: 100px; }
}

/* ============ Модальные окна ============ */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(8, 20, 15, .6); z-index: 150;
  display: none; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--radius); padding: 28px;
  max-width: 520px; width: 100%; max-height: 85vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); animation: fadeIn .3s;
}
@media (max-width: 480px) {
  .modal-backdrop { padding: 12px; }
  .modal { padding: 20px; }
}

/* ============ Восстановленные блоки ============ */
/* Статьи базы знаний */
.article-item {
  /* Теперь это ссылка на отдельную страницу статьи, а не div:
     человек может открыть в новой вкладке и переслать адрес,
     а поисковик — дойти до всех 28 страниц. Отсюда block и цвет текста. */
  display: block; color: inherit;
  border: 1px solid var(--border); border-radius: 14px; padding: 17px 19px;
  background: var(--surface); cursor: pointer; margin-bottom: 10px;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.article-item:hover { text-decoration: none; }
.article-item:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.article-item:hover { border-color: var(--primary); transform: translateX(6px); box-shadow: var(--shadow); }
.article-item .meta { font-size: .82rem; color: var(--muted); }
.article-item .badge { margin-left: 8px; }
.article-full { display: none; }
.article-full.show { display: block; animation: fadeIn .35s; }
.article-full .body { white-space: pre-line; }

/* Футер */
.site-footer {
  border-top: 1px solid var(--border); padding: 36px 0; margin-top: 48px;
  color: var(--muted); font-size: .88rem; text-align: center;
  background: linear-gradient(180deg, transparent, rgba(20, 184, 166, .05));
}
.site-footer a { color: var(--primary); }

/* Личный чат в кабинете */
.chat-panel {
  display: flex; flex-direction: column; height: 460px;
  border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
}
.chat-panel .chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.chat-panel .chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }

/* Таблица админки */
.admin-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.admin-table th {
  text-align: left; padding: 10px 12px; font-size: .76rem; text-transform: uppercase;
  letter-spacing: .5px; color: var(--muted); border-bottom: 2px solid var(--border);
}
.admin-table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:hover td { background: var(--surface-2); }

/* Кнопки привычек Копилки */
.habit-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.habit-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text); font-weight: 700; font-size: .86rem; font-family: inherit;
  transition: all .2s;
}
.habit-btn:hover { border-color: var(--violet); transform: translateY(-2px); }
.habit-btn.active {
  background: var(--grad-violet); color: #fff; border-color: transparent;
  box-shadow: 0 6px 16px rgba(91, 91, 214, .35);
}
.habit-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.habit-btn .soon { font-size: .68rem; font-weight: 800; opacity: .7; }

/* Практикум «Найди ошибку» */
.eh-part { cursor: pointer; border-bottom: 2px dotted transparent; transition: background .2s; }
.eh-part:hover { background: color-mix(in srgb, var(--violet) 12%, transparent); }
.eh-part.found { background: color-mix(in srgb, var(--primary) 22%, transparent); border-bottom-color: var(--primary); }
/* Ложное срабатывание: пункт отмечен, но золотым, а не зелёным —
   это не находка, а промах. Правило написали давно, но сработать
   оно не могло: раньше в договорах не было нормальных пунктов. */
.eh-part.ok { background: color-mix(in srgb, var(--gold) 18%, transparent); cursor: default; }

/* Уважение к reduce-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ===== Загрузка документа (анализ файлом и фото) ===== */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 26px 18px;
  text-align: center;
  cursor: pointer;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.7;
  transition: border-color .2s, background .2s;
}
.dropzone:hover, .dropzone.over {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}
.dropzone b { color: var(--text); }
.dropzone span { font-size: .82rem; }

.doc-status { margin-top: 10px; font-size: .86rem; color: var(--muted); min-height: 1.2em; }
.doc-status.ok  { color: var(--ok, #2e9e6b); }
.doc-status.err { color: var(--danger, #d64545); }

/* ===== Настройки профиля: вкладки, фото, устройства ===== */
.settings-modal { max-width: 560px; }
.settings-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.settings-head h3 { font-family: "Onest", Georgia, serif; margin: 0; }

.settings-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border); margin-bottom: 18px;
}
.settings-tab {
  background: none; border: none; cursor: pointer;
  padding: 9px 14px; font: inherit; font-size: .9rem;
  color: var(--muted); border-bottom: 2px solid transparent;
  border-radius: 8px 8px 0 0; transition: color .15s, border-color .15s;
}
.settings-tab:hover { color: var(--text); }
.settings-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.settings-body h4 { margin: 0 0 6px; font-size: .95rem; }
.settings-body hr { border: none; border-top: 1px solid var(--border); margin: 22px 0 16px; }
.settings-body .hint { color: var(--muted); font-size: .8rem; line-height: 1.6; margin-top: 6px; }

.btn.wide { width: 100%; }

/* Аватар: буква, emoji или фото */
.avatar.has-photo { padding: 0; overflow: hidden; }
.avatar.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.big {
  width: 84px; height: 84px; min-width: 84px;
  font-size: 2rem; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
}

.avatar-editor { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.avatar-actions { flex: 1; min-width: 200px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.avatar-actions .hint { width: 100%; margin-top: 2px; }

/* Индикатор надёжности пароля */
.pw-meter { height: 4px; background: var(--border); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.pw-meter > div { height: 100%; width: 0; border-radius: 3px; transition: width .2s, background .2s; }

/* Список устройств */
.sessions-list { margin: 10px 0 14px; }
.session-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--border); font-size: .86rem;
}
.session-row:last-child { border-bottom: none; }

.limits-list { margin: 0 0 16px 18px; color: var(--muted); font-size: .9rem; line-height: 1.9; }
.pay-history { max-height: 180px; overflow-y: auto; }
.pay-row {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 7px 0; border-bottom: 1px solid var(--border); font-size: .85rem;
}

@media (max-width: 480px) {
  .settings-tab { padding: 8px 10px; font-size: .84rem; }
  .avatar-editor { justify-content: center; text-align: center; }
  .avatar-actions { justify-content: center; }
}


/* ===== Доступность: цели нажатия и читаемость =====
   Ориентир — рекомендации Apple (44 px) и Google (48 px).
   Мелкие ссылки и кнопки — главная причина промахов у пожилых пользователей
   и у всех, кто пользуется телефоном на ходу. */

/* .section-title содержит теперь h1, а не h2 — правило должно ловить оба */
.section-title h1 {
  font-family: "Onest", Georgia, serif;
  font-size: clamp(1.7rem, 4.5vw, 2.6rem);
  line-height: 1.2;
  margin: 0;
}
.section-title h1 span { color: var(--accent); }

@media (pointer: coarse) {
  /* На сенсорных экранах растим все интерактивные элементы до 44 px */
  .nav-links a,
  .mobile-menu a,
  .site-footer a,
  .tab,
  .btn.small,
  .settings-tab {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .nav-burger { min-height: 44px; padding-inline: 14px; }
  .avatar-option { width: 52px; height: 52px; }

  /* Ссылки внутри текста получают запас по вертикали, чтобы не промахиваться */
  .site-footer p a { padding-block: 6px; }
}

/* Мельче 13 px не опускаемся нигде: это нижняя граница комфортного чтения */
.hint,
.pay-note,
.section-title .subtitle,
.stat-label { font-size: max(0.82rem, 13px); }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav-links a, .mobile-menu a { font-size: max(0.9rem, 14px); }
  /* Таблицы на телефоне прокручиваются внутри себя, а не растягивают страницу */
  .cmp-table { display: block; overflow-x: auto; }
}

/* Видимая рамка фокуса: без неё сайтом невозможно пользоваться с клавиатуры */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}


/* ===== Форма входа: пояснение и согласие на обработку данных ===== */
.auth-note {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px;
  font-size: max(.84rem, 13px); color: var(--muted);
  line-height: 1.6; margin-bottom: 20px;
}
.consent {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: max(.82rem, 13px); color: var(--muted);
  line-height: 1.55; margin: 4px 0 16px; cursor: pointer;
}
.consent input {
  width: 20px; height: 20px; min-width: 20px;
  margin: 1px 0 0; accent-color: var(--accent); cursor: pointer;
}
.consent a { color: var(--accent); }

/* Поле пароля с кнопкой «Показать».
   Кнопка лежит поверх поля справа, поэтому полю нужен отступ под неё —
   иначе длинный пароль уезжает под текст кнопки. */
.pass-wrap { position: relative; display: block; }
.pass-wrap input { padding-right: 92px; width: 100%; }
.pass-eye {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
  border: 0; background: transparent; cursor: pointer;
  color: var(--muted); font: inherit; font-size: max(.8rem, 12px);
  padding: 6px 8px; border-radius: 8px; line-height: 1;
}
.pass-eye:hover { color: var(--accent); background: var(--surface-2); }
.pass-eye:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Подсказка о надёжности пароля: цвет — часть сообщения, а не украшение. */
.pass-meter { margin-top: 6px; transition: color .2s; }
.pass-meter.s0, .pass-meter.s1 { color: var(--danger); }
.pass-meter.s2, .pass-meter.s3 { color: var(--gold); }
.pass-meter.s4, .pass-meter.s5 { color: var(--primary); }


/* ===== Реферальный блок ===== */
.ref-code-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.ref-code-row input {
  flex: 1; min-width: 200px; font-size: max(.85rem, 13px);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.ref-stats { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.ref-stats > div {
  flex: 1; min-width: 92px; text-align: center;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 8px;
}
.ref-stats b { display: block; font-size: 1.4rem; color: var(--accent); line-height: 1.2; }
.ref-stats span { font-size: max(.75rem, 12px); color: var(--muted); }
.ref-list { margin: 12px 0; }
.ref-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border); font-size: max(.84rem, 13px);
}
.ref-row:last-child { border-bottom: none; }


/* ===== Сроки и напоминания ===== */
.rem-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border);
}
.rem-row:last-of-type { border-bottom: none; }
.rem-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rem-main b { font-size: max(.92rem, 14px); overflow-wrap: anywhere; }
.rem-meta { font-size: max(.78rem, 12px); color: var(--muted); }
.rem-side { display: flex; align-items: center; gap: 8px; white-space: nowrap; }

/* ===== Колокольчик уведомлений ===== */
.notif-btn { position: relative; }
.notif-dot {
  position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.notif-list { max-height: 340px; overflow-y: auto; margin: 10px 0; }
.notif-item {
  padding: 11px 0; border-bottom: 1px solid var(--border);
  display: flex; gap: 10px; align-items: flex-start;
}
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { border-left: 3px solid var(--accent); padding-left: 10px; }
.notif-item .nt { font-weight: 600; font-size: max(.9rem, 14px); }
.notif-item .nb { font-size: max(.82rem, 13px); color: var(--muted); }
.notif-item .nd { font-size: max(.75rem, 12px); color: var(--muted); margin-top: 3px; }

/* ===== Подключение Telegram ===== */
.tg-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.6rem; font-weight: 700; letter-spacing: .16em;
  text-align: center; padding: 14px; margin: 12px 0;
  background: var(--surface-2); border: 1px dashed var(--border); border-radius: 12px;
}
.tg-steps { margin: 0 0 14px 18px; font-size: max(.86rem, 13px); color: var(--muted); line-height: 1.9; }

/* ===== Партнёрские предложения ===== */
.partners {
  margin: 26px 0 8px; padding: 18px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px;
}
.partners.preview { border-style: dashed; opacity: .85; }
.partners-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.partners-label {
  font-size: max(.78rem, 12px); font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.partners-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.partner-card {
  display: flex; flex-direction: column; justify-content: space-between; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 15px 16px;
}
.partner-card b { font-size: max(.95rem, 15px); display: block; margin-bottom: 5px; }
.partner-card p { font-size: max(.85rem, 13px); color: var(--muted); margin: 0 0 8px; line-height: 1.55; }
.partner-benefit {
  display: inline-block; font-size: max(.76rem, 12px);
  color: var(--accent); font-weight: 600;
}
.partner-foot { display: flex; flex-direction: column; gap: 7px; align-items: flex-start; }
.partner-mark { font-size: 10.5px; color: var(--muted); line-height: 1.4; overflow-wrap: anywhere; }


/* ===== Типографская шкала =====
   На странице жило 18 разных размеров шрифта — значения вроде 14.88, 14.08,
   13.76 отличались на доли пикселя и читались как случайные. Шкала из шести
   ступеней даёт заметную разницу между уровнями и убирает визуальный шум. */
:root {
  --t-xs: 0.8125rem;   /* 13px — подписи, минимум для чтения */
  --t-sm: 0.9375rem;   /* 15px — вспомогательный текст */
  --t-md: 1.0625rem;   /* 17px — основной текст */
  --t-lg: 1.375rem;    /* 22px — подзаголовки */
  --t-xl: 1.875rem;    /* 30px — заголовки блоков */
  --t-2xl: clamp(2.1rem, 4.5vw, 3.25rem);  /* герой */
}

body { font-size: var(--t-md); }
.hint, .pay-note, .stat-label, .partner-mark, .rem-meta { font-size: var(--t-xs); }
.subtitle, .badge { font-size: var(--t-sm); }
h3 { font-size: var(--t-lg); }
.section-title h1, .section-title h2 { font-size: var(--t-xl); }
.hero h1 { font-size: var(--t-2xl); }

/* Длина строки. Было 42 символа в карточках — глазу тесно, приходится
   часто переносить взгляд. Комфортный диапазон 60–75. */
p, li { max-width: 68ch; }
.card p, .card li { max-width: none; }   /* внутри карточки ширину держит сама карточка */
.section-title .subtitle { max-width: 62ch; margin-inline: auto; }

/* Аватар в шапке слипался с именем: «ННапоминалка» */
.site-header .btn .avatar { margin-right: 7px; }

/* ===== Герой: поле вопроса ===== */
.hero-ask {
  display: flex; gap: 10px; flex-wrap: wrap;
  max-width: 620px; margin: 26px auto 12px;
}
.hero-ask input {
  flex: 1; min-width: 240px;
  font-size: max(1rem, 16px);   /* 16px — иначе iOS зумит поле при фокусе */
  padding: 15px 18px; border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .12);
  color: #fff; backdrop-filter: blur(8px);
}
.hero-ask input::placeholder { color: rgba(255, 255, 255, .62); }
.hero-ask input:focus {
  outline: none; border-color: var(--gold-2);
  background: rgba(255, 255, 255, .18);
}
.hero-ask .btn { padding-inline: 26px; }

.hero-hints {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
  max-width: 620px; margin: 0 auto 24px;
}
.hero-hints button {
  font: inherit; font-size: var(--t-xs); cursor: pointer;
  padding: 7px 13px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .07);
  color: rgba(255, 255, 255, .82);
  transition: background .15s, border-color .15s;
}
.hero-hints button:hover {
  background: rgba(255, 255, 255, .16);
  border-color: rgba(255, 255, 255, .45);
}

/* Экранным дикторам подпись нужна, глазам — нет */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (max-width: 640px) {
  .hero-ask { margin-top: 20px; }
  .hero-ask .btn { width: 100%; }
  .hero-hints button { font-size: 12px; }
}

/* ===== Высота героя =====
   С полем вопроса герой перерос экран: 110% высоты — значит ниже него
   не видно вообще ничего, и человек не понимает, что страница продолжается.
   Держим его в пределах экрана и оставляем «хвостик» следующего блока
   в кадре — это единственный надёжный сигнал «здесь есть что листать». */
.hero {
  min-height: min(88vh, 780px);
  /* Отступы поджаты так, чтобы содержимое героя укладывалось в 88vh и снизу
     оставался виден край следующего блока — сигнал «страница продолжается». */
  padding-block: clamp(38px, 5.5vh, 66px) clamp(30px, 4vh, 48px);
}
.hero .hero-stats { margin-top: 22px; }
@media (max-height: 720px) {
  .hero { min-height: auto; }
}
@media (max-width: 640px) {
  .hero { min-height: auto; padding-block: 42px 44px; }
}

/* Сетка на три колонки при 1280px давала 42 символа в строке — глазу тесно.
   Колонки не фиксируем числом, а задаём минимальную ширину: браузер сам
   решит, сколько их поместится, и строка не станет короче комфортной. */
@media (min-width: 861px) {
  .grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
  .grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
}


/* ===================================================================
   ПЕРЕОФОРМЛЕНИЕ 2026
   Зелёный и морская волна — единственный акцент. Золото осталось только
   меткой Pro. Границы вместо теней: инструменту для денег идёт точность,
   а не мягкость потребительских приложений.
   =================================================================== */

body {
  font-family: "Golos Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-feature-settings: "ss01";
  letter-spacing: -0.003em;
}

h1, h2, h3, h4,
.section-title h1, .section-title h2,
.hero h1, .stat-value, .logo {
  font-family: "Onest", "Golos Text", "Segoe UI", system-ui, sans-serif;
  letter-spacing: -0.022em;
  font-weight: 700;
}
.hero h1 { font-weight: 800; letter-spacing: -0.032em; }

/* Цифры денег и сроков выравниваем по разрядам: колонка сумм, в которой
   единицы пляшут по горизонтали, читается как небрежность. */
.stat-value, .cmp-table td, .pay-price, .big, .ref-stats b,
.rem-meta, .notif-item .nd, .tile .num {
  font-variant-numeric: tabular-nums;
}

/* Границы вместо теней */
.card, .modal, .partner-card, .game-stage {
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}
.card:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }

.btn { border-radius: 10px; font-weight: 600; letter-spacing: -0.01em; }
input, select, textarea { border-radius: 10px; }
.badge { border-radius: 7px; font-weight: 600; }

/* Золото — только метка Pro, больше нигде */
.badge.pro {
  background: color-mix(in srgb, var(--gold) 16%, transparent);
  color: var(--gold);
  border: 1px solid color-mix(in srgb, var(--gold) 34%, transparent);
}

/* Кнопка «золотая» была вторым главным действием и спорила с первым.
   Делаем её акцентной в той же зелёно-бирюзовой гамме. */
.btn.gold {
  background: var(--grad-primary);
  color: #fff;
  border: none;
}
.btn.gold:hover { filter: brightness(1.07); }

/* Герой: весы становятся водяным знаком, а не действующим лицом.
   Качающийся элемент рядом с заголовком перетягивает взгляд с текста. */
.hero-scales { opacity: .14; }
.scales-sway { animation: none !important; }
.hero::after { opacity: .7; }

/* Шапка: тонкая линия вместо размытого стекла — так видно границу
   между шапкой и содержимым на любом фоне. */
.site-header {
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(140%) blur(10px);
}

/* Разделы чередуются оттенком фона, а не разными цветными заливками:
   четыре разноцветные секции подряд выглядели как набор чужих блоков. */
.section.tint-green,
.section.tint-gold,
.section.tint-navy { background: var(--bg-2); }
.section.tint-green + .section.tint-gold,
.section.tint-gold + .section.tint-navy { background: var(--bg); }

/* Заголовок раздела: короткая линия под ним была декоративной.
   Оставляем, но привязываем к акценту и делаем тоньше. */
.section-title .line {
  height: 2px; width: 46px; border-radius: 2px;
  background: var(--grad-primary);
}

/* Ссылки в тексте должны быть видны как ссылки */
.card a:not(.btn), main p a:not(.btn) {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* Пункты меню шли цветом --muted: в светлой теме это давало контраст 3.97
   при норме 4.5. Навигацией пользуются все и постоянно — она должна
   читаться без усилия, а не «достаточно». */
.nav-links a,
.mobile-menu a {
  color: color-mix(in srgb, var(--text) 74%, var(--muted));
}
.nav-links a:hover,
.mobile-menu a:hover { color: var(--text); }
.nav-links a.active,
.mobile-menu a.active { color: var(--primary); }

/* ===== Баллы ===== */
.points-banner {
  display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px;
}
.points-num {
  font-family: "Onest", system-ui, sans-serif;
  font-size: 2rem; font-weight: 800; color: var(--primary);
  font-variant-numeric: tabular-nums; line-height: 1;
}
.points-cap { font-size: var(--t-sm); color: var(--muted); margin-left: 6px; }
.points-banner .hint { width: 100%; margin: 0; }

/* ===== Тарифы ===== */
.pay-modal { max-width: 880px; }

.period-switch {
  display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 20px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
}
.period-switch button {
  border: none; background: none; cursor: pointer; font: inherit;
  font-size: var(--t-sm); font-weight: 600; color: var(--muted);
  padding: 9px 18px; border-radius: 999px; transition: background .15s, color .15s;
}
.period-switch button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.period-switch .save {
  font-size: var(--t-xs); font-weight: 700; color: var(--primary); margin-left: 4px;
}

.tier-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.tier {
  position: relative; display: flex; flex-direction: column; gap: 7px;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 18px 18px; cursor: pointer;
  background: var(--surface); transition: border-color .18s, transform .18s;
}
.tier:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
.tier.chosen { border-color: var(--primary); }
/* Средний тариф выделен намеренно: рядом с ним крайние читаются как
   «дешевле» и «мощнее», а не как единственная цена, которую надо принять. */
.tier.best { border-color: var(--primary); border-width: 2px; }
.tier-flag {
  position: absolute; top: -10px; left: 16px;
  background: var(--grad-primary); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  padding: 3px 10px; border-radius: 999px;
}
.tier-title { font-family: "Onest", system-ui, sans-serif; font-size: var(--t-lg); }
.tier-tagline { font-size: var(--t-xs); color: var(--muted); }
.tier-price { display: flex; align-items: baseline; gap: 6px; margin-top: 6px; }
.tier-num {
  font-family: "Onest", system-ui, sans-serif; font-size: 2.1rem; font-weight: 800;
  font-variant-numeric: tabular-nums; line-height: 1;
}
.tier-per { font-size: var(--t-xs); color: var(--muted); }
.tier-year { font-size: var(--t-xs); color: var(--primary); font-weight: 600; }
.tier-perks {
  list-style: none; padding: 0; margin: 10px 0 14px;
  font-size: var(--t-sm); color: var(--muted); line-height: 1.6;
}
.tier-perks li { padding-left: 20px; position: relative; margin-bottom: 6px; }
.tier-perks li::before {
  content: "✓"; position: absolute; left: 0; color: var(--primary); font-weight: 700;
}
.tier-current { align-self: flex-start; }
.tier .btn { margin-top: auto; }

.tier-enterprise {
  display: flex; justify-content: space-between; align-items: center;
  gap: 14px; flex-wrap: wrap; margin-top: 18px; padding: 15px 17px;
  background: var(--surface-2); border: 1px dashed var(--border); border-radius: var(--radius);
}
.tier-enterprise .hint { margin: 4px 0 0; }
.points-note { text-align: center; margin: 14px 0 0; }
.promo-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.promo-row input { max-width: 190px; }

/* ===== Выбор цвета сервиса ===== */
.theme-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.accent-grid {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-top: 12px;
}
.accent-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface);
  font: inherit; font-size: var(--t-sm); color: var(--text); text-align: left;
  transition: border-color .15s;
}
.accent-chip:hover { border-color: var(--primary); }
.accent-chip.on { border-color: var(--primary); border-width: 2px; font-weight: 600; }
.accent-chip.locked { opacity: .6; }
.accent-dot { width: 22px; height: 22px; min-width: 22px; border-radius: 50%; }
.accent-lock {
  margin-left: auto; font-size: 10px; font-weight: 700; letter-spacing: .05em;
  color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
  padding: 2px 6px; border-radius: 5px;
}

@media (max-width: 560px) {
  .tier-grid { grid-template-columns: 1fr; }
  .period-switch { width: 100%; }
  .period-switch button { flex: 1; }
}

/* Карточка тарифа на главной */
.tier-home { position: relative; display: flex; flex-direction: column; }
.tier-home.best { border-color: var(--primary); border-width: 2px; }
.tier-home .tier-perks { flex: 1; }
.tier-home .btn { align-self: flex-start; }

/* ===== Кабинет: вкладки ===== */
.cab-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  margin: 0 0 24px; padding-bottom: 0;
}
.cab-tab {
  border: none; background: none; cursor: pointer; font: inherit;
  font-size: var(--t-sm); font-weight: 600; color: var(--muted);
  padding: 11px 16px; border-bottom: 2px solid transparent;
  border-radius: 10px 10px 0 0; transition: color .15s, border-color .15s;
  min-height: 44px;
}
.cab-tab:hover { color: var(--text); }
.cab-tab.on { color: var(--primary); border-bottom-color: var(--primary); }

.cab-panel { display: none; }
.cab-panel.on { display: block; }

/* «Что сейчас»: единственный блок с ответом на вопрос, с которым заходят */
.card.today { border-left: 3px solid var(--primary); margin-bottom: 20px; }
.today-body { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.today-row {
  display: block; width: 100%; text-align: left; cursor: pointer;
  font: inherit; font-size: var(--t-sm);
  padding: 11px 14px; border-radius: 10px; min-height: 44px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  transition: border-color .15s, background .15s;
}
.today-row:hover { border-color: var(--primary); }
.today-row.warn {
  border-color: color-mix(in srgb, var(--danger) 40%, var(--border));
  background: color-mix(in srgb, var(--danger) 8%, transparent);
}

@media (max-width: 560px) {
  .cab-tabs { gap: 0; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .cab-tabs::-webkit-scrollbar { display: none; }
  .cab-tab { padding: 11px 13px; white-space: nowrap; font-size: var(--t-xs); }
}

/* ===== Выбор темы оформления ===== */
.theme-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  margin-top: 12px;
}
.theme-card {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  padding: 10px; border-radius: 12px; cursor: pointer;
  border: 2px solid var(--border); background: var(--surface);
  font: inherit; color: var(--text); text-align: left;
  transition: border-color .15s, transform .12s;
}
.theme-card:hover { border-color: var(--primary); }
.theme-card.on { border-color: var(--primary); }
.theme-card.locked { opacity: .62; }

/* Миниатюра рисует саму тему: подложка, карточка, две строки акцентом */
.theme-prev {
  display: block; position: relative; height: 56px;
  border-radius: 8px; overflow: hidden;
  border: 1px solid rgba(128, 128, 128, .22);
}
.theme-prev-bar {
  position: absolute; left: 7px; right: 7px; top: 8px; height: 14px; border-radius: 4px;
}
.theme-prev-line {
  position: absolute; left: 11px; height: 6px; width: 46%; border-radius: 3px; top: 30px;
}
.theme-prev-line.short { width: 28%; top: 41px; }

.theme-name { font-size: var(--t-xs); font-weight: 600; line-height: 1.3; }
.theme-tick {
  position: absolute; top: 6px; right: 8px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-size: 12px; font-weight: 700; line-height: 20px; text-align: center;
}
.theme-card .accent-lock { position: absolute; top: 6px; right: 6px; }

@media (max-width: 480px) {
  .theme-grid { grid-template-columns: repeat(2, 1fr); }
}

/* На широком экране виден «Ещё», плоский список спрятан. На узком —
   наоборот: шапка там переносится в два ряда, и выпадающее меню только
   мешало, а его абсолютно позиционированный список растягивал страницу. */
/* Подвал держит полный список разделов: в шапке остаётся только то,
   что нужно конкретному человеку, но ничего не должно теряться. */
.footer-nav { line-height: 2.1; }
.footer-nav a { white-space: nowrap; }


/* ===== Задание недели =====
   Практикум был разовым развлечением. Одно дело на всех, меняется
   по понедельникам — повод вернуться, не требующий нового контента. */
.card.weekly { border-left: 3px solid var(--primary); margin-bottom: 22px; }
.card.weekly.done { border-left-color: var(--muted); opacity: .85; }
.weekly-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; flex-wrap: wrap; margin-bottom: 6px;
}
.weekly-label {
  font-size: var(--t-xs); font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--primary);
}
.card.weekly h3 { margin: 0 0 4px; }
.weekly-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }


/* ===== Контакты ===== */
.contact-row {
  display: flex; gap: 14px; flex-wrap: wrap; align-items: baseline;
  padding: 11px 0; border-bottom: 1px solid var(--border);
}
.contact-row:last-of-type { border-bottom: none; }
.contact-what {
  min-width: 96px; font-weight: 600; font-size: var(--t-sm); color: var(--muted);
}


/* ===== Ожидание ответа ИИ =====
   Ответ считает сервер, поэтому пузырь переживает переход на другую
   страницу. Точки показывают, что работа идёт, а не зависла. */
.chat-msg.thinking { color: var(--muted); font-style: italic; }
.chat-msg.thinking::after {
  content: "";
  display: inline-block;
  width: 1.1em; text-align: left;
  animation: pf-dots 1.2s steps(4, end) infinite;
}
@keyframes pf-dots {
  0%   { content: ""; }
  25%  { content: "."; }
  50%  { content: ".."; }
  75%  { content: "..."; }
}
@media (prefers-reduced-motion: reduce) {
  .chat-msg.thinking::after { animation: none; content: "..."; }
}

/* Значок чата подсвечивается, когда ответ ещё готовится: человек видит
   это с любой страницы, даже не открывая переписку. */
.chat-toggle.busy { box-shadow: 0 0 0 3px var(--primary-soft, rgba(20,160,130,.35)); }


/* Часть кнопок привычек — переходы в разделы, а не переключатели.
   Выглядеть они должны одинаково. */
a.habit-btn { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }


/* ===== Значки в плашках шапки =====
   Две подписи («Уведомления», «Тёмная тема») занимали около 260 пикселей
   и выдавливали последний пункт меню под себя. На узких экранах остаётся
   только значок; на широких подпись возвращается — значок без слова
   понятен не каждому. */
.pill-icon { width: 17px; height: 17px; flex: none; }
.header-pill { gap: 7px; }
.header-pill .pill-text { white-space: nowrap; }

/* Подписи на плашках убраны совсем. Замер: контейнер шапки ограничен
   по ширине, и две подписи («Уведомления», «Тёмная тема») отнимали
   около 200 пикселей — шести пунктам меню не хватало 95 даже на
   экране 1600. Невидимый пункт меню хуже значка без подписи.
   Для чтения с экрана подпись остаётся в разметке и в aria-label. */
.header-pill .pill-text {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.header-pill { padding: 9px 11px; }

/* Кнопки шапки не должны сжиматься: сжимается меню. */
.header-pill, .nav .btn.small { flex: none; }


/* ===== Таблица в результате расчёта =====
   Разбивка важнее итога: человек должен видеть, из чего сложилась
   сумма, иначе он ей не поверит и пойдёт пересчитывать вручную. */
.calc-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: var(--t-sm); }
.calc-table td { padding: 7px 0; border-bottom: 1px solid var(--border); }
.calc-table td:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.calc-table tr:last-child td { border-bottom: none; }
/* Строка с выигрышным вариантом: в сравнении важно, чтобы ответ был
   виден раньше, чем человек прочитает всю таблицу. */
.calc-table tr.best td { background: var(--surface-2); font-weight: 600; }
.calc-table tr.best td:first-child { box-shadow: inset 3px 0 0 var(--primary); padding-left: 10px; }

/* Предупреждение внутри расчёта: не ошибка, а то, на чём попадаются.
   Например, что у организаций пени с 31-го дня считаются вдвое дороже. */
.calc-warn {
  margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  background: var(--surface-2); border-left: 3px solid var(--gold);
  font-size: var(--t-sm); color: var(--muted); line-height: 1.55;
}

/* Поле ключевой ставки: она меняется несколько раз в год, поэтому
   рядом всегда стоит ссылка на первоисточник. */
.rate-hint { margin-top: 5px; line-height: 1.5; }
.rate-hint a { color: var(--primary); text-decoration: underline; }

/* Сумма прописью — её копируют в договор, поэтому текст выделяемый
   и крупнее обычного. */
/* Подпись с нормой под разбором в «Сколько стоит ошибка»: цифра без
   ссылки на норму — это слух, а не знание. */
.pt-law {
  display: block; margin-top: 8px; font-size: var(--t-xs);
  color: var(--muted); letter-spacing: .02em;
}

/* ===== Разбор ситуаций =====
   Человек здесь не изучает, а действует: план должен читаться как
   список поручений самому себе, а не как статья. Отсюда крупные шаги,
   срок справа от каждого и печать без интерфейса. */
.sit-card { display: block; color: inherit; text-decoration: none; }
.sit-card h3 { margin: 10px 0 8px; }
.sit-card p { color: var(--muted); font-size: var(--t-sm); line-height: 1.55; }
.sit-card:hover { border-color: var(--primary); text-decoration: none; }
.sit-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.sit-question { margin-top: 14px; }
.sit-question h3 { margin-bottom: 16px; text-wrap: balance; }
.sit-options { display: flex; flex-direction: column; gap: 10px; }

.sit-plan { margin-top: 14px; }
.sit-plan-title {
  font-family: "Onest", Georgia, serif; font-size: var(--t-xl);
  margin: 10px 0 8px; line-height: 1.2; text-wrap: balance;
}
.sit-summary { color: var(--muted); font-size: 1.02rem; margin-bottom: 6px; }

.sit-steps { counter-reset: sit; list-style: none; margin: 20px 0 0; padding: 0; }
.sit-steps li {
  counter-increment: sit; position: relative;
  padding: 0 0 20px 46px; margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.sit-steps li:last-child { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }
.sit-steps li::before {
  content: counter(sit); position: absolute; left: 0; top: -2px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface-2); border: 1.5px solid var(--primary);
  color: var(--primary); font-weight: 700; font-size: var(--t-sm);
  display: flex; align-items: center; justify-content: center;
}
.sit-step-head {
  display: flex; gap: 12px; align-items: baseline;
  justify-content: space-between; flex-wrap: wrap; margin-bottom: 6px;
}
.sit-step-head b { font-size: 1.04rem; line-height: 1.35; }
.sit-when {
  flex: none; font-size: var(--t-xs); color: var(--gold);
  border: 1px solid var(--gold); border-radius: 20px; padding: 2px 10px;
  white-space: nowrap;
}
.sit-steps p { color: var(--muted); font-size: var(--t-sm); line-height: 1.6; margin: 0; }
.sit-link {
  display: inline-block; margin-top: 8px; font-size: var(--t-sm);
  color: var(--primary); border-bottom: 1px solid currentColor;
}
.sit-link:hover { text-decoration: none; opacity: .8; }

.sit-next { margin-top: 18px; border: 1.5px solid var(--primary); }
.sit-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.sit-articles { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 560px) {
  .sit-steps li { padding-left: 38px; }
  .sit-steps li::before { width: 26px; height: 26px; }
  .sit-actions .btn { width: 100%; }
  /* На телефоне срок уходит на свою строку и переносится: длинные
     формулировки вроде «не позднее 3 рабочих дней с допуска» иначе
     уезжают за край экрана. */
  .sit-step-head { display: block; }
  .sit-when {
    display: inline-block; white-space: normal;
    margin-top: 6px; line-height: 1.4; border-radius: 12px;
  }
}

/* ===== Сертификат за курс =====
   Его показывают работодателю и выкладывают в соцсети, поэтому он
   обязан выглядеть документом, а не всплывающим окном. */
.cert-modal { max-width: 620px; padding: 20px; }
.cert {
  border: 3px double var(--gold);
  padding: 34px 30px; text-align: center;
  background: var(--surface);
}
.cert-kicker {
  display: block; letter-spacing: .32em; text-transform: uppercase;
  color: var(--gold); font-weight: 800; font-size: var(--t-sm);
  margin-bottom: 18px;
}
.cert-lead { color: var(--muted); font-size: var(--t-sm); margin: 0; }
.cert-name {
  font-family: "Onest", Georgia, serif; font-size: 1.7rem;
  margin: 8px 0 14px; line-height: 1.2; text-wrap: balance;
}
.cert-course {
  font-family: "Onest", Georgia, serif; font-size: 1.2rem;
  margin: 8px 0 20px; line-height: 1.3; text-wrap: balance;
}
.cert-meta {
  display: flex; justify-content: center; gap: 26px; flex-wrap: wrap;
  padding-top: 16px; border-top: 1px solid var(--border);
  font-size: var(--t-xs); color: var(--muted);
}
.cert-meta b { display: block; color: var(--text); font-size: var(--t-sm); }
.cert-note {
  margin-top: 16px; font-size: var(--t-xs); color: var(--muted); line-height: 1.5;
}
.cert-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }

/* На печать уходит только сертификат: раньше window.print() выводил
   всю страницу со списком курсов, шапкой и подвалом. */
@media print {
  body.printing-cert > *:not(#certBackdrop) { display: none !important; }
  body.printing-cert #certBackdrop {
    position: static !important; display: block !important;
    background: none !important; backdrop-filter: none !important; padding: 0 !important;
  }
  body.printing-cert .modal { box-shadow: none; max-height: none; padding: 0; }
  body.printing-cert .no-print { display: none !important; }
  body.printing-cert .cert { border-color: #a8791b; }
}

/* Вердикт по ИНН: контрольная сумма ловит опечатку на месте, до того
   как человек пойдёт искать по неверному номеру и решит, что
   контрагента не существует. */
.inn-verdict {
  margin-bottom: 10px; padding: 9px 12px; border-radius: 10px;
  font-size: var(--t-sm); line-height: 1.55;
}
.inn-verdict.ok { background: var(--surface-2); border-left: 3px solid var(--primary); color: var(--muted); }
.inn-verdict.bad { background: var(--surface-2); border-left: 3px solid var(--danger); color: var(--danger); }

.words-out {
  font-size: 1.05rem; line-height: 1.55; padding: 14px 16px;
  border: 1px dashed var(--border); border-radius: 12px;
  background: var(--surface-2); user-select: all; word-break: break-word;
}


/* ===== Ссылки на официальные реестры =====
   Сведения о контрагенте мы не выдумываем: ведём туда, где они
   достоверны и бесплатны. */
.check-links { margin: 14px 0 18px; display: flex; flex-direction: column; gap: 8px; }
.check-link {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 13px; border: 1px solid var(--border); border-radius: 10px;
  text-decoration: none; color: var(--text); transition: border-color .2s;
}
.check-link:hover { border-color: var(--primary); text-decoration: none; }
.check-link b { font-size: var(--t-sm); }
.check-link span { font-size: var(--t-xs); color: var(--muted); }


/* Недоступный режим показываем, а не прячем: человеку важно понять,
   почему он не подходит, а не гадать, куда делся вариант. */
.cmp-table tr.off { opacity: .55; }


/* ===== Публичная лента вопросов =====
   Вопрос виден сразу, ответ раскрывается: так на экран помещается
   десяток разборов, и человек находит свой, не листая простыни. */
.qa-controls { display: flex; flex-direction: column; gap: 12px; margin-bottom: 22px; }
.qa-controls input[type="search"] { width: 100%; }
.qa-topics { display: flex; flex-wrap: wrap; gap: 8px; }
.qa-chip {
  padding: 7px 13px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--border); background: var(--surface);
  color: var(--muted); font-family: inherit; font-size: var(--t-sm); font-weight: 600;
  transition: border-color .2s, color .2s;
}
.qa-chip:hover { border-color: var(--primary); color: var(--primary); }
.qa-chip.on { border-color: var(--primary); color: var(--primary); background: var(--surface-2); }

.qa-item {
  border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 18px; margin-bottom: 12px; background: var(--surface);
}
.qa-item summary { cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.qa-item summary::-webkit-details-marker { display: none; }
.qa-q { font-weight: 600; }
.qa-meta { font-size: var(--t-xs); color: var(--muted); }
.qa-a {
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
  line-height: 1.65; white-space: normal;
}
.qa-actions {
  margin-top: 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}

/* Предложение опубликовать — после ответа в чате. */
.qa-offer {
  margin-top: 8px; padding: 10px 12px; border-radius: 12px;
  background: var(--surface-2); font-size: var(--t-sm);
  display: flex; flex-direction: column; gap: 8px;
}
.qa-offer .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }


/* ===== Проверка вопросов перед публикацией ===== */
.qa-review {
  border: 1px solid var(--border); border-radius: 12px;
  padding: 14px; margin-bottom: 12px;
}
.qa-review label { display: block; font-size: var(--t-xs); color: var(--muted); margin-bottom: 4px; }
.qa-review textarea { width: 100%; min-height: 52px; }
.qa-review-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.qa-review-answer {
  margin-top: 10px; padding: 12px; border-radius: 10px;
  background: var(--surface-2); font-size: var(--t-sm); line-height: 1.6;
  max-height: 260px; overflow-y: auto;
}


/* ===== Предложение пробного периода =====
   Заметное, но не крикливое: это честное предложение попробовать
   без карты, а не баннер-ловушка. */
.trial-banner {
  display: flex; gap: 18px; align-items: center; justify-content: space-between;
  flex-wrap: wrap;
  border: 1.5px solid var(--primary); border-radius: 16px;
  padding: 18px 22px; margin-bottom: 22px;
  background: var(--surface);
}
.trial-banner > div { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 240px; }
.trial-banner b { font-size: 1.05rem; }
.trial-banner span { color: var(--muted); font-size: var(--t-sm); line-height: 1.55; }
.trial-banner .btn { flex: none; }


/* ===== Пейволл =====
   Раньше окно собиралось на встроенных стилях прямо в разметке: свои
   отступы, свой размер шрифта, латинское «Pro». Здесь всё то же, что и
   на остальном сайте, и сначала — бесплатный пробный, потом цена. */
.paywall { max-width: 480px; }
.paywall-reason {
  color: var(--muted); font-size: var(--t-sm); line-height: 1.55;
  padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 14px;
}
.paywall-title {
  font-family: "Onest", Georgia, serif; font-size: var(--t-lg);
  margin: 0 0 16px;
}
.paywall-trial {
  display: flex; flex-direction: column; gap: 8px;
  border: 1.5px solid var(--primary); border-radius: 14px;
  padding: 16px 18px; background: var(--surface-2);
}
.paywall-trial b { font-size: 1.02rem; }
.paywall-trial span { color: var(--muted); font-size: var(--t-sm); line-height: 1.55; }
.paywall-trial .btn { margin-top: 4px; }

/* Разделитель «или»: линия с подписью посередине. */
.paywall-or {
  display: flex; align-items: center; gap: 12px;
  color: var(--muted); font-size: var(--t-xs); margin: 18px 0 14px;
}
.paywall-or::before, .paywall-or::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}

.paywall-plan { border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.paywall-plan-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 4px;
}
.paywall-plan-head b { font-family: "Onest", system-ui, sans-serif; font-size: var(--t-lg); }
.paywall-price {
  font-family: "Onest", system-ui, sans-serif; font-weight: 800;
  font-size: 1.7rem; color: var(--primary); white-space: nowrap;
}
.paywall-price i {
  font-style: normal; font-size: var(--t-xs); font-weight: 500;
  color: var(--muted); margin-left: 6px;
}
.paywall-year { color: var(--muted); font-size: var(--t-sm); margin-bottom: 12px; }
.paywall-perks { list-style: none; margin: 0 0 12px; padding: 0; }
.paywall-perks li {
  position: relative; padding-left: 22px; margin-bottom: 7px;
  font-size: var(--t-sm); line-height: 1.5;
}
.paywall-perks li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  color: var(--primary); font-weight: 700;
}
.paywall-worth {
  color: var(--muted); font-size: var(--t-xs); line-height: 1.55;
  border-left: 3px solid var(--gold); padding-left: 12px; margin-bottom: 14px;
}
.paywall-foot {
  display: flex; flex-direction: column; gap: 10px; align-items: stretch;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border);
}
.paywall-promo summary {
  cursor: pointer; color: var(--muted); font-size: var(--t-xs);
  text-align: center; list-style: none; padding: 4px;
}
.paywall-promo summary::-webkit-details-marker { display: none; }
.paywall-promo summary:hover { color: var(--primary); }
.paywall-promo .promo-row { margin-top: 10px; }
.paywall-later {
  border: 0; background: transparent; cursor: pointer;
  color: var(--muted); font: inherit; font-size: var(--t-xs);
  padding: 6px; border-radius: 8px;
}
.paywall-later:hover { color: var(--text); }
.paywall-later:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Управление продлением в карточке подписки. */
.renew-box { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.renew-box p { margin: 0; }


/* ===== Обещания под ценами =====
   Страх «а вдруг не подойдёт» и «потом не отпишешься» держит от первой
   оплаты сильнее самой цены. Отвечаем на него прямо у кнопки. */
.promises {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  margin: 20px 0 4px;
}
.promise {
  background: var(--surface); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 3px;
}
.promise b { font-size: var(--t-sm); }
.promise span { font-size: var(--t-xs); color: var(--muted); line-height: 1.5; }

/* Во что обходится не иметь тариф — самый весомый довод в карточке. */
.tier-worth {
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border);
  font-size: var(--t-xs); color: var(--muted); line-height: 1.55;
}
.tier-year b { color: var(--primary); }


/* ===== Сколько стоит не знать =====
   Цену подписки человек сравнивает не с нулём, а с ценой ошибки.
   Красным не красим: это не запугивание, а арифметика. */
.cost-block {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.cost-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 20px; display: flex; flex-direction: column; gap: 7px;
}
.cost-item b {
  font-family: "Onest", Georgia, serif; font-size: 1.5rem; line-height: 1.15;
  color: var(--text);
}
.cost-item span { font-size: var(--t-sm); color: var(--muted); line-height: 1.55; }


/* ===== Сохранённые расчёты и история вопросов ===== */
.saved-row {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--border);
}
.saved-row:last-child { border-bottom: none; }
.saved-row > div:first-child { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 200px; }
.saved-summary { font-size: var(--t-sm); color: var(--text); }
.saved-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.hist-item {
  border-bottom: 1px solid var(--border); padding: 12px 0;
}
.hist-item:last-child { border-bottom: none; }
.hist-item summary {
  cursor: pointer; display: flex; flex-direction: column; gap: 3px;
}
.hist-item summary::-webkit-details-marker { display: none; }
.hist-item summary > span:first-child { font-weight: 600; }
.hist-answer {
  margin-top: 12px; padding: 14px; border-radius: 12px;
  background: var(--surface-2); line-height: 1.65; font-size: var(--t-sm);
  max-height: 320px; overflow-y: auto;
}


/* ===== Блоки статьи базы знаний =====
   Шаги и частые ошибки — самое ценное в правовом тексте, поэтому они
   выделены, а не спрятаны в общий поток. */
.kb-summary {
  font-size: 1.02rem; color: var(--muted); line-height: 1.6;
  margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border);
}
.kb-part { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.kb-part h4 {
  font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); margin-bottom: 10px;
}
.kb-part ol, .kb-part ul { margin: 0; padding-left: 1.25em; display: flex; flex-direction: column; gap: 8px; }
.kb-part li { line-height: 1.6; }
.kb-steps h4 { color: var(--primary); }
.kb-steps li::marker { color: var(--primary); font-weight: 700; }
.kb-mistakes h4 { color: var(--danger); }
.kb-mistakes li::marker { color: var(--danger); }
.kb-law p { font-size: var(--t-sm); color: var(--muted); line-height: 1.7; }

/* ===== Отдельные страницы статей (папка st/) =====
   28 статей раньше существовали только как якоря внутри одной страницы,
   то есть для поиска не существовали вовсе. Теперь у каждой свой адрес,
   и эти стили — их оформление. Заголовки внутри текста приходят от
   сборщика, поэтому здесь размечены h2 и h3, а не только классы. */
.crumbs {
  font-size: var(--t-xs); color: var(--muted); margin-bottom: 16px;
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--primary); }

.kb-article h1 {
  font-family: "Onest", Georgia, serif; font-size: var(--t-xl);
  line-height: 1.18; margin: 10px 0 14px; text-wrap: balance;
}
.kb-article h2 {
  font-family: "Onest", Georgia, serif; font-size: var(--t-lg);
  margin: 26px 0 10px; line-height: 1.25;
}
.kb-article > p { margin-bottom: 14px; line-height: 1.72; }
.kb-article ul { margin: 0 0 14px; padding-left: 1.25em; }
.kb-article ul li { margin-bottom: 7px; line-height: 1.65; }
.kb-article .kb-part h3 {
  font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); margin-bottom: 10px; font-family: inherit; font-weight: 700;
}
.kb-article .kb-steps h3 { color: var(--primary); }
.kb-article .kb-mistakes h3 { color: var(--danger); }
.kb-checked {
  margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--border);
  font-size: var(--t-xs); color: var(--muted); line-height: 1.6;
}
.kb-cta { margin-top: 20px; border: 1.5px solid var(--primary); }

/* ===== Разбор ответа в тесте =====
   Показывается всегда, а не только при ошибке: угадавший тоже не
   обязательно понимает, почему это верно. */
.quiz-why {
  margin-top: 16px; padding: 16px 18px; border-radius: 14px;
  background: var(--surface-2); border-left: 3px solid var(--border);
  display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
}
.quiz-why.ok { border-left-color: var(--success, #2C7A52); }
.quiz-why.no { border-left-color: var(--danger); }
.quiz-why b { font-size: var(--t-sm); }
.quiz-why.ok b { color: var(--success, #2C7A52); }
.quiz-why.no b { color: var(--danger); }
.quiz-why p { line-height: 1.6; font-size: var(--t-sm); color: var(--text); }


/* ===== Следующий шаг в обучении =====
   Одно конкретное дело вместо списка возможностей. */
.plan-next {
  margin: 14px 0 4px; border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden;
}
.plan-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 12px 16px; background: var(--surface-2); font-size: var(--t-sm);
}
.plan-item {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 13px 16px; border-top: 1px solid var(--border); flex-wrap: wrap;
}
.plan-item > div { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 200px; }
.plan-item .hint { font-size: var(--t-xs); }


/* ===== Быстрый поиск (Ctrl+K) =====
   Одно поле, которое ищет везде: разделы, калькуляторы, инструменты,
   свои расчёты, сроки и прошлые вопросы. */
.palette-bd {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(10, 16, 14, .55); backdrop-filter: blur(3px);
  display: none; align-items: flex-start; justify-content: center;
  padding: 12vh 16px 16px;
}
.palette-bd.open { display: flex; }
.palette {
  width: 100%; max-width: 620px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 18px; overflow: hidden;
  box-shadow: 0 24px 60px -20px rgba(0,0,0,.5);
  display: flex; flex-direction: column; max-height: 74vh;
}
.palette input {
  border: none; border-bottom: 1px solid var(--border); border-radius: 0;
  padding: 18px 20px; font-size: 1.05rem; background: transparent;
}
.palette input:focus { outline: none; box-shadow: none; }
.palette-list { overflow-y: auto; padding: 6px; }
.palette-item {
  display: grid; grid-template-columns: 92px 1fr; gap: 4px 12px;
  width: 100%; text-align: left; padding: 11px 14px; border: none;
  background: transparent; border-radius: 12px; cursor: pointer;
  font-family: inherit; color: var(--text);
}
.palette-item:hover, .palette-item.on { background: var(--surface-2); }
.palette-kind {
  font-size: var(--t-xs); color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; padding-top: 2px;
}
.palette-title { font-weight: 600; }
.palette-note {
  grid-column: 2; font-size: var(--t-xs); color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.palette-empty { padding: 24px 20px; color: var(--muted); font-size: var(--t-sm); }
.palette-foot {
  display: flex; gap: 16px; padding: 10px 20px;
  border-top: 1px solid var(--border); background: var(--surface-2);
  font-size: var(--t-xs); color: var(--muted);
}
@media (max-width: 640px) {
  .palette-bd { padding: 8vh 10px 10px; }
  .palette-item { grid-template-columns: 1fr; }
  .palette-kind { padding-top: 0; }
  .palette-note, .palette-foot { display: none; }
}


/* ===== Итоги: сколько сделано =====
   Человек не помнит, что сделал за полгода, и потому не чувствует,
   за что платит. Показываем это его же цифрами. */
.sum-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  margin-bottom: 16px;
}
.sum-cell {
  background: var(--surface); padding: 16px;
  display: flex; flex-direction: column; gap: 2px;
}
.sum-cell b {
  font-family: "Onest", Georgia, serif; font-size: 1.6rem;
  line-height: 1.1; color: var(--primary);
}
.sum-cell span { font-size: var(--t-xs); color: var(--muted); line-height: 1.45; }
.sum-saved { font-size: 1.02rem; line-height: 1.6; margin-bottom: 6px; }
.sum-saved b { color: var(--primary); }

/* ===== Достижения =====
   Привязаны к действиям, а не ко времени: «зашёл 7 дней подряд»
   ничего не говорит о пользе. */
.badge-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px; margin-top: 12px;
}
.badge-card {
  border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px; opacity: .6;
}
.badge-card.on { opacity: 1; border-color: var(--primary); }
.badge-card b { font-size: var(--t-sm); }
.badge-card > span { font-size: var(--t-xs); color: var(--muted); line-height: 1.45; }
.badge-card .progress-bar { margin-top: 2px; }

/* Блокнот: без кнопки «сохранить» — она лишний повод потерять запись. */
#notesBox { width: 100%; resize: vertical; font-family: inherit; line-height: 1.6; }

/* ============ Телефон: нижняя панель и лист «Ещё» ============

   Что чинится. На телефоне было две навигации одновременно: шапка
   разворачивалась в два ряда плиток, и вдобавок кнопка «Меню» открывала
   список из тринадцати пунктов. Плюс плавающая кнопка чата поверх всего.
   Ощущение — «налеплено», и это справедливо.

   Что стало. Четыре главных раздела внизу, под большим пальцем: до верха
   экрана на современном телефоне рукой не дотянуться, а низ доступен
   всегда. Шапка ужимается до логотипа, поиска и входа. Остальное — в
   листе «Ещё».

   Граница 860px, а не 640: на планшете в книжной ориентации сверху уже
   тесно, а места внизу столько же.                                     */

.tabbar, .sheet-backdrop { display: none; }

@media (max-width: 860px) {
  /* -------- Шапка: одна строка вместо двух рядов плиток -------- */
  .nav { height: auto; flex-wrap: nowrap; padding: 8px 0; gap: 8px; }
  .logo { font-size: 1.05rem; }
  .nav-links, .nav-burger, .mobile-menu, .site-header .theme-toggle { display: none !important; }
  .header-pill { padding: 9px; margin: 0; }
  .header-pill .pill-text { display: none; }
  .nav > .btn { margin-left: auto; padding: 9px 14px; font-size: .82rem; }
  .header-pill + .btn, .notif-btn + .header-pill { margin-left: 0; }

  /* -------- Нижняя панель -------- */
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 120;
    background: var(--header-bg, var(--surface));
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .tabbar-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 8px 2px 7px; min-height: 56px;
    background: none; border: none; cursor: pointer;
    color: var(--muted); font: inherit; font-size: .68rem; font-weight: 600;
    text-decoration: none; line-height: 1.1; text-align: center;
    /* Подсветка при касании только мешает: палец её всё равно закрывает. */
    -webkit-tap-highlight-color: transparent;
  }
  .tabbar-item .tabbar-icon { width: 23px; height: 23px; }
  .tabbar-item.active { color: var(--primary); }
  .tabbar-item.active .tabbar-icon { stroke-width: 2.1; }
  .tabbar-item:active { background: var(--primary-soft, rgba(20, 160, 130, .1)); }

  /* Место под панель. Без этого она накрывает последнюю строку текста,
     и человек думает, что страница обрезана. */
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .chat-widget { bottom: calc(74px + env(safe-area-inset-bottom, 0px)); right: 14px; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .site-footer { margin-bottom: 0; }

  /* -------- Лист «Ещё» -------- */
  .sheet-backdrop {
    display: block; position: fixed; inset: 0; z-index: 200;
    background: rgba(8, 20, 15, .55); backdrop-filter: blur(3px);
    opacity: 0; pointer-events: none; transition: opacity .22s;
  }
  body.sheet-open .sheet-backdrop { opacity: 1; pointer-events: auto; }
  /* Прокрутку фона под открытым листом останавливаем: иначе палец
     листает страницу, а не список, и это выглядит поломкой. */
  body.sheet-open { overflow: hidden; }

  .sheet {
    position: absolute; left: 0; right: 0; bottom: 0;
    max-height: 86vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
    background: var(--surface); border-radius: 20px 20px 0 0;
    padding: 8px 16px calc(20px + env(safe-area-inset-bottom, 0px));
    transform: translateY(100%); transition: transform .26s cubic-bezier(.32, .72, 0, 1);
    box-shadow: 0 -8px 40px rgba(0, 0, 0, .28);
  }
  body.sheet-open .sheet { transform: translateY(0); }

  /* Полоска сверху: понятный знак «это можно закрыть». */
  .sheet-grip {
    width: 40px; height: 4px; border-radius: 99px; background: var(--border);
    margin: 6px auto 14px; cursor: pointer;
  }
  .sheet-title {
    font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
    color: var(--muted); margin: 16px 4px 8px;
  }
  .sheet-title:first-of-type { margin-top: 4px; }
  .sheet-group {
    display: flex; flex-direction: column;
    border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  }
  .sheet-item {
    display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
    /* 56 пикселей — нижняя граница удобного касания. Ниже начинаются
       промахи, и человек винит себя, а не вёрстку. */
    min-height: 56px; padding: 11px 14px; width: 100%;
    background: none; border: none; border-bottom: 1px solid var(--border);
    color: inherit; text-align: left; text-decoration: none; cursor: pointer;
    font: inherit; -webkit-tap-highlight-color: transparent;
  }
  .sheet-item:last-child { border-bottom: none; }
  .sheet-item:active { background: var(--primary-soft, rgba(20, 160, 130, .1)); }
  .sheet-item.active .sheet-label { color: var(--primary); }
  .sheet-label { font-size: .97rem; font-weight: 700; }
  .sheet-hint { font-size: .78rem; color: var(--muted); line-height: 1.3; }
  .sheet-close { width: 100%; margin-top: 18px; min-height: 48px; }
}

@media (max-width: 860px) and (prefers-reduced-motion: reduce) {
  .sheet, .sheet-backdrop { transition: none; }
}

/* ============ Телефон: длинные ряды выбора ============

   На calc.html девятнадцать калькуляторов, на knowledge.html — разделы,
   на tools.html — инструменты. На широком экране они укладываются в два
   ряда, а на телефоне встают столбиком: до самого расчёта приходилось
   листать десять экранов, и человек не понимал, что страница вообще про
   калькулятор.

   Одна прокручиваемая строка возвращает содержимое на первый экран.
   Полоски прокрутки нет — вместо неё край последней плитки, обрезанный
   границей экрана: это понятнее любой подсказки, палец сам тянется вбок.

   Отрицательные поля нужны, чтобы строка прокручивалась от края до края,
   а не внутри отступов контейнера: иначе кажется, что она сломана.     */

@media (max-width: 860px) {
  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    margin-left: -18px; margin-right: -18px;
    padding: 2px 18px 8px;
    margin-bottom: 18px;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  /* Не сжимать — всем детям ряда, а не только кнопкам. В рядах попадаются
     и метки: они сжимались, текст в них переносился, и вся строка
     вытягивалась в высоту втрое. */
  .tabs > * { flex: 0 0 auto; }
  .tabs { align-items: center; }
  .tabs .tab {
    scroll-snap-align: start;
    padding: 9px 15px;
    font-size: .84rem;
    min-height: 40px;
    white-space: nowrap;
  }
}

/* ============ Телефон: плотность ============

   На широком экране воздух вокруг блоков помогает: глаз отдыхает, взгляд
   находит нужное. На телефоне тот же воздух означает лишний экран
   прокрутки до каждого действия — 64 пикселя сверху и снизу у main
   съедали треть первого экрана впустую.

   Уменьшаем расстояния, но не сами элементы: кнопки и поля остаются
   крупными, иначе в них перестанут попадать. Сжимаем пустоту, а не
   содержимое.                                                          */

@media (max-width: 860px) {
  main { padding: 26px 0 34px; }
  .container { padding-left: 16px; padding-right: 16px; }
  .section-title { margin-bottom: 18px; }
  .section-title h1, .section-title h2 { line-height: 1.15; }

  h1 { font-size: clamp(1.6rem, 7vw, 2.1rem); }
  h2 { font-size: clamp(1.35rem, 5.6vw, 1.7rem); }
  h3 { font-size: 1.08rem; }

  .card { padding: 18px 16px; border-radius: 16px; }
  .grid { gap: 14px; }

  /* Поля и кнопки — наоборот, крупнее: по ним попадают пальцем.
     16px у поля обязателен, иначе iPhone приближает страницу при вводе
     и человек оказывается на увеличенном экране, не понимая почему. */
  .btn { min-height: 46px; padding: 12px 20px; }
  .btn.small { min-height: 40px; }
  input, select, textarea { font-size: 16px; min-height: 46px; }
  textarea { min-height: 92px; }
  label { font-size: .9rem; }
}

/* ============ Телефон: мелочи, которые мешают ============ */

@media (max-width: 860px) {
  /* Кнопка чата закрывала последнюю строку карточки. Делаем меньше
     и прижимаем к краю: она нужна, но не важнее содержимого. */
  .chat-toggle { width: 48px; height: 48px; font-size: 1.2rem; }
  .chat-widget { right: 10px; }
  /* Пульсация вокруг кнопки на телефоне только отвлекает — она и так
     на виду, а анимация ест заряд. */
  .chat-toggle { animation: none; }

  /* Таблицы прокручиваются вбок вместо того, чтобы сжиматься в кашу.
     Сжатая таблица нечитаема, а прокрутка хотя бы понятна. */
  table { display: block; overflow-x: auto; white-space: nowrap; }
  table th, table td { padding: 9px 11px; font-size: .86rem; }

  /* Заголовок статьи и метка закона вставали в одну строку и рвали
     верстку: метку переносим под заголовок. */
  .article-item h3 { display: block; }
  .article-item .badge, .article-item .law-tag { display: inline-block; margin-top: 6px; }

  /* Подвал: список ссылок в три строки мелким шрифтом читать невозможно,
     а он и не нужен — всё то же есть в листе «Ещё». */
  .footer-nav { display: none; }
  .site-footer { padding: 22px 0 18px; font-size: .82rem; }
}
