/* ===== Клиентский плеер курса ===== */
body.learn { background: var(--bg); }
[v-cloak] { display: none; }
a { cursor: pointer; }

/* ---- Вход / регистрация ---- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 30px 28px; width: 380px; max-width: 94vw; box-shadow: 0 14px 50px rgba(0,0,0,.07); }
.auth-card h1 { font-size: 22px; margin-bottom: 18px; text-align: center; }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 18px; background: var(--bg); border-radius: 10px; padding: 4px; }
.auth-tabs button { flex: 1; border: none; background: transparent; padding: 9px; border-radius: 8px; cursor: pointer; color: var(--muted); font: inherit; }
.auth-tabs button.active { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.auth-card label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.auth-card input { padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; font: inherit; }
.auth-card input:focus { outline: none; border-color: var(--accent); }
.primary.big { width: 100%; padding: 13px; font-size: 16px; }
.err { color: var(--err); font-size: 13px; margin-top: 10px; text-align: center; }

/* ---- Раскладка плеера ---- */
.player { min-height: 100vh; display: flex; flex-direction: column; }
.ptop { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 18px; padding: 12px 22px; background: var(--panel); border-bottom: 1px solid var(--line); }
.ptitle { font-weight: 700; font-size: 16px; }
.pprogress { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 220px; }
.pprogress .prog-bar { flex: 1; height: 8px; background: var(--line); border-radius: 5px; overflow: hidden; }
.pprogress .prog-fill { height: 100%; background: var(--ok); transition: width .4s ease; }
.pwho { font-size: 13px; color: var(--muted); white-space: nowrap; }
.pwho a { color: var(--accent); }

