/* ===== теория темы внутри кабинета =====
   Разметка приходит из static/theory-data.js (сборка build_theory.py).
   Здесь только блоки, которых нет в общем theme.css. */

.theorypage { margin: .2rem 0 2rem; }
.theorypage .sec { margin: 0 0 2rem; }

.theorypage .begin {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 14px; margin: 1.4rem 0 1.2rem;
}
.theorypage .begin-card {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.15rem;
}
.theorypage .begin-card h2 {
  font-size: 1rem; margin: 0 0 .5rem; border: 0; padding: 0; color: var(--ink);
  display: flex; align-items: center; gap: .5rem;
}
.theorypage .begin-card h2 .ico {
  font-size: .95rem; width: 1.6em; height: 1.6em;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; background: var(--chip); border: 1px solid var(--line);
}
.theorypage .begin-card p { margin: .35rem 0; }
.theorypage .begin-card p:last-child { margin-bottom: 0; }
.theorypage .begin-card .muted { color: var(--muted); font-size: .9rem; }
.theorypage .begin-card.life { border-left: 3px solid var(--accent); }
.theorypage .begin-card.life b { color: var(--ink); }
.theorypage .begin-card .ask {
  margin-top: .7rem; padding-top: .6rem; border-top: 1px dashed var(--line);
  font-size: .9rem; color: var(--muted);
}
.theorypage .begin-card .ask b { color: var(--ink); font-weight: 600; }
.theorypage .prereq { margin: .4rem 0 0; padding-left: 1.1rem; }
.theorypage .prereq li { margin: .2rem 0; }

.theorypage .gloss {
  margin: 1rem 0 1.4rem; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 0; overflow: hidden;
}
.theorypage .gloss > summary {
  cursor: pointer; padding: .85rem 1.1rem; font-weight: 700; color: var(--ink);
  background: var(--panel-2); border-bottom: 1px solid transparent;
  list-style: none; display: flex; align-items: center; gap: .6rem;
}
.theorypage .gloss > summary::-webkit-details-marker { display: none; }
.theorypage .gloss > summary::before { content: "▸"; color: var(--accent); transition: transform .15s ease; }
.theorypage .gloss[open] > summary::before { transform: rotate(90deg); }
.theorypage .gloss[open] > summary { border-bottom-color: var(--line); }
.theorypage .gloss > summary .hint { margin-left: auto; font-weight: 400; font-size: .8rem; color: var(--muted); }
.theorypage .gloss dl {
  margin: 0; padding: .9rem 1.1rem 1.1rem; display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr; gap: .45rem 1rem;
}
.theorypage .gloss dt { color: var(--ink); font-weight: 600; font-size: .92rem; padding-top: .1rem; }
.theorypage .gloss dd { margin: 0; color: var(--ink); font-size: .92rem; line-height: 1.45; }
.theorypage .gloss dd .fx { white-space: nowrap; }

@media (max-width: 820px) {
  .theorypage .begin { grid-template-columns: 1fr; }
}

/* вкладки темы */
.topic-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1.2rem; }
.topic-tabs a {
  display: inline-block; padding: .45rem .9rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel-2);
  color: var(--muted); text-decoration: none; font-size: .88rem;
}
.topic-tabs a.on { border-color: var(--accent); color: var(--ink); background: var(--chip); }
.topic-tabs a:hover { text-decoration: none; border-color: var(--accent); }

/* перелистывание тем */
.topic-pager {
  display: flex; justify-content: space-between; gap: .6rem; flex-wrap: wrap;
  margin: 1.4rem 0 .4rem; padding-top: 1rem; border-top: 1px solid var(--line);
}
.topic-pager a { color: var(--accent); text-decoration: none; font-size: .9rem; }
.topic-pager a:hover { text-decoration: underline; }
.topic-pager .pager-next { margin-left: auto; text-align: right; }
.topic-pager .pager-off { color: var(--muted); font-size: .9rem; }
