/* App-Rahmen: Seitenleiste (Desktop), Tab-Leiste (Smartphone), Inhaltsbereich. */

.app { display: grid; min-height: 100dvh; }
@media (min-width: 900px) { .app { grid-template-columns: 248px minmax(0, 1fr); } }

.sidebar { display: none; }
@media (min-width: 900px) {
  .sidebar {
    position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 28px;
    padding: 26px 18px; border-right: 1px solid var(--line); background: rgba(10, 12, 17, 0.6);
  }
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand__mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-strong), var(--teal)); color: var(--accent-ink);
  font-family: var(--font-display); font-weight: 700; font-size: 1.15rem;
}
.brand__text b { display: block; font-weight: 800; letter-spacing: -0.01em; }
.brand__text span { display: block; font-size: var(--fs-xs); color: var(--text-3); }

.nav { display: grid; gap: 4px; }
.nav__label { padding: 0 12px 6px; font-size: var(--fs-xs); color: var(--text-3); font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  color: var(--text-2); text-decoration: none; font-weight: 700; font-size: var(--fs-sm);
  transition: background var(--t-fast), color var(--t-fast);
}
.nav a svg { width: 20px; height: 20px; flex: none; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--text); }
.nav a[aria-current="page"] svg { color: var(--accent-strong); }
.nav a .badge { margin-left: auto; padding: 2px 8px; }
.nav a.is-soon { opacity: .6; }
.sidebar__foot { margin-top: auto; font-size: var(--fs-xs); color: var(--text-3); line-height: 1.5; }

.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between;
  height: 60px; padding: 0 var(--gutter);
  background: rgba(10, 12, 17, 0.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
@media (min-width: 900px) { .topbar { display: none; } }
:root { --topbar-h: 60px; }
@media (min-width: 900px) { :root { --topbar-h: 0px; } }

.main { min-width: 0; padding: 22px var(--gutter) calc(110px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { .main { padding: 40px 48px 80px; } }
.page { max-width: 980px; margin: 0 auto; display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); }
.page--narrow { max-width: 760px; }
.page.enter { animation: page-in 260ms var(--ease-out) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .page.enter { animation: none; } }

.page-head { display: grid; gap: 10px; }
.page-head p { max-width: 62ch; }
.back-link {
  display: inline-flex; align-items: center; gap: 6px; width: fit-content;
  color: var(--text-2); text-decoration: none; font-size: var(--fs-sm); font-weight: 700;
  padding: 6px 10px 6px 4px; margin-left: -4px; border-radius: 10px;
  border: 0; background: none;
}
.back-link:hover { color: var(--text); background: var(--surface-2); }
.back-link svg { width: 18px; height: 18px; }

.hero { padding: clamp(8px, 3vw, 24px) 0 4px; display: grid; gap: 12px; }
.hero h1 { font-size: var(--fs-hero); }
.hero h1 .ru { color: var(--accent-strong); }

.grid-2 { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid-4 { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.stack { display: grid; gap: 16px; }
.stack-sm { display: grid; gap: 10px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.row--end { justify-content: flex-end; }
.row--between { justify-content: space-between; }
.settings-grid { display: grid; gap: 20px; }
@media (min-width: 720px) { .settings-grid { grid-template-columns: 1fr 1fr; column-gap: 28px; } .settings-grid .span-2 { grid-column: 1 / -1; } }
.divider { height: 1px; background: var(--line); border: 0; margin: 4px 0; }

/* Tab-Leiste unten (Smartphone) */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: rgba(10, 12, 17, 0.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
@media (min-width: 900px) { .tabbar { display: none; } }
.tabbar a {
  display: grid; justify-items: center; gap: 3px; padding: 6px 2px; border-radius: 12px;
  color: var(--text-3); text-decoration: none; font-size: 0.68rem; font-weight: 750;
}
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a[aria-current="page"] { color: var(--text); }
.tabbar a[aria-current="page"] svg { color: var(--accent-strong); }
body.is-training .tabbar { display: none; }

.footer-note { color: var(--text-3); font-size: var(--fs-xs); text-align: center; padding-top: 12px; }
