.topbar{height:auto;min-height:92px;padding-block:14px;gap:24px}
.topbar nav{height:auto;gap:10px;flex-wrap:wrap}
.topbar nav a[href^="/courses"],.topbar nav a[href="/club"]{min-height:54px;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;gap:11px;padding:12px 18px;border:1px solid #69523f;border-radius:14px;background:#241c17;color:#f9e6d7;font-size:16px;font-weight:700;line-height:1.2;text-decoration:none;transition:background-color .18s ease,border-color .18s ease,box-shadow .18s ease}
.topbar nav a[href^="/courses"] svg,.topbar nav a[href="/club"] svg{width:23px;height:23px;stroke-width:2.2}
.topbar nav a[href^="/courses"]:hover,.topbar nav a[href="/club"]:hover{background:#3a281d;border-color:#e08d53}
.topbar nav a[href^="/courses"].active,.topbar nav a[href="/club"].active,.topbar nav a.club-current-nav{color:#fff4e9;background:#513018;border-color:#ff9b52;box-shadow:inset 0 0 0 1px #ff9b5266}
.topbar nav a:focus-visible{outline:3px solid #ffb579;outline-offset:3px}
.topbar nav a.club-primary-nav::before{content:"";width:23px;height:23px;flex:none;background-size:contain;background-repeat:no-repeat;background-position:center}
.topbar nav a.club-primary-nav[href^="/courses"]::before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ffe3ca' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 7v14'/%3E%3Cpath d='M3 18V4.5A2.5 2.5 0 0 1 5.5 2H8a4 4 0 0 1 4 4 4 4 0 0 1 4-4h2.5A2.5 2.5 0 0 1 21 4.5V18h-5a4 4 0 0 0-4 3 4 4 0 0 0-4-3H3Z'/%3E%3C/svg%3E")}
.topbar nav a.club-primary-nav[href="/club"]::before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ffe3ca' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1'/%3E%3C/svg%3E")}
@media (max-width:700px){.topbar{padding:14px 16px;gap:12px}.topbar nav{order:3;width:100%;gap:8px;padding-top:12px}.topbar nav a[href^="/courses"],.topbar nav a[href="/club"]{flex:1 1 calc(50% - 4px);min-width:0;min-height:54px;padding:10px 8px;font-size:15px}.topbar nav a[href^="/courses"] svg,.topbar nav a[href="/club"] svg,.topbar nav a.club-primary-nav::before{width:22px;height:22px}.topbar nav a[href^="/training"],.topbar nav a[href^="/offline"],.topbar nav a[href^="/admin"],.topbar nav a[href^="/club?tab"]{min-height:44px}}
@media (prefers-reduced-motion:reduce){.topbar nav a[href^="/courses"],.topbar nav a[href="/club"]{transition:none}}

/* === v4 26.11.2026: системный шрифт + компактная шапка на телефоне (одобрено Игорем, «Установить» оставлена значком) === */
body, button, input, select, textarea {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .brand {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  letter-spacing: -0.01em;
}
@media (max-width: 640px) {
  #school-app-navigation { position: absolute; top: 0; right: 16px; left: auto; height: 64px; padding: 0; gap: 4px; border: 0; background: none; display: flex; align-items: center; z-index: 5; }
  #school-app-navigation > a[href="/courses"], #school-app-navigation > a[href="/club"] { display: none; }
  #school-app-navigation #school-install-button { width: 36px; height: 36px; min-width: 36px; padding: 0 !important; font-size: 0 !important; gap: 0 !important; color: inherit; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; }
  #school-app-navigation #school-install-button[hidden] { display: none; }
  #school-install-button::before { content: ""; width: 18px; height: 18px; background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12'/%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3Cpath d='M5 21h14'/%3E%3C/svg%3E") center/contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12'/%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3Cpath d='M5 21h14'/%3E%3C/svg%3E") center/contain no-repeat; }
  #school-app-navigation .school-points-header { height: 36px; padding: 0 8px; min-width: 50px; justify-content: center; gap: 4px; }
  #school-app-navigation .school-points-label { display: none; }
  header.topbar { padding: 12px 16px 10px; gap: 10px; column-gap: 8px; flex-wrap: wrap; align-items: center; }
  header.topbar .brand { order: 1; flex: 1 1 0; min-width: 0; min-height: 40px; white-space: nowrap; font-size: 18px; gap: 8px; }
  header.topbar .brand .brand-mark { width: 32px; height: 32px; min-width: 32px; }
  header.topbar .brand span:last-child { overflow: hidden; text-overflow: ellipsis; }
  header.topbar .account-actions { order: 2; margin: 0 94px 0 0; gap: 4px; }
  header.topbar .account-actions > * { width: 36px; height: 36px; min-width: 36px; }
  header.topbar nav[aria-label="Разделы платформы"] { order: 3; flex: 1 1 100%; row-gap: 8px; }
  header.topbar > :not(.brand):not(.account-actions):not(nav) { order: 4; }
  header.topbar nav[aria-label="Разделы платформы"] > a:nth-child(-n+2) { min-height: 46px !important; height: 46px !important; font-size: 16px; }
  header.topbar nav[aria-label="Разделы платформы"] > a:nth-child(n+3) { font-size: 14px; padding-block: 4px; }
}
@media (max-width: 370px) {
  header.topbar { padding-left: 12px; padding-right: 12px; }
  #school-app-navigation { right: 12px; }
  header.topbar .brand { font-size: 16px; gap: 6px; }
}

/* === v8 26.11.2026: общий стиль + направление A (одобрено Игорем) === */
/* Manrope (SIL OFL 1.1, файл лицензии рядом: assets/Manrope-OFL.txt) — тот же файл, что у раздела тренировок */
@font-face { font-family: "Manrope"; src: url("/assets/manrope-cyrillic-v8.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; src: url("/assets/manrope-latin-v8.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --a8-bg: #0E0E10; --a8-surface: #17171A; --a8-line: #2A2A2E; --a8-text: #F4F1EC; --a8-muted: #A7A29A;
  --a8-accent: #FF8A3D; --a8-accent-ink: #0E0E10;
  /* цвета метода ладони — общие для обучения и будущего трекера (направление C) */
  --palm-protein: #FF7B5C; --palm-carbs: #F2C14E; --palm-veg: #7BD389; --palm-fat: #8C9BFF;
}
html.a8 body, html.a8 button, html.a8 input, html.a8 select, html.a8 textarea {
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
html.a8 h1, html.a8 h2, html.a8 h3, html.a8 .brand { font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; letter-spacing: -0.015em; }

/* карточка «Продолжить» */
.a8-continue { display: flex; flex-direction: column; gap: 10px; margin: 0 0 18px; padding: 20px; border-radius: 22px;
  background: linear-gradient(160deg, #241913 0%, var(--a8-surface) 62%); border: 1px solid #33261C; color: var(--a8-text); }
.a8-eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--a8-accent); }
.a8-meta { font-size: 13px; color: var(--a8-muted); }
.a8-title { margin: 0; font-size: clamp(22px, 3.2vw, 30px); line-height: 1.18; font-weight: 800; }
.a8-row { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.a8-progress { flex: 1; height: 6px; border-radius: 3px; background: var(--a8-line); overflow: hidden; }
.a8-progress > span { display: block; height: 100%; background: var(--a8-accent); border-radius: 3px; }
.a8-count { font-size: 12px; color: var(--a8-muted); white-space: nowrap; }
.a8-sub { font-size: 12px; color: var(--a8-muted); }
.a8-cta { margin-top: 6px; min-height: 50px; border-radius: 14px; background: var(--a8-accent); color: var(--a8-accent-ink) !important;
  font-weight: 800; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.a8-cta:hover { filter: brightness(1.06); }
@media (min-width: 641px) { .a8-continue { max-width: 720px; } .a8-cta { align-self: flex-start; padding: 0 28px; } }
/* большой баннер «Учиться. Понимать. Применять.» не нужен, когда есть что продолжить */
.bento-dashboard.a8-has-continue > .bento-intro { display: none; }

/* нижняя панель вкладок */
.a8-tabbar { display: none; }
@media (max-width: 640px) {
  .a8-tabbar:not([hidden]) { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; justify-content: space-around;
    padding: 8px 6px calc(10px + env(safe-area-inset-bottom, 0px)); background: rgba(14,14,16,.96); border-top: 1px solid #222226;
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
  .a8-tab { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 64px; min-height: 44px; justify-content: center;
    font-size: 11px; font-weight: 600; color: #8C877F !important; text-decoration: none; }
  .a8-tab-active { color: var(--a8-accent) !important; font-weight: 800; }
  html.a8 body { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  /* панель заменяет большие кнопки «Обучение / Мой клуб» в шапке (школа и клуб) */
  html.a8 header.topbar nav[aria-label="Разделы платформы"] > a[href="/courses"],
  html.a8 header.topbar nav[aria-label="Разделы платформы"] > a[href="/club"],
  html.a8 header.topbar nav[aria-label="Разделы платформы"] > a[href="/training"],
  html.a8 .club-primary-nav { display: none !important; }
  /* компактные карточки каталога */
  html.a8 .bento-product-link { min-height: 0 !important; }
  html.a8 .bento-product-bottom { gap: 6px; }
  html.a8 .bento-product .learning-outcome-product { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  html.a8 .training-dashboard-link { padding-block: 14px !important; }
  /* «Мой прогресс» ученика дублирует вкладку «Прогресс»; ссылки кураторов (/progress/curator) остаются */
  html.a8 header.topbar nav[aria-label="Разделы платформы"] > a[data-progress-link][href="/progress"] { display: none !important; }
}
