/* EXEC v7.3 — Luxury dark editorial · by_Ackerman
   Вдохновение: Linear.app × Vercel × Stripe (dark mode)
   Тональность: refined, confident, minimal but rich */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a0f;
  --bg-1: #0e0e14;
  --bg-2: #12121a;
  --bg-card: rgba(16, 16, 24, 0.65);
  --bg-glass: rgba(255, 255, 255, 0.03);

  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --border-accent: rgba(120, 119, 255, 0.3);

  --t1: #f0f0f5;
  --t2: #9898a8;
  --t3: #5c5c6e;
  --t4: #35354a;

  --accent: #7877ff;
  --accent-2: #a78bfa;
  --warm: #f59e42;
  --green: #34d399;
  --rose: #fb7185;
  --sky: #38bdf8;

  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', monospace;

  --sidebar-w: 220px;
  --radius: 12px;
  --radius-sm: 8px;
}

html, body {
  height: 100%; background: var(--bg); color: var(--t1);
  font-family: var(--sans); font-size: 14.5px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow: hidden;
}

/* Мягный градиент-mist на фоне */
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 60% 50% at 25% 0%, rgba(120, 119, 255, 0.07), transparent),
    radial-gradient(ellipse 50% 40% at 75% 100%, rgba(251, 113, 133, 0.05), transparent);
}

/* ═══ LAYOUT ═══ */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; height: 100vh; position: relative; z-index: 1; }

/* ═══ SIDEBAR ═══ */
.sidebar {
  background: var(--bg-1); border-right: 1px solid var(--border);
  padding: 24px 16px 16px; display: flex; flex-direction: column; gap: 2px;
}
.brand { padding: 0 8px 28px; }
.brand-mark {
  font-family: var(--serif); font-size: 28px; font-weight: 400; font-style: italic;
  color: var(--accent); letter-spacing: -0.02em; line-height: 1;
}
.brand-sub {
  font-family: var(--mono); font-size: 10px; color: var(--t3);
  letter-spacing: 0.12em; text-transform: uppercase; margin-top: 4px;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  background: transparent; border: none;
  color: var(--t2); cursor: pointer;
  font-family: var(--sans); font-size: 13.5px; font-weight: 500;
  text-align: left; transition: all 0.15s;
}
.nav-item svg { width: 16px; height: 16px; stroke-width: 1.5; opacity: 0.5; flex-shrink: 0; }
.nav-item:hover { background: var(--bg-glass); color: var(--t1); }
.nav-item:hover svg { opacity: 0.8; }
.nav-item.active { background: rgba(120, 119, 255, 0.1); color: var(--accent); }
.nav-item.active svg { opacity: 1; color: var(--accent); }

.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); }
.status-line {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 10px; color: var(--t3);
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 6px 8px; cursor: pointer;
}
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--rose); }
.status-dot.online { background: var(--green); box-shadow: 0 0 8px rgba(52, 211, 153, 0.5); }
.brand-foot { font-family: var(--mono); font-size: 9px; color: var(--t4); text-align: center; margin-top: 10px; letter-spacing: 0.1em; }

/* ═══ MAIN ═══ */
.main { display: flex; flex-direction: column; overflow: hidden; }
.view { display: none; flex: 1; flex-direction: column; overflow: hidden; }
.view.active { display: flex; }

.view-header {
  padding: 24px 32px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: baseline; gap: 16px; flex-shrink: 0;
}
.view-title {
  font-family: var(--serif); font-size: 28px; font-weight: 400;
  color: var(--t1); letter-spacing: -0.02em;
}
.view-sub { font-size: 14px; color: var(--t3); }
.view-actions { margin-left: auto; display: flex; gap: 8px; }

.view-body { flex: 1; overflow-y: auto; padding: 28px 32px 40px; }

/* ═══ CARDS ═══ */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  transition: border-color 0.2s, box-shadow 0.25s;
}
.card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 0 0 1px var(--border-hover), 0 8px 32px rgba(0,0,0,0.3);
}
.card.featured {
  border-color: var(--border-accent);
  background: linear-gradient(135deg, rgba(120, 119, 255, 0.06), rgba(251, 113, 133, 0.03));
}

