:root {
  --red: #9f1d24;
  --red-dark: #76151a;
  --gold: #e2b63f;
  --ink: #202226;
  --muted: #62666d;
  --paper: #fbf8f0;
  --panel: #ffffff;
  --line: #ddd8cc;
  --soft: #f2eee5;
  --success: #267a4a;
  --warning: #9a6813;
  --danger: #9c2f31;
  --radius: 16px;
  --shadow: 0 12px 36px rgba(36, 30, 22, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
a { color: inherit; }
button, input, select { font: inherit; }
button, .button { min-height: 44px; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .58; }
.shell { min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 12px clamp(16px, 3vw, 34px); background: rgba(251,248,240,.96);
  border-bottom: 1px solid var(--line); backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 850; letter-spacing: .02em; }
.brand-mark { width: 38px; height: 38px; border-radius: 50%; display:grid; place-items:center; background: var(--red); color: var(--gold); font-size: 20px; box-shadow: inset 0 0 0 2px rgba(226,182,63,.35); }
.brand small { display:block; color: var(--muted); font-weight: 650; letter-spacing: 0; }
.top-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.layout { display:grid; grid-template-columns: 240px minmax(0, 1fr); min-height: calc(100vh - 64px); }
.sidebar { border-right:1px solid var(--line); padding:22px 14px; background:#f7f3ea; }
.nav-group { display:grid; gap:7px; }
.nav-link { width:100%; border:0; background:transparent; text-align:left; padding:11px 12px; border-radius:10px; color:#34363b; font-weight:720; }
.nav-link:hover, .nav-link.active { background:#ece4d6; color:var(--red-dark); }
.nav-separator { height:1px; background:var(--line); margin:14px 6px; }
.main { min-width:0; padding: clamp(20px, 4vw, 48px); }
.container { max-width: 1080px; margin: 0 auto; }
.auth-wrap { min-height:100vh; display:grid; place-items:center; padding:24px; }
.auth-card { width:min(620px, 100%); background:var(--panel); border:1px solid var(--line); border-radius:24px; padding:clamp(24px,5vw,46px); box-shadow:var(--shadow); }
.eyebrow { text-transform:uppercase; letter-spacing:.12em; font-size:.76rem; font-weight:850; color:var(--red); margin:0 0 8px; }
h1, h2, h3 { line-height:1.13; }
h1 { font-size:clamp(2rem,5vw,3.35rem); margin:.1em 0 .35em; }
h2 { font-size:clamp(1.45rem,3vw,2.2rem); margin:.1em 0 .45em; }
h3 { font-size:1.06rem; margin:.15em 0 .45em; }
p { line-height:1.6; }
.lede { color:var(--muted); font-size:1.05rem; max-width:760px; }
.muted { color:var(--muted); }
.small { font-size:.88rem; }
.stack { display:grid; gap:16px; }
.stack-sm { display:grid; gap:10px; }
.row { display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.row-between { display:flex; gap:14px; justify-content:space-between; align-items:center; flex-wrap:wrap; }
.grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.grid-3 { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.card { background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:20px; box-shadow:0 4px 18px rgba(36,30,22,.035); }
.card.link-card { transition: transform .15s ease, border-color .15s ease; cursor:pointer; }
.card.link-card:hover { transform:translateY(-2px); border-color:#b9ad99; }
.button { display:inline-flex; align-items:center; justify-content:center; gap:8px; border:1px solid transparent; border-radius:12px; padding:10px 16px; font-weight:800; text-decoration:none; }
.button.primary { background:var(--red); color:white; }
.button.primary:hover { background:var(--red-dark); }
.button.secondary { background:white; color:var(--ink); border-color:var(--line); }
.button.secondary:hover { background:var(--soft); }
.button.ghost { background:transparent; color:var(--red-dark); border-color:transparent; }
.button.wide { width:100%; }
.field { display:grid; gap:7px; }
label { font-weight:760; }
input, select { width:100%; border:1px solid #c9c3b7; border-radius:11px; padding:12px 13px; background:white; color:var(--ink); min-height:46px; }
input:focus, select:focus, button:focus-visible, .button:focus-visible { outline:3px solid rgba(159,29,36,.18); outline-offset:2px; }
.notice { border-left:4px solid var(--gold); background:#fff8de; padding:14px 16px; border-radius:9px; }
.notice.success { border-left-color:var(--success); background:#eef9f2; }
.notice.danger { border-left-color:var(--danger); background:#fff0f0; }
.status-pill { display:inline-flex; align-items:center; gap:6px; padding:5px 9px; border-radius:999px; background:#eee9df; font-size:.82rem; font-weight:800; }
.status-pill.free { background:#e9f7ee; color:#1f6e40; }
.hero { padding:4px 0 12px; }
.continue { padding:24px; border-radius:20px; background:linear-gradient(135deg,var(--red),#6f1820); color:white; box-shadow:var(--shadow); }
.continue .button { background:white; color:var(--red-dark); }
.stat-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.stat { padding:14px; background:#f7f2e9; border-radius:12px; border:1px solid #e7dfd1; }
.stat strong { display:block; margin-top:4px; }
.choice-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.choice { padding:20px; border:2px solid var(--line); background:white; border-radius:16px; text-align:left; }
.choice:hover { border-color:#ba9e67; }
.choice.selected { border-color:var(--red); background:#fff8f3; }
.lesson-steps { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
.lesson-step { font-size:.86rem; padding:8px 10px; border-radius:9px; background:#eee9df; border:1px solid transparent; }
.lesson-step.active { background:#fff0eb; border-color:#c98675; color:var(--red-dark); font-weight:800; }
.placeholder-box { border:2px dashed #c9c1b2; border-radius:16px; padding:26px; text-align:center; background:#fbf8f2; color:var(--muted); }
.pron-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.pron-target { padding:18px; border-radius:14px; border:1px solid var(--line); background:white; }
.coach-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.coach-pane { min-height:230px; border-radius:16px; border:1px solid var(--line); padding:20px; background:#f8f4ec; display:grid; align-content:center; justify-items:center; text-align:center; }
.radar-placeholder { width:min(280px,90%); aspect-ratio:1; border:1px solid var(--line); border-radius:50%; position:relative; background:radial-gradient(circle at center, transparent 0 22%, #e5dfd4 23% 24%, transparent 25% 47%, #e5dfd4 48% 49%, transparent 50% 72%, #e5dfd4 73% 74%, transparent 75%); }
.radar-placeholder::before, .radar-placeholder::after { content:""; position:absolute; background:#d8d0c2; left:50%; top:8%; bottom:8%; width:1px; }
.radar-placeholder::after { top:50%; left:8%; right:8%; width:auto; height:1px; bottom:auto; }
.admin-table { width:100%; border-collapse:collapse; }
.admin-table th, .admin-table td { padding:11px 10px; border-bottom:1px solid var(--line); text-align:left; vertical-align:top; }
.admin-table th { font-size:.8rem; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); }
.codebox { overflow:auto; background:#211f1d; color:#f6f0e4; padding:14px; border-radius:12px; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:.84rem; }
.mobile-menu { display:none; }
.footer-note { margin-top:36px; color:var(--muted); font-size:.84rem; }
.hidden { display:none !important; }
@media (max-width: 860px) {
  .layout { grid-template-columns:1fr; }
  .sidebar { display:none; }
  .mobile-menu { display:inline-flex; }
  .grid, .grid-3, .choice-grid, .coach-grid { grid-template-columns:1fr; }
  .stat-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .pron-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .lesson-steps { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .main { padding:20px 16px 38px; }
  .topbar { padding:10px 12px; }
  .brand small { display:none; }
}
@media (max-width: 470px) {
  .auth-wrap { padding:12px; }
  .auth-card { border-radius:18px; padding:22px 18px; }
  .stat-grid, .pron-grid { grid-template-columns:1fr; }
  .top-actions .user-label { display:none; }
}
