/* БАЗА — карта теории: только каркас и навигация */
.theory-map-section{padding:34px 0 76px}
.theory-map-head{display:flex;align-items:flex-end;justify-content:space-between;gap:28px;margin-bottom:20px}
.theory-map-head h2{font-size:clamp(30px,4vw,48px);line-height:1.02;letter-spacing:-1.4px;margin:6px 0 10px}
.theory-map-head p{max-width:720px;margin:0;color:var(--muted);font-size:14px;line-height:1.6}
.theory-map-stats{display:grid;grid-template-columns:repeat(3,minmax(88px,1fr));gap:8px;min-width:330px}
.theory-map-stats>div{border:1px solid var(--line);background:#fff;border-radius:16px;padding:13px 14px;text-align:center;box-shadow:0 8px 24px rgba(34,42,86,.04)}
.theory-map-stats b{display:block;font-size:21px;letter-spacing:-.4px;color:var(--ink)}
.theory-map-stats span{display:block;margin-top:2px;color:var(--muted);font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.45px}

.theory-tabs-panel{position:relative;border:1px solid var(--line);background:#f8f9fc;border-radius:20px;padding:13px 14px;margin-bottom:12px;overflow:hidden}
.theory-tabs-panel::after{content:"";position:absolute;top:34px;right:0;bottom:0;width:28px;pointer-events:none;background:linear-gradient(90deg,rgba(248,249,252,0),#f8f9fc 82%)}
.theory-tabs-label{font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.65px;color:#8a90a5;margin:0 0 9px 3px}
.theory-tabs-scroll{display:flex;gap:7px;overflow-x:auto;scrollbar-width:none;scroll-snap-type:none;overscroll-behavior-inline:contain}
.theory-tabs-scroll::-webkit-scrollbar{display:none}
.theory-tab{appearance:none;border:1px solid #e1e3ec;background:#fff;color:#737a92;border-radius:13px;padding:9px 11px;display:flex;align-items:center;gap:7px;cursor:pointer;white-space:nowrap;font:inherit;font-size:11px;font-weight:850;transition:.18s ease}
.theory-tab:hover{border-color:#cfc9ff;color:#5749dd;transform:translateY(-1px)}
.theory-tab.active{background:#5b50dc;border-color:#5b50dc;color:#fff;box-shadow:0 7px 18px rgba(84,72,211,.18)}
.theory-tab-icon{font-size:11px;font-weight:950;min-width:19px;text-align:center}
/* В строке класса/маршрута название уже само содержит «5 класс», «ОГЭ» и т. п.;
   отдельный leading icon там дублировал текст. */
.theory-track .theory-tab-icon{display:none}
.theory-tab-count{display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 5px;border-radius:999px;background:rgba(117,123,148,.1);font-size:9px}
.theory-tab.active .theory-tab-count{background:rgba(255,255,255,.17)}

.theory-tab-summary{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:14px;border:1px solid var(--line);background:#fff;border-radius:20px;padding:15px 17px;margin-bottom:14px;box-shadow:0 8px 27px rgba(34,42,86,.04)}
.theory-summary-icon{width:48px;height:48px;border-radius:15px;background:#f0eeff;border:1px solid #dfdbff;color:#5a4de0;display:grid;place-items:center;font-size:16px;font-weight:950}
.theory-tab-summary small{display:block;color:#9297aa;font-size:9px;font-weight:900;text-transform:uppercase;letter-spacing:.55px}
.theory-tab-summary h3{margin:2px 0 2px;font-size:18px;letter-spacing:-.25px}
.theory-tab-summary p{margin:0;color:var(--muted);font-size:11px;line-height:1.45}
.theory-summary-status{text-align:right;display:grid;grid-template-columns:auto auto;gap:0 5px;align-items:baseline}
.theory-summary-status b{font-size:20px}.theory-summary-status span{font-size:10px;color:var(--muted);font-weight:800}
.theory-summary-status em{grid-column:1/-1;font-style:normal;color:#8d84df;font-size:9px;font-weight:850;margin-top:2px}

.theory-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.theory-card{border:1px solid var(--line);border-radius:20px;background:#fff;padding:17px;min-height:190px;display:flex;flex-direction:column;box-shadow:0 8px 27px rgba(34,42,86,.04);position:relative;overflow:hidden}
.theory-card::after{content:"";position:absolute;right:-34px;bottom:-34px;width:90px;height:90px;border-radius:50%;background:#f5f3ff}
.theory-card-top{display:flex;align-items:center;justify-content:space-between;gap:10px;position:relative;z-index:1}
.theory-card-icon{width:37px;height:37px;border-radius:12px;background:#f4f2ff;border:1px solid #e4e0ff;color:#5e51db;display:grid;place-items:center;font-size:13px;font-weight:950}
.theory-card-grade{font-size:9px;font-weight:900;text-transform:uppercase;letter-spacing:.45px;color:#9297aa}
.theory-card h3{font-size:16px;margin:13px 0 6px;letter-spacing:-.2px;position:relative;z-index:1}
.theory-card p{margin:0;color:var(--muted);font-size:11px;line-height:1.5;position:relative;z-index:1}
.theory-card-meta{display:flex;gap:8px;flex-wrap:wrap;margin-top:13px;position:relative;z-index:1}
.theory-card-meta span{font-size:9px;font-weight:800;color:#7d8398;background:#f6f7fa;border:1px solid #eceef3;padding:5px 7px;border-radius:999px}
.theory-card-bottom{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:auto;padding-top:14px;position:relative;z-index:1}
.theory-card-bottom span{font-size:10px;color:#767d94;font-weight:800}
.theory-card-bottom b{font-size:10px;color:#5d52da;background:#efedff;border:1px solid #dedaff;border-radius:999px;padding:5px 8px}
.theory-empty,.theory-empty-note{border:1px dashed #d8dae5;background:#fafbfe;color:var(--muted);border-radius:18px;padding:17px;font-size:11px;line-height:1.5}
.theory-empty-note{margin-top:14px}
.theory-empty-note b{color:var(--ink)}

/* На desktop прокрутка свободная: scroll-snap намеренно выключен, чтобы в конце
   плавного движения лента не делала дополнительный рывок к ближайшей вкладке. */
@media(hover:hover) and (pointer:fine){
  .theory-tabs-panel.is-key-panning,
  .theory-tabs-panel.is-key-panning *,
  .theory-tabs-panel.is-pointer-panning,
  .theory-tabs-panel.is-pointer-panning *{user-select:none}
}

@media(max-width:980px){
  .theory-map-head{align-items:flex-start;flex-direction:column}.theory-map-stats{width:100%;min-width:0}.theory-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:680px){
  .theory-map-section{padding:20px 0 54px}.theory-map-stats{grid-template-columns:1fr 1fr 1fr}.theory-map-stats>div{padding:11px 7px}
  .theory-tabs-panel{padding:11px 12px}.theory-tabs-panel::after{top:32px;width:22px}
  .theory-tab{padding:8px 10px;gap:6px}.theory-tab-icon{min-width:17px;font-size:10px}
  .theory-tab-summary{grid-template-columns:auto 1fr}.theory-summary-status{grid-column:1/-1;text-align:left;grid-template-columns:auto auto 1fr}.theory-summary-status em{grid-column:auto;margin:0 0 0 4px}
  .theory-grid{grid-template-columns:1fr}
}