.card-label {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--t3); margin-bottom: 12px;
}

/* ═══ KPI ═══ */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.kpi {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; transition: all 0.2s;
}
.kpi:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: 0 12px 32px rgba(0,0,0,0.2); }
.kpi-label { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--t3); margin-bottom: 10px; }
.kpi-value { font-family: var(--mono); font-size: 32px; font-weight: 700; color: var(--t1); line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-value.accent { color: var(--accent); }
.kpi-value.green { color: var(--green); }
.kpi-value.warm { color: var(--warm); }
.kpi-value.rose { color: var(--rose); }
.kpi-value.sky { color: var(--sky); }
.kpi-meta { font-family: var(--mono); font-size: 11px; color: var(--t3); margin-top: 6px; }

/* ═══ PROGRESS BAR (красивый градиент) ═══ */
.progress-bar { height: 4px; background: var(--bg-2); border-radius: 2px; overflow: hidden; }
.progress-fill {
  height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--rose));
  transition: width 0.6s ease;
}

/* ═══ ONBOARDING HERO ═══ */
.onboarding-hero {
  background: linear-gradient(135deg, rgba(120, 119, 255, 0.1), rgba(167, 139, 250, 0.05));
  border: 1px solid var(--border-accent); border-radius: var(--radius);
  padding: 28px 32px; margin-bottom: 28px; position: relative; overflow: hidden;
}
.onboarding-hero::before {
  content: ''; position: absolute; top: -50%; right: -20%; width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(120, 119, 255, 0.15), transparent 70%);
  pointer-events: none;
}
.onboarding-hero h2 {
  font-family: var(--serif); font-size: 22px; font-weight: 400; color: var(--t1);
  margin-bottom: 8px; position: relative;
}
.onboarding-hero p { font-size: 14px; color: var(--t2); margin-bottom: 16px; position: relative; }
.onboarding-pct {
  font-family: var(--mono); font-size: 48px; font-weight: 700;
  color: var(--accent); line-height: 1; position: relative;
}

/* ═══ BUSINESS PROJECT CARD ═══ */
.project-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px; cursor: pointer; transition: all 0.25s; position: relative; overflow: hidden;
}
.project-card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(120, 119, 255, 0.06), transparent 50%);
  opacity: 0; transition: opacity 0.3s;
}
.project-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.project-card:hover::before { opacity: 1; }

.project-card h2 {
  font-family: var(--serif); font-size: 36px; font-weight: 400; font-style: italic;
  color: var(--t1); margin-bottom: 6px; position: relative; letter-spacing: -0.02em;
}
.project-card .tagline { font-size: 15px; color: var(--t2); margin-bottom: 20px; position: relative; }
.project-card .stats {
  display: flex; gap: 28px; font-family: var(--mono); font-size: 12px; color: var(--t3);
  letter-spacing: 0.06em; position: relative;
}
.project-card .stats .val { color: var(--accent); font-weight: 600; margin-right: 4px; }

/* ═══ PROJECT DEEP — секции как лендинг ═══ */
.project-header {
  padding: 48px 0 36px; border-bottom: 1px solid var(--border); margin-bottom: 36px;
}
.project-header h1 {
  font-family: var(--serif); font-size: 56px; font-weight: 400; font-style: italic;
  color: var(--t1); letter-spacing: -0.03em; line-height: 1.05; margin-bottom: 12px;
}
.project-header .tagline { font-size: 18px; color: var(--t2); max-width: 600px; line-height: 1.6; margin-bottom: 20px; }
.project-header .meta {
  display: flex; gap: 20px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 11.5px; color: var(--t3);
  letter-spacing: 0.06em; text-transform: uppercase;
}
.project-header .meta .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); display: inline-block; margin-right: 6px; }