.pbody { display: flex; flex: 1; align-items: flex-start; }
.psidebar { width: 320px; flex: none; align-self: stretch; border-right: 1px solid var(--line); background: var(--panel); padding: 16px 12px; position: sticky; top: 57px; max-height: calc(100vh - 57px); overflow: auto; font-size: calc(14px * var(--fs, 1)); }
.psec { margin-bottom: 14px; }
.psec-title { font-weight: 700; font-size: 0.92em; color: var(--muted); padding: 4px 10px; }
.pnav { display: flex; align-items: baseline; gap: 6px; padding: 7px 10px; border-radius: 8px; font-size: 1em; color: var(--ink); word-break: break-word; }
.pnav:hover { background: var(--bg); }
.pnav.cur { background: #e7eefc; color: var(--accent-d); font-weight: 600; }
.pnav.done { color: var(--muted); }
.pnav .chk { width: 14px; color: var(--ok); font-weight: 700; flex: none; }
.pnav .pnum { font-family: ui-monospace, monospace; font-size: 0.85em; color: var(--muted); }

.pmain { flex: 1; max-width: 820px; margin: 0 auto; padding: 32px 28px 80px; }
.pmain-title { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 24px; }
.pmain-title .pnum { font-family: ui-monospace, monospace; font-size: 20px; color: var(--accent); }
.lblock { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 22px; }
.lblock:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.lblock > h3 { color: var(--accent-d); font-size: 14px; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 10px; }
.lblock .md { font-size: 16px; line-height: 1.7; }
.lblock .md pre { background: #0f172a; color: #cbd5e1; padding: 12px; border-radius: 8px; overflow: auto; }
.lblock .md code { background: var(--bg); padding: 1px 5px; border-radius: 4px; }
.lblock .md pre code { background: none; padding: 0; }
.lblock .md table { border-collapse: collapse; }
.lblock .md th, .lblock .md td { border: 1px solid var(--line); padding: 6px 10px; }
.answer { width: 100%; margin-top: 12px; min-height: 110px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; resize: vertical; }
.answer:focus { outline: none; border-color: var(--accent); }

.pnavbtns { display: flex; gap: 10px; align-items: center; margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--line); }
.pnavbtns .primary { margin: 0 auto; }
.share-btn { white-space: nowrap; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; padding: 10px 20px; border-radius: 22px; font-size: 14px; z-index: 200; box-shadow: 0 8px 24px rgba(0,0,0,.25); }

/* ===== Тема и доступность ===== */
html[data-theme=night] { --bg:#0f1420; --panel:#161d2e; --ink:#e8edf6; --muted:#94a2bd; --line:#28324c; --card:#131b2b; }
.pmain { font-size: calc(16px * var(--fs, 1)); }
.lblock .md { font-size: 1.02em; line-height: 1.7; }
.pmain-title { font-size: 1.9em; }
.lblock > h3 { font-size: .82em; }
html[data-vision=low] .pmain { font-size: calc(20px * var(--fs, 1)); }
html[data-vision=low] .lblock .md { font-weight: 500; }
html[data-vision=low] a { text-decoration: underline; }
html[data-vision=low] .quiz-opt, html[data-vision=low] .mark, html[data-vision=low] .btn { padding: 14px 18px; }
html[data-vision=low][data-theme=day] { --ink:#000; --muted:#2a2a2a; --line:#666; }
html[data-vision=low][data-theme=night] { --ink:#fff; --muted:#d2dbef; --line:#5a6b8c; }

.theme-panel { position: sticky; top: 57px; z-index: 9; background: var(--panel); border-bottom: 1px solid var(--line); padding: 12px 22px; display: flex; flex-direction: column; gap: 10px; }
.tp-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tp-lbl { width: 120px; color: var(--muted); font-size: 13px; }
.tp-btn { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 6px 12px; cursor: pointer; color: var(--ink); font: inherit; }
.tp-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.sw { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.sw.on { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--ink); }

/* ===== Отметки карточки + футер ===== */
.marks { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 30px; }
.mark { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 10px 16px; cursor: pointer; font: inherit; color: var(--ink); }
.mark:hover { border-color: var(--accent); }
.mark.ok.on { background: #e6f4ec; border-color: var(--ok); color: var(--ok); }
.mark.hard.on { background: #fdf3e3; border-color: var(--busy); color: var(--busy); }
.mark.reset { margin-left: auto; color: var(--muted); }
html[data-theme=night] .mark.ok.on { background: #10371f; }
html[data-theme=night] .mark.hard.on { background: #3a2c12; }
/* ----- поблочные отметки + заметка «непонятно» ----- */
.bmarks { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--line); }
.bmarks .mark { padding: 7px 13px; font-size: 13px; border-radius: 9px; }
.bmarks .mark.reset { margin-left: auto; }
.hardnote { margin-top: 10px; }
.hardnote textarea { width: 100%; min-height: 80px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: var(--panel); color: var(--ink); resize: vertical; }
.hardnote textarea:focus { outline: none; border-color: var(--accent); }
.hardnote .row { margin-top: 8px; }
.lfooter { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.pnav.hard, .pnav.hard .chk { color: var(--busy); }

@media (max-width: 800px) {
  .ptop { flex-wrap: wrap; gap: 8px 10px; padding: 10px 14px; }
  .ptitle { flex: 1 1 100%; font-size: 15px; line-height: 1.3; }
  .pprogress { order: 5; flex: 1 1 100%; min-width: 0; margin-left: 0; }
  .ptop .ghost.tiny { padding: 6px 10px; }
  .theme-panel { position: static; }
  .tp-lbl { width: auto; }
  .psidebar { position: static; width: 100%; max-height: 240px; border-right: none; border-bottom: 1px solid var(--line); }
  .pbody { flex-direction: column; }
  .pmain { padding: 22px 16px 70px; }
  .pmain-title { font-size: 1.6em; }
}

/* ----- анти-оверфлоу: чтобы контент не вылезал за окно (особенно на мобильных) ----- */
.pmain { min-width: 0; }
html, body { max-width: 100%; overflow-x: hidden; }
.lblock .md { overflow-wrap: anywhere; }
.lblock .md pre { max-width: 100%; }
.lblock .md img, .lblock .md video { max-width: 100%; height: auto; }
.lblock .md table { display: block; overflow-x: auto; max-width: 100%; }

/* ----- программа / серия курсов ----- */
.program { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 22px; background: var(--card); }
.program-head { font-weight: 700; font-size: calc(14px * var(--fs, 1)); margin-bottom: 10px; }
.program-parts { display: flex; flex-direction: column; gap: 3px; }
.program-part { display: flex; align-items: baseline; gap: 8px; padding: 6px 8px; border-radius: 8px; color: var(--ink); cursor: pointer; font-size: calc(14px * var(--fs, 1)); }
.program-part:hover { background: var(--bg); }
.program-part.cur { background: #e7eefc; color: var(--accent-d); font-weight: 600; cursor: default; }
.program-part.locked { color: var(--muted); cursor: default; }
.program-part .pp-num { font-family: ui-monospace, monospace; color: var(--muted); width: 18px; flex: none; }
.program-part .pp-tag { font-size: .8em; color: var(--muted); margin-left: auto; white-space: nowrap; }
html[data-theme=night] .program-part.cur { background: #1a2740; }