.section { margin-bottom: 48px; }
.section-title {
  font-family: var(--serif); font-size: 24px; font-weight: 400;
  color: var(--t1); margin-bottom: 20px; letter-spacing: -0.01em;
}
.section-title::before { content: ''; display: inline-block; width: 3px; height: 20px; background: var(--accent); margin-right: 12px; vertical-align: middle; border-radius: 1px; }

/* Product cards */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.product-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; transition: all 0.2s;
}
.product-card:hover { border-color: var(--border-hover); }
.product-name { font-family: var(--sans); font-size: 15px; font-weight: 600; color: var(--t1); margin-bottom: 4px; }
.product-price { font-family: var(--mono); font-size: 22px; font-weight: 700; color: var(--accent); margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.product-price::after { content: ' ₽'; font-size: 13px; color: var(--t3); font-weight: 400; }
.product-desc { font-size: 12.5px; color: var(--t2); line-height: 1.55; }

/* Sector cards (inside project) */
.sectors-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.sector-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; cursor: pointer; transition: all 0.2s;
}
.sector-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 12px 40px rgba(0,0,0,0.25); }
.sector-label { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--t3); margin-bottom: 10px; }
.sector-value { font-family: var(--mono); font-size: 28px; font-weight: 700; color: var(--t1); line-height: 1; }
.sector-unit { font-size: 13px; color: var(--t3); font-weight: 400; margin-left: 4px; }
.sector-extra { font-family: var(--mono); font-size: 10.5px; color: var(--t3); margin-top: 8px; }

/* ═══ PEOPLE ═══ */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.person-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; transition: all 0.2s; cursor: pointer;
}
.person-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.person-name { font-family: var(--sans); font-size: 15px; font-weight: 600; color: var(--t1); margin-bottom: 2px; }
.person-role { font-size: 13px; color: var(--accent); margin-bottom: 8px; }
.person-notes { font-size: 12.5px; color: var(--t2); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ═══ GOALS ═══ */
.goal-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 24px; margin-bottom: 10px;
}
.goal-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.goal-title { font-size: 15px; font-weight: 500; color: var(--t1); }
.goal-pct { font-family: var(--mono); font-size: 14px; color: var(--accent); font-variant-numeric: tabular-nums; }

/* ═══ TASKS ═══ */
.task-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 6px; transition: all 0.15s;
}
.task-item:hover { border-color: var(--border-hover); }
.task-item.done { opacity: 0.4; }
.task-item.done .task-title { text-decoration: line-through; }
.task-item.priority-high { border-left: 3px solid var(--rose); }
.task-check {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--t3); background: transparent;
  cursor: pointer; flex-shrink: 0; margin-top: 1px; transition: all 0.15s;
}
.task-check:hover { border-color: var(--accent); }
.task-check.checked { background: var(--accent); border-color: var(--accent); }
.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 14px; color: var(--t1); }
.task-meta { font-family: var(--mono); font-size: 10.5px; color: var(--t3); margin-top: 4px; display: flex; gap: 12px; }

/* Story items */
.story-item {
  padding: 16px 0; border-bottom: 1px solid var(--border);
}
.story-q { font-family: var(--mono); font-size: 11.5px; color: var(--accent); letter-spacing: 0.03em; margin-bottom: 6px; }
.story-a { font-size: 14px; color: var(--t1); line-height: 1.6; }

.fact-item {
  padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: 13.5px; color: var(--t2); line-height: 1.55;
}
.fact-ts { font-family: var(--mono); font-size: 10px; color: var(--t4); margin-left: 8px; }

/* Ideas */
.idea-item {
  padding: 14px 16px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 6px; font-size: 14px; color: var(--t1);
}
.idea-meta { font-family: var(--mono); font-size: 10.5px; color: var(--t3); margin-top: 4px; }

/* Docs */
.doc-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 8px; transition: all 0.15s;
}
.doc-item:hover { border-color: var(--border-hover); }
.doc-name { font-size: 14px; font-weight: 500; color: var(--t1); }
.doc-meta { font-family: var(--mono); font-size: 10.5px; color: var(--t3); }
.doc-download {
  margin-left: auto;
  font-family: var(--mono); font-size: 11px; color: var(--accent);
  text-decoration: none; letter-spacing: 0.06em; text-transform: uppercase;
}
.doc-download:hover { text-decoration: underline; }

/* ═══ BUTTONS — минимум ═══ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid var(--border);
  color: var(--t1); font-family: var(--sans); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.15s;
}
.btn:hover { border-color: var(--border-hover); background: var(--bg-glass); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #6b6af0; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-ghost { border-color: transparent; }

.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11px; color: var(--t3);
  text-transform: uppercase; letter-spacing: 0.1em;
  cursor: pointer; background: none; border: none; padding: 4px 0;
  transition: color 0.15s;
}
.back-btn:hover { color: var(--accent); }
.back-btn::before { content: '← '; }

/* ═══ INPUTS (только в настройках) ═══ */
.input {
  width: 100%; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px solid var(--border);
  color: var(--t1); font-family: var(--sans); font-size: 13.5px;
  outline: none; transition: border-color 0.2s;
}
.input::placeholder { color: var(--t4); }
.input:focus { border-color: var(--accent); }
.field { margin-bottom: 14px; }
.field-label { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--t3); margin-bottom: 6px; display: block; }

/* ═══ MODAL ═══ */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(8px); display: none;
  align-items: center; justify-content: center; z-index: 100;
}
.modal-backdrop.active { display: flex; }
.modal {
  background: var(--bg-1); border: 1px solid var(--border-accent); border-radius: var(--radius);
  padding: 28px; width: min(520px, 92vw); max-height: 90vh; overflow-y: auto;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6);
}
.modal-title { font-family: var(--serif); font-size: 22px; color: var(--t1); margin-bottom: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ═══ TOAST ═══ */
.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--bg-1); border: 1px solid var(--accent); border-radius: var(--radius-sm);
  padding: 11px 20px; font-family: var(--mono); font-size: 12px; color: var(--t1);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
  opacity: 0; transition: transform 0.3s, opacity 0.3s; z-index: 200; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-color: var(--rose); }
.toast.success { border-color: var(--green); }

/* ═══ EMPTY ═══ */
.empty { padding: 48px 20px; text-align: center; color: var(--t3); font-size: 14px; font-style: italic; }

/* ═══ TWO-COL ═══ */
.two-col { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--t4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--t3); }

/* ═══ MOBILE / iPhone PWA ═══ */
.tab-bar { display: none; }

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }

  /* Убираем ВСЮ резиновость — фикс для iOS */
  html, body { 
    position: fixed; width: 100%; height: 100%;
    overflow: hidden; overscroll-behavior: none;
  }
  .main { height: 100vh; height: 100dvh; }

  /* View header — safe area для notch/Dynamic Island */
  .view-header {
    padding: max(16px, env(safe-area-inset-top)) 16px 12px;
    min-height: auto;
  }
  .view-title { font-size: 22px; }

  /* View body — основной скролл */
  .view-body {
    padding: 16px 16px calc(76px + env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
  }

  /* KPI — 2 колонки на телефоне */
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px; }
  .kpi { padding: 14px 16px; }
  .kpi-value { font-size: 26px; }

  /* Разделы в одну колонку */
  .two-col { grid-template-columns: 1fr; gap: 14px; }
  .products-grid, .sectors-grid, .people-grid { grid-template-columns: 1fr; gap: 10px; }

  /* Проект */
  .project-header h1 { font-size: 32px; }
  .project-header .tagline { font-size: 15px; }
  .project-header .meta { gap: 10px; font-size: 10px; flex-wrap: wrap; }
  .project-kpi { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .project-card h2 { font-size: 28px; }
  .project-card .stats { gap: 14px; font-size: 11px; flex-wrap: wrap; }

  /* Карточки — чуть компактнее */
  .card { padding: 18px; }
  .sector-card { padding: 16px; }
  .person-card { padding: 14px 16px; }
  .product-card { padding: 16px; }
  .product-price { font-size: 18px; }

  /* Математика */
  .math-header { flex-direction: column; gap: 12px; }
  .math-stats { gap: 14px; font-size: 11px; }
  .math-levels { gap: 6px; }
  .math-level-btn { padding: 6px 12px; font-size: 12px; }
  .math-topics { grid-template-columns: 1fr; gap: 8px; }
  .math-card { padding: 28px 20px; }
  .math-question { font-size: 24px; }
  .math-input { width: 160px; font-size: 20px; padding: 12px 14px; }

  /* Модалка */
  .modal {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 48px);
    margin: auto 12px;
  }

  /* Роадмап на мобиле — вертикально */
  [style*="grid-template-columns:repeat(4"] { grid-template-columns: 1fr 1fr !important; }
  [style*="grid-template-columns:repeat(3"] { grid-template-columns: 1fr !important; }

  /* Профиль */
  .card.featured [style*="font-size:36px"] { font-size: 28px !important; }

  /* Tab bar — фиксированный снизу */
  .tab-bar {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--bg-1);
    border-top: 1px solid var(--border);
    padding: 6px 2px calc(6px + env(safe-area-inset-bottom));
    justify-content: space-around;
    z-index: 80;
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  }

  /* Тост */
  .toast { bottom: calc(70px + env(safe-area-inset-bottom)); font-size: 11px; padding: 9px 16px; }

  /* Онбординг */
  .onboarding-hero { padding: 20px; }
  .onboarding-pct { font-size: 36px; }

  /* Section */
  .section-title { font-size: 20px; }
  .section-title::before { height: 16px; width: 2px; }
}

/* Touch optimization */
@media (hover: none) and (pointer: coarse) {
  /* Убираем hover-эффекты на тач-устройствах — они тормозят */
  .card:hover, .kpi:hover, .sector-card:hover, .person-card:hover,
  .product-card:hover, .project-card:hover, .math-topic-card:hover {
    transform: none !important;
    box-shadow: none !important;
  }
  /* Увеличиваем тач-зоны */
  .tab-btn { padding: 8px 4px; min-height: 44px; }
  .nav-item { min-height: 44px; }
  .btn { min-height: 44px; padding: 10px 18px; }
  .math-next { min-height: 48px; padding: 14px 36px; }
  .math-level-btn { min-height: 40px; }
  .math-topic-card { padding: 16px; }
  /* Active state вместо hover */
  .sector-card:active, .person-card:active, .project-card:active,
  .math-topic-card:active, .kpi:active {
    transform: scale(0.97);
    transition: transform 0.1s;
  }
}
.tab-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 4px; background: transparent; border: none;
  color: var(--t3); cursor: pointer;
  font-family: var(--mono); font-size: 9px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
}
.tab-btn svg { width: 20px; height: 20px; stroke-width: 1.5; }
.tab-btn.active { color: var(--accent); }

/* ═══ ANIMATIONS ═══ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.view.active .view-body > * { animation: fadeUp 0.35s ease both; }
.view.active .view-body > *:nth-child(2) { animation-delay: 0.06s; }
.view.active .view-body > *:nth-child(3) { animation-delay: 0.12s; }
.view.active .view-body > *:nth-child(4) { animation-delay: 0.18s; }
.view.active .view-body > *:nth-child(5) { animation-delay: 0.24s; }

/* ═══ MATH TRAINER ═══ */
.math-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 28px; }
.math-stats { display: flex; gap: 20px; font-family: var(--mono); font-size: 12px; color: var(--t3); }
.math-stats .val { color: var(--accent); font-weight: 700; font-size: 16px; margin-right: 3px; }

.math-levels { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.math-level-btn {
  padding: 8px 16px; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--t2); font-family: var(--sans); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.15s;
}
.math-level-btn:hover { border-color: var(--border-hover); color: var(--t1); }
.math-level-btn.active { background: rgba(120, 119, 255, 0.12); border-color: var(--accent); color: var(--accent); }
.math-level-btn.locked { opacity: 0.4; cursor: default; }

.math-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 28px; }
.math-topic-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; cursor: pointer; transition: all 0.2s;
}
.math-topic-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.math-topic-card.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.math-topic-name { font-size: 14px; font-weight: 600; color: var(--t1); margin-bottom: 4px; }
.math-topic-skill { font-size: 12px; color: var(--t2); }

.math-card {
  max-width: 580px; margin: 0 auto;
  background: var(--bg-card); border: 1px solid var(--border-accent); border-radius: var(--radius);
  padding: 40px; text-align: center; position: relative; overflow: hidden;
}
.math-card::before {
  content: ''; position: absolute; top: -50%; right: -30%; width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(120, 119, 255, 0.08), transparent 70%);
  pointer-events: none;
}
.math-question {
  font-family: var(--serif); font-size: 32px; font-weight: 400;
  color: var(--t1); margin-bottom: 24px; position: relative; line-height: 1.3;
}
.math-input-wrap { display: flex; gap: 12px; justify-content: center; margin-bottom: 16px; position: relative; }
.math-input {
  width: 200px; padding: 14px 18px; border-radius: var(--radius-sm);
  background: var(--bg); border: 2px solid var(--border);
  color: var(--t1); font-family: var(--mono); font-size: 24px; font-weight: 700;
  text-align: center; outline: none; transition: border-color 0.2s;
}
.math-input:focus { border-color: var(--accent); }
.math-input.correct { border-color: var(--green); background: rgba(52, 211, 153, 0.08); }
.math-input.wrong { border-color: var(--rose); background: rgba(251, 113, 133, 0.08); animation: shake 0.4s; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

.math-hint {
  font-size: 13px; color: var(--t3); margin-top: 12px; font-style: italic;
  opacity: 0; transition: opacity 0.3s; position: relative;
}
.math-hint.visible { opacity: 1; }

.math-result {
  font-family: var(--mono); font-size: 15px; font-weight: 600; margin-top: 16px; position: relative;
}
.math-result.correct { color: var(--green); }
.math-result.wrong { color: var(--rose); }

.math-next {
  margin-top: 20px; padding: 12px 32px; border-radius: var(--radius-sm);
  background: var(--accent); border: none; color: #fff;
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background 0.15s; position: relative;
}
.math-next:hover { background: #6b6af0; }

.math-streak-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 20px;
  background: rgba(245, 158, 66, 0.1); border: 1px solid rgba(245, 158, 66, 0.3);
  font-family: var(--mono); font-size: 12px; color: var(--warm);
}

/* ═══ NEWS FEED ═══ */
.news-day { margin-bottom: 28px; }
.news-day-title {
  font-family: var(--serif); font-size: 18px; color: var(--t1); margin-bottom: 14px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.news-item {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 22px; margin-bottom: 10px; transition: border-color 0.2s;
}
.news-item:hover { border-color: var(--border-hover); }
.news-tag {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px;
}
.news-tag.ai { background: rgba(120, 119, 255, 0.15); color: var(--accent); }
.news-tag.business { background: rgba(52, 211, 153, 0.15); color: var(--green); }
.news-tag.edtech { background: rgba(56, 189, 248, 0.15); color: var(--sky); }
.news-tag.general { background: rgba(255,255,255,0.05); color: var(--t3); }
.news-title { font-size: 15px; font-weight: 600; color: var(--t1); margin-bottom: 6px; }
.news-summary { font-size: 13px; color: var(--t2); line-height: 1.6; margin-bottom: 8px; }
.news-relevance { font-size: 12px; color: var(--warm); font-style: italic; }

/* ═══ COST DISPLAY ═══ */
.cost-badge {
  font-family: var(--mono); font-size: 11px; color: var(--green);
  background: rgba(52, 211, 153, 0.08); border: 1px solid rgba(52, 211, 153, 0.2);
  padding: 2px 8px; border-radius: 4px; display: inline-block; margin-left: 8px;
}
